RBShell

## RBShell RBShell — holds the Rhythmbox main window and everything else |

## Synopsis

    enum                RBShellActivationType;
    enum                RBShellError;
    GQuark              rb_shell_error_quark                (void);
    enum                RBShellUILocation;
    struct              RBShell;
    struct              RBShellClass;
    gboolean            rb_shell_present                    (RBShell *shell,
                                                             guint32 timestamp,
                                                             GError **error);
    RBSource *          rb_shell_guess_source_for_uri       (RBShell *shell,
                                                             const char *uri);
    gboolean            rb_shell_add_uri                    (RBShell *shell,
                                                             const char *uri,
                                                             const char *title,
                                                             const char *genre,
                                                             GError **error);
    gboolean            rb_shell_load_uri                   (RBShell *shell,
                                                             const char *uri,
                                                             gboolean play,
                                                             GError **error);
    void                rb_shell_toggle_visibility          (RBShell *shell);
    gboolean            rb_shell_get_song_properties        (RBShell *shell,
                                                             const char *uri,
                                                             GHashTable **properties,
                                                             GError **error);
    gboolean            rb_shell_set_song_property          (RBShell *shell,
                                                             const char *uri,
                                                             const char *propname,
                                                             const GValue *value,
                                                             GError **error);
    gboolean            rb_shell_quit                       (RBShell *shell,
                                                             GError **error);
    gboolean            rb_shell_activate_source_by_uri     (RBShell *shell,
                                                             const char *source_uri,
                                                             guint play,
                                                             GError **error);
    gboolean            rb_shell_activate_source            (RBShell *shell,
                                                             RBSource *source,
                                                             guint play,
                                                             GError **error);
    void                rb_shell_notify_custom              (RBShell *shell,
                                                             guint timeout,
                                                             const char *primary,
                                                             const char *secondary,
                                                             const char *image_uri,
                                                             gboolean requested);
    gboolean            rb_shell_do_notify                  (RBShell *shell,
                                                             gboolean requested,
                                                             GError **error);
    void                rb_shell_register_entry_type_for_source
                                                            (RBShell *shell,
                                                             RBSource *source,
                                                             RhythmDBEntryType *type);
    RBSource *          rb_shell_get_source_by_entry_type   (RBShell *shell,
                                                             RhythmDBEntryType *type);
    gboolean            rb_shell_get_party_mode             (RBShell *shell);
    void                rb_shell_append_display_page        (RBShell *shell,
                                                             RBDisplayPage *page,
                                                             RBDisplayPage *parent);
    void                rb_shell_add_widget                 (RBShell *shell,
                                                             GtkWidget *widget,
                                                             RBShellUILocation location,
                                                             gboolean expand,
                                                             gboolean fill);
    void                rb_shell_remove_widget              (RBShell *shell,
                                                             GtkWidget *widget,
                                                             RBShellUILocation location);

## Object Hierarchy

      GEnum
       +----RBShellUILocation

      GObject
       +----RBShell

## Properties

      "accel-group"              GtkAccelGroup*        : Read
      "application"              RBApplication*        : Read / Write / Construct Only
      "autostarted"              gboolean              : Read / Write / Construct Only
      "clipboard"                RBShellClipboard*     : Read
      "db"                       RhythmDB*             : Read
      "disable-plugins"          gboolean              : Read / Write / Construct Only
      "display-page-model"       RBDisplayPageModel*   : Read
      "display-page-tree"        RBDisplayPageTree*    : Read
      "dry-run"                  gboolean              : Read / Write / Construct Only
      "library-source"           RBLibrarySource*      : Read
      "no-registration"          gboolean              : Read / Write / Construct Only
      "no-update"                gboolean              : Read / Write / Construct Only
      "playlist-manager"         RBPlaylistManager*    : Read
      "playlists-file"           gchar*                : Read / Write / Construct Only
      "prefs"                    RBShellPreferences*   : Read
      "queue-source"             RBPlayQueueSource*    : Read
      "removable-media-manager"  RBRemovableMediaManager*  : Read
      "rhythmdb-file"            gchar*                : Read / Write / Construct Only
      "selected-page"            RBDisplayPage*        : Read
      "shell-player"             RBShellPlayer*        : Read
      "task-list"                RBTaskList*           : Read
      "track-transfer-queue"     RBTrackTransferQueue*  : Read
      "visibility"               gboolean              : Read / Write
      "window"                   GtkWindow*            : Read

## Signals

      "create-song-info"                               : Run Last
      "notify-custom"                                  : Run Last
      "notify-playing-entry"                           : Run Last
      "visibility-changed"                             : Run Last
      "visibility-changing"                            : Run Last

## 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.

## Details

### enum RBShellActivationType

    typedef enum {
    	RB_SHELL_ACTIVATION_SELECT = 0,
    	RB_SHELL_ACTIVATION_PLAY = 1,
    	RB_SHELL_ACTIVATION_ALWAYS_PLAY = 2
    } RBShellActivationType;

`RB_SHELL_ACTIVATION_SELECT` |
`RB_SHELL_ACTIVATION_PLAY` |
`RB_SHELL_ACTIVATION_ALWAYS_PLAY` |

### enum RBShellError

    typedef enum {
    	RB_SHELL_ERROR_NO_SUCH_URI,
    	RB_SHELL_ERROR_NO_SUCH_PROPERTY,
    	RB_SHELL_ERROR_IMMUTABLE_PROPERTY,
    	RB_SHELL_ERROR_INVALID_PROPERTY_TYPE,
    	RB_SHELL_ERROR_NO_SOURCE_FOR_URI
    } RBShellError;

`RB_SHELL_ERROR_NO_SUCH_URI` |
`RB_SHELL_ERROR_NO_SUCH_PROPERTY` |
`RB_SHELL_ERROR_IMMUTABLE_PROPERTY` |
`RB_SHELL_ERROR_INVALID_PROPERTY_TYPE` |
`RB_SHELL_ERROR_NO_SOURCE_FOR_URI` |

### rb_shell_error_quark ()

    GQuark              rb_shell_error_quark                (void);

Returns the GQuark used for RBShell errors

Returns : | shell error GQuark

### enum RBShellUILocation

    typedef enum {
    	RB_SHELL_UI_LOCATION_SIDEBAR,
    	RB_SHELL_UI_LOCATION_RIGHT_SIDEBAR,
    	RB_SHELL_UI_LOCATION_MAIN_TOP,
    	RB_SHELL_UI_LOCATION_MAIN_BOTTOM
    } RBShellUILocation;

`RB_SHELL_UI_LOCATION_SIDEBAR` |
`RB_SHELL_UI_LOCATION_RIGHT_SIDEBAR` |
`RB_SHELL_UI_LOCATION_MAIN_TOP` |
`RB_SHELL_UI_LOCATION_MAIN_BOTTOM` |

### struct RBShell

    struct RBShell;

### 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);
    };

### 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.

`shell` : | the RBShell
`timestamp` : | GTK timestamp to use (for focus-stealing prevention)
`error` : | not used
Returns : | 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.

`shell` : | the RBSource
`uri` : | the URI to guess a source for
Returns : | the most appropriate RBSource for the uri. [transfer none]

### 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

`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
Returns : | TRUE if the URI was added successfully

### 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.

`shell` : | the RBShell
`uri` : | the URI to load
`play` : | if TRUE, start playing the URI (if possible)
`error` : | returns error information
Returns : | TRUE if the URI was added successfully

### rb_shell_toggle_visibility ()

    void                rb_shell_toggle_visibility          (RBShell *shell);

Toggles the visibility of the main Rhythmbox window.

`shell` : | the RBShell

### 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.

`shell` : | the RBShell
`uri` : | the URI to query
`properties` : | (out callee-allocates) (element-type utf8 GObject.Value) returns the properties of the specified URI
`error` : | returns error information
Returns : | `TRUE` if the URI is found in the database

### 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.

`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
Returns : | `TRUE` if the property was set successfully.

### 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.

`shell` : | the RBShell
`error` : | not used
Returns : | not important

### 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.

`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
Returns : | `TRUE` if successful

### 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.

`shell` : | the RBShell
`requested` : | if `TRUE`, the notification was requested by some explicit user action
`error` : | not used
Returns : | not important

### 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.

`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.

`shell` : | the RBShell
`type` : | entry type for which to find a source
Returns : | source instance, if any. [transfer none]

### rb_shell_get_party_mode ()

    gboolean            rb_shell_get_party_mode             (RBShell *shell);

Returns `TRUE` if the shell is in party mode

`shell` : | the RBShell
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.

`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.

`shell` : | the RBShell
`widget` : | the GtkWidget to insert into the main window
`location` : | the location at which to insert the widget
`expand` : | whether the widget should be given extra space
`fill` : | whether the widget should fill all space allocated to it

### 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.

`shell` : | the RBShell
`widget` : | the GtkWidget to remove from the main window
`location` : | the UI location to which the widget was originally added

## Property Details

### The `"accel-group"` property

      "accel-group"              GtkAccelGroup*        : Read

A GtkAccelGroup instance to use for additional accelerator keys

### The `"application"` property

      "application"              RBApplication*        : Read / Write / Construct Only

RBApplication instance.

### The `"autostarted"` property

      "autostarted"              gboolean              : Read / Write / Construct Only

Whether Rhythmbox was automatically started by the session manager

Default value: FALSE

### The `"clipboard"` property

      "clipboard"                RBShellClipboard*     : Read

The RBShellClipboard instance

### The `"db"` property

      "db"                       RhythmDB*             : Read

The RhythmDB instance

### The `"disable-plugins"` property

      "disable-plugins"          gboolean              : Read / Write / Construct Only

If `TRUE`, disable plugins

Default value: FALSE

### The `"display-page-model"` property

      "display-page-model"       RBDisplayPageModel*   : Read

The model underlying the display page tree

### The `"display-page-tree"` property

      "display-page-tree"        RBDisplayPageTree*    : Read

The RBDisplayPageTree instance

### The `"dry-run"` property

      "dry-run"                  gboolean              : Read / Write / Construct Only

If TRUE, don't write back file metadata changes.

Default value: FALSE

### The `"library-source"` property

      "library-source"           RBLibrarySource*      : Read

The library source

### The `"no-registration"` property

      "no-registration"          gboolean              : Read / Write / Construct Only

If `TRUE`, disable single-instance features.

Default value: FALSE

### The `"no-update"` property

      "no-update"                gboolean              : Read / Write / Construct Only

If `TRUE`, don't update the database.

Default value: FALSE

### The `"playlist-manager"` property

      "playlist-manager"         RBPlaylistManager*    : Read

The RBPlaylistManager instance

### The `"playlists-file"` property

      "playlists-file"           gchar*                : Read / Write / Construct Only

The path to the playlist file

Default value: "playlists.xml"

### The `"prefs"` property

      "prefs"                    RBShellPreferences*   : Read

The RBShellPreferences instance

### The `"queue-source"` property

      "queue-source"             RBPlayQueueSource*    : Read

The play queue source

### The `"removable-media-manager"` property

      "removable-media-manager"  RBRemovableMediaManager*  : Read

The RBRemovableMediaManager instance

### The `"rhythmdb-file"` property

      "rhythmdb-file"            gchar*                : Read / Write / Construct Only

The path to the rhythmdb file

Default value: "rhythmdb.xml"

### The `"selected-page"` property

      "selected-page"            RBDisplayPage*        : Read

The currently selected display page

### The `"shell-player"` property

      "shell-player"             RBShellPlayer*        : Read

The RBShellPlayer instance

### The `"task-list"` property

      "task-list"                RBTaskList*           : Read

The RBTaskList instance

### The `"track-transfer-queue"` property

      "track-transfer-queue"     RBTrackTransferQueue*  : Read

The RBTrackTransferQueue instance

### The `"visibility"` property

      "visibility"               gboolean              : Read / Write

Whether the main window is currently visible.

Default value: TRUE

### The `"window"` property

      "window"                   GtkWindow*            : Read

The main Rhythmbox window.

## Signal Details

### The `"create-song-info"` signal

    void                user_function                      (RBShell    *shell,
                                                            RBSongInfo *song_info,
                                                            gboolean    multi,
                                                            gpointer    user_data)      : Run Last

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

`shell` : | the RBShell
`song_info` : | the new RBSongInfo window
`multi` : | if `TRUE`, the song info window is for multiple entries
`user_data` : | user data set when the signal handler was connected.

### The `"notify-custom"` signal

    void                user_function                      (RBShell *shell,
                                                            guint    timeout,
                                                            gchar   *primary,
                                                            gchar   *secondary,
                                                            gchar   *image_uri,
                                                            gboolean requested,
                                                            gpointer user_data)      : Run Last

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

`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 `TRUE`, the notification was triggered by an explicit user action
`user_data` : | user data set when the signal handler was connected.

### The `"notify-playing-entry"` signal

    void                user_function                      (RBShell *shell,
                                                            gboolean arg1,
                                                            gpointer user_data)      : Run Last

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

`shell` : | the RBShell
`user_data` : | user data set when the signal handler was connected.

### The `"visibility-changed"` signal

    void                user_function                      (RBShell *shell,
                                                            gboolean visibile,
                                                            gpointer user_data)      : Run Last

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

`shell` : | the RBShell
`visibile` : | new visibility
`user_data` : | user data set when the signal handler was connected.

### The `"visibility-changing"` signal

    gboolean            user_function                      (RBShell *shell,
                                                            gboolean initial,
                                                            gboolean visible,
                                                            gpointer user_data)      : Run Last

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.

`shell` : | the RBShell
`initial` : | if `TRUE`, this is the initial visibility for the window
`visible` : | new shell visibility
`user_data` : | user data set when the signal handler was connected.