XMMS2
Macros | Typedefs | Functions
xmms_medialib.h File Reference
#include <xmms/xmms_medialib.h>
#include <xmmspriv/xmms_collection.h>
#include <xmmspriv/xmms_fetch_info.h>
#include <xmmspriv/xmms_fetch_spec.h>
#include <s4.h>

Macros

#define xmms_medialib_entry_status_set(s, e, st)   xmms_medialib_entry_property_set_int_source(s, e, XMMS_MEDIALIB_ENTRY_PROPERTY_STATUS, st, "server") /** @todo: hardcoded server id might be bad? */
 

Typedefs

typedef struct xmms_medialib_St xmms_medialib_t
 
typedef struct
xmms_medialib_session_St 
xmms_medialib_session_t
 

Functions

xmms_medialib_txmms_medialib_init (void)
 Initialize the medialib and open the database file. More...
 
s4_txmms_medialib_get_database_backend (xmms_medialib_t *medialib)
 
s4_sourcepref_txmms_medialib_get_source_preferences (xmms_medialib_t *medialib)
 
char * xmms_medialib_uuid (xmms_medialib_t *mlib)
 
s4_resultset_txmms_medialib_session_query (xmms_medialib_session_t *s, s4_fetchspec_t *spec, s4_condition_t *cond)
 
guint xmms_medialib_num_not_resolved (xmms_medialib_session_t *s)
 
xmms_medialib_entry_t xmms_medialib_entry_not_resolved_get (xmms_medialib_session_t *s)
 
xmms_medialib_entry_t xmms_medialib_entry_new (xmms_medialib_session_t *s, const char *url, xmms_error_t *error)
 Welcome to a function that should be called something else. More...
 
xmms_medialib_entry_t xmms_medialib_entry_new_encoded (xmms_medialib_session_t *s, const char *url, xmms_error_t *error)
 
void xmms_medialib_entry_remove (xmms_medialib_session_t *s, xmms_medialib_entry_t entry)
 Remove a medialib entry from the database. More...
 
void xmms_medialib_entry_cleanup (xmms_medialib_session_t *s, xmms_medialib_entry_t entry)
 
gint xmms_medialib_entry_property_get_int (xmms_medialib_session_t *s, xmms_medialib_entry_t entry, const gchar *property)
 Retrieve a property as a int from a entry. More...
 
gchar * xmms_medialib_entry_property_get_str (xmms_medialib_session_t *s, xmms_medialib_entry_t entry, const gchar *property)
 Retrieve a property from an entry. More...
 
xmmsv_txmms_medialib_entry_property_get_value (xmms_medialib_session_t *s, xmms_medialib_entry_t entry, const gchar *property)
 Retrieve a property from an entry. More...
 
gboolean xmms_medialib_entry_property_set_int (xmms_medialib_session_t *s, 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_str (xmms_medialib_session_t *s, 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_int_source (xmms_medialib_session_t *s, xmms_medialib_entry_t entry, const gchar *property, gint value, const gchar *source)
 
gboolean xmms_medialib_entry_property_set_str_source (xmms_medialib_session_t *s, xmms_medialib_entry_t entry, const gchar *property, const gchar *value, const gchar *source)
 
gchar * xmms_medialib_url_encode (const gchar *path)
 
gboolean xmms_medialib_decode_url (char *url)
 
gboolean xmms_medialib_check_id (xmms_medialib_session_t *s, 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_query_random_id (xmms_medialib_session_t *s, xmmsv_t *coll)
 Returns a random entry from a collection. More...
 
xmmsv_txmms_medialib_query (xmms_medialib_session_t *s, xmmsv_t *coll, xmmsv_t *fetch, xmms_error_t *err)
 Queries the medialib and returns an xmmsv_t with the info requested. More...
 
s4_resultset_txmms_medialib_query_recurs (xmms_medialib_session_t *session, xmmsv_t *coll, xmms_fetch_info_t *fetch)
 Internal function that does the actual querying. More...
 
xmmsv_txmms_medialib_query_to_xmmsv (s4_resultset_t *set, xmms_fetch_spec_t *spec)
 
xmms_medialib_session_txmms_medialib_session_begin (xmms_medialib_t *mlib)
 
xmms_medialib_session_txmms_medialib_session_begin_ro (xmms_medialib_t *medialib)
 
void xmms_medialib_session_abort (xmms_medialib_session_t *session)
 
gboolean xmms_medialib_session_commit (xmms_medialib_session_t *session)
 
s4_sourcepref_txmms_medialib_session_get_source_preferences (xmms_medialib_session_t *session)
 
void xmms_medialib_session_track_garbage (xmms_medialib_session_t *session, xmmsv_t *data)
 
gint xmms_medialib_session_property_set (xmms_medialib_session_t *session, xmms_medialib_entry_t entry, const gchar *key, const s4_val_t *value, const gchar *source)
 
gint xmms_medialib_session_property_unset (xmms_medialib_session_t *session, xmms_medialib_entry_t entry, const gchar *key, const s4_val_t *value, const gchar *source)
 

Macro Definition Documentation

#define xmms_medialib_entry_status_set (   s,
  e,
  st 
)    xmms_medialib_entry_property_set_int_source(s, e, XMMS_MEDIALIB_ENTRY_PROPERTY_STATUS, st, "server") /** @todo: hardcoded server id might be bad? */

Typedef Documentation

typedef struct xmms_medialib_session_St xmms_medialib_session_t
typedef struct xmms_medialib_St xmms_medialib_t

Function Documentation

gboolean xmms_medialib_check_id ( xmms_medialib_session_t s,
xmms_medialib_entry_t  entry 
)
gboolean xmms_medialib_decode_url ( char *  url)
xmms_medialib_entry_t xmms_medialib_entry_new_encoded ( xmms_medialib_session_t s,
const char *  url,
xmms_error_t error 
)
xmms_medialib_entry_t xmms_medialib_entry_not_resolved_get ( xmms_medialib_session_t s)
guint xmms_medialib_num_not_resolved ( xmms_medialib_session_t s)
xmmsv_t* xmms_medialib_query ( xmms_medialib_session_t session,
xmmsv_t coll,
xmmsv_t fetch,
xmms_error_t err 
)

Queries the medialib and returns an xmmsv_t with the info requested.

Parameters
collThe collection to find
fetchSpecifies what to fetch
Returns
An xmmsv_t with the structure requested in fetch

Referenced by xmms_medialib_query_random_id().

xmms_medialib_entry_t xmms_medialib_query_random_id ( xmms_medialib_session_t session,
xmmsv_t coll 
)

Returns a random entry from a collection.

Parameters
collThe collection to find a random entry in
Returns
A random entry from the collection, 0 if the collection is empty

Referenced by xmms_collection_get_random_media().

s4_resultset_t* xmms_medialib_query_recurs ( xmms_medialib_session_t session,
xmmsv_t coll,
xmms_fetch_info_t fetch 
)

Internal function that does the actual querying.

Parameters
collThe collection to use when querying
fetchInformation on what is being fetched
Returns
An S4 resultset correspoding to the entires in the medialib matching the collection. Must be free with s4_resultset_free

Referenced by xmms_medialib_query().

xmmsv_t* xmms_medialib_query_to_xmmsv ( s4_resultset_t set,
xmms_fetch_spec_t spec 
)
void xmms_medialib_session_abort ( xmms_medialib_session_t session)
xmms_medialib_session_t* xmms_medialib_session_begin ( xmms_medialib_t mlib)
xmms_medialib_session_t* xmms_medialib_session_begin_ro ( xmms_medialib_t medialib)
gboolean xmms_medialib_session_commit ( xmms_medialib_session_t session)
s4_sourcepref_t* xmms_medialib_session_get_source_preferences ( xmms_medialib_session_t session)

Referenced by xmms_medialib_query().

gint xmms_medialib_session_property_set ( xmms_medialib_session_t session,
xmms_medialib_entry_t  entry,
const gchar *  key,
const s4_val_t value,
const gchar *  source 
)
gint xmms_medialib_session_property_unset ( xmms_medialib_session_t session,
xmms_medialib_entry_t  entry,
const gchar *  key,
const s4_val_t value,
const gchar *  source 
)
s4_resultset_t* xmms_medialib_session_query ( xmms_medialib_session_t s,
s4_fetchspec_t spec,
s4_condition_t cond 
)
void xmms_medialib_session_track_garbage ( xmms_medialib_session_t session,
xmmsv_t data 
)

Referenced by xmms_medialib_query().

gchar* xmms_medialib_url_encode ( const gchar *  path)