MPD: LightSong Struct Reference

MPD 0.20.18

Public Member Functions | Data Fields
LightSong Struct Reference

A reference to a song file. More...

`#include <LightSong.hxx>`

Inheritance diagram for LightSong:
[legend]
Collaboration diagram for LightSong:
[legend]

## Public Member Functions
gcc_pure std::string | GetURI () const noexcept
gcc_pure SignedSongTime | GetDuration () const noexcept

## Data Fields
const char * | directory
| If this is not nullptr, then it denotes a prefix for the uri. More...
const char * | uri
const char * | real_uri
| The "real" URI, the one to be used for opening the resource. More...
const Tag * | tag
| Must not be nullptr. 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...

## Detailed Description

A reference to a song file.

Unlike the other "Song" classes in the MPD code base, this one consists only of pointers. It is supposed to be as light as possible while still providing all the information MPD has about a song file. This class does not manage any memory, and the pointers become invalid quickly. Only to be used to pass around during well-defined situations.

Definition at line 40 of file LightSong.hxx.

## Member Function Documentation

## ◆ GetDuration()

gcc_pure SignedSongTime LightSong::GetDuration | ( |  | ) | const
| noexcept

## ◆ GetURI()

gcc_pure std::string LightSong::GetURI | ( |  | ) | const
| inlinenoexcept

Definition at line 79 of file LightSong.hxx.

## Field Documentation

## ◆ directory

const char* LightSong::directory

If this is not nullptr, then it denotes a prefix for the uri.

To build the full URI, join directory and uri with a slash.

Definition at line 46 of file LightSong.hxx.

## ◆ end_time

SongTime LightSong::end_time

End of this sub-song within the file.

Unused if zero.

Definition at line 76 of file LightSong.hxx.

## ◆ mtime

time_t LightSong::mtime

Definition at line 65 of file LightSong.hxx.

## ◆ real_uri

const char* LightSong::real_uri

The "real" URI, the one to be used for opening the resource.

If this attribute is nullptr, then uri (and directory) shall be used.

This attribute is used for songs from the database which have a relative URI.

Definition at line 58 of file LightSong.hxx.

## ◆ start_time

SongTime LightSong::start_time

Start of this sub-song within the file.

Definition at line 70 of file LightSong.hxx.

## ◆ tag

const Tag* LightSong::tag

Must not be nullptr.

Definition at line 63 of file LightSong.hxx.

## ◆ uri

const char* LightSong::uri

Definition at line 48 of file LightSong.hxx.

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

- db/LightSong.hxx