RB.ShellPlayer¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
|
||
r |
Whether there is a next track |
||
r |
Whether there is a previous track |
||
r/w |
Whether playback is muted |
||
r |
What play order to use |
||
r |
|
||
r |
Whether Rhythmbox is currently playing |
||
r |
Whether playing from the play queue or not |
||
r/w |
Activation only adds to queue |
||
r/w |
RBPlayQueueSource object |
||
r/w |
|
||
r/w |
Current playback volume |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when the playback position changes. |
|
Emitted when the playback position changes. |
|
Emitted when playback either stops or starts. |
|
Emitted when the playing database entry changes |
|
Emitted when a property of the playing database entry changes. |
|
Emitted when a new |
|
Emitted when the playing database entry changes, providing the URI of the entry. |
|
Emitted when the main window title text should be changed |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class RB.ShellPlayer(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(db)¶
- Parameters:
db (
RB.RhythmDB
) – theRB.RhythmDB
- Returns:
the
RB.ShellPlayer
instance- Return type:
Creates the
RB.ShellPlayer
- add_play_order(name, description, order_type, hidden)¶
- Parameters:
name (
str
) – name of the new play orderdescription (
str
) – description of the new play orderorder_type (
GObject.GType
) – theGObject.GType
of the play order classhidden (
bool
) – ifTrue
, don’t display the play order in the UI
Adds a new play order to the set of available play orders.
- do_next()¶
- Raises:
- Returns:
True
if successful- Return type:
Skips to the next song. Consults the play queue and handles transitions between the play queue and the active source. Fails if there is no entry to play after the current one.
- do_previous()¶
- Raises:
- Returns:
True
if successful- Return type:
If the current song has been playing for more than 3 seconds, restarts it, otherwise, goes back to the previous song. Fails if there is no current song, or if inside the first 3 seconds of the first song in the play order.
- get_active_source()¶
-
Retrieves the active source. This is the source that the user selected for playback.
- get_mute()¶
- Raises:
- Returns:
True
if currently muted- mute:
returns the current mute setting
- Return type:
Returns
True
if currently muted
- get_playback_state()¶
- Returns:
True
if successful.- shuffle:
returns the current shuffle setting
- repeat:
returns the current repeat setting
- Return type:
Retrieves the current state of the shuffle and repeat settings.
- get_playing()¶
- Raises:
- Returns:
True
if successful- playing:
playback state return
- Return type:
Reports whether playback is occuring by setting #playing.
- get_playing_entry()¶
- Returns:
the currently playing
RB.RhythmDBEntry
, orNone
- Return type:
Retrieves the currently playing
RB.RhythmDBEntry
, orNone
if nothing is playing. The caller must unref the entry (usingRB.RhythmDBEntry.unref
) when it is no longer needed.
- get_playing_path()¶
- Raises:
- Returns:
True
if successful- path:
returns the URI of the current playing entry
- Return type:
Retrieves the URI of the current playing entry. The caller must not free the returned string.
- get_playing_song_duration()¶
- Returns:
duration, or -1 if not playing
- Return type:
Retrieves the duration of the current playing song.
- get_playing_source()¶
-
Retrieves the current playing source. That is, the source from which the current song was drawn. This differs from
RB.ShellPlayer.get_active_source
when the current song came from the play queue.
- get_playing_time()¶
- Raises:
- Returns:
True
if successful- time:
returns the current playback position
- Return type:
Retrieves the current playback position. Fails if the player currently cannot provide the playback position.
- get_playing_time_string()¶
- Returns:
allocated playing time string
- Return type:
Constructs a string showing the current playback position, taking the time display settings into account.
- get_volume()¶
- Raises:
- Returns:
the current volume level.
- volume:
returns the volume level
- Return type:
Returns the current volume level
- jump_to_current()¶
- pause()¶
- Raises:
- Returns:
whether playback is not occurring (
True
when successfully paused/stopped or playback was not occurring).- Return type:
Pauses playback if possible, completely stopping if not.
- play()¶
- Raises:
- Returns:
whether playback is now occurring (
True
when successfully started or already playing).- Return type:
Starts playback, if it is not already playing.
- play_entry(entry, source)¶
- Parameters:
entry (
RB.RhythmDBEntry
) – theRB.RhythmDBEntry
to playsource (
RB.Source
) – the newRB.Source
to set as playing (orNone
to use the selected source)
Plays a specified entry.
- playpause()¶
- Raises:
- Returns:
True
if successful- Return type:
Toggles between playing and paused state. If there is no playing entry, chooses an entry from (in order of preference) the play queue, the selection in the current source, or the play order.
- remove_play_order(name)¶
- Parameters:
name (
str
) – name of the play order to remove
Removes a play order previously added with
RB.ShellPlayer.add_play_order
from the set of available play orders.
- seek(offset)¶
- Parameters:
offset (
int
) – relative seek target (in seconds)- Raises:
- Returns:
True
if successful- Return type:
Seeks forwards or backwards in the current playing song. Fails if the current song is not seekable.
- set_mute(mute)¶
- Parameters:
- Raises:
- Returns:
True
if successful- Return type:
Updates the mute setting on the player.
- set_playback_state(shuffle, repeat)¶
- Parameters:
Sets the state of the shuffle and repeat settings.
- set_playing_source(source)¶
-
Replaces the current playing source.
- set_playing_time(time)¶
- Parameters:
time (
int
) – the target playback position (in seconds)- Raises:
- Returns:
True
if successful- Return type:
Attempts to set the playback position. Fails if the current song is not seekable.
- set_selected_source(source)¶
-
Updates the player to reflect a new source being selected.
- set_volume(volume)¶
- Parameters:
volume (
float
) – the volume level (between 0 and 1)- Raises:
- Returns:
True
on success- Return type:
Sets the playback volume level.
- set_volume_relative(delta)¶
- Parameters:
delta (
float
) – difference to apply to the volume level (between -1 and 1)- Raises:
- Returns:
True
on success- Return type:
Adds the specified value to the current volume level.
- stop()¶
Completely stops playback, freeing resources and unloading the file.
In general
RB.ShellPlayer.pause
() should be used instead, as it stops the audio, but does not completely free resources.
- do_playing_song_changed(entry) virtual¶
- Parameters:
entry (
RB.RhythmDBEntry
) –
- do_playing_song_property_changed(uri, property, old, newValue) virtual¶
- Parameters:
uri (
str
) –property (
str
) –old (
GObject.Value
) –newValue (
GObject.Value
) –
Signal Details¶
- RB.ShellPlayer.signals.elapsed_changed(shell_player, elapsed)¶
- Signal Name:
elapsed-changed
- Flags:
- Parameters:
shell_player (
RB.ShellPlayer
) – The object which received the signalelapsed (
int
) – the new playback position in seconds
Emitted when the playback position changes.
- RB.ShellPlayer.signals.elapsed_nano_changed(shell_player, elapsed)¶
- Signal Name:
elapsed-nano-changed
- Flags:
- Parameters:
shell_player (
RB.ShellPlayer
) – The object which received the signalelapsed (
int
) – the new playback position in nanoseconds
Emitted when the playback position changes. Only use this (as opposed to elapsed-changed) when you require subsecond precision. This signal will be emitted multiple times per second.
- RB.ShellPlayer.signals.playing_changed(shell_player, playing)¶
- Signal Name:
playing-changed
- Flags:
- Parameters:
shell_player (
RB.ShellPlayer
) – The object which received the signalplaying (
bool
) – flag indicating playback state
Emitted when playback either stops or starts.
- RB.ShellPlayer.signals.playing_song_changed(shell_player, entry)¶
- Signal Name:
playing-song-changed
- Flags:
- Parameters:
shell_player (
RB.ShellPlayer
) – The object which received the signalentry (
RB.RhythmDBEntry
) – the new playingRB.RhythmDBEntry
Emitted when the playing database entry changes
- RB.ShellPlayer.signals.playing_song_property_changed(shell_player, uri, property, old, newvalue)¶
- Signal Name:
playing-song-property-changed
- Flags:
- Parameters:
shell_player (
RB.ShellPlayer
) – The object which received the signaluri (
str
) – the URI of the playing entryproperty (
str
) – the name of the property that changedold (
GObject.Value
) – the previous value for the propertynewvalue (
GObject.Value
) – the new value of the property
Emitted when a property of the playing database entry changes.
- RB.ShellPlayer.signals.playing_source_changed(shell_player, source)¶
- Signal Name:
playing-source-changed
- Flags:
- Parameters:
shell_player (
RB.ShellPlayer
) – The object which received the signal
Emitted when a new
RB.Source
instance starts playing
- RB.ShellPlayer.signals.playing_uri_changed(shell_player, uri)¶
- Signal Name:
playing-uri-changed
- Flags:
- Parameters:
shell_player (
RB.ShellPlayer
) – The object which received the signaluri (
str
) – the URI of the new playing entry
Emitted when the playing database entry changes, providing the URI of the entry.
- RB.ShellPlayer.signals.window_title_changed(shell_player, title)¶
- Signal Name:
window-title-changed
- Flags:
- Parameters:
shell_player (
RB.ShellPlayer
) – The object which received the signaltitle (
str
) – the new window title
Emitted when the main window title text should be changed
Property Details¶
- RB.ShellPlayer.props.db¶
- Name:
db
- Type:
- Default Value:
- Flags:
The
RB.RhythmDB
- RB.ShellPlayer.props.has_next¶
-
Whether there is a track to play after the current track.
- RB.ShellPlayer.props.has_prev¶
-
Whether there was a previous track before the current track.
- RB.ShellPlayer.props.mute¶
-
Whether playback is currently muted.
- RB.ShellPlayer.props.play_order¶
-
The current play order object.
- RB.ShellPlayer.props.player¶
- Name:
player
- Type:
- Default Value:
- Flags:
The player backend object (an object implementing the
RB.Player
interface).
- RB.ShellPlayer.props.playing¶
-
Whether Rhythmbox is currently playing something
- RB.ShellPlayer.props.playing_from_queue¶
-
If
True
, the current playing entry came from the play queue.
- RB.ShellPlayer.props.queue_source¶
- Name:
queue-source
- Type:
- Default Value:
- Flags:
The play queue source
- RB.ShellPlayer.props.source¶
-
The current source that is selected for playback.