![]() |
![]() |
![]() |
Rhythmbox Development Reference Manual | ![]() |
---|---|---|---|---|
RBPlayOrder; RBPlayOrderClass; void rb_play_order_playing_source_changed (RBPlayOrder *porder, RBSource *source); void rb_play_order_query_model_changed (RBPlayOrder *porder); gboolean rb_play_order_has_next (RBPlayOrder *porder); RhythmDBEntry* rb_play_order_get_next (RBPlayOrder *porder); void rb_play_order_go_next (RBPlayOrder *porder); gboolean rb_play_order_has_previous (RBPlayOrder *porder); RhythmDBEntry* rb_play_order_get_previous (RBPlayOrder *porder); void rb_play_order_go_previous (RBPlayOrder *porder); void rb_play_order_set_playing_entry (RBPlayOrder *porder, RhythmDBEntry *entry); RhythmDBEntry* rb_play_order_get_playing_entry (RBPlayOrder *porder); RBShellPlayer* rb_play_order_get_player (RBPlayOrder *porder); RBSource* rb_play_order_get_source (RBPlayOrder *porder); RhythmDB* rb_play_order_get_db (RBPlayOrder *porder); RhythmDBQueryModel* rb_play_order_get_query_model (RBPlayOrder *porder); gboolean rb_play_order_model_not_empty (RBPlayOrder *porder);
"player" RBShellPlayer* : Read / Write / Construct Only "playing-entry" RhythmDBEntry* : Read / Write
A play order defines an ordering of the entries from a RhythmDBQueryModel that the RBShellPlayer uses to get the next or previous entry to play.
Play order methods are invoked when changes are made to the query model, when the query model is replaced, the playing source is changed, or a new playing entry is selected.
The play order must implement methods to check for, retrieve, and move to the next and previous entries in the play order. Only the go_next and go_previous methods actually change anything.
The play order should also emit the have-next-previous-changed signal to hint that the availability of either a next or previous entry in the order may have changed. This information is used to update the sensitivity of the next and previous buttons.
typedef struct { GObjectClass parent_class; /* EVENTS */ void (*playing_source_changed) (RBPlayOrder *porder); void (*db_changed) (RBPlayOrder *porder, RhythmDB *new_db); void (*playing_entry_changed) (RBPlayOrder *porder, RhythmDBEntry *old_entry, RhythmDBEntry *new_entry); void (*entry_added) (RBPlayOrder *porder, RhythmDBEntry *entry); void (*entry_removed) (RBPlayOrder *porder, RhythmDBEntry *entry); void (*query_model_changed) (RBPlayOrder *porder); void (*db_entry_deleted) (RBPlayOrder *porder, RhythmDBEntry *entry); void (*playing_entry_removed) (RBPlayOrder *porder, RhythmDBEntry *entry); /* QUERIES */ /* * Returns whether there is a next song. This controls the next * button's sensitivity. If not implemented, defaults to * get_next()!=NULL. * * Must not change any visible state. */ gboolean (*has_next) (RBPlayOrder* porder); /* * get_next() must return the next song to play. It's called when a * song finishes, when the user clicks the next button, and when the * user clicks play after playback is stopped. * * get_next() is also used to find the first song. You can figure out * whether the player is currently playing by calling * rb_play_order_player_is_playing(porder). * * Must not change any visible state. */ RhythmDBEntry* (*get_next) (RBPlayOrder* porder); /* * Tells the play order that the user has moved to the next song. * Should be called before the EntryView::playing-entry property is * changed. */ void (*go_next) (RBPlayOrder* porder); /* * Returns whether there is a previous song. This controls the previous * button's sensitivity. If not implemented, defaults to * get_previous()!=NULL. * * Must not change any visible state. */ gboolean (*has_previous) (RBPlayOrder* porder); /* * get_previous() must return the previous song to play. It's called * when the user clicks the previous button within 2 seconds of the * beginning of a song. * * Must not change any visible state. */ RhythmDBEntry* (*get_previous) (RBPlayOrder* porder); /* * Tells the play order that the user has moved to the previous song. * Should be called before the EntryView::playing-entry property is * changed. */ void (*go_previous) (RBPlayOrder* porder); /* SIGNALS */ void (*have_next_previous_changed) (RBPlayOrder *porder, gboolean have_next, gboolean have_previous); } RBPlayOrderClass;
void rb_play_order_playing_source_changed (RBPlayOrder *porder, RBSource *source);
Sets the playing RBSource for the play order. Should be called
by RBShellPlayer when the active source changes. Subclasses
should implement playing_source_changed()
to make any necessary
changes.
|
RBPlayOrder instance |
|
New playing RBSource |
void rb_play_order_query_model_changed (RBPlayOrder *porder);
Updates the RhythmDBQueryModel instance for the play order.
Called from the RBSource notify signal handler, and also from
rb_play_order_source_changed. Subclasses should implement
query_model_changed()
to make any necessary adjustments if they
store any state based on the contents of the RhythmDBQueryModel.
|
RBPlayOrder instance |
gboolean rb_play_order_has_next (RBPlayOrder *porder);
If there is no current playing entry, returns true if the play order is non-empty.
|
RBPlayOrder instance. |
Returns : |
true if there is an entry after the current playing entry in the play order. |
RhythmDBEntry* rb_play_order_get_next (RBPlayOrder *porder);
|
RBPlayOrder instance |
Returns : |
the next entry in the play order, or the first if not currently playing. |
void rb_play_order_go_next (RBPlayOrder *porder);
Moves to the next entry in the play order. If not currently playing, sets the first entry in the play order as the playing entry.
|
RBPlayOrder instance |
gboolean rb_play_order_has_previous (RBPlayOrder *porder);
|
RBPlayOrder instance |
Returns : |
true if there is an entry before the current entry in the play order. If not currently playing, returns false. |
RhythmDBEntry* rb_play_order_get_previous (RBPlayOrder *porder);
|
RBPlayOrder instance |
Returns : |
the previous entry in the play order, or NULL if not currently playing. |
void rb_play_order_go_previous (RBPlayOrder *porder);
Moves to the previous entry in the play order. If not currently playing, does nothing.
|
RBPlayOrder instance |
void rb_play_order_set_playing_entry (RBPlayOrder *porder, RhythmDBEntry *entry);
Sets the playing entry in the play order.
|
RBPlayOrder instance |
|
The new playing entry (or NULL for none) |
RhythmDBEntry* rb_play_order_get_playing_entry (RBPlayOrder *porder);
|
RBPlayOrder instance |
Returns : |
the current playing entry in the play order. |
RBShellPlayer* rb_play_order_get_player (RBPlayOrder *porder);
Only for use by RBPlayOrder subclasses.
|
RBPlayOrder instance |
Returns : |
RBShellPlayer instance |
RBSource* rb_play_order_get_source (RBPlayOrder *porder);
Only for use by RBPlayOrder subclasses.
|
RBPlayOrder instance |
Returns : |
the playing RBSource instance. |
RhythmDB* rb_play_order_get_db (RBPlayOrder *porder);
Only for use by RBPlayOrder subclasses.
|
RBPlayOrder instance |
Returns : |
the RhythmDB instance. |
RhythmDBQueryModel* rb_play_order_get_query_model (RBPlayOrder *porder);
Only for use by RBPlayOrder subclasses.
|
RBPlayOrder instance |
Returns : |
the active RhythmDBQueryModel for the playing source. |
gboolean rb_play_order_model_not_empty (RBPlayOrder *porder);
|
RBPlayOrder instance |
Returns : |
true if the RhythmDBQueryModel is not empty. Can be used to implement has_next and has_previous for play orders that have no beginning or end. |
"player"
property"player" RBShellPlayer* : Read / Write / Construct Only
The RBShellPlayer instance
"playing-entry"
property"playing-entry" RhythmDBEntry* : Read / Write
The current playing RhythmDBEntry
"have-next-previous-changed"
signalvoid user_function (RBPlayOrder *porder, gboolean have_next, gboolean have_previous, gpointer user_data) : Run Last
Emitted as a hint to suggest that the sensitivity of next/previous buttons may need to be updated.
|
the RBPlayOrder |
|
if TRUE , the play order has at least one more entry
|
|
if TRUE , the play order has at least one entry
before the current entry
|
|
user data set when the signal handler was connected. |