MPD  0.20.6
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes
Song Struct Reference

A song file inside the configured music directory. More...

#include <Song.hxx>

Collaboration diagram for Song:
[legend]

Data Structures

struct  Disposer
 

Public Types

typedef boost::intrusive::link_mode< link_modeLinkMode
 
typedef boost::intrusive::list_member_hook< LinkModeHook
 

Public Member Functions

 Song (const char *_uri, size_t uri_length, Directory &parent)
 
 ~Song ()
 
void Free ()
 
bool UpdateFile (Storage &storage)
 
gcc_pure std::string GetURI () const
 Returns the URI of the song in UTF-8 encoding, including its location within the music directory. More...
 
gcc_pure LightSong Export () const
 

Static Public Member Functions

static gcc_malloc SongNewFrom (DetachedSong &&other, Directory &parent)
 
static gcc_malloc SongNewFile (const char *path_utf8, Directory &parent)
 allocate a new song with a local file name More...
 
static gcc_malloc SongLoadFile (Storage &storage, const char *name_utf8, Directory &parent)
 allocate a new song structure with a local file name and attempt to load its metadata. More...
 

Data Fields

Hook siblings
 Pointers to the siblings of this directory within the parent directory. More...
 
Tag tag
 
Directory *const parent
 The Directory that contains this song. More...
 
time_t mtime
 
SongTime start_time
 Start of this sub-song within the file. More...
 
SongTime end_time
 End of this sub-song within the file. More...
 
char uri [sizeof(int)]
 The file name. More...
 

Static Public Attributes

static constexpr auto link_mode = boost::intrusive::normal_link
 

Detailed Description

A song file inside the configured music directory.

Internal SimpleDatabase class.

Definition at line 44 of file Song.hxx.

Member Typedef Documentation

typedef boost::intrusive::list_member_hook<LinkMode> Song::Hook

Definition at line 47 of file Song.hxx.

typedef boost::intrusive::link_mode<link_mode> Song::LinkMode

Definition at line 46 of file Song.hxx.

Constructor & Destructor Documentation

Song::Song ( const char *  _uri,
size_t  uri_length,
Directory parent 
)
Song::~Song ( )

Member Function Documentation

gcc_pure LightSong Song::Export ( ) const
void Song::Free ( )
gcc_pure std::string Song::GetURI ( ) const

Returns the URI of the song in UTF-8 encoding, including its location within the music directory.

static gcc_malloc Song* Song::LoadFile ( Storage storage,
const char *  name_utf8,
Directory parent 
)
static

allocate a new song structure with a local file name and attempt to load its metadata.

If all decoder plugin fail to read its meta data, nullptr is returned.

static gcc_malloc Song* Song::NewFile ( const char *  path_utf8,
Directory parent 
)
static

allocate a new song with a local file name

static gcc_malloc Song* Song::NewFrom ( DetachedSong &&  other,
Directory parent 
)
static
bool Song::UpdateFile ( Storage storage)

Field Documentation

SongTime Song::end_time

End of this sub-song within the file.

Unused if zero.

Definition at line 84 of file Song.hxx.

constexpr auto Song::link_mode = boost::intrusive::normal_link
static

Definition at line 45 of file Song.hxx.

time_t Song::mtime

Definition at line 73 of file Song.hxx.

Directory* const Song::parent

The Directory that contains this song.

Must be non-nullptr. directory this way.

Definition at line 71 of file Song.hxx.

Hook Song::siblings

Pointers to the siblings of this directory within the parent directory.

It is unused (undefined) if this song is not in the database.

This attribute is protected with the global db_mutex. Read access in the update thread does not need protection.

Definition at line 63 of file Song.hxx.

SongTime Song::start_time

Start of this sub-song within the file.

Definition at line 78 of file Song.hxx.

Tag Song::tag

Definition at line 65 of file Song.hxx.

char Song::uri[sizeof(int)]

The file name.

Definition at line 89 of file Song.hxx.


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