![]() |
![]() |
![]() |
LibRhythmCat Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Signals |
#include <rclib-db.h> #define RCLIB_TYPE_DB_LIBRARY_QUERY_RESULT_PROP_ITER struct RCLibDb; RCLibDbCatalogData; enum RCLibDbCatalogDataType; RCLibDbCatalogIter; enum RCLibDbCatalogType; struct RCLibDbClass; RCLibDbLibraryData; enum RCLibDbLibraryDataType; struct RCLibDbLibraryQueryResult; struct RCLibDbLibraryQueryResultClass; RCLibDbLibraryQueryResultIter; RCLibDbLibraryQueryResultPropIter; enum RCLibDbLibraryType; RCLibDbPlaylistData; enum RCLibDbPlaylistDataType; RCLibDbPlaylistIter; enum RCLibDbPlaylistType; RCLibDbQuery; enum RCLibDbQueryConditionType; enum RCLibDbQueryDataType; gboolean rclib_db_autosaved_exist (); void rclib_db_autosaved_remove (); RCLibDbCatalogIter * rclib_db_catalog_add (const gchar *name
,RCLibDbCatalogIter *iter
,gint type
); void rclib_db_catalog_data_free (RCLibDbCatalogData *data
); void rclib_db_catalog_data_get (RCLibDbCatalogData *data
,RCLibDbCatalogDataType type1
,...
); void rclib_db_catalog_data_iter_get (RCLibDbCatalogIter *iter
,RCLibDbCatalogDataType type1
,...
); void rclib_db_catalog_data_iter_set (RCLibDbCatalogIter *iter
,RCLibDbCatalogDataType type1
,...
); RCLibDbCatalogData * rclib_db_catalog_data_new (); RCLibDbCatalogData * rclib_db_catalog_data_ref (RCLibDbCatalogData *data
); void rclib_db_catalog_data_set (RCLibDbCatalogData *data
,RCLibDbCatalogDataType type1
,...
); void rclib_db_catalog_data_unref (RCLibDbCatalogData *data
); void rclib_db_catalog_delete (RCLibDbCatalogIter *iter
); void rclib_db_catalog_foreach (GFunc func
,gpointer user_data
); RCLibDbCatalogIter * rclib_db_catalog_get_begin_iter (); RCLibDbCatalogIter * rclib_db_catalog_get_end_iter (); RCLibDbCatalogIter * rclib_db_catalog_get_iter_at_pos (gint pos
); RCLibDbCatalogIter * rclib_db_catalog_get_last_iter (); gint rclib_db_catalog_get_length (); gboolean rclib_db_catalog_is_valid_iter (RCLibDbCatalogIter *catalog_iter
); gint rclib_db_catalog_iter_compare (RCLibDbCatalogIter *a
,RCLibDbCatalogIter *b
); void rclib_db_catalog_iter_foreach_range (RCLibDbCatalogIter *begin
,RCLibDbCatalogIter *end
,GFunc func
,gpointer user_data
); RCLibDbCatalogData * rclib_db_catalog_iter_get_data (RCLibDbCatalogIter *iter
); gint rclib_db_catalog_iter_get_position (RCLibDbCatalogIter *iter
); gboolean rclib_db_catalog_iter_is_begin (RCLibDbCatalogIter *iter
); gboolean rclib_db_catalog_iter_is_end (RCLibDbCatalogIter *iter
); RCLibDbCatalogIter * rclib_db_catalog_iter_next (RCLibDbCatalogIter *iter
); RCLibDbCatalogIter * rclib_db_catalog_iter_prev (RCLibDbCatalogIter *iter
); RCLibDbCatalogIter * rclib_db_catalog_iter_range_get_midpoint (RCLibDbCatalogIter *begin
,RCLibDbCatalogIter *end
); void rclib_db_catalog_name_sort (gboolean direction
); void rclib_db_catalog_reorder (gint *new_order
); void rclib_db_exit (); GObject * rclib_db_get_instance (); GHashTable * rclib_db_get_library_table (); void rclib_db_import_cancel (); gint rclib_db_import_queue_get_length (); gboolean rclib_db_init (const gchar *file
); void rclib_db_library_add_music (const gchar *uri
); void rclib_db_library_add_music_and_play (const gchar *uri
); void rclib_db_library_data_free (RCLibDbLibraryData *data
); void rclib_db_library_data_get (RCLibDbLibraryData *data
,RCLibDbLibraryDataType type1
,...
); RCLibDbLibraryData * rclib_db_library_data_new (); gboolean rclib_db_library_data_query (RCLibDbLibraryData *library_data
,RCLibDbQuery *query
,GCancellable *cancellable
); RCLibDbLibraryData * rclib_db_library_data_ref (RCLibDbLibraryData *data
); void rclib_db_library_data_set (RCLibDbLibraryData *data
,RCLibDbLibraryDataType type1
,...
); void rclib_db_library_data_unref (RCLibDbLibraryData *data
); void rclib_db_library_data_uri_get (const gchar *uri
,RCLibDbLibraryDataType type1
,...
); void rclib_db_library_data_uri_set (const gchar *uri
,RCLibDbLibraryDataType type1
,...
); void rclib_db_library_delete (const gchar *uri
); gboolean rclib_db_library_exist (RCLibDbLibraryData *library_data
); GObject * rclib_db_library_get_album_query_result (); GObject * rclib_db_library_get_artist_query_result (); GObject * rclib_db_library_get_base_query_result (); RCLibDbLibraryData * rclib_db_library_get_data (const gchar *uri
); GObject * rclib_db_library_get_genre_query_result (); gboolean rclib_db_library_has_uri (const gchar *uri
); GPtrArray * rclib_db_library_query (RCLibDbQuery *query
,GCancellable *cancellable
); GPtrArray * rclib_db_library_query_get_uris (RCLibDbQuery *query
,GCancellable *cancellable
); void rclib_db_library_query_result_chain (RCLibDbLibraryQueryResult *query_result
,RCLibDbLibraryQueryResult *base
,gboolean import_entries
); void rclib_db_library_query_result_copy_contents (RCLibDbLibraryQueryResult *dst
,RCLibDbLibraryQueryResult *src
); RCLibDbLibraryQueryResult * rclib_db_library_query_result_get_base (RCLibDbLibraryQueryResult *query_result
); RCLibDbLibraryQueryResultIter * rclib_db_library_query_result_get_begin_iter (RCLibDbLibraryQueryResult *query_result
); RCLibDbLibraryData * rclib_db_library_query_result_get_data (RCLibDbLibraryQueryResult *query_result
,RCLibDbLibraryQueryResultIter *iter
); RCLibDbLibraryQueryResultIter * rclib_db_library_query_result_get_iter_at_pos (RCLibDbLibraryQueryResult *query_result
,gint pos
); RCLibDbLibraryQueryResultIter * rclib_db_library_query_result_get_iter_by_uri (RCLibDbLibraryQueryResult *query_result
,const gchar *uri
); RCLibDbLibraryQueryResultIter * rclib_db_library_query_result_get_last_iter (RCLibDbLibraryQueryResult *query_result
); guint rclib_db_library_query_result_get_length (RCLibDbLibraryQueryResult *query_result
); RCLibDbLibraryQueryResultIter * rclib_db_library_query_result_get_next_iter (RCLibDbLibraryQueryResult *query_result
,RCLibDbLibraryQueryResultIter *iter
); gint rclib_db_library_query_result_get_position (RCLibDbLibraryQueryResult *query_result
,RCLibDbLibraryQueryResultIter *iter
); RCLibDbLibraryQueryResultIter * rclib_db_library_query_result_get_prev_iter (RCLibDbLibraryQueryResult *query_result
,RCLibDbLibraryQueryResultIter *iter
); const RCLibDbQuery * rclib_db_library_query_result_get_query (RCLibDbLibraryQueryResult *query_result
); RCLibDbLibraryQueryResultIter * rclib_db_library_query_result_get_random_iter (RCLibDbLibraryQueryResult *query_result
); gboolean rclib_db_library_query_result_iter_is_begin (RCLibDbLibraryQueryResult *query_result
,RCLibDbLibraryQueryResultIter *iter
); gboolean rclib_db_library_query_result_iter_is_end (RCLibDbLibraryQueryResult *query_result
,RCLibDbLibraryQueryResultIter *iter
); GObject * rclib_db_library_query_result_new (RCLibDb *db
,RCLibDbLibraryQueryResult *base
,RCLibDbQueryDataType *prop_types
); RCLibDbLibraryQueryResultPropIter * rclib_db_library_query_result_prop_get_begin_iter (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
); gboolean rclib_db_library_query_result_prop_get_data (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
,RCLibDbLibraryQueryResultPropIter *iter
,gchar **prop_name
,guint *prop_count
); RCLibDbLibraryQueryResultPropIter * rclib_db_library_query_result_prop_get_iter_at_pos (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
,gint pos
); RCLibDbLibraryQueryResultPropIter * rclib_db_library_query_result_prop_get_iter_by_prop (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
,const gchar *prop_text
); RCLibDbLibraryQueryResultPropIter * rclib_db_library_query_result_prop_get_last_iter (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
); guint rclib_db_library_query_result_prop_get_length (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
); RCLibDbLibraryQueryResultPropIter * rclib_db_library_query_result_prop_get_next_iter (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
,RCLibDbLibraryQueryResultPropIter *iter
); gint rclib_db_library_query_result_prop_get_position (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
,RCLibDbLibraryQueryResultPropIter *iter
); RCLibDbLibraryQueryResultPropIter * rclib_db_library_query_result_prop_get_prev_iter (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
,RCLibDbLibraryQueryResultPropIter *iter
); gboolean rclib_db_library_query_result_prop_get_total_count (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
,guint *count
); gboolean rclib_db_library_query_result_prop_iter_is_begin (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
,RCLibDbLibraryQueryResultPropIter *iter
); gboolean rclib_db_library_query_result_prop_iter_is_end (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
,RCLibDbLibraryQueryResultPropIter *iter
); void rclib_db_library_query_result_prop_sort (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
,gboolean direction
); void rclib_db_library_query_result_query_cancel (RCLibDbLibraryQueryResult *query_result
); void rclib_db_library_query_result_query_clear (RCLibDbLibraryQueryResult *query_result
); void rclib_db_library_query_result_query_start (RCLibDbLibraryQueryResult *query_result
,gboolean clear
); void rclib_db_library_query_result_set_query (RCLibDbLibraryQueryResult *query_result
,const RCLibDbQuery *query
); void rclib_db_library_query_result_sort (RCLibDbLibraryQueryResult *query_result
,RCLibDbLibraryDataType column
,gboolean direction
); gboolean rclib_db_load_autosaved (); gboolean rclib_db_load_legacy (); void rclib_db_playlist_add_directory (RCLibDbCatalogIter *iter
,RCLibDbPlaylistIter *insert_iter
,const gchar *dir
); void rclib_db_playlist_add_m3u_file (RCLibDbCatalogIter *iter
,RCLibDbPlaylistIter *insert_iter
,const gchar *filename
); void rclib_db_playlist_add_music (RCLibDbCatalogIter *iter
,RCLibDbPlaylistIter *insert_iter
,const gchar *uri
); void rclib_db_playlist_add_music_and_play (RCLibDbCatalogIter *iter
,RCLibDbPlaylistIter *insert_iter
,const gchar *uri
); void rclib_db_playlist_data_free (RCLibDbPlaylistData *data
); void rclib_db_playlist_data_get (RCLibDbPlaylistData *data
,RCLibDbPlaylistDataType type1
,...
); void rclib_db_playlist_data_iter_get (RCLibDbPlaylistIter *iter
,RCLibDbPlaylistDataType type1
,...
); void rclib_db_playlist_data_iter_set (RCLibDbPlaylistIter *iter
,RCLibDbPlaylistDataType type1
,...
); RCLibDbPlaylistData * rclib_db_playlist_data_new (); gboolean rclib_db_playlist_data_query (RCLibDbPlaylistData *playlist_data
,RCLibDbQuery *query
,GCancellable *cancellable
); RCLibDbPlaylistData * rclib_db_playlist_data_ref (RCLibDbPlaylistData *data
); void rclib_db_playlist_data_set (RCLibDbPlaylistData *data
,RCLibDbPlaylistDataType type1
,...
); void rclib_db_playlist_data_unref (RCLibDbPlaylistData *data
); void rclib_db_playlist_delete (RCLibDbPlaylistIter *iter
); gboolean rclib_db_playlist_export_all_m3u_files (const gchar *dir
); gboolean rclib_db_playlist_export_m3u_file (RCLibDbCatalogIter *iter
,const gchar *sfilename
); void rclib_db_playlist_foreach (RCLibDbCatalogIter *catalog_iter
,GFunc func
,gpointer user_data
); RCLibDbPlaylistIter * rclib_db_playlist_get_begin_iter (RCLibDbCatalogIter *catalog_iter
); RCLibDbPlaylistIter * rclib_db_playlist_get_end_iter (RCLibDbCatalogIter *catalog_iter
); RCLibDbPlaylistIter * rclib_db_playlist_get_iter_at_pos (RCLibDbCatalogIter *catalog_iter
,gint pos
); RCLibDbPlaylistIter * rclib_db_playlist_get_last_iter (RCLibDbCatalogIter *catalog_iter
); gint rclib_db_playlist_get_length (RCLibDbCatalogIter *catalog_iter
); RCLibDbPlaylistIter * rclib_db_playlist_get_random_iter (RCLibDbCatalogIter *catalog_iter
,gboolean rating_limit
,gboolean condition
,gfloat rating
); gboolean rclib_db_playlist_is_valid_iter (RCLibDbPlaylistIter *playlist_iter
); void rclib_db_playlist_item_sort (RCLibDbCatalogIter *catalog_iter
,RCLibDbPlaylistDataType column
,gboolean direction
); gint rclib_db_playlist_iter_compare (RCLibDbPlaylistIter *a
,RCLibDbPlaylistIter *b
); void rclib_db_playlist_iter_foreach_range (RCLibDbPlaylistIter *begin
,RCLibDbPlaylistIter *end
,GFunc func
,gpointer user_data
); RCLibDbPlaylistIter * rclib_db_playlist_iter_get_begin_iter (RCLibDbPlaylistIter *playlist_iter
); RCLibDbPlaylistData * rclib_db_playlist_iter_get_data (RCLibDbPlaylistIter *iter
); RCLibDbPlaylistIter * rclib_db_playlist_iter_get_end_iter (RCLibDbPlaylistIter *playlist_iter
); RCLibDbPlaylistIter * rclib_db_playlist_iter_get_iter_at_pos (RCLibDbPlaylistIter *playlist_iter
,gint pos
); RCLibDbPlaylistIter * rclib_db_playlist_iter_get_last_iter (RCLibDbPlaylistIter *playlist_iter
); gint rclib_db_playlist_iter_get_length (RCLibDbPlaylistIter *playlist_iter
); gint rclib_db_playlist_iter_get_position (RCLibDbPlaylistIter *iter
); RCLibDbPlaylistIter * rclib_db_playlist_iter_get_random_iter (RCLibDbPlaylistIter *piter
,gboolean rating_limit
,gboolean condition
,gfloat rating
); gboolean rclib_db_playlist_iter_is_begin (RCLibDbPlaylistIter *iter
); gboolean rclib_db_playlist_iter_is_end (RCLibDbPlaylistIter *iter
); RCLibDbPlaylistIter * rclib_db_playlist_iter_next (RCLibDbPlaylistIter *iter
); RCLibDbPlaylistIter * rclib_db_playlist_iter_prev (RCLibDbPlaylistIter *iter
); gboolean rclib_db_playlist_iter_query (RCLibDbPlaylistIter *playlist_iter
,RCLibDbQuery *query
,GCancellable *cancellable
); RCLibDbPlaylistIter * rclib_db_playlist_iter_range_get_midpoint (RCLibDbPlaylistIter *begin
,RCLibDbPlaylistIter *end
); void rclib_db_playlist_move_to_another_catalog (RCLibDbPlaylistIter **iters
,guint num
,RCLibDbCatalogIter *catalog_iter
); GPtrArray * rclib_db_playlist_query (RCLibDbCatalogIter *catalog_iter
,RCLibDbQuery *query
,GCancellable *cancellable
); GPtrArray * rclib_db_playlist_query_get_iters (RCLibDbCatalogIter *catalog_iter
,RCLibDbQuery *query
,GCancellable *cancellable
); void rclib_db_playlist_refresh (RCLibDbCatalogIter *iter
); void rclib_db_playlist_reorder (RCLibDbCatalogIter *iter
,gint *new_order
); void rclib_db_playlist_update_metadata (RCLibDbPlaylistIter *iter
,const RCLibDbPlaylistData *data
); gboolean rclib_db_query_concatenate (RCLibDbQuery *target
,const RCLibDbQuery *src
); RCLibDbQuery * rclib_db_query_copy (const RCLibDbQuery *query
); void rclib_db_query_free (RCLibDbQuery *query
); GType rclib_db_query_get_query_data_type (RCLibDbQueryDataType query_type
); RCLibDbQuery * rclib_db_query_parse (RCLibDbQueryConditionType condition1
,...
); RCLibDbQuery * rclib_db_query_parse_valist (RCLibDbQueryConditionType condition1
,va_list args
); void rclib_db_refresh_cancel (); gint rclib_db_refresh_queue_get_length (); gulong rclib_db_signal_connect (const gchar *name
,GCallback callback
,gpointer data
); void rclib_db_signal_disconnect (gulong handler_id
); gboolean rclib_db_sync ();
GObject +----RCLibDb
GBoxed +----RCLibDbCatalogData
gpointer +----RCLibDbCatalogIter
GBoxed +----RCLibDbLibraryData
GObject +----RCLibDbLibraryQueryResult
gpointer +----RCLibDbLibraryQueryResultIter
GBoxed +----RCLibDbPlaylistData
gpointer +----RCLibDbPlaylistIter
GBoxed +----RCLibDbQuery
"catalog-added" :Run First
"catalog-changed" :Run First
"catalog-delete" :Run First
"catalog-reordered" :Run First
"import-updated" :Run First
"library-added" :Run First
"library-changed" :Run First
"library-deleted" :Run First
"playlist-added" :Run First
"playlist-changed" :Run First
"playlist-delete" :Run First
"playlist-reordered" :Run First
"refresh-updated" :Run First
"prop-added" :Run First
"prop-changed" :Run First
"prop-delete" :Run First
"prop-reordered" :Run First
"query-result-added" :Run First
"query-result-changed" :Run First
"query-result-delete" :Run First
"query-result-reordered" :Run First
The RCLibDb is a class which manages the playlists in the player, all playlists are put in a catalog list, and all music are put in their playlists. The catalog item (playlist) and playlist item (music) data can be accessed by RCLibDbCatalogIter and RCLibDbPlaylistIter. The database can import music or playlist file asynchronously, or update the metadata in playlists asynchronously.
struct RCLibDb;
The playlist database. The contents of the RCLibDb structure are private and should only be accessed via the provided API.
typedef enum { RCLIB_DB_CATALOG_DATA_TYPE_NONE = 0, RCLIB_DB_CATALOG_DATA_TYPE_PLAYLIST = 1, RCLIB_DB_CATALOG_DATA_TYPE_SELF_ITER = 2, RCLIB_DB_CATALOG_DATA_TYPE_NAME = 3, RCLIB_DB_CATALOG_DATA_TYPE_TYPE = 4, RCLIB_DB_CATALOG_DATA_TYPE_STORE = 5 } RCLibDbCatalogDataType;
The enum type for set/get the data in the RCLibDbCatalogData
none type, not used by data | |
the playlist data structure, should not be used out of this module | |
the iter pointed to self (RCLibDbCatalogIter) | |
the catalog name (string) | |
the catalog type (RCLibDbCatalogType) | |
the store pointer which can be used for UI (gpointer) |
typedef enum { RCLIB_DB_CATALOG_TYPE_PLAYLIST = 1 } RCLibDbCatalogType;
The enum type for catalog type.
typedef enum { RCLIB_DB_LIBRARY_DATA_TYPE_NONE = 0, RCLIB_DB_LIBRARY_DATA_TYPE_TYPE = 1, RCLIB_DB_LIBRARY_DATA_TYPE_URI = 2, RCLIB_DB_LIBRARY_DATA_TYPE_TITLE = 3, RCLIB_DB_LIBRARY_DATA_TYPE_ARTIST = 4, RCLIB_DB_LIBRARY_DATA_TYPE_ALBUM = 5, RCLIB_DB_LIBRARY_DATA_TYPE_FTYPE = 6, RCLIB_DB_LIBRARY_DATA_TYPE_LENGTH = 7, RCLIB_DB_LIBRARY_DATA_TYPE_TRACKNUM = 8, RCLIB_DB_LIBRARY_DATA_TYPE_YEAR = 9, RCLIB_DB_LIBRARY_DATA_TYPE_RATING = 10, RCLIB_DB_LIBRARY_DATA_TYPE_LYRICFILE = 11, RCLIB_DB_LIBRARY_DATA_TYPE_LYRICSECFILE = 12, RCLIB_DB_LIBRARY_DATA_TYPE_ALBUMFILE = 13, RCLIB_DB_LIBRARY_DATA_TYPE_GENRE = 14 } RCLibDbLibraryDataType;
The enum type for set/get the data in the RCLibDbPlaylistData
none type, not used by data | |
the library item type (RCLibDbLibraryType) | |
the URI (string) | |
the title (string) | |
the artist (string) | |
the album (string) | |
the file type (string) | |
the time length (gint64) | |
the track number (gint) | |
the year (gint), | |
the rating (gfloat) | |
the lyric file path (string) | |
the second lyric file path (string) | |
the album image file path (string) | |
the genre (string) |
struct RCLibDbLibraryQueryResult;
The query result from the library. The contents of the RCLibDbLibraryQueryResult structure are private and should only be accessed via the provided API.
struct RCLibDbLibraryQueryResultClass { };
RCLibDbLibraryQueryResult class.
typedef struct _RCLibDbLibraryQueryResultIter RCLibDbLibraryQueryResultIter;
typedef struct _RCLibDbLibraryQueryResultPropIter RCLibDbLibraryQueryResultPropIter;
typedef enum { RCLIB_DB_LIBRARY_TYPE_MISSING = 0, RCLIB_DB_LIBRARY_TYPE_MUSIC = 1, RCLIB_DB_LIBRARY_TYPE_CUE = 2 } RCLibDbLibraryType;
The enum type for library.
typedef enum { RCLIB_DB_PLAYLIST_DATA_TYPE_NONE = 0, RCLIB_DB_PLAYLIST_DATA_TYPE_CATALOG = 1, RCLIB_DB_PLAYLIST_DATA_TYPE_SELF_ITER = 2, RCLIB_DB_PLAYLIST_DATA_TYPE_TYPE = 3, RCLIB_DB_PLAYLIST_DATA_TYPE_URI = 4, RCLIB_DB_PLAYLIST_DATA_TYPE_TITLE = 5, RCLIB_DB_PLAYLIST_DATA_TYPE_ARTIST = 6, RCLIB_DB_PLAYLIST_DATA_TYPE_ALBUM = 7, RCLIB_DB_PLAYLIST_DATA_TYPE_FTYPE = 8, RCLIB_DB_PLAYLIST_DATA_TYPE_LENGTH = 9, RCLIB_DB_PLAYLIST_DATA_TYPE_TRACKNUM = 10, RCLIB_DB_PLAYLIST_DATA_TYPE_YEAR = 11, RCLIB_DB_PLAYLIST_DATA_TYPE_RATING = 12, RCLIB_DB_PLAYLIST_DATA_TYPE_LYRICFILE = 13, RCLIB_DB_PLAYLIST_DATA_TYPE_LYRICSECFILE = 14, RCLIB_DB_PLAYLIST_DATA_TYPE_ALBUMFILE = 15, RCLIB_DB_PLAYLIST_DATA_TYPE_GENRE = 16 } RCLibDbPlaylistDataType;
The enum type for set/get the data in the RCLibDbPlaylistData
none type, not used by data | |
the catalog (RCLibDbCatalogIter) | |
the iter pointed to self (RCLibDbPlaylistIter) | |
the playlist type (RCLibDbPlaylistType) | |
the URI (string) | |
the title (string) | |
the artist (string) | |
the album (string) | |
the file type (string) | |
the time length (gint64) | |
the track number (gint) | |
the year (gint) | |
the rating (gfloat) | |
the lyric file path (string) | |
the second lyric file path (string) | |
the album image file path (string) | |
the genre (string) |
typedef enum { RCLIB_DB_PLAYLIST_TYPE_MISSING = 0, RCLIB_DB_PLAYLIST_TYPE_MUSIC = 1, RCLIB_DB_PLAYLIST_TYPE_CUE = 2 } RCLibDbPlaylistType;
The enum type for playlist type.
typedef enum { RCLIB_DB_QUERY_CONDITION_TYPE_NONE = 0, RCLIB_DB_QUERY_CONDITION_TYPE_SUBQUERY = 1, RCLIB_DB_QUERY_CONDITION_TYPE_PROP_EQUALS = 2, RCLIB_DB_QUERY_CONDITION_TYPE_PROP_NOT_EQUAL = 3, RCLIB_DB_QUERY_CONDITION_TYPE_PROP_LIKE = 4, RCLIB_DB_QUERY_CONDITION_TYPE_PROP_NOT_LIKE = 5, RCLIB_DB_QUERY_CONDITION_TYPE_PROP_PREFIX = 6, RCLIB_DB_QUERY_CONDITION_TYPE_PROP_SUFFIX = 7, RCLIB_DB_QUERY_CONDITION_TYPE_PROP_GREATER = 8, RCLIB_DB_QUERY_CONDITION_TYPE_PROP_LESS = 9, RCLIB_DB_QUERY_CONDITION_TYPE_PROP_GREATER_OR_EQUAL = 10, RCLIB_DB_QUERY_CONDITION_TYPE_PROP_LESS_OR_EQUAL = 11, RCLIB_DB_QUERY_CONDITION_TYPE_OR = 12, RCLIB_DB_QUERY_CONDITION_TYPE_LAST = 13 } RCLibDbQueryConditionType;
The enum type for query the properties of the items in the library by the given condition type.
none query type | |
the sub-query type | |
the property equals to the query condition | |
the property does not equal to the query condition | |
the property contains the sub-string which equals to the query condition | |
the property does not contain the sub-string which equals to the query condition | |
the prefix of the property equals to the query condition | |
the suffix of the property equals to the query condition | |
the query condition is greater than the property | |
the query condition is lesser than the property | |
the query condition is greater than or equal to the property | |
the query condition is lesser than or equal to the property | |
the or condition type | |
not used, just a last enum type |
typedef enum { RCLIB_DB_QUERY_DATA_TYPE_NONE = 0, RCLIB_DB_QUERY_DATA_TYPE_URI = 1, RCLIB_DB_QUERY_DATA_TYPE_TITLE = 2, RCLIB_DB_QUERY_DATA_TYPE_ARTIST = 3, RCLIB_DB_QUERY_DATA_TYPE_ALBUM = 4, RCLIB_DB_QUERY_DATA_TYPE_FTYPE = 5, RCLIB_DB_QUERY_DATA_TYPE_LENGTH = 6, RCLIB_DB_QUERY_DATA_TYPE_TRACKNUM = 7, RCLIB_DB_QUERY_DATA_TYPE_YEAR = 8, RCLIB_DB_QUERY_DATA_TYPE_RATING = 9, RCLIB_DB_QUERY_DATA_TYPE_GENRE = 10 } RCLibDbQueryDataType;
The enum type for query the given data type in the database.
gboolean rclib_db_autosaved_exist ();
Whether auto-saved playlist file exists.
Returns : |
The existence of auto-saved playlist file. |
void rclib_db_autosaved_remove ();
Remove the auto-saved playlist file.
RCLibDbCatalogIter * rclib_db_catalog_add (const gchar *name
,RCLibDbCatalogIter *iter
,gint type
);
Add a new playlist to the catalog before the iter, if the iter is NULL, it will be added to the end. Must be called in main thread.
|
the name for the new playlist |
|
insert position (before this iter) |
|
the type of the new playlist |
Returns : |
(skip): The iter to the new playlist in the catalog. [transfer none] |
void rclib_db_catalog_data_free (RCLibDbCatalogData *data
);
Free the RCLibDbCatalogData structure.
Please use #rclib_db_catalog_data_unref()
in case of multi-threading.
|
the data to free |
void rclib_db_catalog_data_get (RCLibDbCatalogData *data
,RCLibDbCatalogDataType type1
,...
);
Gets properties of a RCLibDbCatalogData. The property contents will be copied (except the playlist and the store pointer). MT safe.
|
the RCLibDbCatalogData data |
|
the first property in catalog data to get |
|
return location for the first property, followed optionally by more
name/return location pairs, followed by RCLIB_DB_CATALOG_DATA_TYPE_NONE
|
void rclib_db_catalog_data_iter_get (RCLibDbCatalogIter *iter
,RCLibDbCatalogDataType type1
,...
);
Gets properties of the data in a RCLibDbCatalogIter. The property contents will be copied, except the playlist and store pointer. MT safe.
|
the RCLibDbCatalogIter iter |
|
the first property in catalog data to get |
|
value for the first property, followed optionally by more
name/value pairs, followed by RCLIB_DB_CATALOG_DATA_TYPE_NONE
|
void rclib_db_catalog_data_iter_set (RCLibDbCatalogIter *iter
,RCLibDbCatalogDataType type1
,...
);
Sets properties on the data in a RCLibDbCatalogIter. Must be called in main thread.
|
the RCLibDbCatalogIter iter |
|
the first property in catalog data to set |
|
value for the first property, followed optionally by more
name/value pairs, followed by RCLIB_DB_CATALOG_DATA_TYPE_NONE
|
RCLibDbCatalogData * rclib_db_catalog_data_new ();
Create a new empty RCLibDbCatalogData structure, and set the reference count to 1. MT safe.
Returns : |
The new empty allocated RCLibDbCatalogData structure. |
RCLibDbCatalogData * rclib_db_catalog_data_ref (RCLibDbCatalogData *data
);
Increase the reference of RCLibDbCatalogData by 1. MT safe.
|
the RCLibDbCatalogData structure |
Returns : |
The RCLibDbCatalogData structure. [transfer none] |
void rclib_db_catalog_data_set (RCLibDbCatalogData *data
,RCLibDbCatalogDataType type1
,...
);
Sets properties on a RCLibDbCatalogData. Must be called in main thread.
|
the RCLibDbCatalogData data |
|
the first property in catalog data to set |
|
value for the first property, followed optionally by more
name/value pairs, followed by RCLIB_DB_CATALOG_DATA_TYPE_NONE
|
void rclib_db_catalog_data_unref (RCLibDbCatalogData *data
);
Decrease the reference of RCLibDbCatalogData by 1. If the reference down to zero, the structure will be freed. MT safe.
|
the RCLibDbCatalogData structure |
Returns : |
The RCLibDbCatalogData structure. |
void rclib_db_catalog_delete (RCLibDbCatalogIter *iter
);
Delete the catalog pointed to by iter. Must be called in main thread.
|
the iter to the catalog |
void rclib_db_catalog_foreach (GFunc func
,gpointer user_data
);
Calls func
for each item in the playlist catalog passing
user_data
to the function. MT safe.
|
the function to call for each item in seq . [scope call]
|
|
user data passed to func
|
RCLibDbCatalogIter * rclib_db_catalog_get_begin_iter ();
Get the begin iterator for the playlist catalog. MT safe.
Returns : |
(skip): The begin iterator. [transfer none] |
RCLibDbCatalogIter * rclib_db_catalog_get_end_iter ();
Get the end iterator for the playlist catalog. MT safe.
Returns : |
(skip): The end iterator. [transfer none] |
RCLibDbCatalogIter * rclib_db_catalog_get_iter_at_pos (gint pos
);
Return the iterator at position pos
. If pos
is negative or larger
than the number of items in the playlist catalog, the end iterator
is returned. MT safe.
|
the position in the playlist catalog, or -1 for the end. |
Returns : |
(skip): The RCLibDbCatalogIter at
position pos . [transfer none]
|
RCLibDbCatalogIter * rclib_db_catalog_get_last_iter ();
Get the last iterator for the playlist catalog. MT safe.
Returns : |
(skip): The last iterator, NULL if does not exist. [transfer none] |
gint rclib_db_catalog_get_length ();
Get the element length of the playlist catalog. MT safe.
Returns : |
The length of catalog, -1 if any error occurs. |
gboolean rclib_db_catalog_is_valid_iter (RCLibDbCatalogIter *catalog_iter
);
Check whether the iter is valid in the catalog sequence. MT safe.
|
the iter to check |
Returns : |
Whether the iter is valid. |
gint rclib_db_catalog_iter_compare (RCLibDbCatalogIter *a
,RCLibDbCatalogIter *b
);
Return a negative number if a
comes before b
, 0 if they are equal,
and a positive number if a
comes after b
. MT safe.
The a
and b
iterators must point into the same catalog.
|
a RCLibDbCatalogIter |
|
a RCLibDbCatalogIter |
Returns : |
A negative number if a comes before b , 0 if they are
equal, and a positive number if a comes after b . |
void rclib_db_catalog_iter_foreach_range (RCLibDbCatalogIter *begin
,RCLibDbCatalogIter *end
,GFunc func
,gpointer user_data
);
Calls func
for each item in the range (begin
, end
) passing
user_data
to the function. MT safe.
|
a RCLibDbCatalogIter |
|
a RCLibDbCatalogIter |
|
a GFunc. [scope call] |
|
user data passed to func
|
RCLibDbCatalogData * rclib_db_catalog_iter_get_data (RCLibDbCatalogIter *iter
);
Get the catalog item data which the iter pointed to. MT safe.
|
the iter pointed to the catalog data |
Returns : |
The RCLibDbCatalogData. [transfer full] |
gint rclib_db_catalog_iter_get_position (RCLibDbCatalogIter *iter
);
Returns the position of iter
. MT safe.
|
a RCLibDbCatalogIter |
Returns : |
the position of iter , -1 if the iter is not valid. |
gboolean rclib_db_catalog_iter_is_begin (RCLibDbCatalogIter *iter
);
Return whether iter
is the begin iterator. MT safe.
Notice that this function will NOT check whether the iter is valid.
|
a RCLibDbCatalogIter |
Returns : |
whether iter is the begin iterator |
gboolean rclib_db_catalog_iter_is_end (RCLibDbCatalogIter *iter
);
Return whether iter
is the end iterator. MT safe.
Notice that this function will NOT check whether the iter is valid.
|
a RCLibDbCatalogIter |
Returns : |
whether iter is the end iterator |
RCLibDbCatalogIter * rclib_db_catalog_iter_next (RCLibDbCatalogIter *iter
);
Return an iterator pointing to the next position after iter
. If
iter
is not valid, or iter
is the last iterator in the catalog,
NULL is returned. MT safe.
|
a RCLibDbCatalogIter |
Returns : |
(skip): a RCLibDbCatalogIter pointing to
the next position after iter . [transfer none]
|
RCLibDbCatalogIter * rclib_db_catalog_iter_prev (RCLibDbCatalogIter *iter
);
Return an iterator pointing to the previous position before iter
. If
iter
is not valid, or iter
is the first iterator in the catalog,
NULL is returned. MT safe.
|
a RCLibDbCatalogIter |
Returns : |
(skip): a RCLibDbCatalogIter pointing to the
previous position before iter . [transfer none]
|
RCLibDbCatalogIter * rclib_db_catalog_iter_range_get_midpoint (RCLibDbCatalogIter *begin
,RCLibDbCatalogIter *end
);
Find an iterator somewhere in the range (begin
, end
). This
iterator will be close to the middle of the range, but is not
guaranteed to be exactly in the middle.
The begin
and end
iterators must both point to the same
catalog and begin
must come before or be equal
to end
in the sequence. MT safe.
|
a RCLibDbCatalogIter |
|
a RCLibDbCatalogIter |
Returns : |
(skip): A RCLibDbCatalogIter pointing
somewhere in the (begin , end ) range. [transfer none]
|
void rclib_db_catalog_name_sort (gboolean direction
);
Sort the catalogs by alphabets (ascending or descending). This function can only be called in main thread.
void rclib_db_catalog_reorder (gint *new_order
);
Reorder the catalog to follow the order indicated by new_order
.
Must be called in main thread.
|
an array of integers mapping the new position of
each child to its old position before the re-ordering,
i.e. new_order [newpos] = oldpos . [array]
|
GObject * rclib_db_get_instance ();
Get the running RCLibDb instance.
Returns : |
The running instance. [transfer none] |
GHashTable * rclib_db_get_library_table ();
Get the library table.
Returns : |
(skip): The library table, NULL if the table does not exist. [transfer none] |
void rclib_db_import_cancel ();
Cancel all remaining import jobs in the queue.
gint rclib_db_import_queue_get_length ();
Get the number of remaining jobs in the import queue.
Returns : |
The number of remaining jobs. |
gboolean rclib_db_init (const gchar *file
);
Initialize the music library database.
|
the file of the music library database to load |
Returns : |
Whether the initialization succeeded. |
void rclib_db_library_add_music (const gchar *uri
);
Add music to the music library. MT safe.
|
the URI of the music to add |
void rclib_db_library_add_music_and_play (const gchar *uri
);
Add music to the music library, and then play it if the add operation succeeds. MT safe.
|
the URI of the music to add |
void rclib_db_library_data_free (RCLibDbLibraryData *data
);
Free the RCLibDbLibraryData structure.
Please use #rclib_db_library_data_unref()
in case of multi-threading.
|
the data to free |
void rclib_db_library_data_get (RCLibDbLibraryData *data
,RCLibDbLibraryDataType type1
,...
);
Gets properties of a RCLibDbLibraryData. The property contents will be copied. MT safe.
|
the RCLibDbLibraryData data |
|
the first property in library data to get |
|
return location for the first property, followed optionally by more
name/return location pairs, followed by RCLIB_DB_LIBRARY_DATA_TYPE_NONE
|
RCLibDbLibraryData * rclib_db_library_data_new ();
Create a new empty RCLibDbLibraryData structure, and set the reference count to 1. MT safe.
Returns : |
The new empty allocated RCLibDbLibraryData structure. |
gboolean rclib_db_library_data_query (RCLibDbLibraryData *library_data
,RCLibDbQuery *query
,GCancellable *cancellable
);
Check whether the library data satisfied the query condition. MT safe.
|
the library data to check |
|
the query condition |
|
optional GCancellable object, NULL to ignore. [allow-none] |
Returns : |
Whether the library data satisfied the query condition. |
RCLibDbLibraryData * rclib_db_library_data_ref (RCLibDbLibraryData *data
);
Increase the reference of RCLibDbLibraryData by 1. MT safe.
|
the RCLibDbLibraryData structure |
Returns : |
The RCLibDbLibraryData structure. [transfer none] |
void rclib_db_library_data_set (RCLibDbLibraryData *data
,RCLibDbLibraryDataType type1
,...
);
Sets properties on a RCLibDbPlaylistData. MT safe.
|
the RCLibDbLibraryDataType data |
|
the first property in playlist data to set |
|
value for the first property, followed optionally by more
name/value pairs, followed by RCLIB_DB_LIBRARY_DATA_TYPE_NONE
|
void rclib_db_library_data_unref (RCLibDbLibraryData *data
);
Decrease the reference of RCLibDbLibraryData by 1. If the reference down to zero, the structure will be freed. MT safe.
|
the RCLibDbLibraryData structure |
Returns : |
The RCLibDbLibraryData structure. |
void rclib_db_library_data_uri_get (const gchar *uri
,RCLibDbLibraryDataType type1
,...
);
Gets properties of the RCLibDbLibraryData which uri
points to.
The property contents will be copied. MT safe.
|
the URI of the RCLibDbPlaylistData entry |
|
the first property in library data to get |
|
return location for the first property, followed optionally by more
name/return location pairs, followed by RCLIB_DB_LIBRARY_DATA_TYPE_NONE
|
void rclib_db_library_data_uri_set (const gchar *uri
,RCLibDbLibraryDataType type1
,...
);
Sets properties on the RCLibDbPlaylistData which uri
points to.
MT safe.
|
the URI of the RCLibDbPlaylistData entry |
|
the first property in playlist data to set |
|
value for the first property, followed optionally by more
name/value pairs, followed by RCLIB_DB_LIBRARY_DATA_TYPE_NONE
|
void rclib_db_library_delete (const gchar *uri
);
Delete the the music item by the given URI. MT safe.
|
the URI of the music item to delete |
gboolean rclib_db_library_exist (RCLibDbLibraryData *library_data
);
Check whether the library data exists in the library.
|
the library data |
Returns : |
Whether the library data exists in the library. |
GObject * rclib_db_library_get_album_query_result ();
Get the built-in album query result object instance of the library.
Returns : |
The album query result object, unref after usage. [transfer full] |
GObject * rclib_db_library_get_artist_query_result ();
Get the built-in artist query result object instance of the library.
Returns : |
The artist query result object, unref after usage. [transfer full] |
GObject * rclib_db_library_get_base_query_result ();
Get the built-in base query result object instance of the library.
Returns : |
The base query result object, unref after usage. [transfer full] |
RCLibDbLibraryData * rclib_db_library_get_data (const gchar *uri
);
Get the library entry data which uri
points to. MT safe.
|
the URI of the RCLibDbPlaylistData entry |
Returns : |
The library entry data, NULL if not found.
Free the data with #rclib_db_library_data_unref() after usage. [transfer full]
|
GObject * rclib_db_library_get_genre_query_result ();
Get the built-in genre query result object instance of the library.
Returns : |
The genre query result object, unref after usage. [transfer full] |
gboolean rclib_db_library_has_uri (const gchar *uri
);
Check whether the give URI exists in the library. MT safe.
|
the URI to find |
Returns : |
Whether the URI exists in the library. |
GPtrArray * rclib_db_library_query (RCLibDbQuery *query
,GCancellable *cancellable
);
Query data from the music library. MT safe.
|
he query condition |
|
optional GCancellable object, NULL to ignore. [allow-none] |
Returns : |
The library data array which satisfied
the query condition. Free with #g_ptr_array_free() or
#g_ptr_array_unref() after usage. [transfer full]
|
GPtrArray * rclib_db_library_query_get_uris (RCLibDbQuery *query
,GCancellable *cancellable
);
Query data from the music library, and get an array of the URIs which points to the music that satisfied the query condition. MT safe.
|
he query condition |
|
optional GCancellable object, NULL to ignore. [allow-none] |
Returns : |
The URI array which points to the music that
satisfied the query condition. Free with #g_ptr_array_free() or
#g_ptr_array_unref() after usage. [transfer full]
|
void rclib_db_library_query_result_chain (RCLibDbLibraryQueryResult *query_result
,RCLibDbLibraryQueryResult *base
,gboolean import_entries
);
Chain query_result
to base
, All changes made to the base instance will
be reflected in the child instance.
|
the RCLibDbLibraryQueryResult instance |
|
the base RCLibDbLibraryQueryResult instance |
|
whether to copy the contents from base
|
void rclib_db_library_query_result_copy_contents (RCLibDbLibraryQueryResult *dst
,RCLibDbLibraryQueryResult *src
);
Deep copy the content data from src
to dst
.
|
the destination RCLibDbLibraryQueryResult instance |
|
the source RCLibDbLibraryQueryResult instance |
RCLibDbLibraryQueryResult * rclib_db_library_query_result_get_base
(RCLibDbLibraryQueryResult *query_result
);
Get the base query result of current query result, if the query result is chained to another query result, or return NULL.
|
the RCLibDbLibraryQueryResult instance |
Returns : |
The base query result, NULL if not exist or any error occurs. Dereference it after Usage. [transfer full] |
RCLibDbLibraryQueryResultIter * rclib_db_library_query_result_get_begin_iter
(RCLibDbLibraryQueryResult *query_result
);
Get the begin iter of the query result.
|
the RCLibDbLibraryQueryResult instance |
Returns : |
(skip): The begin iter, NULL if the query result is empty or any error occurs. [transfer none] |
RCLibDbLibraryData * rclib_db_library_query_result_get_data (RCLibDbLibraryQueryResult *query_result
,RCLibDbLibraryQueryResultIter *iter
);
Get the library data which the iter
points to.
|
the RCLibDbLibraryQueryResult instance |
|
the iter |
Returns : |
The library data, NULL if not found or any error occurs. [transfer full] |
RCLibDbLibraryQueryResultIter * rclib_db_library_query_result_get_iter_at_pos (RCLibDbLibraryQueryResult *query_result
,gint pos
);
Return the iterator at position pos
. If pos
is negative or larger
than the number of items in the query result sequence, the end iterator
is returned.
|
the RCLibDbLibraryQueryResult instance |
|
the position in the query result sequence, or -1 for the end. |
Returns : |
(skip): The RCLibDbLibraryQueryResultIter at
position pos . [transfer none]
|
RCLibDbLibraryQueryResultIter * rclib_db_library_query_result_get_iter_by_uri (RCLibDbLibraryQueryResult *query_result
,const gchar *uri
);
Get the iter of the query result item by the given uri
.
|
the RCLibDbLibraryQueryResult instance |
|
the URI of the query result item |
Returns : |
(skip): The iter, NULL if the URI does not exist in the query result. [transfer none] |
RCLibDbLibraryQueryResultIter * rclib_db_library_query_result_get_last_iter
(RCLibDbLibraryQueryResult *query_result
);
Get the last iter of the query result.
|
the RCLibDbLibraryQueryResult instance |
Returns : |
(skip): The last iter, NULL if the query result is empty or any error occurs. [transfer none] |
guint rclib_db_library_query_result_get_length
(RCLibDbLibraryQueryResult *query_result
);
Get the query result length number.
|
the RCLibDbLibraryQueryResult instance |
Returns : |
The number of the query result. |
RCLibDbLibraryQueryResultIter * rclib_db_library_query_result_get_next_iter (RCLibDbLibraryQueryResult *query_result
,RCLibDbLibraryQueryResultIter *iter
);
Get the next iter of iter
.
|
the RCLibDbLibraryQueryResult instance |
|
the iter |
Returns : |
(skip): The next iter, NULL if there is no next one or any error occurs. [transfer none] |
gint rclib_db_library_query_result_get_position (RCLibDbLibraryQueryResult *query_result
,RCLibDbLibraryQueryResultIter *iter
);
Returns the position of iter
.
|
the RCLibDbLibraryQueryResult instance |
|
the iter |
Returns : |
the position of iter , -1 if the iter is not valid. |
RCLibDbLibraryQueryResultIter * rclib_db_library_query_result_get_prev_iter (RCLibDbLibraryQueryResult *query_result
,RCLibDbLibraryQueryResultIter *iter
);
Get the previous iter of iter
.
|
the RCLibDbLibraryQueryResult instance |
|
the iter |
Returns : |
(skip): The previous iter, NULL if there is no previous one or any error occurs. [transfer none] |
const RCLibDbQuery * rclib_db_library_query_result_get_query
(RCLibDbLibraryQueryResult *query_result
);
Get the current query applied to the query result.
|
the RCLibDbLibraryQueryResult instance |
Returns : |
The current query appiled to the query result. [transfer none] |
RCLibDbLibraryQueryResultIter * rclib_db_library_query_result_get_random_iter
(RCLibDbLibraryQueryResult *query_result
);
Return the iterator at arandom position. If there is nothing in the query result, NULL is returned.
|
the RCLibDbLibraryQueryResult instance |
Returns : |
(skip): The RCLibDbLibraryQueryResultIter at a random position. [transfer none] |
gboolean rclib_db_library_query_result_iter_is_begin (RCLibDbLibraryQueryResult *query_result
,RCLibDbLibraryQueryResultIter *iter
);
Return whether iter
is the begin iterator.
Notice that this function will NOT check whether the iter
is valid.
|
the RCLibDbLibraryQueryResult instance |
|
the iter |
Returns : |
whether iter is the begin iterator |
gboolean rclib_db_library_query_result_iter_is_end (RCLibDbLibraryQueryResult *query_result
,RCLibDbLibraryQueryResultIter *iter
);
Return whether iter
is the end iterator.
Notice that this function will NOT check whether the iter
is valid.
|
the RCLibDbLibraryQueryResult instance |
|
the iter |
Returns : |
whether iter is the end iterator |
GObject * rclib_db_library_query_result_new (RCLibDb *db
,RCLibDbLibraryQueryResult *base
,RCLibDbQueryDataType *prop_types
);
Create a new library query result object instance.
|
the RCLibDb instance |
|
the base instance of the query result, NULL to create a base instance |
|
the property type list, end with RCLIB_DB_QUERY_DATA_TYPE_NONE |
Returns : |
The RCLibDbLibraryQueryResult instance, NULL the operation failed. [transfer full] |
RCLibDbLibraryQueryResultPropIter * rclib_db_library_query_result_prop_get_begin_iter (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
);
Get the begin iter of the given property type in the the query result.
|
the RCLibDbLibraryQueryResult instance |
|
the property type |
Returns : |
(skip): The begin iter, NULL if the query result is empty or any error occurs. [transfer none] |
gboolean rclib_db_library_query_result_prop_get_data (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
,RCLibDbLibraryQueryResultPropIter *iter
,gchar **prop_name
,guint *prop_count
);
Get the data of the property in the query result.
|
the RCLibDbLibraryQueryResult instance |
|
the property type |
|
the iter pointed to the property |
|
the property name. [out] |
|
the number of the property name used. [out] |
Returns : |
Whether the property data exists. |
RCLibDbLibraryQueryResultPropIter * rclib_db_library_query_result_prop_get_iter_at_pos (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
,gint pos
);
Return the iterator at position pos
. If pos
is negative or larger
than the number of items in the property sequence, the end iterator
is returned.
|
the RCLibDbLibraryQueryResult instance |
|
the property type |
|
the position in the property sequence, or -1 for the end. |
Returns : |
(skip): The RCLibDbLibraryQueryResultPropIter at
position pos . [transfer none]
|
RCLibDbLibraryQueryResultPropIter * rclib_db_library_query_result_prop_get_iter_by_prop (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
,const gchar *prop_text
);
Get the iter pointed to the given prop_text
of the given property type
in the the query result.
|
the RCLibDbLibraryQueryResult instance |
|
the property type |
|
the property text |
Returns : |
(skip): The iter, NULL if the property text does not exist or any error occurs. [transfer none] |
RCLibDbLibraryQueryResultPropIter * rclib_db_library_query_result_prop_get_last_iter (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
);
Get the last iter of the given property type in the the query result.
|
the RCLibDbLibraryQueryResult instance |
|
the property type |
Returns : |
(skip): The last iter, NULL if the query result is empty or any error occurs. [transfer none] |
guint rclib_db_library_query_result_prop_get_length (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
);
Get length of the given property type in the the query result.
|
the RCLibDbLibraryQueryResult instance |
|
the property type |
Returns : |
The length of the given property type. |
RCLibDbLibraryQueryResultPropIter * rclib_db_library_query_result_prop_get_next_iter (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
,RCLibDbLibraryQueryResultPropIter *iter
);
Get the next iter of iter
.
|
the RCLibDbLibraryQueryResult instance |
|
the property type |
|
the iter pointed to the property |
Returns : |
(skip): The next iter, NULL if there is no next one or any error occurs. [transfer none] |
gint rclib_db_library_query_result_prop_get_position (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
,RCLibDbLibraryQueryResultPropIter *iter
);
Returns the position of iter
.
|
the RCLibDbLibraryQueryResult instance |
|
the property type |
|
the iter pointed to the property |
Returns : |
the position of iter , -1 if the iter is not valid. |
RCLibDbLibraryQueryResultPropIter * rclib_db_library_query_result_prop_get_prev_iter (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
,RCLibDbLibraryQueryResultPropIter *iter
);
Get the previous iter of iter
.
|
the RCLibDbLibraryQueryResult instance |
|
the property type |
|
the iter pointed to the property |
Returns : |
(skip): The previous iter, NULL if there is no next one or any error occurs. [transfer none] |
gboolean rclib_db_library_query_result_prop_get_total_count (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
,guint *count
);
Get the total count of music in the given property type in the query result.
|
the RCLibDbLibraryQueryResult instance |
|
the property type |
|
the total count of music in this property type. [out] |
Returns : |
Whether the property type exists. |
gboolean rclib_db_library_query_result_prop_iter_is_begin (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
,RCLibDbLibraryQueryResultPropIter *iter
);
Return whether iter
is the begin iterator.
Notice that this function will NOT check whether the iter
is valid.
|
the RCLibDbLibraryQueryResult instance |
|
the property type |
|
the iter |
Returns : |
whether iter is the begin iterator. |
gboolean rclib_db_library_query_result_prop_iter_is_end (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
,RCLibDbLibraryQueryResultPropIter *iter
);
Return whether iter
is the end iterator.
Notice that this function will NOT check whether the iter
is valid.
|
the RCLibDbLibraryQueryResult instance |
|
the property type |
|
the iter |
Returns : |
whether iter is the end iterator. |
void rclib_db_library_query_result_prop_sort (RCLibDbLibraryQueryResult *query_result
,RCLibDbQueryDataType prop_type
,gboolean direction
);
Sort the query result property items by the alphabets order
(ascending or descending) of the given column
.
|
the RCLibDbLibraryQueryResult instance |
|
the property type |
|
the sort direction, FALSE to use ascending, TRUE to use descending |
void rclib_db_library_query_result_query_cancel
(RCLibDbLibraryQueryResult *query_result
);
Cancel the current query process.
|
the RCLibDbLibraryQueryResult instance |
void rclib_db_library_query_result_query_clear
(RCLibDbLibraryQueryResult *query_result
);
Clear the query result.
|
the RCLibDbLibraryQueryResult instance |
void rclib_db_library_query_result_query_start (RCLibDbLibraryQueryResult *query_result
,gboolean clear
);
Start query operation.
|
the RCLibDbLibraryQueryResult instance |
|
whether to clear the query result data |
void rclib_db_library_query_result_set_query (RCLibDbLibraryQueryResult *query_result
,const RCLibDbQuery *query
);
Set the query condition with query
.
|
the RCLibDbLibraryQueryResult instance |
|
the query to set |
void rclib_db_library_query_result_sort (RCLibDbLibraryQueryResult *query_result
,RCLibDbLibraryDataType column
,gboolean direction
);
Sort the query result items by the alphabets order (ascending or descending)
of the given column
.
|
the RCLibDbLibraryQueryResult instance |
|
the column to sort |
|
the sort direction, FALSE to use ascending, TRUE to use descending |
gboolean rclib_db_load_autosaved ();
Load all playlist data from auto-saved playlist.
gboolean rclib_db_load_legacy ();
Load legacy playlist file from RhythmCat 1.0.
Returns : |
Whether the operation succeeds. |
void rclib_db_playlist_add_directory (RCLibDbCatalogIter *iter
,RCLibDbPlaylistIter *insert_iter
,const gchar *dir
);
Add all music in the directory to the catalog pointed to by iter. MT safe.
|
the catalog iter |
|
insert the music before this iter |
|
the directory path |
void rclib_db_playlist_add_m3u_file (RCLibDbCatalogIter *iter
,RCLibDbPlaylistIter *insert_iter
,const gchar *filename
);
Load a m3u playlist file, and add all music inside to the catalog pointed to by iter. MT safe.
|
the catalog iter |
|
insert the music before this iter |
|
the path of the playlist file |
void rclib_db_playlist_add_music (RCLibDbCatalogIter *iter
,RCLibDbPlaylistIter *insert_iter
,const gchar *uri
);
Add music to the playlist by given catalog iter. MT safe.
|
the catalog iter |
|
insert the music before this iter |
|
the URI of the music |
void rclib_db_playlist_add_music_and_play (RCLibDbCatalogIter *iter
,RCLibDbPlaylistIter *insert_iter
,const gchar *uri
);
Add music to the playlist by given catalog iter, and then play it if the add operation succeeds. MT safe.
|
the catalog iter |
|
insert the music before this iter |
|
the URI of the music |
void rclib_db_playlist_data_free (RCLibDbPlaylistData *data
);
Free the RCLibDbPlaylistData structure.
Please use #rclib_db_playlist_data_unref()
in case of multi-threading.
|
the data to free |
void rclib_db_playlist_data_get (RCLibDbPlaylistData *data
,RCLibDbPlaylistDataType type1
,...
);
Gets properties of a RCLibDbPlaylistData. The property contents will be copied, except the catalog and iters. MT safe.
|
the RCLibDbPlaylistData data |
|
the first property in playlist data to get |
|
return location for the first property, followed optionally by more
name/return location pairs, followed by RCLIB_DB_PLAYLIST_DATA_TYPE_NONE
|
void rclib_db_playlist_data_iter_get (RCLibDbPlaylistIter *iter
,RCLibDbPlaylistDataType type1
,...
);
Gets properties of the data in a RCLibDbPlaylistIter. The property contents will be copied, except the catalog and iters. MT safe.
|
the RCLibDbPlaylistIter iter |
|
the first property in playlist data to get |
|
value for the first property, followed optionally by more
name/value pairs, followed by RCLIB_DB_PLAYLIST_DATA_TYPE_NONE
|
void rclib_db_playlist_data_iter_set (RCLibDbPlaylistIter *iter
,RCLibDbPlaylistDataType type1
,...
);
Sets properties on the data in a RCLibDbPlaylistIter. Must be called in main thread.
|
the RCLibDbPlaylistIter iter |
|
the first property in playlist data to set |
|
value for the first property, followed optionally by more
name/value pairs, followed by RCLIB_DB_PLAYLIST_DATA_TYPE_NONE
|
RCLibDbPlaylistData * rclib_db_playlist_data_new ();
Create a new empty RCLibDbPlaylistData structure, and set the reference count to 1. MT safe.
Returns : |
The new empty allocated RCLibDbPlaylistData structure. |
gboolean rclib_db_playlist_data_query (RCLibDbPlaylistData *playlist_data
,RCLibDbQuery *query
,GCancellable *cancellable
);
Check whether the playlist data satisfied the query condition. MT safe.
|
the playlist data to check |
|
the query condition |
|
optional GCancellable object, NULL to ignore. [allow-none] |
Returns : |
Whether the playlist data satisfied the query condition. |
RCLibDbPlaylistData * rclib_db_playlist_data_ref (RCLibDbPlaylistData *data
);
Increase the reference of RCLibDbPlaylistData by 1. MT safe.
|
the RCLibDbPlaylistData structure |
Returns : |
The RCLibDbPlaylistData structure. [transfer none] |
void rclib_db_playlist_data_set (RCLibDbPlaylistData *data
,RCLibDbPlaylistDataType type1
,...
);
Sets properties on a RCLibDbPlaylistData. Must be called in main thread.
|
the RCLibDbPlaylistData data |
|
the first property in playlist data to set |
|
value for the first property, followed optionally by more
name/value pairs, followed by RCLIB_DB_PLAYLIST_DATA_TYPE_NONE
|
void rclib_db_playlist_data_unref (RCLibDbPlaylistData *data
);
Decrease the reference of RCLibDbPlaylistData by 1. If the reference down to zero, the structure will be freed. MT safe.
|
the RCLibDbPlaylistData structure |
Returns : |
The RCLibDbPlaylistData structure. |
void rclib_db_playlist_delete (RCLibDbPlaylistIter *iter
);
Delete the playlist data pointed to by iter. Must be called in main thread.
|
the iter to the playlist data |
gboolean rclib_db_playlist_export_all_m3u_files
(const gchar *dir
);
Export all playlists in the catalog to playlist files. MTsafe.
|
the directory to save playlist files |
Returns : |
Whether the operation succeeded. |
gboolean rclib_db_playlist_export_m3u_file (RCLibDbCatalogIter *iter
,const gchar *sfilename
);
Export the catalog pointed to by iter to a new playlist file. MT safe.
|
the catalog iter |
|
the new playlist file path |
Returns : |
Whether the operation succeeded. |
void rclib_db_playlist_foreach (RCLibDbCatalogIter *catalog_iter
,GFunc func
,gpointer user_data
);
Calls func
for each item in the playlist passing
user_data
to the function. MT safe.
|
the RCLibDbCatalogIter which stores the playlist |
|
the function to call for each item in seq . [scope call]
|
|
user data passed to func
|
RCLibDbPlaylistIter * rclib_db_playlist_get_begin_iter (RCLibDbCatalogIter *catalog_iter
);
Get the begin iterator for the playlist stored in RCLibDbCatalogIter. MT safe.
|
the RCLibDbCatalogIter which stores the playlist |
Returns : |
(skip): The begin iterator. [transfer none] |
RCLibDbPlaylistIter * rclib_db_playlist_get_end_iter (RCLibDbCatalogIter *catalog_iter
);
Get the end iterator for the playlist stored in RCLibDbCatalogIter. MT safe.
|
the RCLibDbCatalogIter which stores the playlist |
Returns : |
(skip): The end iterator. [transfer none] |
RCLibDbPlaylistIter * rclib_db_playlist_get_iter_at_pos (RCLibDbCatalogIter *catalog_iter
,gint pos
);
Return the iterator at position pos
. If pos
is negative or larger
than the number of items in the playlist, the end iterator is returned.
MT safe.
|
the RCLibDbCatalogIter which stores the playlist |
|
the position in the playlist, or -1 for the end. |
Returns : |
(skip): The RCLibDbPlaylistIter at
position pos . [transfer none]
|
RCLibDbPlaylistIter * rclib_db_playlist_get_last_iter (RCLibDbCatalogIter *catalog_iter
);
Get the last iterator for the playlist stored in RCLibDbCatalogIter. MT safe.
|
the RCLibDbCatalogIter which stores the playlist |
Returns : |
(skip): The last iterator. [transfer none] |
gint rclib_db_playlist_get_length (RCLibDbCatalogIter *catalog_iter
);
Get the playlist length stored in the RCLibDbCatalogIter. MT safe.
|
the RCLibDbCatalogIter which stores the playlist |
Returns : |
The playlist length, -1 if the playlist does not exist. |
RCLibDbPlaylistIter * rclib_db_playlist_get_random_iter (RCLibDbCatalogIter *catalog_iter
,gboolean rating_limit
,gboolean condition
,gfloat rating
);
Get a random playlist iter from in the given catalog or all catalogs. MT safe.
|
the catalog iter pointed to the catalog, NULL to use all catalogs |
|
whether to use rating limit |
|
the condition, TRUE to get a random iter which pointed to
the RCLibDbPlaylistData whose rating is less or equal to the rating ,
FALSE to get the a random iter which pointed to the
RCLibDbPlaylistData whose rating is greater or equal to the rating
|
|
the rating limit value |
Returns : |
(skip): A random playlist iter. [transfer none] |
gboolean rclib_db_playlist_is_valid_iter (RCLibDbPlaylistIter *playlist_iter
);
Check whether the iter is valid in the playlist sequence. MT safe.
|
the iter to check |
Returns : |
Whether the iter is valid. |
void rclib_db_playlist_item_sort (RCLibDbCatalogIter *catalog_iter
,RCLibDbPlaylistDataType column
,gboolean direction
);
Sort the playlist items by the alphabets order (ascending or descending)
of the given column
. This function can only be called in main thread.
gint rclib_db_playlist_iter_compare (RCLibDbPlaylistIter *a
,RCLibDbPlaylistIter *b
);
Return a negative number if a
comes before b
, 0 if they are equal,
and a positive number if a
comes after b
. MT safe.
The a
and b
iterators must point into the same playlist.
|
a RCLibDbPlaylistIter |
|
a RCLibDbPlaylistIter |
Returns : |
A negative number if a comes before b , 0 if they are
equal, and a positive number if a comes after b . |
void rclib_db_playlist_iter_foreach_range (RCLibDbPlaylistIter *begin
,RCLibDbPlaylistIter *end
,GFunc func
,gpointer user_data
);
Calls func
for each item in the range (begin
, end
) passing
user_data
to the function. MT safe.
|
a RCLibDbPlaylistIter |
|
a RCLibDbPlaylistIter |
|
a GFunc. [scope call] |
|
user data passed to func
|
RCLibDbPlaylistIter * rclib_db_playlist_iter_get_begin_iter
(RCLibDbPlaylistIter *playlist_iter
);
Get the begin iterator of the playlist that the RCLibDbPlaylistIter belongs to. MT safe.
|
the RCLibDbPlaylistIter which the playlist belongs to |
Returns : |
(skip): The begin iterator. [transfer none] |
RCLibDbPlaylistData * rclib_db_playlist_iter_get_data (RCLibDbPlaylistIter *iter
);
Get the playlist item data which the iter pointed to. MT safe.
|
the iter pointed to the playlist data |
Returns : |
The RCLibDbPlaylistData. [transfer full] |
RCLibDbPlaylistIter * rclib_db_playlist_iter_get_end_iter
(RCLibDbPlaylistIter *playlist_iter
);
Get the end iterator of the playlist that the RCLibDbPlaylistIter belongs to. MT safe.
|
the RCLibDbPlaylistIter which the playlist belongs to |
Returns : |
(skip): The end iterator. [transfer none] |
RCLibDbPlaylistIter * rclib_db_playlist_iter_get_iter_at_pos (RCLibDbPlaylistIter *playlist_iter
,gint pos
);
Return the iterator at position pos
. If pos
is negative or larger
than the number of items in the playlist, the end iterator is returned.
MT safe.
|
the RCLibDbPlaylistIter which the playlist belongs to |
|
the position in the playlist, or -1 for the end. |
Returns : |
(skip): The RCLibDbPlaylistIter at
position pos . [transfer none]
|
RCLibDbPlaylistIter * rclib_db_playlist_iter_get_last_iter
(RCLibDbPlaylistIter *playlist_iter
);
Get the last iterator of the playlist that the RCLibDbPlaylistIter belongs to. MT safe.
|
the RCLibDbPlaylistIter which the playlist belongs to |
Returns : |
(skip): The last iterator. [transfer none] |
gint rclib_db_playlist_iter_get_length (RCLibDbPlaylistIter *playlist_iter
);
Get the playlist length that the RCLibDbPlaylistIter belongs to. MT safe.
|
the RCLibDbPlaylistIter which the playlist belongs to |
Returns : |
The playlist length, -1 if the playlist iter is not valid. |
gint rclib_db_playlist_iter_get_position (RCLibDbPlaylistIter *iter
);
Return the position of iter
. MT safe.
|
a RCLibDbPlaylistIter |
Returns : |
the position of iter , -1 if the iter is not valid. |
RCLibDbPlaylistIter * rclib_db_playlist_iter_get_random_iter (RCLibDbPlaylistIter *piter
,gboolean rating_limit
,gboolean condition
,gfloat rating
);
Get a random playlist iter from in the given catalog (which the piter
belongs to) or all catalogs. MT safe.
|
the playlist iter which belongs to the catalog, NULL to use all catalogs |
|
whether to use rating limit |
|
the condition, TRUE to get a random iter which pointed to
the RCLibDbPlaylistData whose rating is less or equal to the rating ,
FALSE to get the a random iter which pointed to the
RCLibDbPlaylistData whose rating is greater or equal to the rating
|
|
the rating limit value |
Returns : |
(skip): A random playlist iter. [transfer none] |
gboolean rclib_db_playlist_iter_is_begin (RCLibDbPlaylistIter *iter
);
Return whether iter
is the begin iterator. MT safe.
Notice that this function will NOT check whether the iter is valid.
|
a RCLibDbPlaylistIter |
Returns : |
whether iter is the begin iterator. |
gboolean rclib_db_playlist_iter_is_end (RCLibDbPlaylistIter *iter
);
Return whether iter
is the end iterator. MT safe.
Notice that this function will NOT check whether the iter is valid.
|
a RCLibDbPlaylistIter |
Returns : |
whether iter is the end iterator. |
RCLibDbPlaylistIter * rclib_db_playlist_iter_next (RCLibDbPlaylistIter *iter
);
Return an iterator pointing to the next position after iter
. If
iter
is not valid , or iter
the end iterator, NULL is returned.
MT safe.
|
a RCLibDbPlaylistIter |
Returns : |
(skip): a RCLibDbPlaylistIter pointing to
the next position after iter . [transfer none]
|
RCLibDbPlaylistIter * rclib_db_playlist_iter_prev (RCLibDbPlaylistIter *iter
);
Return an iterator pointing to the previous position before iter
. If
iter
is not valid , or iter
the begin iterator, NULL is returned.
MT safe.
|
a RCLibDbPlaylistIter |
Returns : |
(skip): a RCLibDbPlaylistIter pointing to the
previous position before iter . [transfer none]
|
gboolean rclib_db_playlist_iter_query (RCLibDbPlaylistIter *playlist_iter
,RCLibDbQuery *query
,GCancellable *cancellable
);
Check whether the playlist data stored in the iter satisfied the query condition. MT safe.
|
the playlist iter to check |
|
the query condition |
|
optional GCancellable object, NULL to ignore. [allow-none] |
Returns : |
Whether the playlist data stored in the iter satisfied the query condition. |
RCLibDbPlaylistIter * rclib_db_playlist_iter_range_get_midpoint (RCLibDbPlaylistIter *begin
,RCLibDbPlaylistIter *end
);
Find an iterator somewhere in the range (begin
, end
). This
iterator will be close to the middle of the range, but is not
guaranteed to be exactly in the middle. MT safe.
The begin
and end
iterators must both point to the same
playlist and begin
must come before or be equal
to end
in the sequence.
|
a RCLibDbPlaylistIter |
|
a RCLibDbPlaylistIter |
Returns : |
(skip): A RCLibDbPlaylistIter pointing
somewhere in the (begin , end ) range. [transfer none]
|
void rclib_db_playlist_move_to_another_catalog (RCLibDbPlaylistIter **iters
,guint num
,RCLibDbCatalogIter *catalog_iter
);
Move the playlist data pointed to by iters to another catalog pointed to by catalog_iter. Must be called in main thread.
|
an iter array |
|
the size of the iter array |
|
the iter for the catalog |
GPtrArray * rclib_db_playlist_query (RCLibDbCatalogIter *catalog_iter
,RCLibDbQuery *query
,GCancellable *cancellable
);
Query data from the playlist library. MT safe.
|
the catalog to query, set to NULL to query in all catalogs |
|
the query condition |
|
optional GCancellable object, NULL to ignore. [allow-none] |
Returns : |
The playlist data array which satisfied
the query condition. Free with #g_ptr_array_free() or
#g_ptr_array_unref() after usage. [transfer full]
|
GPtrArray * rclib_db_playlist_query_get_iters (RCLibDbCatalogIter *catalog_iter
,RCLibDbQuery *query
,GCancellable *cancellable
);
Query data from the playlist library, and get an array of iters which satisfied the query condition. MT safe.
|
the catalog to query, set to NULL to query in all catalogs |
|
the query condition |
|
optional GCancellable object, NULL to ignore. [allow-none] |
Returns : |
The playlist iter array which satisfied
the query condition. Free with #g_ptr_array_free() or
#g_ptr_array_unref() after usage. [transfer full]
|
void rclib_db_playlist_refresh (RCLibDbCatalogIter *iter
);
Refresh the metadata of the music in the playlist pointed to by the given catalog iter. MT safe.
|
the catalog iter |
void rclib_db_playlist_reorder (RCLibDbCatalogIter *iter
,gint *new_order
);
Reorder the playlist to follow the order indicated by new_order
.
Must be called in main thread.
|
the iter pointed to catalog |
|
an array of integers mapping the new position of
each child to its old position before the re-ordering,
i.e. new_order [newpos] = oldpos . [array]
|
void rclib_db_playlist_update_metadata (RCLibDbPlaylistIter *iter
,const RCLibDbPlaylistData *data
);
Update the metadata in the playlist pointed to by iter. Title, artist, album, file type, track number, year information will be updated. Must be called in main thread.
|
the iter to the playlist |
|
the new metadata |
gboolean rclib_db_query_concatenate (RCLibDbQuery *target
,const RCLibDbQuery *src
);
Appends src
to target
.
|
query to append to |
|
query to append |
Returns : |
Whether the concatenate succeeded. |
RCLibDbQuery * rclib_db_query_copy (const RCLibDbQuery *query
);
Create a new query copied from the given query.
|
the query to copy |
Returns : |
A new copied query. Must be freed after usage. [transfer full] |
void rclib_db_query_free (RCLibDbQuery *query
);
Free the query.
|
the query to free |
GType rclib_db_query_get_query_data_type (RCLibDbQueryDataType query_type
);
Get the query data type.
|
the RCLibDbQueryDataType |
Returns : |
The GType of the given query data type |
RCLibDbQuery * rclib_db_query_parse (RCLibDbQueryConditionType condition1
,...
);
Create a query from a list of criteria.
|
the first query condition |
|
the query condition arguments, finished with RCLIB_DB_QUERY_CONDITION_TYPE_NONE |
Returns : |
A new created query. Must be freed after usage. [transfer full] |
RCLibDbQuery * rclib_db_query_parse_valist (RCLibDbQueryConditionType condition1
,va_list args
);
Create a query from a list of criteria in the variable list.
|
the first query condition |
|
a list of parameters which contain the query conditions |
Returns : |
A new created query. Must be freed after usage. [transfer full] |
void rclib_db_refresh_cancel ();
Cancel all remaining refresh jobs in the queue.
gint rclib_db_refresh_queue_get_length ();
Get the number of remaining jobs in the refresh queue.
Returns : |
The number of remaining jobs. |
gulong rclib_db_signal_connect (const gchar *name
,GCallback callback
,gpointer data
);
Connect the GCallback function to the given signal for the running instance of RCLibDb object.
|
the name of the signal |
|
the the GCallback to connect. [scope call] |
|
the user data |
Returns : |
The handler ID. |
void rclib_db_signal_disconnect (gulong handler_id
);
Disconnects a handler from the running RCLibDb instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. The handler_id becomes invalid and may be reused.
|
handler id of the handler to be disconnected |
gboolean rclib_db_sync ();
Save the database (if modified) to disk.
Returns : |
Whether the operation succeeded. |
"catalog-added"
signalvoid user_function (RCLibDb *db,
gpointer iter,
gpointer user_data) : Run First
The ::catalog-added signal is emitted when a new item has been added to the catalog.
|
the RCLibDb that received the signal |
|
the iter pointed to the added item |
|
user data set when the signal handler was connected. |
"catalog-changed"
signalvoid user_function (RCLibDb *db,
gpointer iter,
gpointer user_data) : Run First
The ::catalog-changed signal is emitted when an item has been changed in the catalog.
|
the RCLibDb that received the signal |
|
the iter pointed to the changed item |
|
user data set when the signal handler was connected. |
"catalog-delete"
signalvoid user_function (RCLibDb *db,
gpointer iter,
gpointer user_data) : Run First
The ::catalog-delete signal is emitted before an item in the catalog is about to be deleted.
|
the RCLibDb that received the signal |
|
the iter pointed to the item which is about to be deleted |
|
user data set when the signal handler was connected. |
"catalog-reordered"
signalvoid user_function (RCLibDb *db,
gpointer new_order,
gpointer user_data) : Run First
The ::catalog-reordered signal is emitted when the catalog items have been reordered.
|
the RCLibDb that received the signal |
|
an array of integers mapping the current position of each
catalog item to its old position before the re-ordering,
i.e. new_order [newpos] = oldpos
|
|
user data set when the signal handler was connected. |
"import-updated"
signalvoid user_function (RCLibDb *db,
gint remaining,
gpointer user_data) : Run First
The ::import-updated signal is emitted when a job in the import queue have been processed.
|
the RCLibDb that received the signal |
|
the number of remaing jobs in current import queue |
|
user data set when the signal handler was connected. |
"library-added"
signalvoid user_function (RCLibDb *db,
gchar *uri,
gpointer user_data) : Run First
The ::library-added signal is emitted when a new music item is added to the music library. This signal is emitted in main thread.
|
the RCLibDb that received the signal |
|
the new URI added to the music library |
|
user data set when the signal handler was connected. |
"library-changed"
signalvoid user_function (RCLibDb *db,
gchar *uri,
gpointer user_data) : Run First
The ::library-added signal is emitted when the data of the music item in the music library is changed. This signal is emitted in main thread.
|
the RCLibDb that received the signal |
|
the URI of the music item that changed in the music library |
|
user data set when the signal handler was connected. |
"library-deleted"
signalvoid user_function (RCLibDb *db,
gchar *uri,
gpointer user_data) : Run First
The ::library-deleted signal is emitted when the data of the music item in the music library is removed. This signal is emitted in main thread.
|
the RCLibDb that received the signal |
|
the URI of the music item which is about to be deleted |
|
user data set when the signal handler was connected. |
"playlist-added"
signalvoid user_function (RCLibDb *db,
gpointer iter,
gpointer user_data) : Run First
The ::playlist-added signal is emitted when a new item has been added to the playlist.
|
the RCLibDb that received the signal |
|
the iter pointed to the added item |
|
user data set when the signal handler was connected. |
"playlist-changed"
signalvoid user_function (RCLibDb *db,
gpointer iter,
gpointer user_data) : Run First
The ::playlist-changed signal is emitted when an item has been changed in the playlist.
|
the RCLibDb that received the signal |
|
the iter pointed to the changed item |
|
user data set when the signal handler was connected. |
"playlist-delete"
signalvoid user_function (RCLibDb *db,
gpointer iter,
gpointer user_data) : Run First
The ::playlist-delete signal is emitted before an item in the playlist is about to be deleted.
|
the RCLibDb that received the signal |
|
the iter pointed to the item which is about to be deleted |
|
user data set when the signal handler was connected. |
"playlist-reordered"
signalvoid user_function (RCLibDb *db,
gpointer iter,
gpointer new_order,
gpointer user_data) : Run First
The ::playlist-reordered signal is emitted when the catalog items have been reordered.
|
the RCLibDb that received the signal |
|
the iter pointed to the catalog item which contains the reordered playlist items |
|
an array of integers mapping the current position of each
playlist item to its old position before the re-ordering,
i.e. new_order [newpos] = oldpos
|
|
user data set when the signal handler was connected. |
"refresh-updated"
signalvoid user_function (RCLibDb *db,
gint remaining,
gpointer user_data) : Run First
The ::refresh-updated signal is emitted when a job in the refresh queue have been processed.
|
the RCLibDb that received the signal |
|
the number of remaing jobs in current refresh queue |
|
user data set when the signal handler was connected. |
"prop-added"
signalvoid user_function (RCLibDbLibraryQueryResult *qr,
guint prop_type,
gchar *prop_string,
gpointer user_data) : Run First
The ::query-result-changed signal is emitted when new property item
which the prop
)_string pointed to has been added.
|
the RCLibDb that received the signal |
|
the property type |
|
the property text of the new item |
|
user data set when the signal handler was connected. |
"prop-changed"
signalvoid user_function (RCLibDbLibraryQueryResult *qr,
guint prop_type,
gchar *prop_string,
gpointer user_data) : Run First
The ::query-result-changed signal is emitted when the property item
which the prop_string
pointed to has been changed.
|
the RCLibDb that received the signal |
|
the property type |
|
the property text of the item |
|
user data set when the signal handler was connected. |
"prop-delete"
signalvoid user_function (RCLibDbLibraryQueryResult *qr,
guint prop_type,
gchar *prop_string,
gpointer user_data) : Run First
The ::query-result-changed signal is emitted when the property item
which the prop_string
pointed to is about to be deleted.
|
the RCLibDb that received the signal |
|
the property type |
|
the property text of the item |
|
user data set when the signal handler was connected. |
"prop-reordered"
signalvoid user_function (RCLibDbLibraryQueryResult *qr,
guint prop_type,
gpointer new_order,
gpointer user_data) : Run First
The ::prop-reordered signal is emitted when the query result property items have been reordered.
|
the RCLibDb that received the signal |
|
the property type |
|
an array of integers mapping the current position of each
playlist item to its old position before the re-ordering,
i.e. new_order [newpos] = oldpos
|
|
user data set when the signal handler was connected. |
"query-result-added"
signalvoid user_function (RCLibDbLibraryQueryResult *qr,
gchar *uri,
gpointer user_data) : Run First
The ::query-result-added signal is emitted when a new item has been added to the query result.
|
the RCLibDb that received the signal |
|
the URI of the added item |
|
user data set when the signal handler was connected. |
"query-result-changed"
signalvoid user_function (RCLibDbLibraryQueryResult *qr,
gchar *uri,
gpointer user_data) : Run First
The ::query-result-changed signal is emitted when the uri
which
pointed to the item has been changed.
|
the RCLibDb that received the signal |
|
the URI of the changed item |
|
user data set when the signal handler was connected. |
"query-result-delete"
signalvoid user_function (RCLibDbLibraryQueryResult *qr,
gchar *uri,
gpointer user_data) : Run First
The ::query-result-delete signal is emitted before the uri
which
pointed to the item removed from the query result.
|
the RCLibDb that received the signal |
|
the URI of the deleted item |
|
user data set when the signal handler was connected. |
"query-result-reordered"
signalvoid user_function (RCLibDbLibraryQueryResult *qr,
gpointer new_order,
gpointer user_data) : Run First
The ::query-result-reordered signal is emitted when the query result items have been reordered.
|
the RCLibDb that received the signal |
|
an array of integers mapping the current position of each
playlist item to its old position before the re-ordering,
i.e. new_order [newpos] = oldpos
|
|
user data set when the signal handler was connected. |