MPD 0.20.6

- Main Page
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

Public Member Functions | Data Fields
MusicChunk Struct Reference

A chunk of music data. More...

`#include <MusicChunk.hxx>`

Collaboration diagram for MusicChunk:
[legend]

## Public Member Functions
| MusicChunk ()=default
| MusicChunk (const MusicChunk &)=delete
| ~MusicChunk ()
MusicChunk & | operator= (const MusicChunk &)=delete
bool | IsEmpty () const
gcc_pure bool | CheckFormat (AudioFormat audio_format) const
| Checks if the audio format if the chunk is equal to the specified audio_format. More...
WritableBuffer< void > | Write (AudioFormat af, SongTime data_time, uint16_t bit_rate)
| Prepares appending to the music chunk. More...
bool | Expand (AudioFormat af, size_t length)
| Increases the length of the chunk after the caller has written to the buffer returned by Write(). More...

## Data Fields
MusicChunk * | next
| the next chunk in a linked list More...
MusicChunk * | other = nullptr
| An optional chunk which should be mixed into this chunk. More...
float | mix_ratio
| The current mix ratio for cross-fading: 1.0 means play 100% of this chunk, 0.0 means play 100% of the "other" chunk. More...
uint16_t | length = 0
| number of bytes stored in this chunk More...
uint16_t | bit_rate
| current bit rate of the source file More...
SignedSongTime | time
| the time stamp within the song More...
Tag * | tag = nullptr
| An optional tag associated with this chunk (and the following chunks); appears at song boundaries. More...
ReplayGainInfo | replay_gain_info
| Replay gain information associated with this chunk. More...
unsigned | replay_gain_serial = 0
| A serial number for checking if replay gain info has changed since the last chunk. More...
uint8_t | data [CHUNK_SIZE]
| the data (probably PCM) More...
AudioFormat | audio_format

## Detailed Description

A chunk of music data.

Its format is defined by the MusicPipe::Push() caller.

Definition at line 43 of file MusicChunk.hxx.

## Constructor & Destructor Documentation

MusicChunk::MusicChunk | ( |  | ) |
| default

MusicChunk::MusicChunk | ( | const MusicChunk & |  | ) |
| delete

MusicChunk::~MusicChunk | ( |  | ) |

## Member Function Documentation

gcc_pure bool MusicChunk::CheckFormat | ( | AudioFormat | audio_format | ) | const

Checks if the audio format if the chunk is equal to the specified audio_format.

bool MusicChunk::Expand | ( | AudioFormat | af,
|  | size_t | length
| ) |  |

Increases the length of the chunk after the caller has written to the buffer returned by Write().

Parameters

  af | the audio format for the appended data; must stay the same for the life cycle of this chunk
  length | the number of bytes which were appended

Returns
  true if the chunk is full

bool MusicChunk::IsEmpty | ( |  | ) | const
| inline

Definition at line 104 of file MusicChunk.hxx.

MusicChunk& MusicChunk::operator= | ( | const MusicChunk & |  | ) |
| delete

WritableBuffer<void> MusicChunk::Write | ( | AudioFormat | af,
|  | SongTime | data_time,
|  | uint16_t | bit_rate
| ) |  |

Prepares appending to the music chunk.

Returns a buffer where you may write into. After you are finished, call Expand().

Parameters

  af | the audio format for the appended data; must stay the same for the life cycle of this chunk
  data_time | the time within the song
  bit_rate | the current bit rate of the source file

Returns
  a writable buffer, or nullptr if the chunk is full

## Field Documentation

AudioFormat MusicChunk::audio_format

Definition at line 93 of file MusicChunk.hxx.

uint16_t MusicChunk::bit_rate

current bit rate of the source file

Definition at line 63 of file MusicChunk.hxx.

uint8_t MusicChunk::data[CHUNK_SIZE]

the data (probably PCM)

Definition at line 90 of file MusicChunk.hxx.

uint16_t MusicChunk::length = 0

number of bytes stored in this chunk

Definition at line 60 of file MusicChunk.hxx.

float MusicChunk::mix_ratio

The current mix ratio for cross-fading: 1.0 means play 100% of this chunk, 0.0 means play 100% of the "other" chunk.

Definition at line 57 of file MusicChunk.hxx.

MusicChunk* MusicChunk::next

the next chunk in a linked list

Definition at line 45 of file MusicChunk.hxx.

MusicChunk* MusicChunk::other = nullptr

An optional chunk which should be mixed into this chunk.

This is used for cross-fading.

Definition at line 51 of file MusicChunk.hxx.

ReplayGainInfo MusicChunk::replay_gain_info

Replay gain information associated with this chunk.

Only valid if the serial is not 0.

Definition at line 80 of file MusicChunk.hxx.

unsigned MusicChunk::replay_gain_serial = 0

A serial number for checking if replay gain info has changed since the last chunk.

The magic value 0 indicates that there is no replay gain info available.

Definition at line 87 of file MusicChunk.hxx.

Tag* MusicChunk::tag = nullptr

An optional tag associated with this chunk (and the following chunks); appears at song boundaries.

The tag object is owned by this chunk, and must be freed when this chunk is deinitialized.

Definition at line 74 of file MusicChunk.hxx.

SignedSongTime MusicChunk::time

the time stamp within the song

Definition at line 66 of file MusicChunk.hxx.

The documentation for this struct was generated from the following file:

- MusicChunk.hxx