Database Advanced Search
[Database]


Functions

void mpd_database_search_add_constraint (MpdObj *mi, mpd_TagItems field, const char *value)
void mpd_database_search_start (MpdObj *mi, int exact)
void mpd_database_search_field_start (MpdObj *mi, mpd_TagItems field)
MpdDatampd_database_search_commit (MpdObj *mi)

Detailed Description

The following functions provide an interface to the improved search capabilities of mpd 0.12.0.

Function Documentation

void mpd_database_search_add_constraint ( MpdObj mi,
mpd_TagItems  field,
const char *  value 
)

Parameters:
mi A MpdObj
field A mpd_TagItems
value a string that field needs to match
Adds a constraint to the search

MpdData* mpd_database_search_commit ( MpdObj mi  ) 

Parameters:
mi A MpdObj
Commits the search and gathers the result in a MpdData list.

Returns:
a MpdData list with the search result, or NULL when nothing is found

void mpd_database_search_field_start ( MpdObj mi,
mpd_TagItems  field 
)

Parameters:
mi a MpdObj
field a mpd_TagItems
Starts a field search, eg. if you want a list of all albums, you do;

You can add constraints using mpd_database_search_add_constraint, for example if you want all albums by eric clapton:

void mpd_database_search_start ( MpdObj mi,
int  exact 
)

Parameters:
mi A MpdObj
exact a boolean indicating if the search is fuzzy or exact
Starts a search, you can add "constraints" by calling mpd_database_search_add_constraint For Example if you want all songs by Eric Clapton you could do:

If you only want the songs from the album unplugged:

This function requires mpd 0.12.0 or higher


Copyright 2006 Qball Cow