RB.PlayOrder

g GObject.Object GObject.Object RB.PlayOrder RB.PlayOrder GObject.Object->RB.PlayOrder

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

get_db ()

get_next ()

get_player ()

get_playing_entry ()

get_previous ()

get_query_model ()

get_source ()

go_next ()

go_previous ()

has_next ()

has_previous ()

model_not_empty ()

player_is_playing ()

playing_source_changed (source)

query_model_changed ()

set_playing_entry (entry)

Virtual Methods

Inherited:

GObject.Object (7)

do_db_changed (new_db)

do_db_entry_deleted (entry)

do_entry_added (entry)

do_entry_removed (entry)

do_get_next ()

do_get_previous ()

do_go_next ()

do_go_previous ()

do_has_next ()

do_has_previous ()

do_have_next_previous_changed (have_next, have_previous)

do_playing_entry_changed (old_entry, new_entry)

do_playing_entry_removed (entry)

do_playing_source_changed ()

do_query_model_changed ()

Properties

Name

Type

Flags

Short Description

player

RB.ShellPlayer

r/w/co

Rhythmbox Player

playing-entry

RB.RhythmDBEntry

r/w

Playing entry

Signals

Inherited:

GObject.Object (1)

Name

Short Description

have-next-previous-changed

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

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class RB.PlayOrder(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

RB.PlayOrderClass

A play order defines an ordering of the entries from a RB.RhythmDBQueryModel that the RB.ShellPlayer 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.

get_db()
Returns:

the RB.RhythmDB instance.

Return type:

RB.RhythmDB

Only for use by RB.PlayOrder subclasses.

get_next()
Returns:

next entry to play

Return type:

RB.RhythmDBEntry

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

get_player()
Returns:

RB.ShellPlayer instance

Return type:

RB.ShellPlayer

Only for use by RB.PlayOrder subclasses.

get_playing_entry()
Returns:

playing entry

Return type:

RB.RhythmDBEntry

Returns the current playing entry in the play order.

get_previous()
Returns:

previous entry

Return type:

RB.RhythmDBEntry

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

get_query_model()
Returns:

the active RB.RhythmDBQueryModel for the playing source.

Return type:

RB.RhythmDBQueryModel

Only for use by RB.PlayOrder subclasses.

get_source()
Returns:

the playing RB.Source instance.

Return type:

RB.Source

Only for use by RB.PlayOrder subclasses.

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.

go_previous()

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

has_next()
Returns:

true if there is an entry after the current playing entry in the play order.

Return type:

bool

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

has_previous()
Returns:

True if previous entry exists

Return type:

bool

Returns True if there is an entry before the current entry in the play order. If not currently playing, returns False.

model_not_empty()
Returns:

True if not empty

Return type:

bool

Returns True if the RB.RhythmDBQueryModel is not empty. Can be used to implement has_next and has_previous for play orders that have no beginning or end.

player_is_playing()
Returns:

True if playing

Return type:

bool

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

playing_source_changed(source)
Parameters:

source (RB.Source) – New playing RB.Source

Sets the playing RB.Source for the play order. Should be called by RB.ShellPlayer when the active source changes. Subclasses should implement playing_source_changed() to make any necessary changes.

query_model_changed()

Updates the RB.RhythmDBQueryModel instance for the play order. Called from the RB.Source 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 RB.RhythmDBQueryModel.

set_playing_entry(entry)
Parameters:

entry (RB.RhythmDBEntry or None) – The new playing entry (or None for none)

Sets the playing entry in the play order.

do_db_changed(new_db) virtual
Parameters:

new_db (RB.RhythmDB) –

do_db_entry_deleted(entry) virtual
Parameters:

entry (RB.RhythmDBEntry) –

do_entry_added(entry) virtual
Parameters:

entry (RB.RhythmDBEntry) –

do_entry_removed(entry) virtual
Parameters:

entry (RB.RhythmDBEntry) –

do_get_next() virtual
Returns:

next entry to play

Return type:

RB.RhythmDBEntry

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

do_get_previous() virtual
Returns:

previous entry

Return type:

RB.RhythmDBEntry

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

do_go_next() virtual

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.

do_go_previous() virtual

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

do_has_next() virtual
Returns:

true if there is an entry after the current playing entry in the play order.

Return type:

bool

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

do_has_previous() virtual
Returns:

True if previous entry exists

Return type:

bool

Returns True if there is an entry before the current entry in the play order. If not currently playing, returns False.

do_have_next_previous_changed(have_next, have_previous) virtual
Parameters:
  • have_next (bool) –

  • have_previous (bool) –

do_playing_entry_changed(old_entry, new_entry) virtual
Parameters:
do_playing_entry_removed(entry) virtual
Parameters:

entry (RB.RhythmDBEntry) –

do_playing_source_changed() virtual
do_query_model_changed() virtual

Updates the RB.RhythmDBQueryModel instance for the play order. Called from the RB.Source 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 RB.RhythmDBQueryModel.

Signal Details

RB.PlayOrder.signals.have_next_previous_changed(play_order, have_next, have_previous)
Signal Name:

have-next-previous-changed

Flags:

RUN_LAST

Parameters:
  • play_order (RB.PlayOrder) – The object which received the signal

  • have_next (bool) – if True, the play order has at least one more entry

  • have_previous (bool) – if True, the play order has at least one entry before the current entry

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

Property Details

RB.PlayOrder.props.player
Name:

player

Type:

RB.ShellPlayer

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The RB.ShellPlayer instance

RB.PlayOrder.props.playing_entry
Name:

playing-entry

Type:

RB.RhythmDBEntry

Default Value:

None

Flags:

READABLE, WRITABLE

The current playing RB.RhythmDBEntry