MPD: Song Struct Reference

MPD 0.20.15

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_mode > | LinkMode
typedef boost::intrusive::list_member_hook< LinkMode > | Hook

## 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 noexcept
| Returns the URI of the song in UTF-8 encoding, including its location within the music directory. More...
gcc_pure LightSong | Export () const noexcept

## Static Public Member Functions
static gcc_malloc Song * | NewFrom (DetachedSong &&other, Directory &parent)
static gcc_malloc Song * | NewFile (const char *path_utf8, Directory &parent)
| allocate a new song with a local file name More...
static gcc_malloc Song * | LoadFile (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

## ◆ Hook

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

Definition at line 47 of file Song.hxx.

## ◆ LinkMode

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

Definition at line 46 of file Song.hxx.

## Constructor & Destructor Documentation

## ◆ Song()

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

## ◆ ~Song()

Song::~Song | ( |  | ) |

## Member Function Documentation

## ◆ Export()

gcc_pure LightSong Song::Export | ( |  | ) | const
| noexcept

## ◆ Free()

void Song::Free | ( |  | ) |

## ◆ GetURI()

gcc_pure std::string Song::GetURI | ( |  | ) | const
| noexcept

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

## ◆ LoadFile()

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.

## ◆ NewFile()

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

allocate a new song with a local file name

## ◆ NewFrom()

static gcc_malloc Song* Song::NewFrom | ( | DetachedSong && | other,
|  | Directory & | parent
| ) |  |
| static

## ◆ UpdateFile()

bool Song::UpdateFile | ( | Storage & | storage | ) |

## Field Documentation

## ◆ end_time

SongTime Song::end_time

End of this sub-song within the file.

Unused if zero.

Definition at line 84 of file Song.hxx.

## ◆ link_mode

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

Definition at line 45 of file Song.hxx.

## ◆ mtime

time_t Song::mtime

Definition at line 73 of file Song.hxx.

## ◆ parent

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.

## ◆ siblings

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.

## ◆ start_time

SongTime Song::start_time

Start of this sub-song within the file.

Definition at line 78 of file Song.hxx.

## ◆ tag

Tag Song::tag

Definition at line 65 of file Song.hxx.

## ◆ uri

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:

- db/plugins/simple/Song.hxx