Class
RBShellPlayer
Description [src]
class RB.ShellPlayer : GObject.Object
{
priv: RBShellPlayerPrivate*
}
The shell player (or player shell, depending on who you’re talking to)
manages the RBPlayer
instance, tracks the current playing RhythmDBEntry
,
and manages the various RBPlayOrder
instances. It provides simple operations
such as next, previous, play/pause, and seek.
When playing internet radio streams, it first attempts to read the stream URL as a playlist. If this succeeds, the URLs from the playlist are stored in a list and tried in turn in case of errors. If the playlist parsing fails, the stream URL is played directly.
The mapping from the separate shuffle and repeat settings to an RBPlayOrder
instance occurs in here. The play order logic can also support a number of
additional play orders not accessible via the shuffle and repeat buttons.
If the player backend supports multiple streams, the shell player crossfades between streams by watching the elapsed time of the current stream and simulating an end-of-stream event when it gets within the crossfade duration of the actual end.
Instance methods
rb_shell_player_do_next
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.
rb_shell_player_do_previous
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.
rb_shell_player_get_active_source
Retrieves the active source. This is the source that the user selected for playback.
rb_shell_player_get_playing_entry
Retrieves the currently playing RhythmDBEntry
, or NULL if
nothing is playing. The caller must unref the entry
(using #rhythmdb_entry_unref) when it is no longer needed.
rb_shell_player_get_playing_path
Retrieves the URI of the current playing entry. The caller must not free the returned string.
rb_shell_player_get_playing_source
Retrieves the current playing source. That is, the source from which the current song was drawn. This differs from
rb_shell_player_get_active_source when the current song came
from the play queue.
rb_shell_player_get_playing_time
Retrieves the current playback position. Fails if the player currently cannot provide the playback position.
rb_shell_player_get_playing_time_string
Constructs a string showing the current playback position, taking the time display settings into account.
rb_shell_player_playpause
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.
rb_shell_player_remove_play_order
Removes a play order previously added with #rb_shell_player_add_play_order from the set of available play orders.
rb_shell_player_seek
Seeks forwards or backwards in the current playing song. Fails if the current song is not seekable.
rb_shell_player_set_playing_time
Attempts to set the playback position. Fails if the current song is not seekable.
Signals
RB.ShellPlayer::elapsed-nano-changed
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::playing-song-property-changed
Emitted when a property of the playing database entry changes.
RB.ShellPlayer::playing-uri-changed
Emitted when the playing database entry changes, providing the URI of the entry.
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 RBShellPlayerClass {
GObjectClass parent_class;
void (* window_title_changed) (
RBShellPlayer* player,
const char* window_title
);
void (* elapsed_changed) (
RBShellPlayer* player,
guint elapsed
);
void (* elapsed_nano_changed) (
RBShellPlayer* player,
gint64 elapsed
);
void (* playing_changed) (
RBShellPlayer* player,
gboolean playing
);
void (* playing_source_changed) (
RBShellPlayer* player,
RBSource* source
);
void (* playing_uri_changed) (
RBShellPlayer* player,
const char* uri
);
void (* playing_song_changed) (
RBShellPlayer* player,
RhythmDBEntry* entry
);
void (* playing_song_property_changed) (
RBShellPlayer* player,
const char* uri,
const char* property,
GValue* old,
GValue* newValue
);
}
No description available.
Class members
parent_class: GObjectClass
No description available.
window_title_changed: void (* window_title_changed) ( RBShellPlayer* player, const char* window_title )
No description available.
elapsed_changed: void (* elapsed_changed) ( RBShellPlayer* player, guint elapsed )
No description available.
elapsed_nano_changed: void (* elapsed_nano_changed) ( RBShellPlayer* player, gint64 elapsed )
No description available.
playing_changed: void (* playing_changed) ( RBShellPlayer* player, gboolean playing )
No description available.
playing_source_changed: void (* playing_source_changed) ( RBShellPlayer* player, RBSource* source )
No description available.
playing_uri_changed: void (* playing_uri_changed) ( RBShellPlayer* player, const char* uri )
No description available.
playing_song_changed: void (* playing_song_changed) ( RBShellPlayer* player, RhythmDBEntry* entry )
No description available.
playing_song_property_changed: void (* playing_song_property_changed) ( RBShellPlayer* player, const char* uri, const char* property, GValue* old, GValue* newValue )
No description available.