RB.PlaylistManager¶
Subclasses: | None |
---|
Methods¶
Inherited: | GObject.Object (37) |
---|---|
Structs: | GObject.ObjectClass (5) |
class | error_quark () |
class | new (shell, playlists_file) |
add_to_playlist (name, uri) |
|
create_static_playlist (name) |
|
delete_playlist (name) |
|
export_playlist (name, uri, m3u_format) |
|
get_playlist_names () |
|
get_playlists () |
|
load_playlists () |
|
new_playlist (suggested_name, automatic) |
|
new_playlist_from_selection_data (data) |
|
parse_file (uri) |
|
remove_from_playlist (name, uri) |
|
save_playlist_file (source) |
|
save_playlists (force) |
|
shutdown () |
Virtual Methods¶
Inherited: | GObject.Object (7) |
---|
do_load_finish () |
|
do_load_start () |
|
do_playlist_added (source) |
|
do_playlist_created (source) |
Properties¶
Name | Type | Flags | Short Description |
---|---|---|---|
playlists-file |
str |
r/w | playlists file |
shell |
RB.Shell |
r/w | RB.Shell object |
source |
RB.Source |
r/w | RB.Source object |
Signals¶
Inherited: | GObject.Object (1) |
---|
Name | Short Description |
---|---|
load-finish |
Emitted when the playlist manager finishes loading the user’s playlist file. |
load-start |
Emitted when the playlist manager starts loading the user’s playlist file. |
playlist-added |
Emitted when a playlist is added, including when being loaded from the user’s playlist file. |
playlist-created |
Emitted when a new playlist is created. |
Class Details¶
-
class
RB.
PlaylistManager
(**kwargs)¶ Bases: GObject.Object
Abstract: No Structure: RB.PlaylistManagerClass
-
classmethod
new
(shell, playlists_file)¶ Parameters: Returns: Return type: Creates the
RB.PlaylistManager
instance
-
add_to_playlist
(name, uri)¶ Parameters: Raises: Returns: True
if successful.Return type: Adds an entry to the specified playlist. Fails if no playlist with that name exists. This is part of the playlist manager dbus interface.
-
create_static_playlist
(name)¶ Parameters: name ( str
) – name of the new playlistRaises: GLib.Error
Returns: True
if successful.Return type: bool
Creates a new static playlist source with the given name. Will fail if a playlist with that name already exists. This is part of the playlist manager dbus interface.
-
delete_playlist
(name)¶ Parameters: name ( str
) – name of the playlist to deleteRaises: GLib.Error
Returns: True
if successful.Return type: bool
Deletes the specified playlist. Will fail if no playlist with that name exists. This is part of the playlist manager dbus interface.
-
export_playlist
(name, uri, m3u_format)¶ Parameters: Raises: Returns: True
if successful.Return type: Saves the specified playlist to a file in either M3U or PLS format. This is part of the playlist manager dbus interface.
-
get_playlist_names
()¶ Raises: GLib.Error
Returns: True
if successful.playlists: holds the array of playlist names on reutrn Return type: ( bool
, playlists:str
)Allocates and returns an array containing the names of all local playlists. This is part of the playlist manager dbus interface.
-
get_playlists
()¶ Returns: list of playlists Return type: [ RB.Source
]Returns a
GLib.List
containing all local playlist source objects.
-
load_playlists
()¶ Loads the user’s playlists, or if the playlist file does not exists, reads the default playlist file. Should be called only once on startup.
-
new_playlist
(suggested_name, automatic)¶ Parameters: Returns: the new playlist object.
Return type: Creates a new playlist and adds it to the source list.
-
new_playlist_from_selection_data
(data)¶ Parameters: data ( Gtk.SelectionData
) – theGtk.SelectionData
from which to create a playlistReturns: the new playlist. Return type: RB.Source
Creates a new playlist based on selection data from gtk. Used to implement playlist creation through drag and drop to the source list.
-
parse_file
(uri)¶ Parameters: uri ( str
) – URI of the playlist to loadRaises: GLib.Error
Returns: True
on successReturn type: bool
Parses a playlist file, adding entries to the database and to a new static playlist. If the playlist file includes a title, the static playlist created will have the same title.
-
remove_from_playlist
(name, uri)¶ Parameters: Raises: Returns: True
if successful.Return type: Removes an entry from the specified playlist. Fails if no playlist with that name exists. This is part of the playlist manager dbus interface.
-
save_playlists
(force)¶ Parameters: force ( bool
) – ifTrue
, save playlists synchronously and unconditionallyReturns: True
if a playlist save operation has been startedReturn type: bool
Saves the user’s playlists. If the force flag is
True
, the playlists will always be saved. Otherwise, the playlists will only be saved if a playlist has been created, modified, or deleted since the last time the playlists were saved, and no save operation is currently taking place.
-
shutdown
()¶ Shuts down the playlist manager, making sure any outstanding playlist save operation finishes.
-
do_load_finish
() virtual¶
-
do_load_start
() virtual¶
-
classmethod
Signal Details¶
-
RB.PlaylistManager.signals.
load_finish
(playlist_manager)¶ Signal Name: load-finish
Flags: RUN_LAST
Parameters: playlist_manager ( RB.PlaylistManager
) – The object which received the signalEmitted when the playlist manager finishes loading the user’s playlist file.
-
RB.PlaylistManager.signals.
load_start
(playlist_manager)¶ Signal Name: load-start
Flags: RUN_LAST
Parameters: playlist_manager ( RB.PlaylistManager
) – The object which received the signalEmitted when the playlist manager starts loading the user’s playlist file.
-
RB.PlaylistManager.signals.
playlist_added
(playlist_manager, source)¶ Signal Name: playlist-added
Flags: Parameters: - playlist_manager (
RB.PlaylistManager
) – The object which received the signal - source (
GObject.Object
) – the newRB.Source
Emitted when a playlist is added, including when being loaded from the user’s playlist file.
- playlist_manager (
-
RB.PlaylistManager.signals.
playlist_created
(playlist_manager, source)¶ Signal Name: playlist-created
Flags: Parameters: - playlist_manager (
RB.PlaylistManager
) – The object which received the signal - source (
GObject.Object
) – the newly created playlistRB.Source
Emitted when a new playlist is created.
- playlist_manager (