RB.PlaylistManager¶
- Subclasses:
 None
Methods¶
- Inherited:
 - Structs:
 
class  | 
  | 
class  | 
  | 
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
Virtual Methods¶
- Inherited:
 
  | 
|
  | 
Properties¶
Name  | 
Type  | 
Flags  | 
Short Description  | 
|---|---|---|---|
r/w  | 
playlists file  | 
||
r/w  | 
  | 
||
r/w  | 
  | 
Signals¶
- Inherited:
 
Name  | 
Short Description  | 
|---|---|
Emitted when the playlist manager finishes loading the user’s playlist file.  | 
|
Emitted when the playlist manager starts loading the user’s playlist file.  | 
|
Emitted when a playlist is added, including when being loaded from the user’s playlist file.  | 
|
Emitted when a new playlist is created.  | 
Fields¶
- Inherited:
 
Name  | 
Type  | 
Access  | 
Description  | 
|---|---|---|---|
parent  | 
r  | 
Class Details¶
- class RB.PlaylistManager(**kwargs)¶
 - Bases:
 - Abstract:
 No
- Structure:
 
The playlist manager loads and saves the on-disk playlist file, provides UI actions and a DBus interface for dealing with playlists, and internal interfaces for creating playlists.
- classmethod new(shell, playlists_file)¶
 - Parameters:
 - Returns:
 - Return type:
 
Creates the
RB.PlaylistManagerinstance
- add_to_playlist(name, uri)¶
 - Parameters:
 - Raises:
 - Returns:
 Trueif 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)¶
 - 
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 delete- Raises:
 - Returns:
 Trueif successful.- Return type:
 
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:
 Trueif 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:
 - Returns:
 Trueif successful.- playlists:
 holds the array of playlist names on reutrn
- Return type:
 
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:
 
Returns a
GLib.Listcontaining 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.SelectionDatafrom which to create a playlist- Returns:
 the new playlist.
- Return type:
 
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)¶
 - 
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:
 Trueif 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 unconditionally- Returns:
 Trueif a playlist save operation has been started- Return type:
 
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¶
 
Signal Details¶
- RB.PlaylistManager.signals.load_finish(playlist_manager)¶
 - Signal Name:
 load-finish- Flags:
 - Parameters:
 playlist_manager (
RB.PlaylistManager) – The object which received the signal
Emitted when the playlist manager finishes loading the user’s playlist file.
- RB.PlaylistManager.signals.load_start(playlist_manager)¶
 - Signal Name:
 load-start- Flags:
 - Parameters:
 playlist_manager (
RB.PlaylistManager) – The object which received the signal
Emitted 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 signalsource (
GObject.Object) – the newRB.Source
Emitted when a playlist is added, including when being loaded from the user’s playlist file.
- RB.PlaylistManager.signals.playlist_created(playlist_manager, source)¶
 - Signal Name:
 playlist-created- Flags:
 - Parameters:
 playlist_manager (
RB.PlaylistManager) – The object which received the signalsource (
GObject.Object) – the newly created playlistRB.Source
Emitted when a new playlist is created.
Property Details¶
- RB.PlaylistManager.props.playlists_file¶
 - 
playlists file