MPD
Functions
song_sticker.h File Reference
#include <stdbool.h>
#include <glib.h>

Go to the source code of this file.

Functions

char * sticker_song_get_value (const struct song *song, const char *name)
 Returns one value from a song's sticker record.
 
bool sticker_song_set_value (const struct song *song, const char *name, const char *value)
 Sets a sticker value in the specified song.
 
bool sticker_song_delete (const struct song *song)
 Deletes a sticker from the database.
 
bool sticker_song_delete_value (const struct song *song, const char *name)
 Deletes a sticker value.
 
struct sticker * sticker_song_get (const struct song *song)
 Loads the sticker for the specified song.
 
bool sticker_song_find (struct directory *directory, const char *name, void(*func)(struct song *song, const char *value, gpointer user_data), gpointer user_data)
 Finds stickers with the specified name below the specified directory.
 

Function Documentation

bool sticker_song_delete ( const struct song song)

Deletes a sticker from the database.

All values are deleted.

bool sticker_song_delete_value ( const struct song song,
const char *  name 
)

Deletes a sticker value.

Does nothing if the sticker did not exist.

bool sticker_song_find ( struct directory directory,
const char *  name,
void(*)(struct song *song, const char *value, gpointer user_data)  func,
gpointer  user_data 
)

Finds stickers with the specified name below the specified directory.

Parameters
directorythe base directory to search in
namethe name of the sticker
Returns
true on success (even if no sticker was found), false on failure
struct sticker* sticker_song_get ( const struct song song)
read

Loads the sticker for the specified song.

Parameters
songthe song object
Returns
a sticker object, or NULL on error or if there is no sticker
char* sticker_song_get_value ( const struct song song,
const char *  name 
)

Returns one value from a song's sticker record.

The caller must free the return value with g_free().

bool sticker_song_set_value ( const struct song song,
const char *  name,
const char *  value 
)

Sets a sticker value in the specified song.

Overwrites existing values.