Top |
Functions
char * | (*RhythmDBEntryTypeStringFunc) () |
gboolean | (*RhythmDBEntryTypeBooleanFunc) () |
void | (*RhythmDBEntryTypeSyncFunc) () |
const char * | rhythmdb_entry_type_get_name () |
char * | rhythmdb_entry_get_playback_uri () |
void | rhythmdb_entry_update_availability () |
void | rhythmdb_entry_created () |
void | rhythmdb_entry_pre_destroy () |
gboolean | rhythmdb_entry_can_sync_metadata () |
void | rhythmdb_entry_sync_metadata () |
RhythmDBEntryType * | rhythmdb_get_song_entry_type () |
RhythmDBEntryType * | rhythmdb_get_error_entry_type () |
RhythmDBEntryType * | rhythmdb_get_ignore_entry_type () |
Properties
gchar * | cache-name | Read / Write / Construct Only |
RhythmDBEntryCategory | category | Read / Write / Construct Only |
RhythmDB * | db | Read / Write / Construct Only |
gchar * | name | Read / Write / Construct Only |
gboolean | save-to-disk | Read / Write / Construct Only |
guint | type-data-size | Read / Write / Construct Only |
Types and Values
enum | RhythmDBEntryCategory |
enum | RhythmDBEntryAvailability |
struct | RhythmDBEntryType |
struct | RhythmDBEntryTypeClass |
#define | RHYTHMDB_ENTRY_TYPE_SONG |
#define | RHYTHMDB_ENTRY_TYPE_IMPORT_ERROR |
#define | RHYTHMDB_ENTRY_TYPE_IGNORE |
Description
This is the base class for database entry type classes, which provide some aspects of the behaviour of database entry types. There are different entry types for songs, radio streams, podcast feeds and episodes, and so on.
Plugins written in Python or Vala can create new entry types by subclassing and overriding any methods required. Plugins written in C can create a new instance of the RhythmDBEntryType base class and use its function pointer members rather than subclassing.
Functions
RhythmDBEntryTypeStringFunc ()
char * (*RhythmDBEntryTypeStringFunc) (RhythmDBEntryType *entry_type
,RhythmDBEntry *entry
);
RhythmDBEntryTypeBooleanFunc ()
gboolean (*RhythmDBEntryTypeBooleanFunc) (RhythmDBEntryType *entry_type
,RhythmDBEntry *entry
);
RhythmDBEntryTypeSyncFunc ()
void (*RhythmDBEntryTypeSyncFunc) (RhythmDBEntryType *entry_type
,RhythmDBEntry *entry
,GSList *changes
,GError **error
);
rhythmdb_entry_type_get_name ()
const char *
rhythmdb_entry_type_get_name (RhythmDBEntryType *etype
);
Returns the name of the entry type
rhythmdb_entry_get_playback_uri ()
char *
rhythmdb_entry_get_playback_uri (RhythmDBEntry *entry
);
Returns an allocated string containing the playback URI for entry
,
or NULL if the entry cannot be played.
rhythmdb_entry_update_availability ()
void rhythmdb_entry_update_availability (RhythmDBEntry *entry
,RhythmDBEntryAvailability avail
);
Updates entry
to reflect its new availability.
rhythmdb_entry_created ()
void
rhythmdb_entry_created (RhythmDBEntry *entry
);
Calls the entry type's post-creation method for entry
.
rhythmdb_entry_pre_destroy ()
void
rhythmdb_entry_pre_destroy (RhythmDBEntry *entry
);
Calls the entry type's pre-deletion method for entry
.
rhythmdb_entry_can_sync_metadata ()
gboolean
rhythmdb_entry_can_sync_metadata (RhythmDBEntry *entry
);
Calls the entry type's method to check if it can sync metadata for entry
.
Usually this is only true for entries backed by files, where tag-writing is
enabled, and the appropriate tag-writing facilities are available.
rhythmdb_entry_sync_metadata ()
void rhythmdb_entry_sync_metadata (RhythmDBEntry *entry
,GSList *changes
,GError **error
);
Calls the entry type's method to sync metadata changes for entry
.
Parameters
entry |
a RhythmDBEntry |
|
changes |
a list of RhythmDBEntryChange structures. |
[element-type RB.RhythmDBEntryChange] |
error |
returns error information |
rhythmdb_get_song_entry_type ()
RhythmDBEntryType *
rhythmdb_get_song_entry_type (void
);
Returns the RhythmDBEntryType for normal songs.
rhythmdb_get_error_entry_type ()
RhythmDBEntryType *
rhythmdb_get_error_entry_type (void
);
Returns the RhythmDBEntryType for import errors
rhythmdb_get_ignore_entry_type ()
RhythmDBEntryType *
rhythmdb_get_ignore_entry_type (void
);
Returns the RhythmDBEntryType for ignored files
Types and Values
enum RhythmDBEntryCategory
Categories used to group entry types. These are used in a few places to control handling of entries.
enum RhythmDBEntryAvailability
Various events that can result in changes to the entry's availability.
struct RhythmDBEntryTypeClass
struct RhythmDBEntryTypeClass { GObjectClass parent_class; /* methods */ void (*entry_created) (RhythmDBEntryType *etype, RhythmDBEntry *entry); void (*destroy_entry) (RhythmDBEntryType *etype, RhythmDBEntry *entry); char * (*get_playback_uri) (RhythmDBEntryType *etype, RhythmDBEntry *entry); void (*update_availability) (RhythmDBEntryType *etype, RhythmDBEntry *entry, RhythmDBEntryAvailability avail); gboolean (*can_sync_metadata) (RhythmDBEntryType *etype, RhythmDBEntry *entry); void (*sync_metadata) (RhythmDBEntryType *etype, RhythmDBEntry *entry, GSList *changes, GError **error); char * (*uri_to_cache_key) (RhythmDBEntryType *etype, const char *uri); char * (*cache_key_to_uri) (RhythmDBEntryType *etype, const char *key); };
RHYTHMDB_ENTRY_TYPE_IMPORT_ERROR
#define RHYTHMDB_ENTRY_TYPE_IMPORT_ERROR (rhythmdb_get_error_entry_type ())
Property Details
The “cache-name”
property
“cache-name” gchar *
Metadata cache name. For entry types created by a plugin, should match the plugin name. If this is set, the entry type must also implement the uri_to_cache_key method.
Flags: Read / Write / Construct Only
Default value: NULL
The “category”
property
“category” RhythmDBEntryCategory
The RhythmDBEntryCategory that this entry type fits into.
Flags: Read / Write / Construct Only
Default value: RHYTHMDB_ENTRY_NORMAL
The “name”
property
“name” gchar *
Entry type name. This must be unique.
Flags: Read / Write / Construct Only
Default value: NULL
The “save-to-disk”
property
“save-to-disk” gboolean
If TRUE
, entries of this type should be written to the
on-disk database.
Flags: Read / Write / Construct Only
Default value: FALSE
The “type-data-size”
property
“type-data-size” guint
The size of the type-specific data structure to allocate for each entry of this type.
Flags: Read / Write / Construct Only
Default value: 0