|
myMPD
Internal API documentation
|
Playlist helper functions. More...
#include "src/lib/mympd_state.h"

Go to the source code of this file.
Enumerations | |
| enum | playlist_types { PLTYPE_ALL = 0 , PLTYPE_STATIC = 1 , PLTYPE_SMART = 2 , PLTYPE_SMARTPLS_ONLY = 3 } |
| enum | playlist_sort_types { PLSORT_UNKNOWN = -1 , PLSORT_NAME , PLSORT_LAST_MODIFIED } |
Functions | |
| bool | mympd_client_get_all_playlists (struct t_partition_state *partition_state, struct t_list *l, bool smartpls, sds *error) |
| time_t | mympd_client_get_playlist_mtime (struct t_partition_state *partition_state, const char *playlist) |
| bool | mympd_client_playlist_crop (struct t_partition_state *partition_state, const char *plist, unsigned num_entries) |
| bool | mympd_client_playlist_clear (struct t_partition_state *partition_state, const char *plist, sds *error) |
| bool | mympd_client_playlist_get (struct t_partition_state *partition_state, const char *plist, bool reverse, struct t_list *l, sds *error) |
| bool | mympd_client_playlist_shuffle (struct t_partition_state *partition_state, const char *uri, sds *error) |
| bool | mympd_client_playlist_sort (struct t_partition_state *partition_state, const char *uri, const char *tagstr, bool sortdesc, sds *error) |
| bool | mympd_client_enum_playlist (struct t_partition_state *partition_state, const char *plist, unsigned *count, unsigned *duration, sds *error) |
| int | mympd_client_playlist_validate (struct t_partition_state *partition_state, const char *playlist, bool remove, sds *error) |
| int | mympd_client_playlist_validate_all (struct t_partition_state *partition_state, bool remove, sds *error) |
| int64_t | mympd_client_playlist_dedup (struct t_partition_state *partition_state, const char *playlist, bool remove, sds *error) |
| int64_t | mympd_client_playlist_dedup_all (struct t_partition_state *partition_state, bool remove, sds *error) |
| enum playlist_sort_types | playlist_parse_sort (const char *str) |
| bool | mympd_send_list_playlist_range (struct t_partition_state *partition_state, const char *plist, unsigned start, unsigned end) |
| bool | mympd_send_list_playlist_range_meta (struct t_partition_state *partition_state, const char *plist, unsigned start, unsigned end) |
Playlist helper functions.
| enum playlist_sort_types |
Playlist sort types
| enum playlist_types |
Playlist types
| bool mympd_client_enum_playlist | ( | struct t_partition_state * | partition_state, |
| const char * | plist, | ||
| unsigned * | count, | ||
| unsigned * | duration, | ||
| sds * | error | ||
| ) |
Counts the number of songs in the playlist
| partition_state | pointer to partition specific states |
| plist | playlist to enumerate |
| count | pointer to unsigned for entity count |
| duration | pointer to unsigned for total playtime |
| error | pointer to an already allocated sds string for the error message |
| bool mympd_client_get_all_playlists | ( | struct t_partition_state * | partition_state, |
| struct t_list * | l, | ||
| bool | smartpls, | ||
| sds * | error | ||
| ) |
Public functions Gets all playlists.
| partition_state | pointer to partition state |
| l | pointer to list to populate |
| smartpls | true = integrate smart playlists, false = ignore smart playlists |
| error | pointer to an already allocated sds string for the error message |
| time_t mympd_client_get_playlist_mtime | ( | struct t_partition_state * | partition_state, |
| const char * | playlist | ||
| ) |
Returns the playlists last modification time
| partition_state | pointer to partition specific states |
| playlist | name of the playlist to check |
| bool mympd_client_playlist_clear | ( | struct t_partition_state * | partition_state, |
| const char * | plist, | ||
| sds * | error | ||
| ) |
Clears a playlist
| partition_state | pointer to partition specific states |
| plist | playlist name |
| error | pointer to an already allocated sds string for the error message |
| bool mympd_client_playlist_crop | ( | struct t_partition_state * | partition_state, |
| const char * | plist, | ||
| unsigned | num_entries | ||
| ) |
Crops a playlist
| partition_state | Pointer to partition specific states |
| plist | Playlist name |
| num_entries | May number of songs |
| int64_t mympd_client_playlist_dedup | ( | struct t_partition_state * | partition_state, |
| const char * | playlist, | ||
| bool | remove, | ||
| sds * | error | ||
| ) |
Deduplicates the playlist content
| partition_state | pointer to partition state |
| playlist | playlist to check |
| remove | true = remove duplicate songs, else count duplicate songs |
| error | pointer to an already allocated sds string for the error message |
| int64_t mympd_client_playlist_dedup_all | ( | struct t_partition_state * | partition_state, |
| bool | remove, | ||
| sds * | error | ||
| ) |
Deduplicates all static playlists
| partition_state | pointer to partition state |
| remove | true = remove duplicate songs, else count duplicate songs |
| error | pointer to an already allocated sds string for the error message |
| bool mympd_client_playlist_get | ( | struct t_partition_state * | partition_state, |
| const char * | plist, | ||
| bool | reverse, | ||
| struct t_list * | l, | ||
| sds * | error | ||
| ) |
Gets the contents of a playlist. Uses the range feature for MPD 0.24+
| partition_state | Pointer to partition specific states |
| plist | Playlist name |
| reverse | List in reverse order? |
| l | Already allocated list |
| error | Pointer to an already allocated sds string for the error message |
| bool mympd_client_playlist_shuffle | ( | struct t_partition_state * | partition_state, |
| const char * | playlist, | ||
| sds * | error | ||
| ) |
Shuffles a playlist
| partition_state | pointer to partition specific states |
| playlist | playlist to shuffle |
| error | pointer to an already allocated sds string for the error message |
| bool mympd_client_playlist_sort | ( | struct t_partition_state * | partition_state, |
| const char * | playlist, | ||
| const char * | tagstr, | ||
| bool | sortdesc, | ||
| sds * | error | ||
| ) |
Sorts a playlist. Wrapper for playlist_sort that enables the mympd tags afterwards
| partition_state | pointer to partition specific states |
| playlist | playlist to shuffle |
| tagstr | mpd tag to sort by |
| sortdesc | sort descending? |
| error | pointer to an already allocated sds string for the error message |
| int mympd_client_playlist_validate | ( | struct t_partition_state * | partition_state, |
| const char * | playlist, | ||
| bool | remove, | ||
| sds * | error | ||
| ) |
Validates the playlist entries
| partition_state | pointer to partition state |
| playlist | playlist to check |
| remove | true = remove invalid songs, else count invalid songs |
| error | pointer to an already allocated sds string for the error message |
| int mympd_client_playlist_validate_all | ( | struct t_partition_state * | partition_state, |
| bool | remove, | ||
| sds * | error | ||
| ) |
Validates all entries from all static playlists
| partition_state | pointer to partition state |
| remove | true = remove invalid songs, else count invalid songs |
| error | pointer to an already allocated sds string for the error message |
| bool mympd_send_list_playlist_range | ( | struct t_partition_state * | partition_state, |
| const char * | plist, | ||
| unsigned | start, | ||
| unsigned | end | ||
| ) |
Wrapper for mpd_send_list_playlist_range that falls back to mpd_send_list_playlist if not supported by MPD.
| partition_state | Pointer to partition specific states |
| plist | Playlist name |
| start | Start position (including) |
| end | End position (excluding) |
| bool mympd_send_list_playlist_range_meta | ( | struct t_partition_state * | partition_state, |
| const char * | plist, | ||
| unsigned | start, | ||
| unsigned | end | ||
| ) |
Wrapper for mpd_send_list_playlist_range_meta that falls back to mpd_send_list_playlist_meta if not supported by MPD.
| partition_state | Pointer to partition specific states |
| plist | Playlist name |
| start | Start position (including) |
| end | End position (excluding) |
| enum playlist_sort_types playlist_parse_sort | ( | const char * | str | ) |
Parses the provided string to the playlist_sort_type
| str | String to parse |