Top |
Functions
Properties
Types and Values
enum | RBShellActivationType |
enum | RBShellError |
enum | RBShellUILocation |
struct | RBShell |
struct | RBShellClass |
Description
RBShell is the main application class in Rhythmbox. It creates and holds references to the other main objects (RBShellPlayer, RhythmDB, RBDisplayPageTree), constructs the main window UI, and provides the basic DBus interface.
Functions
rb_shell_present ()
gboolean rb_shell_present (RBShell *shell
,guint32 timestamp
,GError **error
);
Attempts to display the main window to the user. See gtk_window_present for details.
Parameters
shell |
the RBShell |
|
timestamp |
GTK timestamp to use (for focus-stealing prevention) |
|
error |
not used |
rb_shell_guess_source_for_uri ()
RBSource * rb_shell_guess_source_for_uri (RBShell *shell
,const char *uri
);
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.
rb_shell_add_uri ()
gboolean rb_shell_add_uri (RBShell *shell
,const char *uri
,const char *title
,const char *genre
,GError **error
);
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
Parameters
shell |
the RBShell |
|
uri |
the URI to add |
|
title |
optional title value for the URI |
|
genre |
optional genre value for the URI |
|
error |
returns error information |
rb_shell_load_uri ()
gboolean rb_shell_load_uri (RBShell *shell
,const char *uri
,gboolean play
,GError **error
);
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.
Parameters
shell |
the RBShell |
|
uri |
the URI to load |
|
play |
if TRUE, start playing the URI (if possible) |
|
error |
returns error information |
rb_shell_toggle_visibility ()
void
rb_shell_toggle_visibility (RBShell *shell
);
Toggles the visibility of the main Rhythmbox window.
rb_shell_get_song_properties ()
gboolean rb_shell_get_song_properties (RBShell *shell
,const char *uri
,GHashTable **properties
,GError **error
);
Gathers and returns all metadata (including extra metadata such as album art URIs and lyrics) for the specified URI.
Parameters
shell |
the RBShell |
|
uri |
the URI to query |
|
properties |
returns the properties of the specified URI. |
[out callee-allocates][element-type utf8 GObject.Value] |
error |
returns error information |
rb_shell_set_song_property ()
gboolean rb_shell_set_song_property (RBShell *shell
,const char *uri
,const char *propname
,const GValue *value
,GError **error
);
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.
Parameters
shell |
the RBShell |
|
uri |
the URI to modify |
|
propname |
the name of the property to modify |
|
value |
the new value to set |
|
error |
returns error information |
rb_shell_quit ()
gboolean rb_shell_quit (RBShell *shell
,GError **error
);
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.
rb_shell_activate_source_by_uri ()
gboolean rb_shell_activate_source_by_uri (RBShell *shell
,const char *source_uri
,guint play
,GError **error
);
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.
Parameters
shell |
the RBShell |
|
source_uri |
URI for the source to activate |
|
play |
0: select source, 1: play source if not playing, 2: play source |
|
error |
returns error information |
rb_shell_activate_source ()
gboolean rb_shell_activate_source (RBShell *shell
,RBSource *source
,guint play
,GError **error
);
rb_shell_notify_custom ()
void rb_shell_notify_custom (RBShell *shell
,guint timeout
,const char *primary
,const char *secondary
,const char *image_uri
,gboolean requested
);
rb_shell_do_notify ()
gboolean rb_shell_do_notify (RBShell *shell
,gboolean requested
,GError **error
);
Displays a notification of the current playing track.
rb_shell_register_entry_type_for_source ()
void rb_shell_register_entry_type_for_source (RBShell *shell
,RBSource *source
,RhythmDBEntryType *type
);
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.
Parameters
shell |
the RBShell |
|
source |
the RBSource to register |
|
type |
the RhythmDBEntryType to register for |
rb_shell_get_source_by_entry_type ()
RBSource * rb_shell_get_source_by_entry_type (RBShell *shell
,RhythmDBEntryType *type
);
Looks up and returns the source that owns entries of the specified type.
rb_shell_get_party_mode ()
gboolean
rb_shell_get_party_mode (RBShell *shell
);
Returns TRUE
if the shell is in party mode
rb_shell_append_display_page ()
void rb_shell_append_display_page (RBShell *shell
,RBDisplayPage *page
,RBDisplayPage *parent
);
Adds a new display page to the shell.
Parameters
shell |
the RBShell |
|
page |
the new RBDisplayPage |
|
parent |
the parent page for the new page. |
[allow-none] |
rb_shell_add_widget ()
void rb_shell_add_widget (RBShell *shell
,GtkWidget *widget
,RBShellUILocation location
,gboolean expand
,gboolean fill
);
Adds a widget to the main Rhythmbox window. See gtk_box_pack_start for details on how the expand and fill parameters work.
rb_shell_remove_widget ()
void rb_shell_remove_widget (RBShell *shell
,GtkWidget *widget
,RBShellUILocation location
);
Removes a widget added with rb_shell_add_widget from the main window.
Types and Values
struct RBShellClass
struct RBShellClass { GtkApplicationClass parent_class; /* signals */ gboolean (*visibility_changing) (RBShell *shell, gboolean initial, gboolean visible); void (*visibility_changed) (RBShell *shell, gboolean visible); void (*create_song_info) (RBShell *shell, RBSongInfo *song_info, gboolean multi); void (*removable_media_scan_finished) (RBShell *shell); void (*database_load_complete) (RBShell *shell); };
Property Details
The “accel-group”
property
“accel-group” GtkAccelGroup *
A GtkAccelGroup instance to use for additional accelerator keys
Flags: Read
The “application”
property
“application” RBApplication *
RBApplication instance.
Flags: Read / Write / Construct Only
The “autostarted”
property
“autostarted” gboolean
Whether Rhythmbox was automatically started by the session manager
Flags: Read / Write / Construct Only
Default value: FALSE
The “disable-plugins”
property
“disable-plugins” gboolean
If TRUE
, disable plugins
Flags: Read / Write / Construct Only
Default value: FALSE
The “display-page-model”
property
“display-page-model” RBDisplayPageModel *
The model underlying the display page tree
Flags: Read
The “display-page-tree”
property
“display-page-tree” RBDisplayPageTree *
The RBDisplayPageTree instance
Flags: Read
The “dry-run”
property
“dry-run” gboolean
If TRUE, don't write back file metadata changes.
Flags: Read / Write / Construct Only
Default value: FALSE
The “no-registration”
property
“no-registration” gboolean
If TRUE
, disable single-instance features.
Flags: Read / Write / Construct Only
Default value: FALSE
The “no-update”
property
“no-update” gboolean
If TRUE
, don't update the database.
Flags: Read / Write / Construct Only
Default value: FALSE
The “playlist-manager”
property
“playlist-manager” RBPlaylistManager *
The RBPlaylistManager instance
Flags: Read
The “playlists-file”
property
“playlists-file” gchar *
The path to the playlist file
Flags: Read / Write / Construct Only
Default value: "playlists.xml"
The “removable-media-manager”
property
“removable-media-manager” RBRemovableMediaManager *
The RBRemovableMediaManager instance
Flags: Read
The “rhythmdb-file”
property
“rhythmdb-file” gchar *
The path to the rhythmdb file
Flags: Read / Write / Construct Only
Default value: "rhythmdb.xml"
The “selected-page”
property
“selected-page” RBDisplayPage *
The currently selected display page
Flags: Read
The “track-transfer-queue”
property
“track-transfer-queue” RBTrackTransferQueue *
The RBTrackTransferQueue instance
Flags: Read
The “visibility”
property
“visibility” gboolean
Whether the main window is currently visible.
Flags: Read / Write
Default value: TRUE
Signal Details
The “create-song-info”
signal
void user_function (RBShell *shell, RBSongInfo *song_info, gboolean multi, gpointer user_data)
Emitted when creating a new RBSongInfo window. Signal handlers can add pages to the song info window notebook to display additional information.
Parameters
shell |
the RBShell |
|
song_info |
the new RBSongInfo window |
|
multi |
if |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
The “notify-custom”
signal
void user_function (RBShell *shell, guint timeout, gchar *primary, gchar *secondary, gchar *image_uri, gboolean requested, gpointer user_data)
Emitted when a custom notification should be displayed to the user.
Parameters
shell |
the RBShell |
|
timeout |
length of time (in seconds) to display the notification |
|
primary |
main notification text |
|
secondary |
secondary notification text |
|
image_uri |
URI for an image to include in the notification (optional) |
|
requested |
if |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
The “notify-playing-entry”
signal
void user_function (RBShell *shell, gboolean requested, gpointer user_data)
Emitted when a notification should be displayed showing the current playing entry.
Flags: Run Last
The “visibility-changed”
signal
void user_function (RBShell *shell, gboolean visibile, gpointer user_data)
Emitted after the visibility of the main Rhythmbox window has changed.
Parameters
shell |
the RBShell |
|
visibile |
new visibility |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
The “visibility-changing”
signal
gboolean user_function (RBShell *shell, gboolean initial, gboolean visible, gpointer user_data)
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.
Flags: Run Last