ncmpc  0.31
Public Types | Public Member Functions | Data Fields
MpdQueue Struct Reference

#include <Queue.hxx>

Public Types

using Vector = std::vector< std::unique_ptr< struct mpd_song, SongDeleter > >
 
using size_type = Vector::size_type
 

Public Member Functions

size_type size () const
 
bool empty () const
 
void clear ()
 
const struct mpd_song & operator[] (size_type i) const
 
struct mpd_song & operator[] (size_type i)
 
gcc_pure const struct mpd_song * GetChecked (int i) const
 
void push_back (const struct mpd_song &song)
 
void Replace (size_type i, const struct mpd_song &song)
 
void RemoveIndex (size_type i)
 
void Move (unsigned dest, unsigned src)
 
gcc_pure size_type FindByReference (const struct mpd_song &song) const
 
gcc_pure int FindById (unsigned id) const
 
gcc_pure int FindByUri (const char *uri) const
 
gcc_pure int FindIdByUri (const char *uri) const
 
gcc_pure bool ContainsUri (const char *uri) const
 

Data Fields

unsigned version = 0
 
Vector items
 

Member Typedef Documentation

◆ Vector

using MpdQueue::Vector = std::vector<std::unique_ptr<struct mpd_song, SongDeleter> >

◆ size_type

using MpdQueue::size_type = Vector::size_type

Member Function Documentation

◆ size()

size_type MpdQueue::size ( ) const
inline

◆ empty()

bool MpdQueue::empty ( ) const
inline

◆ clear()

void MpdQueue::clear ( )

remove and free all songs in the playlist

◆ operator[]() [1/2]

const struct mpd_song& MpdQueue::operator[] ( size_type  i) const
inline

◆ operator[]() [2/2]

struct mpd_song& MpdQueue::operator[] ( size_type  i)
inline

◆ GetChecked()

gcc_pure const struct mpd_song* MpdQueue::GetChecked ( int  i) const

◆ push_back()

void MpdQueue::push_back ( const struct mpd_song &  song)
inline

◆ Replace()

void MpdQueue::Replace ( size_type  i,
const struct mpd_song &  song 
)
inline

◆ RemoveIndex()

void MpdQueue::RemoveIndex ( size_type  i)
inline

◆ Move()

void MpdQueue::Move ( unsigned  dest,
unsigned  src 
)

◆ FindByReference()

gcc_pure size_type MpdQueue::FindByReference ( const struct mpd_song &  song) const

Find a song by its reference. This method compares #mpd_song references, so this method makes only sense for songs references which were obtained from this container.

Returns
the song position

◆ FindById()

gcc_pure int MpdQueue::FindById ( unsigned  id) const

Find a song by its id.

Returns
the song position

◆ FindByUri()

gcc_pure int MpdQueue::FindByUri ( const char *  uri) const

Find a song by its URI.

Returns
the song position

◆ FindIdByUri()

gcc_pure int MpdQueue::FindIdByUri ( const char *  uri) const
inline

Like FindByUri(), but return the song id, not the song position

Returns
the song id

◆ ContainsUri()

gcc_pure bool MpdQueue::ContainsUri ( const char *  uri) const
inline

Field Documentation

◆ version

unsigned MpdQueue::version = 0

◆ items

Vector MpdQueue::items

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