RB.Shell

g GObject.Object GObject.Object RB.Shell RB.Shell GObject.Object->RB.Shell

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

activate_source (source, play)

activate_source_by_uri (source_uri, play)

add_uri (uri, title, genre)

add_widget (widget, location, expand, fill)

append_display_page (page, parent)

do_notify (requested)

get_song_properties (uri)

get_source_by_entry_type (type)

guess_source_for_uri (uri)

load_uri (uri, play)

notify_custom (timeout, primary, secondary, image_uri, requested)

present (timestamp)

quit ()

register_entry_type_for_source (source, type)

remove_widget (widget, location)

set_song_property (uri, propname, value)

toggle_visibility ()

Virtual Methods

Inherited:

GObject.Object (7)

do_create_song_info (song_info, multi)

do_database_load_complete ()

do_removable_media_scan_finished ()

do_visibility_changed (visible)

do_visibility_changing (initial, visible)

Properties

Name

Type

Flags

Short Description

accel-group

Gtk.AccelGroup

r

Gtk.AccelGroup object

application

RB.Application

r/w/co

RB.Application instance

autostarted

bool

r/w/co

True if autostarted

db

RB.RhythmDB

r

RB.RhythmDB object

disable-plugins

bool

r/w/co

Whether or not to disable plugins

display-page-model

RB.DisplayPageModel

r

RB.DisplayPageModel

display-page-tree

RB.DisplayPageTree

r

RB.DisplayPageTree

dry-run

bool

r/w/co

Whether or not this is a dry run

no-registration

bool

r/w/co

Whether or not to register

no-update

bool

r/w/co

Whether or not to update the library

playlist-manager

RB.PlaylistManager

r

RB.PlaylistManager object

playlists-file

str

r/w/co

The playlists file to use

prefs

RB.ShellPreferences

r

RB.ShellPreferences object

removable-media-manager

RB.RemovableMediaManager

r

RB.RemovableMediaManager object

rhythmdb-file

str

r/w/co

The RB.RhythmDB file to use

selected-page

RB.DisplayPage

r

xlib.Display page which is currently selected

shell-player

RB.ShellPlayer

r

RB.ShellPlayer object

task-list

RB.TaskList

r

task list

track-transfer-queue

RB.TrackTransferQueue

r

RB.TrackTransferQueue object

visibility

bool

r/w

Current window visibility

window

Gtk.Window

r

Gtk.Window object

Signals

Inherited:

GObject.Object (1)

Name

Short Description

create-song-info

Emitted when creating a new RB.SongInfo window.

notify-custom

Emitted when a custom notification should be displayed to the user.

notify-playing-entry

Emitted when a notification should be displayed showing the current playing entry.

visibility-changed

Emitted after the visibility of the main Rhythmbox window has changed.

visibility-changing

Emitted before the visibility of the main window changes.

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

Gtk.Application

r

Class Details

class RB.Shell(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

RB.ShellClass

activate_source(source, play)
Parameters:
Raises:

GLib.Error

Return type:

bool

activate_source_by_uri(source_uri, play)
Parameters:
  • source_uri (str) – URI for the source to activate

  • play (int) – 0: select source, 1: play source if not playing, 2: play source

Raises:

GLib.Error

Returns:

True if successful

Return type:

bool

Searches for a source matching source_uri and if found, selects it, and depending on the value of play, may start playing from it. Device-based sources will match the device node or mount point URI. Other types of sources may have their own URI scheme or format. This is part of the DBus interface.

add_uri(uri, title, genre)
Parameters:
  • uri (str) – the URI to add

  • title (str) – optional title value for the URI

  • genre (str) – optional genre value for the URI

Raises:

GLib.Error

Returns:

True if the URI was added successfully

Return type:

bool

Adds the specified URI to the Rhythmbox database. Whether the title and genre specified are actually used is up to the source that handles the URI

add_widget(widget, location, expand, fill)
Parameters:
  • widget (Gtk.Widget) – the Gtk.Widget to insert into the main window

  • location (RB.ShellUILocation) – the location at which to insert the widget

  • expand (bool) – whether the widget should be given extra space

  • fill (bool) – whether the widget should fill all space allocated to it

Adds a widget to the main Rhythmbox window. See Gtk.Box.pack_start for details on how the expand and fill parameters work.

append_display_page(page, parent)
Parameters:

Adds a new display page to the shell.

do_notify(requested)
Parameters:

requested (bool) – if True, the notification was requested by some explicit user action

Raises:

GLib.Error

Returns:

not important

Return type:

bool

Displays a notification of the current playing track.

get_song_properties(uri)
Parameters:

uri (str) – the URI to query

Raises:

GLib.Error

Returns:

True if the URI is found in the database

properties:

returns the properties of the specified URI

Return type:

(bool, properties: {str: GObject.Value})

Gathers and returns all metadata (including extra metadata such as album art URIs and lyrics) for the specified URI.

get_source_by_entry_type(type)
Parameters:

type (RB.RhythmDBEntryType) – entry type for which to find a source

Returns:

source instance, if any

Return type:

RB.Source

Looks up and returns the source that owns entries of the specified type.

guess_source_for_uri(uri)
Parameters:

uri (str) – the URI to guess a source for

Returns:

the most appropriate RB.Source for the uri

Return type:

RB.Source

Attempts to locate the source that should handle the specified URI. This iterates through all sources, calling RB.Source.want_uri, returning the source that returns the highest value.

load_uri(uri, play)
Parameters:
  • uri (str) – the URI to load

  • play (bool) – if True, start playing the URI (if possible)

Raises:

GLib.Error

Returns:

True if the URI was added successfully

Return type:

bool

Loads a URI representing a single song, a directory, a playlist, or an internet radio station, and optionally starts playing it.

For playlists containing only stream URLs, we either add the playlist itself (if it’s remote) or each URL from it (if it’s local). The main reason for this is so clicking on stream playlist links in web browsers works properly - the playlist file will be downloaded to /tmp/, and we can’t add that to the database, so we need to add the stream URLs instead.

notify_custom(timeout, primary, secondary, image_uri, requested)
Parameters:
  • timeout (int) –

  • primary (str) –

  • secondary (str) –

  • image_uri (str) –

  • requested (bool) –

present(timestamp)
Parameters:

timestamp (int) – GTK timestamp to use (for focus-stealing prevention)

Raises:

GLib.Error

Returns:

not used.

Return type:

bool

Attempts to display the main window to the user. See Gtk.Window.present for details.

quit()
Raises:

GLib.Error

Returns:

not important

Return type:

bool

Begins the process of shutting down Rhythmbox. This function will return. The error parameter and return value only exist because this function is part of the DBus interface.

register_entry_type_for_source(source, type)
Parameters:

Registers a source as the owner of entries of the specified type. The main effect of this is that calling RB.Shell.get_source_by_entry_type with the same entry type will return the source. A source should only be registered as the owner of a single entry type.

remove_widget(widget, location)
Parameters:

Removes a widget added with RB.Shell.add_widget from the main window.

set_song_property(uri, propname, value)
Parameters:
  • uri (str) – the URI to modify

  • propname (str) – the name of the property to modify

  • value (GObject.Value) – the new value to set

Raises:

GLib.Error

Returns:

True if the property was set successfully.

Return type:

bool

Attempts to set a property of a database entry identified by its URI. If the URI identifies a file and the property is one associated with a file metadata tag, the new value will be written to the file.

toggle_visibility()

Toggles the visibility of the main Rhythmbox window.

do_create_song_info(song_info, multi) virtual
Parameters:
do_database_load_complete() virtual
do_removable_media_scan_finished() virtual
do_visibility_changed(visible) virtual
Parameters:

visible (bool) –

do_visibility_changing(initial, visible) virtual
Parameters:
Return type:

bool

Signal Details

RB.Shell.signals.create_song_info(shell, song_info, multi)
Signal Name:

create-song-info

Flags:

RUN_LAST

Parameters:

Emitted when creating a new RB.SongInfo window. Signal handlers can add pages to the song info window notebook to display additional information.

RB.Shell.signals.notify_custom(shell, timeout, primary, secondary, image_uri, requested)
Signal Name:

notify-custom

Flags:

RUN_LAST

Parameters:
  • shell (RB.Shell) – The object which received the signal

  • timeout (int) – length of time (in seconds) to display the notification

  • primary (str) – main notification text

  • secondary (str) – secondary notification text

  • image_uri (str) – URI for an image to include in the notification (optional)

  • requested (bool) – if True, the notification was triggered by an explicit user action

Emitted when a custom notification should be displayed to the user.

RB.Shell.signals.notify_playing_entry(shell, requested)
Signal Name:

notify-playing-entry

Flags:

RUN_LAST

Parameters:
  • shell (RB.Shell) – The object which received the signal

  • requested (bool) – True if user requested

Emitted when a notification should be displayed showing the current playing entry.

RB.Shell.signals.visibility_changed(shell, visibile)
Signal Name:

visibility-changed

Flags:

RUN_LAST

Parameters:
  • shell (RB.Shell) – The object which received the signal

  • visibile (bool) – new visibility

Emitted after the visibility of the main Rhythmbox window has changed.

RB.Shell.signals.visibility_changing(shell, initial, visible)
Signal Name:

visibility-changing

Flags:

RUN_LAST

Parameters:
  • shell (RB.Shell) – The object which received the signal

  • initial (bool) – if True, this is the initial visibility for the window

  • visible (bool) – new shell visibility

Return type:

bool

Emitted before the visibility of the main window changes. The return value overrides the visibility setting. If multiple signal handlers are attached, the last one wins.

Property Details

RB.Shell.props.accel_group
Name:

accel-group

Type:

Gtk.AccelGroup

Default Value:

None

Flags:

READABLE

A Gtk.AccelGroup instance to use for additional accelerator keys

RB.Shell.props.application
Name:

application

Type:

RB.Application

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

RB.Application instance

RB.Shell.props.autostarted
Name:

autostarted

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Whether Rhythmbox was automatically started by the session manager

RB.Shell.props.db
Name:

db

Type:

RB.RhythmDB

Default Value:

None

Flags:

READABLE

The RB.RhythmDB instance

RB.Shell.props.disable_plugins
Name:

disable-plugins

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

If True, disable plugins

RB.Shell.props.display_page_model
Name:

display-page-model

Type:

RB.DisplayPageModel

Default Value:

None

Flags:

READABLE

The model underlying the display page tree

RB.Shell.props.display_page_tree
Name:

display-page-tree

Type:

RB.DisplayPageTree

Default Value:

None

Flags:

READABLE

The RB.DisplayPageTree instance

RB.Shell.props.dry_run
Name:

dry-run

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

If True, don’t write back file metadata changes.

RB.Shell.props.no_registration
Name:

no-registration

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

If True, disable single-instance features.

RB.Shell.props.no_update
Name:

no-update

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

If True, don’t update the database.

RB.Shell.props.playlist_manager
Name:

playlist-manager

Type:

RB.PlaylistManager

Default Value:

None

Flags:

READABLE

The RB.PlaylistManager instance

RB.Shell.props.playlists_file
Name:

playlists-file

Type:

str

Default Value:

'playlists.xml'

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The path to the playlist file

RB.Shell.props.prefs
Name:

prefs

Type:

RB.ShellPreferences

Default Value:

None

Flags:

READABLE

The RB.ShellPreferences instance

RB.Shell.props.removable_media_manager
Name:

removable-media-manager

Type:

RB.RemovableMediaManager

Default Value:

None

Flags:

READABLE

The RB.RemovableMediaManager instance

RB.Shell.props.rhythmdb_file
Name:

rhythmdb-file

Type:

str

Default Value:

'rhythmdb.xml'

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The path to the rhythmdb file

RB.Shell.props.selected_page
Name:

selected-page

Type:

RB.DisplayPage

Default Value:

None

Flags:

READABLE

The currently selected display page

RB.Shell.props.shell_player
Name:

shell-player

Type:

RB.ShellPlayer

Default Value:

None

Flags:

READABLE

The RB.ShellPlayer instance

RB.Shell.props.task_list
Name:

task-list

Type:

RB.TaskList

Default Value:

None

Flags:

READABLE

The RB.TaskList instance

RB.Shell.props.track_transfer_queue
Name:

track-transfer-queue

Type:

RB.TrackTransferQueue

Default Value:

None

Flags:

READABLE

The RB.TrackTransferQueue instance

RB.Shell.props.visibility
Name:

visibility

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE

Whether the main window is currently visible.

RB.Shell.props.window
Name:

window

Type:

Gtk.Window

Default Value:

None

Flags:

READABLE

The main Rhythmbox window.