|
myMPD
Internal API documentation
|
Album implementation. More...


Go to the source code of this file.
Data Structures | |
| struct | t_albums_config |
Enumerations | |
| enum | album_modes { ALBUM_MODE_SIMPLE = 0 , ALBUM_MODE_ADV } |
Functions | |
| struct t_album * | album_new (void) |
| struct t_album * | album_new_uri (const char *uri) |
| struct t_album * | album_new_from_song (const struct mpd_song *song, const struct t_mympd_mpd_tags *album_tags) |
| void | album_free (struct t_album *album) |
| const char * | album_get_uri (const struct t_album *album) |
| time_t | album_get_last_modified (const struct t_album *album) |
| time_t | album_get_added (const struct t_album *album) |
| unsigned | album_get_disc_count (const struct t_album *album) |
| unsigned | album_get_total_time (const struct t_album *album) |
| unsigned | album_get_song_count (const struct t_album *album) |
| bool | album_get_unknown (const struct t_album *album) |
| const char * | album_get_tag (const struct t_album *album, enum mpd_tag_type type, unsigned idx) |
| void | album_set_discs (struct t_album *album, const char *disc) |
| void | album_set_disc_count (struct t_album *album, unsigned count) |
| void | album_set_last_modified (struct t_album *album, time_t last_modified) |
| void | album_set_added (struct t_album *album, time_t added) |
| void | album_set_total_time (struct t_album *album, unsigned duration) |
| void | album_inc_total_time (struct t_album *album, unsigned duration) |
| void | album_set_song_count (struct t_album *album, unsigned count) |
| void | album_inc_song_count (struct t_album *album) |
| bool | album_append_tag (struct t_album *song, enum mpd_tag_type type, const char *value) |
| bool | album_append_tags (struct t_album *album, const struct mpd_song *song, const struct t_mympd_mpd_tags *tags) |
| bool | album_copy_tags (struct t_album *song, enum mpd_tag_type src, enum mpd_tag_type dst) |
| void | album_set_uri (struct t_album *album, const char *uri) |
| void | album_set_unknown (struct t_album *album, bool unknown) |
| sds | album_get_tag_value_string (const struct t_album *album, enum mpd_tag_type tag, sds tag_values) |
| sds | album_get_tag_values (const struct t_album *album, enum mpd_tag_type tag, sds tag_values) |
| sds | album_get_tag_value_padded (const struct t_album *album, enum mpd_tag_type tag, char pad, size_t len, sds tag_values) |
| sds | print_album_tags (sds buffer, const struct t_albums_config *album_config, const struct t_mympd_mpd_tags *tagcols, const struct t_album *album) |
Album implementation.
| enum album_modes |
Modes for the album cache
| bool album_append_tag | ( | struct t_album * | album, |
| enum mpd_tag_type | type, | ||
| const char * | value | ||
| ) |
Adds a tag value to the album if value does not already exists
| album | pointer to a t_album struct |
| type | mpd tag type |
| value | tag value to add |
| bool album_append_tags | ( | struct t_album * | album, |
| const struct mpd_song * | song, | ||
| const struct t_mympd_mpd_tags * | tags | ||
| ) |
Appends tag values from a song to the album
| album | pointer to a t_album struct representing the album |
| song | song to add tag values from |
| tags | tags to append |
| bool album_copy_tags | ( | struct t_album * | album, |
| enum mpd_tag_type | src, | ||
| enum mpd_tag_type | dst | ||
| ) |
Copies all values from a tag to another tag
| album | pointer to a t_album struct |
| src | source tag |
| dst | destination tag |
| void album_free | ( | struct t_album * | album | ) |
Frees an album struct
| album | Pointer to album struct |
| time_t album_get_added | ( | const struct t_album * | album | ) |
Gets the added timestamp for the album
| album | t_album struct representing the album |
| unsigned album_get_disc_count | ( | const struct t_album * | album | ) |
Gets the number of discs
| album | t_album struct representing the album |
| time_t album_get_last_modified | ( | const struct t_album * | album | ) |
Gets the last-modified timestamp for the album
| album | t_album struct representing the album |
| unsigned album_get_song_count | ( | const struct t_album * | album | ) |
Gets the number of songs
| album | t_album struct representing the album |
| const char * album_get_tag | ( | const struct t_album * | album, |
| enum mpd_tag_type | type, | ||
| unsigned | idx | ||
| ) |
Gets the album tag value at position idx
| album | t_album struct representing the album |
| type | mpd tag type |
| idx | index of tag value to get |
| sds album_get_tag_value_padded | ( | const struct t_album * | album, |
| enum mpd_tag_type | tag, | ||
| char | pad, | ||
| size_t | len, | ||
| sds | tag_values | ||
| ) |
Get's a tag value from an album and pads it
| album | Album struct |
| tag | mpd tag type |
| pad | padding char |
| len | length to pad |
| tag_values | already allocated sds string to append |
| sds album_get_tag_value_string | ( | const struct t_album * | album, |
| enum mpd_tag_type | tag, | ||
| sds | tag_values | ||
| ) |
Appends a comma separated list of tag values
| album | pointer to album struct |
| tag | mpd tag type to get values for |
| tag_values | already allocated sds string to append the values |
| sds album_get_tag_values | ( | const struct t_album * | album, |
| enum mpd_tag_type | tag, | ||
| sds | tag_values | ||
| ) |
Appends a a json string/array of tag values
| album | pointer to album struct |
| tag | mpd tag type to get values for |
| tag_values | already allocated sds string to append the values |
| unsigned album_get_total_time | ( | const struct t_album * | album | ) |
Gets the album duration
| album | t_album struct representing the album |
| bool album_get_unknown | ( | const struct t_album * | album | ) |
Gets the unknown marker for an album
| album | t_album struct representing the album |
| const char * album_get_uri | ( | const struct t_album * | album | ) |
Gets the album uri (uri of first song)
| album | t_album struct representing the album |
| void album_inc_song_count | ( | struct t_album * | album | ) |
Increments the song count
| album | pointer to a t_album struct |
| void album_inc_total_time | ( | struct t_album * | album, |
| unsigned | duration | ||
| ) |
Increments the albums duration
| album | t_album struct representing the album |
| duration | seconds to increment |
| struct t_album * album_new | ( | void | ) |
Creates and initializes a new struct for an album.
| struct t_album * album_new_from_song | ( | const struct mpd_song * | song, |
| const struct t_mympd_mpd_tags * | album_tags | ||
| ) |
Creates and initializes a new struct for an album with values copied from song
| song | Song to create album from |
| album_tags | Tags to use |
| struct t_album * album_new_uri | ( | const char * | uri | ) |
Creates and initializes a new struct for an album with defined first song uri
| uri | First song uri |
| void album_set_added | ( | struct t_album * | album, |
| time_t | added | ||
| ) |
Sets the albums added timestamp if it is older as current album added timestamp
| album | t_album struct representing the album |
| added | added timestamp to set |
| void album_set_disc_count | ( | struct t_album * | album, |
| unsigned | count | ||
| ) |
Sets a fixed disc count
| album | t_album struct representing the album |
| count | disc count |
| void album_set_discs | ( | struct t_album * | album, |
| const char * | disc | ||
| ) |
Sets the albums disc count from disc song tag
| album | t_album struct representing the album |
| disc | mpd song disc tag value |
| void album_set_last_modified | ( | struct t_album * | album, |
| time_t | last_modified | ||
| ) |
Sets the albums last modified timestamp if it is newer as current album last-modified timestamp
| album | t_album struct representing the album |
| last_modified | last-modified timestamp to set |
| void album_set_song_count | ( | struct t_album * | album, |
| unsigned | count | ||
| ) |
Set the song count
| album | t_album struct representing the album |
| count | song count |
| void album_set_total_time | ( | struct t_album * | album, |
| unsigned | duration | ||
| ) |
Sets the albums duration
| album | t_album struct representing the album |
| duration | total time to set |
| void album_set_unknown | ( | struct t_album * | album, |
| bool | unknown | ||
| ) |
Sets the unknown marker for an album
| album | t_album struct representing the album |
| unknown | true if it is a unknown album, else false |
| void album_set_uri | ( | struct t_album * | album, |
| const char * | uri | ||
| ) |
Replaces the uri
| album | pointer to album struct |
| uri | new uri to set |
| sds print_album_tags | ( | sds | buffer, |
| const struct t_albums_config * | album_config, | ||
| const struct t_mympd_mpd_tags * | tagcols, | ||
| const struct t_album * | album | ||
| ) |
Prints the tag values for an album as json string
| buffer | already allocated sds string to append the values |
| album_config | Album configuration |
| tagcols | pointer to t_tags struct (tags to retrieve) |
| album | pointer to album |