Helper functions for MPD search.
More...
Go to the source code of this file.
|
| bool | mympd_client_search_add_to_plist (struct t_partition_state *partition_state, const char *expression, const char *plist, unsigned to, const char *sort, bool sortdesc, sds *error) |
| |
| bool | mympd_client_search_add_to_plist_window (struct t_partition_state *partition_state, const char *expression, const char *plist, unsigned to, const char *sort, bool sortdesc, unsigned start, unsigned end, sds *error) |
| |
| bool | mympd_client_search_add_to_queue (struct t_partition_state *partition_state, const char *expression, unsigned to, enum mpd_position_whence whence, const char *sort, bool sortdesc, sds *error) |
| |
| bool | mympd_client_search_add_to_queue_window (struct t_partition_state *partition_state, const char *expression, unsigned to, enum mpd_position_whence whence, const char *sort, bool sortdesc, unsigned start, unsigned end, sds *error) |
| |
| bool | mympd_client_add_search_sort_param (struct t_partition_state *partition_state, const char *sort, bool sortdesc) |
| |
| bool | mympd_client_add_search_group_param (struct mpd_connection *conn, enum mpd_tag_type tag) |
| |
| bool | mympd_client_add_search_window_param_mpd_025 (struct t_partition_state *partition_state, unsigned start, unsigned end) |
| |
| sds | get_search_expression_album (sds buffer, enum mpd_tag_type tag_albumartist, struct t_album *album, const struct t_albums_config *album_config) |
| |
| sds | get_search_expression_album_tag (sds buffer, enum mpd_tag_type tag_albumartist, struct t_album *album, enum mpd_tag_type tag, const char *tag_value, const struct t_albums_config *album_config) |
| |
| sds | escape_mpd_search_expression (sds buffer, const char *tag, const char *operator, const char *value) |
| |
Helper functions for MPD search.
◆ escape_mpd_search_expression()
| sds escape_mpd_search_expression |
( |
sds |
buffer, |
|
|
const char * |
tag, |
|
|
const char * |
operator, |
|
|
const char * |
value |
|
) |
| |
Escapes a mpd search expression
- Parameters
-
| buffer | already allocated sds string to append |
| tag | search tag |
| operator | search operator |
| value | search value |
- Returns
- pointer to buffer
◆ get_search_expression_album()
| sds get_search_expression_album |
( |
sds |
buffer, |
|
|
enum mpd_tag_type |
tag_albumartist, |
|
|
struct t_album * |
album, |
|
|
const struct t_albums_config * |
album_config |
|
) |
| |
Creates a mpd search expression to find all songs in an album
- Parameters
-
| buffer | Buffer to set the search expression |
| tag_albumartist | albumartist tag |
| album | the album |
| album_config | album configuration |
- Returns
- Pointer to buffer
◆ get_search_expression_album_tag()
| sds get_search_expression_album_tag |
( |
sds |
buffer, |
|
|
enum mpd_tag_type |
tag_albumartist, |
|
|
struct t_album * |
album, |
|
|
enum mpd_tag_type |
tag, |
|
|
const char * |
tag_value, |
|
|
const struct t_albums_config * |
album_config |
|
) |
| |
Creates a mpd search expression to find all songs of specified disc of an album
- Parameters
-
| buffer | Buffer to set the search expression |
| tag_albumartist | albumartist tag |
| album | the album |
| tag | MPD tag |
| tag_value | MPD tag value |
| album_config | album configuration |
- Returns
- Pointer to buffer
◆ mympd_client_add_search_group_param()
| bool mympd_client_add_search_group_param |
( |
struct mpd_connection * |
conn, |
|
|
enum mpd_tag_type |
tag |
|
) |
| |
Adds the group parameter to the search command. Ignores MPD_TAG_UNKNOWN.
- Parameters
-
| conn | mpd connection |
| tag | group tag to add |
- Returns
- true on success or on MPD_TAG_UNKNOWN, else false
◆ mympd_client_add_search_sort_param()
| bool mympd_client_add_search_sort_param |
( |
struct t_partition_state * |
partition_state, |
|
|
const char * |
sort, |
|
|
bool |
sortdesc |
|
) |
| |
Adds the sort parameter to the search command
- Parameters
-
| partition_state | pointer to partition state |
| sort | tag to sort |
| sortdesc | descending sort in reverse order? |
- Returns
- true on success, else false
◆ mympd_client_add_search_window_param_mpd_025()
| bool mympd_client_add_search_window_param_mpd_025 |
( |
struct t_partition_state * |
partition_state, |
|
|
unsigned |
start, |
|
|
unsigned |
end |
|
) |
| |
Adds the window parameter to the search command. Ignores the parameter if MPD < 0.25.0.
- Parameters
-
| partition_state | pointer to partition state |
| start | Start of the range (including) |
| end | End of the range (excluding), use UINT_MAX for open end |
- Returns
- true on success or on MPD < 0.25.0, else false
◆ mympd_client_search_add_to_plist()
| bool mympd_client_search_add_to_plist |
( |
struct t_partition_state * |
partition_state, |
|
|
const char * |
expression, |
|
|
const char * |
plist, |
|
|
unsigned |
to, |
|
|
const char * |
sort, |
|
|
bool |
sortdesc, |
|
|
sds * |
error |
|
) |
| |
Searches the mpd database for songs by expression and adds the result to a playlist
- Parameters
-
| partition_state | pointer to partition specific states |
| expression | mpd search expression |
| plist | playlist to create or to append the result |
| to | position to insert the songs, UINT_MAX to append |
| sort | tag to sort |
| sortdesc | false = ascending, true = descending |
| error | pointer to already allocated sds string for the error message or NULL to return no response |
- Returns
- true on success else false
◆ mympd_client_search_add_to_plist_window()
| bool mympd_client_search_add_to_plist_window |
( |
struct t_partition_state * |
partition_state, |
|
|
const char * |
expression, |
|
|
const char * |
plist, |
|
|
unsigned |
to, |
|
|
const char * |
sort, |
|
|
bool |
sortdesc, |
|
|
unsigned |
start, |
|
|
unsigned |
end, |
|
|
sds * |
error |
|
) |
| |
Searches the mpd database for songs by expression and adds the result to a playlist
- Parameters
-
| partition_state | pointer to partition specific states |
| expression | mpd search expression |
| plist | playlist to create or to append the result |
| to | position to insert the songs, UINT_MAX to append |
| sort | tag to sort |
| sortdesc | false = ascending, true = descending |
| start | window start (including) |
| end | window end (excluding), UINT_MAX for open end |
| error | pointer to already allocated sds string for the error message or NULL to return no response |
- Returns
- true on success else false
◆ mympd_client_search_add_to_queue()
| bool mympd_client_search_add_to_queue |
( |
struct t_partition_state * |
partition_state, |
|
|
const char * |
expression, |
|
|
unsigned |
to, |
|
|
enum mpd_position_whence |
whence, |
|
|
const char * |
sort, |
|
|
bool |
sortdesc, |
|
|
sds * |
error |
|
) |
| |
Searches the mpd database for songs by expression and adds the result to the queue
- Parameters
-
| partition_state | pointer to partition specific states |
| expression | mpd search expression |
| to | position to insert the songs, UINT_MAX to append |
| whence | enum mpd_position_whence: 0 = MPD_POSITION_ABSOLUTE 1 = MPD_POSITION_AFTER_CURRENT 2 = MPD_POSITION_BEFORE_CURRENT |
| sort | tag to sort |
| sortdesc | false = ascending, true = descending |
| error | pointer to already allocated sds string for the error message or NULL to return no response |
- Returns
- true on success else false
◆ mympd_client_search_add_to_queue_window()
| bool mympd_client_search_add_to_queue_window |
( |
struct t_partition_state * |
partition_state, |
|
|
const char * |
expression, |
|
|
unsigned |
to, |
|
|
enum mpd_position_whence |
whence, |
|
|
const char * |
sort, |
|
|
bool |
sortdesc, |
|
|
unsigned |
start, |
|
|
unsigned |
end, |
|
|
sds * |
error |
|
) |
| |
Searches the mpd database for songs by expression and adds the result window to the queue
- Parameters
-
| partition_state | pointer to partition specific states |
| expression | mpd search expression |
| to | position to insert the songs, UINT_MAX to append |
| whence | enum mpd_position_whence: 0 = MPD_POSITION_ABSOLUTE 1 = MPD_POSITION_AFTER_CURRENT 2 = MPD_POSITION_BEFORE_CURRENT |
| sort | tag to sort |
| sortdesc | false = ascending, true = descending |
| start | Start of the range (including) |
| end | End of the range (excluding), use UINT_MAX for open end |
| error | pointer to already allocated sds string for the error message or NULL to return no response |
- Returns
- true on success else false