RB.RhythmDBEntry¶
Fields¶
None
Methods¶
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class RB.RhythmDBEntry¶
- classmethod example_new(db, type, uri)¶
- Parameters:
db (
RB.RhythmDB
) – aRB.RhythmDB
.type (
RB.RhythmDBEntryType
) – type of entry to createuri (
str
) – the location of the entry, this be unique amongst all entries.
- Returns:
the newly created
RB.RhythmDBEntry
- Return type:
Creates a new sample entry of type type and location uri, it does not insert it into the database. This is indended for use as a example entry.
This may return
None
if entry creation fails.
- classmethod new(db, type, uri)¶
- Parameters:
db (
RB.RhythmDB
) – aRB.RhythmDB
.type (
RB.RhythmDBEntryType
) – type of entry to createuri (
str
) – the location of the entry, this be unique amongst all entries.
- Returns:
the newly created
RB.RhythmDBEntry
- Return type:
Creates a new entry of type type and location uri, and inserts it into the database. You must call
RB.RhythmDB.commit
() at some point after invoking this function.This may return
None
if entry creation fails. This can occur if there is already an entry with the given uri.
- apply_cached_metadata(metadata)¶
- Parameters:
metadata ([
RB.RhythmDBEntryChange
]) – cached metadata to apply
Applies a set of metadata properties to self. The metadata should be in the form returned by rhythmdb_entry_type_fetch_metadata.
- cache_metadata()¶
Stores metadata for self in the metadata cache (if any) for its entry type.
- can_sync_metadata()¶
-
Calls the entry type’s method to check if it can sync metadata for self. Usually this is only true for entries backed by files, where tag-writing is enabled, and the appropriate tag-writing facilities are available.
- create_ext_db_key(prop)¶
- Parameters:
prop (
RB.RhythmDBPropType
) – the primaryRB.RhythmDBPropType
for metadata lookups- Returns:
the new
RB.ExtDBKey
- Return type:
Creates a
RB.ExtDBKey
for finding external metadata for a given property. This is mostly useful for finding album or track related data.
- created()¶
Calls the entry type’s post-creation method for self.
- dup_string(propid)¶
- Parameters:
propid (
RB.RhythmDBPropType
) –- Return type:
- get_boolean(propid)¶
- Parameters:
propid (
RB.RhythmDBPropType
) – property to return- Returns:
property value
- Return type:
Returns the value of a boolean property of self.
- get_double(propid)¶
- Parameters:
propid (
RB.RhythmDBPropType
) – the property to return- Returns:
property value
- Return type:
Returns the value of a double-precision floating point property of value.
- get_entry_type()¶
- Returns:
the
RB.RhythmDBEntryType
for self- Return type:
Returns the
RB.RhythmDBEntryType
for self. This is used to access entry type properties, to check that entries are of the same type, and to call entry type methods.
- get_object(propid)¶
- Parameters:
propid (
RB.RhythmDBPropType
) – the property to return- Returns:
property value
- Return type:
Returns the value of an object property of self.
- get_playback_uri()¶
-
Returns an allocated string containing the playback URI for self, or
None
if the entry cannot be played.
- get_refstring(propid)¶
- Parameters:
propid (
RB.RhythmDBPropType
) – the property to return- Returns:
a
RB.RefString
, must be unreffed by caller.- Return type:
Returns an
RB.RefString
containing a string property of self.
- get_string(propid)¶
- Parameters:
propid (
RB.RhythmDBPropType
) – theRB.RhythmDBPropType
to return- Returns:
property value, must not be freed
- Return type:
Returns the value of a string property of #entry.
- get_type_data(expected_size)¶
- Parameters:
expected_size (
int
) – expected size of the type-specific data.- Returns:
type-specific data pointer
- Return type:
Retrieves a pointer to the entry’s type-specific data, checking that the size of the data structure matches what is expected. Callers should use the RHYTHMDB_ENTRY_GET_TYPE_DATA macro for a slightly more friendly interface to this functionality.
- get_uint64(propid)¶
- Parameters:
propid (
RB.RhythmDBPropType
) – property to return- Returns:
property value
- Return type:
Returns the value of a 64bit unsigned integer property.
- get_ulong(propid)¶
- Parameters:
propid (
RB.RhythmDBPropType
) – property to return- Returns:
property value
- Return type:
Returns the value of an unsigned long integer property of self.
- is_lossless()¶
-
Checks if self represents a file that is losslessly encoded. An entry is considered lossless if it has no bitrate value and its media type is “audio/x-flac”. Other lossless encoding types may be added in the future.
- pre_destroy()¶
Calls the entry type’s pre-deletion method for self.
- ref()¶
- Returns:
the entry
- Return type:
Increase the reference count of the entry.
- sync_metadata(changes)¶
- Parameters:
changes ([
RB.RhythmDBEntryChange
]) – a list ofRB.RhythmDBEntryChange
structures- Raises:
Calls the entry type’s method to sync metadata changes for self.
- unref()¶
Decrease the reference count of the entry, and destroys it if there are no references left.
- update_availability(avail)¶
- Parameters:
avail (
RB.RhythmDBEntryAvailability
) – an availability event
Updates self to reflect its new availability.