![]() |
![]() |
![]() |
Rhythmbox Development Reference Manual | ![]() |
---|---|---|---|---|
enum RBPlaylistManagerError; #define RB_PLAYLIST_MANAGER_ERROR GQuark rb_playlist_manager_error_quark (void); typedef RBPlaylistManagerPrivate; RBPlaylistManager* rb_playlist_manager_new (RBShell *shell, RBSourceList *sourcelist); gboolean rb_playlist_manager_parse_file (RBPlaylistManager *mgr, const char *uri, GError **error); void rb_playlist_manager_load_playlists (RBPlaylistManager *mgr); gboolean rb_playlist_manager_save_playlists (RBPlaylistManager *mgr, gboolean force); RBSource* rb_playlist_manager_new_playlist (RBPlaylistManager *mgr, const char *suggested_name, gboolean automatic); GList* rb_playlist_manager_get_playlists (RBPlaylistManager *manager);
typedef enum { RB_PLAYLIST_MANAGER_ERROR_PARSE, RB_PLAYLIST_MANAGER_ERROR_PLAYLIST_EXISTS, RB_PLAYLIST_MANAGER_ERROR_PLAYLIST_NOT_FOUND } RBPlaylistManagerError;
RBPlaylistManager* rb_playlist_manager_new (RBShell *shell, RBSourceList *sourcelist);
shell : |
|
sourcelist : |
|
Returns : |
gboolean rb_playlist_manager_parse_file (RBPlaylistManager *mgr, const char *uri, GError **error);
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.
mgr : |
the RBPlaylistManager |
uri : |
URI of the playlist to load |
error : |
returns a GError in case of error |
Returns : | TRUE on success |
void rb_playlist_manager_load_playlists (RBPlaylistManager *mgr);
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.
mgr : |
the RBPlaylistManager |
gboolean rb_playlist_manager_save_playlists (RBPlaylistManager *mgr, gboolean force);
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.
mgr : |
the RBPlaylistManager |
force : |
if TRUE, save playlists synchronously and unconditionally |
Returns : | TRUE if a playlist save operation has been started |
RBSource* rb_playlist_manager_new_playlist (RBPlaylistManager *mgr, const char *suggested_name, gboolean automatic);
Creates a new playlist and adds it to the source list.
mgr : |
the RBPlaylistManager |
suggested_name : |
optional name to use for the new playlist |
automatic : |
if TRUE, create an auto playlist |
Returns : | the new playlist object. |