## rhythmdb

rhythmdb —

## Synopsis

    #define     RHYTHMDB_TYPE
    #define     RHYTHMDB                        (o)
    #define     RHYTHMDB_IS                     (o)
    #define     RHYTHMDB_GET_CLASS              (o)
    typedef     RhythmDBEntryType;
    #define     RHYTHMDB_ENTRY_TYPE_SONG
    #define     RHYTHMDB_ENTRY_TYPE_IRADIO_STATION
    enum        RhythmDBQueryType;
    enum        RhythmDBPropType;
    GType       rhythmdb_prop_get_type          (void);
    #define     RHYTHMDB_TYPE_QUERY
    #define     RHYTHMDB_TYPE_PROP
                RhythmDBQueryData;
                RhythmDBEntry;
                RhythmDBEntryChange;
    void        rhythmdb_entry_get              (RhythmDBEntry *entry,
                                                 RhythmDBPropType propid,
                                                 GValue *val);
    const char* rhythmdb_entry_get_string       (RhythmDBEntry *entry,
                                                 RhythmDBPropType propid);
    gboolean    rhythmdb_entry_get_boolean      (RhythmDBEntry *entry,
                                                 RhythmDBPropType propid);
    guint64     rhythmdb_entry_get_uint64       (RhythmDBEntry *entry,
                                                 RhythmDBPropType propid);
    gulong      rhythmdb_entry_get_ulong        (RhythmDBEntry *entry,
                                                 RhythmDBPropType propid);
    double      rhythmdb_entry_get_double       (RhythmDBEntry *entry,
                                                 RhythmDBPropType propid);
    const char* rb_refstring_get                (const RBRefString *val);
    const char* rb_refstring_get_sort_key       (const RBRefString *val);
    const char* rb_refstring_get_folded         (const RBRefString *val);
    enum        RhythmDBError;
    #define     RHYTHMDB_ERROR
    GQuark      rhythmdb_error_quark            (void);
    typedef     RhythmDBPrivate;
    GType       rhythmdb_get_type               (void);
    RhythmDB*   rhythmdb_new                    (const char *name);
    void        rhythmdb_shutdown               (RhythmDB *db);
    void        rhythmdb_load                   (RhythmDB *db);
    void        rhythmdb_save                   (RhythmDB *db);
    void        rhythmdb_save_async             (RhythmDB *db);
    void        rhythmdb_commit                 (RhythmDB *db);
    gboolean    rhythmdb_entry_is_editable      (RhythmDB *db,
                                                 RhythmDBEntry *entry);
    RhythmDBEntry* rhythmdb_entry_new           (RhythmDB *db,
                                                 RhythmDBEntryType type,
                                                 const char *uri);
    void        rhythmdb_add_uri                (RhythmDB *db,
                                                 const char *uri);
    void        rhythmdb_entry_set              (RhythmDB *db,
                                                 RhythmDBEntry *entry,
                                                 guint propid,
                                                 const GValue *value);
    void        rhythmdb_entry_set_nonotify     (RhythmDB *db,
                                                 RhythmDBEntry *entry,
                                                 guint propid,
                                                 const GValue *value);
    void        rhythmdb_entry_set_uninserted   (RhythmDB *db,
                                                 RhythmDBEntry *entry,
                                                 guint propid,
                                                 const GValue *value);
    void        rhythmdb_entry_delete           (RhythmDB *db,
                                                 RhythmDBEntry *entry);
    void        rhythmdb_entry_delete_by_type   (RhythmDB *db,
                                                 RhythmDBEntryType type);
    RhythmDBEntry* rhythmdb_entry_lookup_by_location
                                                (RhythmDB *db,
                                                 const char *uri);
    gboolean    rhythmdb_evaluate_query         (RhythmDB *db,
                                                 GPtrArray *query,
                                                 RhythmDBEntry *entry);
    void        rhythmdb_entry_foreach          (RhythmDB *db,
                                                 GFunc func,
                                                 gpointer data);
    void        rhythmdb_do_full_query          (RhythmDB *db,
                                                 GtkTreeModel *main_model,
                                                 ...);
    void        rhythmdb_do_full_query_parsed   (RhythmDB *db,
                                                 GtkTreeModel *main_model,
                                                 GPtrArray *query);
    void        rhythmdb_do_full_query_async    (RhythmDB *db,
                                                 GtkTreeModel *main_model,
                                                 ...);
    void        rhythmdb_do_full_query_async_parsed
                                                (RhythmDB *db,
                                                 GtkTreeModel *main_model,
                                                 GPtrArray *query);
    void        rhythmdb_query_cancel           (RhythmDB *db,
                                                 GtkTreeModel *query_model);
    void        rhythmdb_entry_sync_mirrored    (RhythmDB *db,
                                                 RhythmDBEntry *entry,
                                                 guint propid);
    GPtrArray*  rhythmdb_query_parse            (RhythmDB *db,
                                                 ...);
    void        rhythmdb_query_append           (RhythmDB *db,
                                                 GPtrArray *query,
                                                 ...);
    void        rhythmdb_query_free             (GPtrArray *query);
    GPtrArray*  rhythmdb_query_copy             (GPtrArray *array);
    void        rhythmdb_query_serialize        (RhythmDB *db,
                                                 GPtrArray *query,
                                                 xmlNodePtr node);
    GPtrArray*  rhythmdb_query_deserialize      (RhythmDB *db,
                                                 xmlNodePtr node);
    void        rhythmdb_emit_entry_added       (RhythmDB *db,
                                                 RhythmDBEntry *entry);
    void        rhythmdb_emit_entry_deleted     (RhythmDB *db,
                                                 RhythmDBEntry *entry);
    gboolean    rhythmdb_is_busy                (RhythmDB *db);
    char*       rhythmdb_compute_status_normal  (gint n_songs,
                                                 glong duration,
                                                 GnomeVFSFileSize size);
    RhythmDBEntryType rhythmdb_entry_register_type
                                                (void);
    RhythmDBEntryType rhythmdb_entry_song_get_type
                                                (void);
    RhythmDBEntryType rhythmdb_entry_iradio_get_type
                                                (void);
    RhythmDBEntryType rhythmdb_entry_icecast_get_type
                                                (void);
    GType       rhythmdb_get_property_type      (RhythmDB *db,
                                                 guint property_id);
    void        rhythmdb_entry_ref              (RhythmDB *db,
                                                 RhythmDBEntry *entry);
    void        rhythmdb_entry_unref            (RhythmDB *db,
                                                 RhythmDBEntry *entry);

## Description

## Details

### RHYTHMDB_TYPE

    #define RHYTHMDB_TYPE      (rhythmdb_get_type ())

### RHYTHMDB()

    #define RHYTHMDB(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), RHYTHMDB_TYPE, RhythmDB))

`o` : |

### RHYTHMDB_IS()

    #define RHYTHMDB_IS(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), RHYTHMDB_TYPE))

`o` : |

### RHYTHMDB_GET_CLASS()

    #define RHYTHMDB_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), RHYTHMDB_TYPE, RhythmDBClass))

`o` : |

### RhythmDBEntryType

    typedef gint32 RhythmDBEntryType;

### RHYTHMDB_ENTRY_TYPE_SONG

    #define RHYTHMDB_ENTRY_TYPE_SONG (rhythmdb_entry_song_get_type ())

### RHYTHMDB_ENTRY_TYPE_IRADIO_STATION

    #define RHYTHMDB_ENTRY_TYPE_IRADIO_STATION (rhythmdb_entry_iradio_get_type ())

### enum RhythmDBQueryType

    typedef enum
    {
    	RHYTHMDB_QUERY_END,
    	RHYTHMDB_QUERY_DISJUNCTION,
    	RHYTHMDB_QUERY_SUBQUERY,
    	RHYTHMDB_QUERY_PROP_EQUALS,
    	RHYTHMDB_QUERY_PROP_LIKE,
    	RHYTHMDB_QUERY_PROP_NOT_LIKE,
    	RHYTHMDB_QUERY_PROP_GREATER,
    	RHYTHMDB_QUERY_PROP_LESS,
    	RHYTHMDB_QUERY_PROP_CURRENT_TIME_WITHIN,
    	RHYTHMDB_QUERY_PROP_CURRENT_TIME_NOT_WITHIN,
    	RHYTHMDB_QUERY_PROP_YEAR_EQUALS,
    	RHYTHMDB_QUERY_PROP_YEAR_GREATER,
    	RHYTHMDB_QUERY_PROP_YEAR_LESS,
    } RhythmDBQueryType;

### enum RhythmDBPropType

    typedef enum
    {
    	RHYTHMDB_PROP_TYPE = 0,
    	RHYTHMDB_PROP_TITLE,
    	RHYTHMDB_PROP_GENRE,
    	RHYTHMDB_PROP_ARTIST,
    	RHYTHMDB_PROP_ALBUM,
    	RHYTHMDB_PROP_TRACK_NUMBER,
    	RHYTHMDB_PROP_DISC_NUMBER,
    	RHYTHMDB_PROP_DURATION,
    	RHYTHMDB_PROP_FILE_SIZE,
    	RHYTHMDB_PROP_LOCATION,
    	RHYTHMDB_PROP_MOUNTPOINT,
    	RHYTHMDB_PROP_MTIME,
    	RHYTHMDB_PROP_FIRST_SEEN,
    	RHYTHMDB_PROP_LAST_SEEN,
    	RHYTHMDB_PROP_RATING,
    	RHYTHMDB_PROP_PLAY_COUNT,
    	RHYTHMDB_PROP_LAST_PLAYED,
    	RHYTHMDB_PROP_BITRATE,
    	RHYTHMDB_PROP_DATE,
    	RHYTHMDB_PROP_TRACK_GAIN,
    	RHYTHMDB_PROP_TRACK_PEAK,
    	RHYTHMDB_PROP_ALBUM_GAIN,
    	RHYTHMDB_PROP_ALBUM_PEAK,
    	RHYTHMDB_PROP_MIMETYPE,
    	RHYTHMDB_PROP_TITLE_SORT_KEY,
    	RHYTHMDB_PROP_GENRE_SORT_KEY,
    	RHYTHMDB_PROP_ARTIST_SORT_KEY,
    	RHYTHMDB_PROP_ALBUM_SORT_KEY,
    	RHYTHMDB_PROP_TITLE_FOLDED,
    	RHYTHMDB_PROP_GENRE_FOLDED,
    	RHYTHMDB_PROP_ARTIST_FOLDED,
    	RHYTHMDB_PROP_ALBUM_FOLDED,
    	RHYTHMDB_PROP_LAST_PLAYED_STR,
    	RHYTHMDB_PROP_HIDDEN,
    	RHYTHMDB_PROP_PLAYBACK_ERROR,
    	RHYTHMDB_PROP_FIRST_SEEN_STR,
    	RHYTHMDB_PROP_SEARCH_MATCH,

    	/* Podcast properties */
    	RHYTHMDB_PROP_STATUS,
    	RHYTHMDB_PROP_DESCRIPTION,
    	RHYTHMDB_PROP_SUBTITLE,
    	RHYTHMDB_PROP_SUMMARY,
    	RHYTHMDB_PROP_LANG,
    	RHYTHMDB_PROP_COPYRIGHT,
    	RHYTHMDB_PROP_IMAGE,
    	RHYTHMDB_PROP_POST_TIME,

    	RHYTHMDB_NUM_PROPERTIES
    } RhythmDBPropType;

### rhythmdb_prop_get_type ()

    GType       rhythmdb_prop_get_type          (void);

Returns : |

### RHYTHMDB_TYPE_QUERY

    #define RHYTHMDB_TYPE_QUERY (rhythmdb_query_get_type ())

### RHYTHMDB_TYPE_PROP

    #define RHYTHMDB_TYPE_PROP (rhythmdb_prop_get_type ())

### RhythmDBQueryData

    typedef struct {
    	guint type;
    	guint propid;
    	GValue *val;
    	GPtrArray *subquery;
    } RhythmDBQueryData;

### RhythmDBEntry

    typedef struct {
    	/* internal bits */
    #ifndef G_DISABLE_ASSERT
    	guint magic;
    #endif
    	gboolean inserted;
    	gint refcount;
    	void *data;
    	gulong type;

    	/* metadata */
    	RBRefString *title;
    	RBRefString *artist;
    	RBRefString *album;
    	RBRefString *genre;
    	gulong tracknum;
    	gulong discnum;
    	gulong duration;
    	gulong bitrate;
    	double track_gain;
    	double track_peak;
    	double album_gain;
    	double album_peak;
    	GDate *date;

    	/* filesystem */
    	char *location;
    	RBRefString *mountpoint;
    	guint64 file_size;
    	RBRefString *mimetype;
    #if 0
    	dev_t device;
    	GnomeVFSInodeNumber inode;
    #endif
    	gulong mtime;
    	gulong first_seen;
    	gulong last_seen;

    	/* user data */
    	gdouble rating;
    	glong play_count;
    	gulong last_played;

    	/* cached data */
    	RBRefString *last_played_str;
    	RBRefString *first_seen_str;

    	/* playback error string */
    	char *playback_error;

    	/* visibility (to hide entries on unmounted volumes) */
    	gboolean hidden;

    	/*Podcast*/
    	RhythmDBPodcastFields *podcast;
    } RhythmDBEntry;

### RhythmDBEntryChange

    typedef struct {
    	RhythmDBPropType prop;
    	GValue old;
    	GValue new;
    } RhythmDBEntryChange;

### rhythmdb_entry_get ()

    void        rhythmdb_entry_get              (RhythmDBEntry *entry,
                                                 RhythmDBPropType propid,
                                                 GValue *val);

Gets a property of an entry, storing it in the given GValue.

`entry` : | a RhythmDBEntry.
`propid` : | the id of the property to get.
`val` : | return location for the property value.

### rhythmdb_entry_get_string ()

    const char* rhythmdb_entry_get_string       (RhythmDBEntry *entry,
                                                 RhythmDBPropType propid);

`entry` : |
`propid` : |
Returns : |

### rhythmdb_entry_get_boolean ()

    gboolean    rhythmdb_entry_get_boolean      (RhythmDBEntry *entry,
                                                 RhythmDBPropType propid);

`entry` : |
`propid` : |
Returns : |

### rhythmdb_entry_get_uint64 ()

    guint64     rhythmdb_entry_get_uint64       (RhythmDBEntry *entry,
                                                 RhythmDBPropType propid);

`entry` : |
`propid` : |
Returns : |

### rhythmdb_entry_get_ulong ()

    gulong      rhythmdb_entry_get_ulong        (RhythmDBEntry *entry,
                                                 RhythmDBPropType propid);

`entry` : |
`propid` : |
Returns : |

### rhythmdb_entry_get_double ()

    double      rhythmdb_entry_get_double       (RhythmDBEntry *entry,
                                                 RhythmDBPropType propid);

`entry` : |
`propid` : |
Returns : |

### rb_refstring_get ()

    const char* rb_refstring_get                (const RBRefString *val);

`val` : |
Returns : |

### rb_refstring_get_sort_key ()

    const char* rb_refstring_get_sort_key       (const RBRefString *val);

`val` : |
Returns : |

### rb_refstring_get_folded ()

    const char* rb_refstring_get_folded         (const RBRefString *val);

`val` : |
Returns : |

### enum RhythmDBError

    typedef enum
    {
    	RHYTHMDB_ERROR_ACCESS_FAILED,
    } RhythmDBError;

### RHYTHMDB_ERROR

    #define RHYTHMDB_ERROR (rhythmdb_error_quark ())

### rhythmdb_error_quark ()

    GQuark      rhythmdb_error_quark            (void);

Returns : |

### RhythmDBPrivate

    typedef struct RhythmDBPrivate RhythmDBPrivate;

### rhythmdb_get_type ()

    GType       rhythmdb_get_type               (void);

Returns : |

### rhythmdb_new ()

    RhythmDB*   rhythmdb_new                    (const char *name);

`name` : |
Returns : |

### rhythmdb_shutdown ()

    void        rhythmdb_shutdown               (RhythmDB *db);

Ceases all RhythmDB operations, including stopping all directory monitoring, and removing all actions and events currently queued.

`db` : |

### rhythmdb_load ()

    void        rhythmdb_load                   (RhythmDB *db);

Load the database from disk.

`db` : | a RhythmDB.

### rhythmdb_save ()

    void        rhythmdb_save                   (RhythmDB *db);

Save the database to disk, not returning until it has been saved.

`db` : | a RhythmDB.

### rhythmdb_save_async ()

    void        rhythmdb_save_async             (RhythmDB *db);

Save the database to disk, asynchronously.

`db` : | a RhythmDB.

### rhythmdb_commit ()

    void        rhythmdb_commit                 (RhythmDB *db);

Apply all database changes, and send notification of changes and new entries. This needs to be called after any changes have been made, such as a group of `rhythmdb_entry_set()` calls, or a new entry has been added.

`db` : | a RhythmDB.

### rhythmdb_entry_is_editable ()

    gboolean    rhythmdb_entry_is_editable      (RhythmDB *db,
                                                 RhythmDBEntry *entry);

This determines whether any changes to the entries metadata can be saved. Usually this is only true for entries backed by files, where tag-writing is enabled, and the appropriate tag-writing facilities are available.

`db` : | a RhythmDB.
`entry` : | a RhythmDBEntry.
Returns : | whether the entries metadata can be changed.

### rhythmdb_entry_new ()

    RhythmDBEntry* rhythmdb_entry_new           (RhythmDB *db,
                                                 RhythmDBEntryType type,
                                                 const char *uri);

Creates a new entry of type `type` and location `uri`, and inserts it into the database. You must call `rhythmdb_commit()` at some point after invoking this function.

This may return NULL if entry creation fails. This can occur if there is already an entry with the given uri.

`db` : | a RhythmDB.
`type` : | type of entry to create
`uri` : | the location of the entry, this be unique amongst all entries.
Returns : | the newly created RhythmDBEntry

### rhythmdb_add_uri ()

    void        rhythmdb_add_uri                (RhythmDB *db,
                                                 const char *uri);

Adds the file(s) pointed to by `uri` to the database, as entries of type RHYTHMDB_ENTRY_TYPE_SONG. If the URI is that of a file, they will be added. If the URI is that of a directory, everything under it will be added recursively.

`db` : | a RhythmDB.
`uri` : | the URI to add an entry/entries for

### rhythmdb_entry_set ()

    void        rhythmdb_entry_set              (RhythmDB *db,
                                                 RhythmDBEntry *entry,
                                                 guint propid,
                                                 const GValue *value);

This function can be called by any code which wishes to change a song property and send a notification. It may be called when the database is read-only; in this case the change will be queued for an unspecified time in the future. The implication of this is that `rhythmdb_entry_get()` may not reflect the changes immediately. However, if this property is exposed in the user interface, you should still make the change in the widget. Then when the database returns to a writable state, your change will take effect in the database too, and a notification will be sent at that point.

Note that you must call `rhythmdb_commit()` at some point after invoking this function, and that even after the commit, your change may not have taken effect.

`db` : | # a RhythmDB.
`entry` : | a RhythmDBEntry.
`propid` : | the id of the property to set.
`value` : | the property value.

### rhythmdb_entry_set_nonotify ()

    void        rhythmdb_entry_set_nonotify     (RhythmDB *db,
                                                 RhythmDBEntry *entry,
                                                 guint propid,
                                                 const GValue *value);

This function is like `rhythmdb_entry_set()`, except no notification of the change will be sent. This is useful if you know no one could possibly be listening for the change.

Note that you do not need to call `rhythmdb_commit()` after this.

`db` : | a RhythmDB.
`entry` : | a RhythmDBEntry.
`propid` : | the id of the property to set.
`value` : | the property value.

### rhythmdb_entry_set_uninserted ()

    void        rhythmdb_entry_set_uninserted   (RhythmDB *db,
                                                 RhythmDBEntry *entry,
                                                 guint propid,
                                                 const GValue *value);

This function is like `rhythmdb_entry_set()`, except that it should only be called for entries that have been created with `rhythmdb_entry_new()` but not yet committed to the database (i.e. before `rhythmdb_commit()`).

Note that you need to call `rhythmdb_commit()` after all properties are set.

`db` : | a RhythmDB.
`entry` : | a RhythmDBEntry.
`propid` : | the id of the property to set.
`value` : | the property value.

### rhythmdb_entry_delete ()

    void        rhythmdb_entry_delete           (RhythmDB *db,
                                                 RhythmDBEntry *entry);

Delete entry `entry` from the database, sending notification of it's deletion. This is usually used by sources where entries can disappear randomly, such as a network source.

`db` : | a RhythmDB.
`entry` : | a RhythmDBEntry.

### rhythmdb_entry_delete_by_type ()

    void        rhythmdb_entry_delete_by_type   (RhythmDB *db,
                                                 RhythmDBEntryType type);

Delete all entries from the database of the given type. This is usually used by non-permanent sources when they disappear, such as removable media being removed, or a network share becoming unavailable.

`db` : | a RhythmDB.
`type` : | type of entried to delete.

### rhythmdb_entry_lookup_by_location ()

    RhythmDBEntry* rhythmdb_entry_lookup_by_location
                                                (RhythmDB *db,
                                                 const char *uri);

Looks up the entry with location `uri`.

`db` : | a RhythmDB.
`uri` : | the URI of the entry to lookup.
Returns : | the entry with location `uri`, or NULL if no such entry exists.

### rhythmdb_evaluate_query ()

    gboolean    rhythmdb_evaluate_query         (RhythmDB *db,
                                                 GPtrArray *query,
                                                 RhythmDBEntry *entry);

Evaluates the given entry against the given query.

`db` : | a RhythmDB.
`query` : | a query. `entry` a `RhythmDBEntry`.
`entry` : |
Returns : | whether the given entry matches the criteria of the given query.

### rhythmdb_entry_foreach ()

    void        rhythmdb_entry_foreach          (RhythmDB *db,
                                                 GFunc func,
                                                 gpointer data);

Calls the given function for each of the entries in the database.

`db` : | a RhythmDB.
`func` : | the function to call with each entry.
`data` : | user data to pass to the function.

### rhythmdb_do_full_query ()

    void        rhythmdb_do_full_query          (RhythmDB *db,
                                                 GtkTreeModel *main_model,
                                                 ...);

`db` : |
`main_model` : |
`...` : |

### rhythmdb_do_full_query_parsed ()

    void        rhythmdb_do_full_query_parsed   (RhythmDB *db,
                                                 GtkTreeModel *main_model,
                                                 GPtrArray *query);

`db` : |
`main_model` : |
`query` : |

### rhythmdb_do_full_query_async ()

    void        rhythmdb_do_full_query_async    (RhythmDB *db,
                                                 GtkTreeModel *main_model,
                                                 ...);

`db` : |
`main_model` : |
`...` : |

### rhythmdb_do_full_query_async_parsed ()

    void        rhythmdb_do_full_query_async_parsed
                                                (RhythmDB *db,
                                                 GtkTreeModel *main_model,
                                                 GPtrArray *query);

`db` : |
`main_model` : |
`query` : |

### rhythmdb_query_cancel ()

    void        rhythmdb_query_cancel           (RhythmDB *db,
                                                 GtkTreeModel *query_model);

`db` : |
`query_model` : |

### rhythmdb_entry_sync_mirrored ()

    void        rhythmdb_entry_sync_mirrored    (RhythmDB *db,
                                                 RhythmDBEntry *entry,
                                                 guint propid);

Synchronise "mirrored" properties, such as the string version of the last-played time. This should be called when a property is directly modified, passing the original property.

This should only be used by RhythmDB itself, or a backend (such as rhythmdb-tree).

`db` : | a RhythmDB.
`entry` : |
`propid` : | the property to sync the mirrored version of.

### rhythmdb_query_parse ()

    GPtrArray*  rhythmdb_query_parse            (RhythmDB *db,
                                                 ...);

Creates a query from a list of criteria.

Most criteria consists of an operator (RhythmDBQueryType), a property (RhythmDBPropType) and the data to compare with. An entry matches a criteria if the operator returns true with the value of the entries property as the first argument, and the given data as the second argument.

Three types criteria are special. Passing RHYTHMDB_QUERY_END indicates the end of the list of criteria, and must be the last passes parameter.

The second special criteria is a subquery which is defined by passing RHYTHMDB_QUERY_SUBQUERY, followed by a query (GPtrArray). An entry will match a subquery criteria if it matches all criteria in the subquery.

The third special criteria is a disjunction which is defined by passing RHYTHMDB_QUERY_DISJUNCTION, which will make an entry match the query if it matches the criteria before the disjunction, the criteria after the disjunction, or both.

Example: rhythmdb_query_parse (db, RHYTHMDB_QUERY_SUBQUERY, subquery, RHYTHMDB_QUERY_DISJUNCTION RHYTHMDB_QUERY_PROP_LIKE, RHYTHMDB_PROP_TITLE, "cat", RHYTHMDB_QUERY_DISJUNCTION RHYTHMDB_QUERY_PROP_GREATER, RHYTHMDB_PROP_RATING, 2.5, RHYTHMDB_QUERY_PROP_LESS, RHYTHMDB_PROP_PLAY_COUNT, 10, RHYTHMDB_QUERY_END);

will create a query that matches entries: a) that match the query "subquery", or b) that have "cat" in their title, or c) have a rating of at least 2.5, and a play count of at most 10

`db` : | a RhythmDB instance
`...` : |
Returns : | a the newly created query. It must be freed with `rhythmdb_query_free()`

### rhythmdb_query_append ()

    void        rhythmdb_query_append           (RhythmDB *db,
                                                 GPtrArray *query,
                                                 ...);

Appends new criteria to the query `query`.

The list of criteria must be in the same format as for rhythmdb_query_parse, and ended by RHYTHMDB_QUERY_END.

`db` : | a RhythmDB instance
`query` : | a query.
`...` : |

### rhythmdb_query_free ()

    void        rhythmdb_query_free             (GPtrArray *query);

Frees the query `query`

`query` : | a query.

### rhythmdb_query_copy ()

    GPtrArray*  rhythmdb_query_copy             (GPtrArray *array);

Creates a copy of a query.

`array` : | the query to copy.
Returns : | a copy of the passed query. It must be freed with `rhythmdb_query_free()`

### rhythmdb_query_serialize ()

    void        rhythmdb_query_serialize        (RhythmDB *db,
                                                 GPtrArray *query,
                                                 xmlNodePtr node);

`db` : |
`query` : |
`node` : |

### rhythmdb_query_deserialize ()

    GPtrArray*  rhythmdb_query_deserialize      (RhythmDB *db,
                                                 xmlNodePtr node);

`db` : |
`node` : |
Returns : |

### rhythmdb_emit_entry_added ()

    void        rhythmdb_emit_entry_added       (RhythmDB *db,
                                                 RhythmDBEntry *entry);

`db` : |
`entry` : |

### rhythmdb_emit_entry_deleted ()

    void        rhythmdb_emit_entry_deleted     (RhythmDB *db,
                                                 RhythmDBEntry *entry);

`db` : |
`entry` : |

### rhythmdb_is_busy ()

    gboolean    rhythmdb_is_busy                (RhythmDB *db);

`db` : | a RhythmDB.
Returns : | whether the RhythmDB has events to process.

### rhythmdb_compute_status_normal ()

    char*       rhythmdb_compute_status_normal  (gint n_songs,
                                                 glong duration,
                                                 GnomeVFSFileSize size);

Creates a string containing the "status" information about a list of tracks.

`n_songs` : | the number of tracks.
`duration` : | the total duration of the tracks.
`size` : | the total size of the tracks.
Returns : | the string, which should be freed with g_free.

### rhythmdb_entry_register_type ()

    RhythmDBEntryType rhythmdb_entry_register_type
                                                (void);

Registers a new RhythmDBEntryType. This should be called to create a new entry type for non-permanent sources.

Returns : | the new RhythmDBEntryType.

### rhythmdb_entry_song_get_type ()

    RhythmDBEntryType rhythmdb_entry_song_get_type
                                                (void);

Returns : |

### rhythmdb_entry_iradio_get_type ()

    RhythmDBEntryType rhythmdb_entry_iradio_get_type
                                                (void);

Returns : |

### rhythmdb_entry_icecast_get_type ()

    RhythmDBEntryType rhythmdb_entry_icecast_get_type
                                                (void);

Returns : |

### rhythmdb_get_property_type ()

    GType       rhythmdb_get_property_type      (RhythmDB *db,
                                                 guint property_id);

`db` : |
`property_id` : |
Returns : |

### rhythmdb_entry_ref ()

    void        rhythmdb_entry_ref              (RhythmDB *db,
                                                 RhythmDBEntry *entry);

Increase the reference count of the entry.

`db` : | a RhythmDB.
`entry` : | a RhythmDBEntry.

### rhythmdb_entry_unref ()

    void        rhythmdb_entry_unref            (RhythmDB *db,
                                                 RhythmDBEntry *entry);

Decrease the reference count of the entry, and destroy it if there are no references left.

`db` : | a RhythmDB.
`entry` : | a RhythmDBEntry.