### Class

# RB PlayOrder

#### Description [src]

    class RB.PlayOrder : GObject.Object
    {
      RBPlayOrderPrivate* priv
    }

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.

#### Ancestors

- GObject

#### Instance methods

###### rb_play_order_get_db

Only for use by `RBPlayOrder` subclasses.

###### rb_play_order_get_next

Returns the next entry in the play order, or the first if not currently playing.

###### rb_play_order_get_player

Only for use by `RBPlayOrder` subclasses.

###### rb_play_order_get_playing_entry

Returns the current playing entry in the play order.

###### rb_play_order_get_previous

Returns the previous entry in the play order, or NULL if not currently playing.

###### rb_play_order_get_query_model

Only for use by `RBPlayOrder` subclasses.

###### rb_play_order_get_source

Only for use by `RBPlayOrder` subclasses.

###### rb_play_order_go_next

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.

###### rb_play_order_go_previous

Moves to the previous entry in the play order. If not currently playing, does nothing.

###### rb_play_order_has_next

If there is no current playing entry, returns true if the play order is non-empty.

###### rb_play_order_has_previous

Returns `TRUE` if there is an entry before the current entry in the play order. If not currently playing, returns `FALSE`.

###### rb_play_order_model_not_empty

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.

###### rb_play_order_player_is_playing

Returns `TRUE` if there is a current playing entry in the play order.

###### rb_play_order_playing_source_changed

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.

###### rb_play_order_query_model_changed

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`.

###### rb_play_order_set_playing_entry

Sets the playing entry in the play order.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### RB.PlayOrder:player

The `RBShellPlayer` instance.

###### RB.PlayOrder:playing-entry

The current playing `RhythmDBEntry`.

#### Signals

###### RB.PlayOrder::have-next-previous-changed

Emitted as a hint to suggest that the sensitivity of next/previous buttons may need to be updated.

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct RBPlayOrderClass {
      GObjectClass parent_class;
      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
      );
      gboolean (* has_next) (
        RBPlayOrder* porder
      );
      RhythmDBEntry* (* get_next) (
        RBPlayOrder* porder
      );
      void (* go_next) (
        RBPlayOrder* porder
      );
      gboolean (* has_previous) (
        RBPlayOrder* porder
      );
      RhythmDBEntry* (* get_previous) (
        RBPlayOrder* porder
      );
      void (* go_previous) (
        RBPlayOrder* porder
      );
      void (* have_next_previous_changed) (
        RBPlayOrder* porder,
        gboolean have_next,
        gboolean have_previous
      );

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  No description available.

`playing_source_changed: void (* playing_source_changed) ( RBPlayOrder* porder )`

  No description available.

`db_changed: void (* db_changed) ( RBPlayOrder* porder, RhythmDB* new_db )`

  No description available.

`playing_entry_changed: void (* playing_entry_changed) ( RBPlayOrder* porder, RhythmDBEntry* old_entry, RhythmDBEntry* new_entry )`

  No description available.

`entry_added: void (* entry_added) ( RBPlayOrder* porder, RhythmDBEntry* entry )`

  No description available.

`entry_removed: void (* entry_removed) ( RBPlayOrder* porder, RhythmDBEntry* entry )`

  No description available.

`query_model_changed: void (* query_model_changed) ( RBPlayOrder* porder )`

  No description available.

`db_entry_deleted: void (* db_entry_deleted) ( RBPlayOrder* porder, RhythmDBEntry* entry )`

  No description available.

`playing_entry_removed: void (* playing_entry_removed) ( RBPlayOrder* porder, RhythmDBEntry* entry )`

  No description available.

`has_next: gboolean (* has_next) ( RBPlayOrder* porder )`

  No description available.

`get_next: RhythmDBEntry* (* get_next) ( RBPlayOrder* porder )`

  No description available.

`go_next: void (* go_next) ( RBPlayOrder* porder )`

  No description available.

`has_previous: gboolean (* has_previous) ( RBPlayOrder* porder )`

  No description available.

`get_previous: RhythmDBEntry* (* get_previous) ( RBPlayOrder* porder )`

  No description available.

`go_previous: void (* go_previous) ( RBPlayOrder* porder )`

  No description available.

`have_next_previous_changed: void (* have_next_previous_changed) ( RBPlayOrder* porder, gboolean have_next, gboolean have_previous )`

  No description available.

#### Virtual methods

###### RB.PlayOrderClass.db_changed

No description available.

###### RB.PlayOrderClass.db_entry_deleted

No description available.

###### RB.PlayOrderClass.entry_added

No description available.

###### RB.PlayOrderClass.entry_removed

No description available.

###### RB.PlayOrderClass.get_next

Returns the next entry in the play order, or the first if not currently playing.

###### RB.PlayOrderClass.get_previous

Returns the previous entry in the play order, or NULL if not currently playing.

###### RB.PlayOrderClass.go_next

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.

###### RB.PlayOrderClass.go_previous

Moves to the previous entry in the play order. If not currently playing, does nothing.

###### RB.PlayOrderClass.has_next

If there is no current playing entry, returns true if the play order is non-empty.

###### RB.PlayOrderClass.has_previous

Returns `TRUE` if there is an entry before the current entry in the play order. If not currently playing, returns `FALSE`.

###### RB.PlayOrderClass.have_next_previous_changed

No description available.

###### RB.PlayOrderClass.playing_entry_changed

No description available.

###### RB.PlayOrderClass.playing_entry_removed

No description available.

###### RB.PlayOrderClass.playing_source_changed

No description available.

###### RB.PlayOrderClass.query_model_changed

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`.