MPD  0.20.6
Public Member Functions
MusicPipe Class Reference

A queue of MusicChunk objects. More...

#include <MusicPipe.hxx>

Public Member Functions

 MusicPipe ()=default
 Creates a new MusicPipe object. More...
 
 MusicPipe (const MusicPipe &)=delete
 
 ~MusicPipe ()
 Frees the object. More...
 
MusicPipeoperator= (const MusicPipe &)=delete
 
gcc_pure bool CheckFormat (AudioFormat other) const
 Checks if the audio format if the chunk is equal to the specified audio_format. More...
 
gcc_pure bool Contains (const MusicChunk *chunk) const
 Checks if the specified chunk is enqueued in the music pipe. More...
 
gcc_pure const MusicChunkPeek () const
 Returns the first MusicChunk from the pipe. More...
 
MusicChunkShift ()
 Removes the first chunk from the head, and returns it. More...
 
void Clear (MusicBuffer &buffer)
 Clears the whole pipe and returns the chunks to the buffer. More...
 
void Push (MusicChunk *chunk)
 Pushes a chunk to the tail of the pipe. More...
 
gcc_pure unsigned GetSize () const
 Returns the number of chunks currently in this pipe. More...
 
gcc_pure bool IsEmpty () const
 

Detailed Description

A queue of MusicChunk objects.

One party appends chunks at the tail, and the other consumes them from the head.

Definition at line 39 of file MusicPipe.hxx.

Constructor & Destructor Documentation

MusicPipe::MusicPipe ( )
default

Creates a new MusicPipe object.

It is empty.

MusicPipe::MusicPipe ( const MusicPipe )
delete
MusicPipe::~MusicPipe ( )
inline

Frees the object.

It must be empty now.

Definition at line 67 of file MusicPipe.hxx.

Member Function Documentation

gcc_pure bool MusicPipe::CheckFormat ( AudioFormat  other) const
inline

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

Definition at line 80 of file MusicPipe.hxx.

void MusicPipe::Clear ( MusicBuffer buffer)

Clears the whole pipe and returns the chunks to the buffer.

Parameters
bufferthe buffer object to return the chunks to
gcc_pure bool MusicPipe::Contains ( const MusicChunk chunk) const

Checks if the specified chunk is enqueued in the music pipe.

gcc_pure unsigned MusicPipe::GetSize ( ) const
inline

Returns the number of chunks currently in this pipe.

Definition at line 122 of file MusicPipe.hxx.

gcc_pure bool MusicPipe::IsEmpty ( ) const
inline

Definition at line 127 of file MusicPipe.hxx.

MusicPipe& MusicPipe::operator= ( const MusicPipe )
delete
gcc_pure const MusicChunk* MusicPipe::Peek ( ) const
inline

Returns the first MusicChunk from the pipe.

Returns nullptr if the pipe is empty.

Definition at line 97 of file MusicPipe.hxx.

void MusicPipe::Push ( MusicChunk chunk)

Pushes a chunk to the tail of the pipe.

MusicChunk* MusicPipe::Shift ( )

Removes the first chunk from the head, and returns it.


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