Top |
void | (*DmapIdRecordFunc) () |
guint | dmap_db_add () |
guint | dmap_db_add_with_id () |
guint | dmap_db_add_path () |
DmapRecord * | dmap_db_lookup_by_id () |
guint | dmap_db_lookup_id_by_location () |
void | dmap_db_foreach () |
gulong | dmap_db_count () |
GHashTable * | dmap_db_apply_filter () |
void (*DmapIdRecordFunc) (guint id
,DmapRecord *record
,gpointer user_data
);
The type of function passed to dmap_db_foreach()
.
guint dmap_db_add (DmapDb *db
,DmapRecord *record
,GError **error
);
Add a record to the database.
db |
A media database. |
|
record |
A database record. |
|
error |
return location for a GError, or NULL. |
The ID for the newly added record or DMAP_DB_ID_BAD
on failure. A
reference to the record will be retained by the database (if required; an
adapter-type implementation might not want to retain a reference as the
record data may be placed elsewhere). In all cases, a returned record should
be unrefed by the calling code.
guint dmap_db_add_with_id (DmapDb *db
,DmapRecord *record
,guint id
,GError **error
);
Add a record to the database and assign it the given ID. id
cannot be
DMAP_DB_ID_BAD
.
guint dmap_db_add_path (DmapDb *db
,const gchar *path
,GError **error
);
Create a record and add it to the database.
DmapRecord * dmap_db_lookup_by_id (const DmapDb *db
,guint id
);
the database record corresponding to id
. id
cannot be DMAP_DB_ID_BAD. The returned record should be unrefed by the
calling code when no longer required.
If you are implementing a full database using this API, then you probably want to increment the reference count before returning a record pointer.
On the other hand, if you are implementing an adapter class and the records are stored elsewhere, then you will probably return a transient record. That is, once the user is done using it, the returned record should be free'd because it is a adapter copy of the real record. In this case, the reference count should not be incremented before returning a record pointer.
[transfer full]
guint dmap_db_lookup_id_by_location (const DmapDb *db
,const gchar *location
);
void dmap_db_foreach (const DmapDb *db
,DmapIdRecordFunc func
,gpointer data
);
Apply a function to each record in a media database.
GHashTable * dmap_db_apply_filter (DmapDb *db
,GSList *filter_def
);