2006-12-03 James Livingston <doclivingston@gmail.com>
[rhythmbox.git] / shell / rb-playlist-manager.h
bloba8b8dcde195a3d66d64f157060d119b275fa2682
1 /*
2 * arch-tag: Header for Rhythmbox playlist management object
4 * Copyright (C) 2003,2004 Colin Walters <walters@verbum.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef __RB_PLAYLIST_MANAGER_H
23 #define __RB_PLAYLIST_MANAGER_H
25 #include "rb-source.h"
26 #include "rhythmdb.h"
27 #include "rb-sourcelist.h"
29 G_BEGIN_DECLS
31 #define RB_TYPE_PLAYLIST_MANAGER (rb_playlist_manager_get_type ())
32 #define RB_PLAYLIST_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), RB_TYPE_PLAYLIST_MANAGER, RBPlaylistManager))
33 #define RB_PLAYLIST_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), RB_TYPE_PLAYLIST_MANAGER, RBPlaylistManagerClass))
34 #define RB_IS_PLAYLIST_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), RB_TYPE_PLAYLIST_MANAGER))
35 #define RB_IS_PLAYLIST_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), RB_TYPE_PLAYLIST_MANAGER))
36 #define RB_PLAYLIST_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), RB_TYPE_PLAYLIST_MANAGER, RBPlaylistManagerClass))
38 typedef enum
40 RB_PLAYLIST_MANAGER_ERROR_PARSE,
41 RB_PLAYLIST_MANAGER_ERROR_PLAYLIST_EXISTS,
42 RB_PLAYLIST_MANAGER_ERROR_PLAYLIST_NOT_FOUND
43 } RBPlaylistManagerError;
45 #define RB_PLAYLIST_MANAGER_ERROR rb_playlist_manager_error_quark ()
47 GQuark rb_playlist_manager_error_quark (void);
49 typedef struct RBPlaylistManagerPrivate RBPlaylistManagerPrivate;
51 typedef struct
53 GObject parent;
55 RBPlaylistManagerPrivate *priv;
56 } RBPlaylistManager;
58 typedef struct
60 GObjectClass parent_class;
62 /* signals */
63 void (*playlist_added) (RBPlaylistManager *manager, RBSource *source);
64 void (*playlist_created) (RBPlaylistManager *manager, RBSource *source);
65 void (*load_start) (RBPlaylistManager *manager);
66 void (*load_finish) (RBPlaylistManager *manager);
67 } RBPlaylistManagerClass;
69 typedef enum
71 RB_PLAYLIST_EXPORT_TYPE_UNKNOWN,
72 RB_PLAYLIST_EXPORT_TYPE_M3U,
73 RB_PLAYLIST_EXPORT_TYPE_PLS,
74 } RBPlaylistExportType;
76 GType rb_playlist_manager_get_type (void);
78 RBPlaylistManager * rb_playlist_manager_new (RBShell *shell,
79 RBSourceList *sourcelist,
80 const char *playlists_file);
82 void rb_playlist_manager_shutdown (RBPlaylistManager *mgr);
83 gboolean rb_playlist_manager_parse_file (RBPlaylistManager *mgr,
84 const char *uri,
85 GError **error);
87 void rb_playlist_manager_load_playlists (RBPlaylistManager *mgr);
89 gboolean rb_playlist_manager_save_playlists (RBPlaylistManager *mgr,
90 gboolean force);
92 RBSource * rb_playlist_manager_new_playlist (RBPlaylistManager *mgr,
93 const char *suggested_name,
94 gboolean automatic);
95 RBSource * rb_playlist_manager_new_playlist_from_selection_data (RBPlaylistManager *mgr,
96 GtkSelectionData *data);
98 GList * rb_playlist_manager_get_playlists (RBPlaylistManager *manager);
100 gboolean rb_playlist_manager_get_playlist_names (RBPlaylistManager *manager,
101 gchar ***playlists,
102 GError **error);
103 gboolean rb_playlist_manager_create_static_playlist (RBPlaylistManager *manager,
104 const gchar *name,
105 GError **error);
106 gboolean rb_playlist_manager_delete_playlist (RBPlaylistManager *manager,
107 const gchar *name,
108 GError **error);
109 gboolean rb_playlist_manager_add_to_playlist (RBPlaylistManager *manager,
110 const gchar *playlist,
111 const gchar *uri,
112 GError **error);
113 gboolean rb_playlist_manager_remove_from_playlist (RBPlaylistManager *manager,
114 const gchar *playlist,
115 const gchar *uri,
116 GError **error);
117 gboolean rb_playlist_manager_export_playlist (RBPlaylistManager *manager,
118 const gchar *playlist,
119 const gchar *uri,
120 gboolean m3u_format,
121 GError **error);
123 G_END_DECLS
125 #endif /* __RB_PLAYLIST_MANAGER_H */