XMMS2
Macros | Functions
Medialib

Medialib caches metadata. More...

Macros

#define XMMS_MEDIALIB_SOURCE_SERVER   "server"
 

Functions

xmms_medialib_txmms_medialib_init (void)
 Initialize the medialib and open the database file. More...
 
s4_sourcepref_txmms_medialib_get_source_preferences (xmms_medialib_t *medialib)
 
s4_txmms_medialib_get_database_backend (xmms_medialib_t *medialib)
 
char * xmms_medialib_uuid (xmms_medialib_t *medialib)
 
xmmsv_txmms_medialib_entry_property_get_value (xmms_medialib_session_t *session, xmms_medialib_entry_t id_num, const gchar *property)
 Retrieve a property from an entry. More...
 
gchar * xmms_medialib_entry_property_get_str (xmms_medialib_session_t *session, xmms_medialib_entry_t entry, const gchar *property)
 Retrieve a property from an entry. More...
 
gint xmms_medialib_entry_property_get_int (xmms_medialib_session_t *session, xmms_medialib_entry_t id_num, const gchar *property)
 Retrieve a property as a int from a entry. More...
 
gboolean xmms_medialib_entry_property_set_int (xmms_medialib_session_t *session, xmms_medialib_entry_t entry, const gchar *property, gint value)
 Set a entry property to a new value, overwriting the old value. More...
 
gboolean xmms_medialib_entry_property_set_int_source (xmms_medialib_session_t *session, xmms_medialib_entry_t id_num, const gchar *property, gint value, const gchar *source)
 
gboolean xmms_medialib_entry_property_set_str (xmms_medialib_session_t *session, xmms_medialib_entry_t entry, const gchar *property, const gchar *value)
 Set a entry property to a new value, overwriting the old value. More...
 
gboolean xmms_medialib_entry_property_set_str_source (xmms_medialib_session_t *session, xmms_medialib_entry_t id_num, const gchar *property, const gchar *value, const gchar *source)
 
void xmms_medialib_entry_remove (xmms_medialib_session_t *session, xmms_medialib_entry_t entry)
 Remove a medialib entry from the database. More...
 
void xmms_medialib_entry_cleanup (xmms_medialib_session_t *session, xmms_medialib_entry_t entry)
 
xmmsv_txmms_medialib_add_recursive (xmms_medialib_t *medialib, const gchar *path, xmms_error_t *error)
 Recursively add files under a path to the media library. More...
 
xmms_medialib_entry_t xmms_medialib_entry_new_encoded (xmms_medialib_session_t *session, const gchar *url, xmms_error_t *error)
 
xmms_medialib_entry_t xmms_medialib_entry_new (xmms_medialib_session_t *session, const char *url, xmms_error_t *error)
 Welcome to a function that should be called something else. More...
 

Detailed Description

Medialib caches metadata.

Controls metadata storage.

Macro Definition Documentation

#define XMMS_MEDIALIB_SOURCE_SERVER   "server"

Function Documentation

xmmsv_t* xmms_medialib_add_recursive ( xmms_medialib_t medialib,
const gchar *  path,
xmms_error_t error 
)

Recursively add files under a path to the media library.

Parameters
medialibthe medialib object
paththe directory to scan for files
errorIf an error occurs, it will be stored in there.
Returns
an IDLIST collection with the added entries
void xmms_medialib_entry_cleanup ( xmms_medialib_session_t session,
xmms_medialib_entry_t  entry 
)
xmms_medialib_entry_t xmms_medialib_entry_new ( xmms_medialib_session_t session,
const char *  url,
xmms_error_t error 
)

Welcome to a function that should be called something else.

Returns a entry for a URL, if the URL is already in the medialib the current entry will be returned otherwise a new one will be created and returned.

Todo:
rename to something better?
Parameters
urlURL to add/retrieve from the medialib
errorIf an error occurs, it will be stored in there.
Returns
Entry mapped to the URL
xmms_medialib_entry_t xmms_medialib_entry_new_encoded ( xmms_medialib_session_t session,
const gchar *  url,
xmms_error_t error 
)

Referenced by xmms_medialib_entry_new().

gint xmms_medialib_entry_property_get_int ( xmms_medialib_session_t session,
xmms_medialib_entry_t  id_num,
const gchar *  property 
)

Retrieve a property as a int from a entry.

Parameters
id_numEntry to query.
propertyThe property to extract. Strings passed should be defined in medialib.h
Returns
Property as integer, or -1 if it doesn't exist.
gchar* xmms_medialib_entry_property_get_str ( xmms_medialib_session_t session,
xmms_medialib_entry_t  entry,
const gchar *  property 
)

Retrieve a property from an entry.

Parameters
entryEntry to query.
propertyThe property to extract. Strings passed should be defined in medialib.h
Returns
Newly allocated gchar that needs to be freed with g_free
xmmsv_t* xmms_medialib_entry_property_get_value ( xmms_medialib_session_t session,
xmms_medialib_entry_t  id_num,
const gchar *  property 
)

Retrieve a property from an entry.

See Also
xmms_medialib_entry_property_get_str

Referenced by xmms_medialib_check_id().

gboolean xmms_medialib_entry_property_set_int ( xmms_medialib_session_t session,
xmms_medialib_entry_t  entry,
const gchar *  property,
gint  value 
)

Set a entry property to a new value, overwriting the old value.

Parameters
entryEntry to alter.
propertyThe property to extract. Strings passed should be defined in medialib.h
valuegint with the new value, will be copied in to the medialib
Returns
TRUE on success and FALSE on failure.

Referenced by xmms_sample_converter_to_medialib().

gboolean xmms_medialib_entry_property_set_int_source ( xmms_medialib_session_t session,
xmms_medialib_entry_t  id_num,
const gchar *  property,
gint  value,
const gchar *  source 
)
gboolean xmms_medialib_entry_property_set_str ( xmms_medialib_session_t session,
xmms_medialib_entry_t  entry,
const gchar *  property,
const gchar *  value 
)

Set a entry property to a new value, overwriting the old value.

Parameters
entryEntry to alter.
propertyThe property to extract. Strings passed should be defined in medialib.h
valuegchar with the new value, will be copied in to the medialib
Returns
TRUE on success and FALSE on failure.

Referenced by xmms_sample_converter_to_medialib().

gboolean xmms_medialib_entry_property_set_str_source ( xmms_medialib_session_t session,
xmms_medialib_entry_t  id_num,
const gchar *  property,
const gchar *  value,
const gchar *  source 
)
void xmms_medialib_entry_remove ( xmms_medialib_session_t session,
xmms_medialib_entry_t  entry 
)

Remove a medialib entry from the database.

Parameters
id_numEntry to remove
s4_t* xmms_medialib_get_database_backend ( xmms_medialib_t medialib)
s4_sourcepref_t* xmms_medialib_get_source_preferences ( xmms_medialib_t medialib)
xmms_medialib_t* xmms_medialib_init ( void  )

Initialize the medialib and open the database file.

Returns
TRUE if successful and FALSE if there was a problem

Referenced by main().

char* xmms_medialib_uuid ( xmms_medialib_t medialib)

Referenced by main().