XMMS2
Macros | Functions
medialib.c File Reference

Medialib is a metainfo cache that is searchable. More...

#include <xmms_configuration.h>
#include <xmmspriv/xmms_medialib.h>
#include <xmmspriv/xmms_xform.h>
#include <xmmspriv/xmms_utils.h>
#include <xmms/xmms_error.h>
#include <xmms/xmms_config.h>
#include <xmms/xmms_object.h>
#include <xmms/xmms_ipc.h>
#include <xmms/xmms_log.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <glib.h>
#include <glib/gstdio.h>
#include <time.h>
#include <xmmspriv/xmms_fetch_info.h>
#include <xmmspriv/xmms_fetch_spec.h>
#include "s4.h"
#include "medialib_ipc.c"

Macros

#define XMMS_MEDIALIB_SOURCE_SERVER   "server"
 
#define GOODCHAR(a)
 

Functions

gchar * xmms_medialib_url_encode (const gchar *path)
 
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...
 
gboolean xmms_medialib_check_id (xmms_medialib_session_t *session, xmms_medialib_entry_t 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. More...
 
xmms_medialib_entry_t xmms_medialib_entry_not_resolved_get (xmms_medialib_session_t *session)
 
guint xmms_medialib_num_not_resolved (xmms_medialib_session_t *session)
 
gboolean xmms_medialib_decode_url (gchar *url)
 
xmmsv_txmms_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. More...
 

Detailed Description

Medialib is a metainfo cache that is searchable.

Macro Definition Documentation

#define GOODCHAR (   a)
Value:
((((a) >= 'a') && ((a) <= 'z')) || \
(((a) >= 'A') && ((a) <= 'Z')) || \
(((a) >= '0') && ((a) <= '9')) || \
((a) == ':') || \
((a) == '/') || \
((a) == '-') || \
((a) == '.') || \
((a) == '_'))

Referenced by xmms_medialib_url_encode().

Function Documentation

gboolean xmms_medialib_check_id ( xmms_medialib_session_t session,
xmms_medialib_entry_t  id 
)
gboolean xmms_medialib_decode_url ( gchar *  url)

Referenced by xmms_xform_browse().

xmms_medialib_entry_t xmms_medialib_entry_not_resolved_get ( xmms_medialib_session_t session)
guint xmms_medialib_num_not_resolved ( xmms_medialib_session_t session)
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().

gchar * xmms_medialib_url_encode ( const gchar *  path)