RB.RhythmDBQueryModel¶
- Subclasses:
None
Methods¶
- Inherited:
GObject.Object (37), Gtk.TreeModel (28), RB.RhythmDBQueryResults (2)
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
|
|
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/c |
|||
r/w/co |
|
||
r/w/co |
type of limit |
||
r/w/co |
value of limit |
||
r/w |
RhythmDBQuery |
||
r/w/c |
if |
||
r/w |
Sort data |
||
r/w |
Sort data destroy function |
||
r/w |
Sort function |
||
r/w |
Reverse sort order flag |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when the database query populating the model is complete. |
|
Emitted when an entry in the query model is changed. |
|
Emitted when an entry is removed from the model. |
|
Emitted when an entry is being added to a model by drag-and-drop. |
|
Emitted when a URI that does not match an existing |
|
Emitted after an entry has been removed from the model. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class RB.RhythmDBQueryModel(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod album_sort_func(a, b, data)¶
- Parameters:
a (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
b (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
- Returns:
result of sort comparison between a and b.
- Return type:
Sort function for sorting by album. Sorts by album, then disc number, then track number, then title.
- classmethod artist_sort_func(a, b, data)¶
- Parameters:
a (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
b (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
- Returns:
result of sort comparison between a and b.
- Return type:
Sort function for sorting by artist. Sorts by artist, then album, then disc number, then track number, then title.
- classmethod bitrate_sort_func(a, b, data)¶
- Parameters:
a (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
b (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
- Returns:
result of sort comparison between a and b.
- Return type:
Sort function for sorting by bitrate. Lossless encodings (as identified by media type) are considered to have the highest possible bitrate. Falls back to sorting by location for equal bitrates.
- classmethod composer_sort_func(a, b, data)¶
- Parameters:
a (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
b (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
- Returns:
result of sort comparison between a and b.
- Return type:
Sort function for sorting by composer. Sorts by composer, then album, then disc number, then track number, then title.
- classmethod date_sort_func(a, b, data)¶
- Parameters:
a (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
b (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
- Returns:
result of sort comparison between a and b.
- Return type:
Sort function for sorting by release date. Falls back to album sort order for equal dates.
- classmethod double_ceiling_sort_func(a, b, data)¶
- Parameters:
a (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
b (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
- Returns:
result of sort comparison between a and b.
- Return type:
Sort function for sorting by a rounded floating point value. The property value is rounded up to an integer value for sorting. If the values are the same, falls back to sorting by location.
- classmethod genre_sort_func(a, b, data)¶
- Parameters:
a (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
b (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
- Returns:
result of sort comparison between a and b.
- Return type:
Sort function for sorting by genre. Sorts by genre, then artist, then album, then disc number, then track number, then title.
- classmethod location_sort_func(a, b, data)¶
- Parameters:
a (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
b (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
- Returns:
result of sort comparison between a and b.
- Return type:
Sort function for sorting by location.
- classmethod new_empty(db)¶
- Parameters:
db (
RB.RhythmDB
) – theRB.RhythmDB
- Returns:
the newly constructed query model
- Return type:
Constructs a new empty query model with no query or sorting parameters. This should only be used when the query model will be populated by explicitly adding entries.
- classmethod new_for_entry_type(db, entry_type, show_hidden)¶
- Parameters:
db (
RB.RhythmDB
) – theRB.RhythmDB
entry_type (
RB.RhythmDBEntryType
) – theRB.RhythmDBEntryType
to display
- Returns:
the newly constructed query model
- Return type:
- classmethod string_sort_func(a, b, data)¶
- Parameters:
a (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
b (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
- Returns:
result of sort comparison between a and b.
- Return type:
Sort function for sorting by a single string property Falls back to location sort order if the strings are equal.
- classmethod title_sort_func(a, b, data)¶
- Parameters:
a (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
b (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
- Returns:
result of sort comparison between a and b.
- Return type:
Sort function for sorting by title. Falls back to sorting by location if the titles are the same.
- classmethod track_sort_func(a, b, data)¶
- Parameters:
a (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
b (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
- Returns:
result of sort comparison between a and b.
- Return type:
Sort function for sorting by track. Sorts by artist, then album, then disc number, then track number, then title.
- classmethod ulong_sort_func(a, b, data)¶
- Parameters:
a (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
b (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
- Returns:
result of sort comparison between a and b.
- Return type:
Sort function for sorting by an unsigned integer property value. If the values are the same, falls back to sorting by location.
- add_entry(entry, index)¶
- Parameters:
entry (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
to addindex (
int
) – position at which to add it, or -1 to add at the end
Adds an entry to the query model at the specified position. Does not check if the entry matches the query (if any).
- chain(base, import_entries)¶
- Parameters:
base (
RB.RhythmDBQueryModel
) – theRB.RhythmDBQueryModel
to chain it toimport_entries (
bool
) – ifTrue
, copy all existing entries from base to self
Chains self to base. All changes made to the base model will be reflected in the child model, and all changes made to the child model will be passed on to the base model.
- compute_status_normal(singular, plural)¶
- Parameters:
- Returns:
allocated status string, to be freed by the caller.
- Return type:
Constructs a status string describing the contents of the model.
- copy_contents(src)¶
- Parameters:
src (
RB.RhythmDBQueryModel
) – sourceRB.RhythmDBQueryModel
Copies all entries from src to self.
- entry_to_iter(entry, iter)¶
- Parameters:
entry (
RB.RhythmDBEntry
) – theRB.RhythmDBEntry
to look upiter (
Gtk.TreeIter
) – holds the returnedGtk.TreeIter
- Returns:
True
if the iterator now points to the entry- Return type:
Creates a
Gtk.TreeIter
pointing to the specified entry in the model.
- get_duration()¶
- Returns:
the total duration (in seconds) of all entries in the model
- Return type:
Returns the total duration of all entries in the model.
- get_next_from_entry(entry)¶
- Parameters:
entry (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
- Returns:
the next
RB.RhythmDBEntry
in the model, if any- Return type:
Locates and returns the next
RB.RhythmDBEntry
in the model after the specified entry. The caller owns a reference to the returned entry.
- get_previous_from_entry(entry)¶
- Parameters:
entry (
RB.RhythmDBEntry
) – aRB.RhythmDBEntry
- Returns:
the previous
RB.RhythmDBEntry
in the model, if any- Return type:
Locates and returns the
RB.RhythmDBEntry
in the model before the specified entry. The caller owns a reference to the returned entry.
- get_size()¶
- Returns:
the total size (in bytes) of all entries in the model
- Return type:
Returns the total size of all entries in the model.
- has_pending_changes()¶
-
Checks if a
RB.RhythmDBQueryModel
has any outstanding changes that are yet to be processed. This is not very useful.
- iter_to_entry(entry_iter)¶
- Parameters:
entry_iter (
Gtk.TreeIter
) – aGtk.TreeIter
to dereference- Returns:
the
RB.RhythmDBEntry
, if any- Return type:
Locates and returns the
RB.RhythmDBEntry
pointed to by the specified iterator in the model. The caller owns a reference to the returned entry.
- move_entry(entry, index)¶
- Parameters:
entry (
RB.RhythmDBEntry
) – theRB.RhythmDBEntry
to moveindex (
int
) – position to move to
Moves an entry to a new position in the query model. The position must be a between 0 and the number of entries in the model. Specifying -1 does not move the entry to the end of the model.
- reapply_query(filter)¶
-
Reapplies the existing query to the entries in the model. This is mostly useful when the query contains relative time criteria (such as ‘not played in the last hour’). This will only remove entries that are already in the model, it will not find entries that previously did not match the query.
The ‘filter’ parameter should be set to
True
when the query is being used as a filter, rather than to define a base set of entries.
- remove_entry(entry)¶
- Parameters:
entry (
RB.RhythmDBEntry
) – theRB.RhythmDBEntry
to remove- Returns:
True
if the entry was removed- Return type:
Removes an entry from the query model.
- set_sort_order(sort_func, sort_data, sort_reverse)¶
- Parameters:
sort_func (
GLib.CompareDataFunc
) – new sort functionsort_data (
object
orNone
) – data to pass to the new sort function
Sets a new sort order on the model. This reorders the entries in the model to match the new sort order.
- shuffle_entries()¶
Shuffles the entries in the model into a new random order.
- tree_path_to_entry(path)¶
- Parameters:
path (
Gtk.TreePath
) – aGtk.TreePath
- Returns:
the
RB.RhythmDBEntry
, if any- Return type:
Locates the
RB.RhythmDBEntry
identified by the specified path in the model. The caller owns a reference to the returned entry.
- do_complete() virtual¶
- do_entry_prop_changed(entry, prop, old, new_value) virtual¶
- Parameters:
entry (
RB.RhythmDBEntry
) –prop (
RB.RhythmDBPropType
) –old (
GObject.Value
) –new_value (
GObject.Value
) –
- do_entry_removed(entry) virtual¶
- Parameters:
entry (
RB.RhythmDBEntry
) –
- do_filter_entry_drop(entry) virtual¶
- Parameters:
entry (
RB.RhythmDBEntry
) –- Return type:
- do_post_entry_delete(entry) virtual¶
- Parameters:
entry (
RB.RhythmDBEntry
) –
Signal Details¶
- RB.RhythmDBQueryModel.signals.complete(rhythm_d_b_query_model)¶
- Signal Name:
complete
- Flags:
- Parameters:
rhythm_d_b_query_model (
RB.RhythmDBQueryModel
) – The object which received the signal
Emitted when the database query populating the model is complete.
- RB.RhythmDBQueryModel.signals.entry_prop_changed(rhythm_d_b_query_model, entry, prop, old, new_value)¶
- Signal Name:
entry-prop-changed
- Flags:
- Parameters:
rhythm_d_b_query_model (
RB.RhythmDBQueryModel
) – The object which received the signalentry (
RB.RhythmDBEntry
) – theRB.RhythmDBEntry
that changedprop (
int
) – theRB.RhythmDBPropType
that was changed
Emitted when an entry in the query model is changed. When multiple properties are changed, the entry-prop-changed signals will be emitted in the order that the changes were made. At the point that the signal is emitted, all changes have already been applied to the
RB.RhythmDBEntry
.
- RB.RhythmDBQueryModel.signals.entry_removed(rhythm_d_b_query_model, entry)¶
- Signal Name:
entry-removed
- Flags:
- Parameters:
rhythm_d_b_query_model (
RB.RhythmDBQueryModel
) – The object which received the signalentry (
RB.RhythmDBEntry
) – theRB.RhythmDBEntry
that was removed
Emitted when an entry is removed from the model. There is some difference between this and the
Gtk.TreeModel
row-removed signal but I don’t know what it is right now.
- RB.RhythmDBQueryModel.signals.filter_entry_drop(rhythm_d_b_query_model, entry)¶
- Signal Name:
filter-entry-drop
- Flags:
- Parameters:
rhythm_d_b_query_model (
RB.RhythmDBQueryModel
) – The object which received the signalentry (
RB.RhythmDBEntry
) – theRB.RhythmDBEntry
being dropped
- Return type:
Emitted when an entry is being added to a model by drag-and-drop. This allows the owner of the model to filter out entries that should not be added to the model (based on entry type, for instance). If the signal handler returns
False
, the entry will not be added.
- RB.RhythmDBQueryModel.signals.non_entry_dropped(rhythm_d_b_query_model, uri, position)¶
- Signal Name:
non-entry-dropped
- Flags:
- Parameters:
rhythm_d_b_query_model (
RB.RhythmDBQueryModel
) – The object which received the signaluri (
str
) – the URI that was droppedposition (
int
) – the position in the query model at which it was dropped
Emitted when a URI that does not match an existing
RB.RhythmDBEntry
is dropped into the query model.
- RB.RhythmDBQueryModel.signals.post_entry_delete(rhythm_d_b_query_model, entry)¶
- Signal Name:
post-entry-delete
- Flags:
- Parameters:
rhythm_d_b_query_model (
RB.RhythmDBQueryModel
) – The object which received the signalentry (
RB.RhythmDBEntry
) – theRB.RhythmDBEntry
that was removed
Emitted after an entry has been removed from the model.
Property Details¶
- RB.RhythmDBQueryModel.props.base_model¶
- Name:
base-model
- Type:
- Default Value:
- Flags:
- RB.RhythmDBQueryModel.props.db¶
- Name:
db
- Type:
- Default Value:
- Flags:
RB.RhythmDB
object
- RB.RhythmDBQueryModel.props.limit_type¶
- Name:
limit-type
- Type:
- Default Value:
- Flags:
type of limit
- RB.RhythmDBQueryModel.props.limit_value¶
- Name:
limit-value
- Type:
- Default Value:
- Flags:
value of limit
- RB.RhythmDBQueryModel.props.query¶
-
RhythmDBQuery
-
if
True
, include entries that are ordinarily hidden
- RB.RhythmDBQueryModel.props.sort_data¶
-
Sort data
- RB.RhythmDBQueryModel.props.sort_data_destroy¶
-
Sort data destroy function
- RB.RhythmDBQueryModel.props.sort_func¶
-
Sort function