commit f5f8f8cf49d2454c36bc0ef2975db1c35ef2db5d
Author: phantomjinx <[email protected]>
Date: Wed Jan 13 22:56:15 2010 +0000
More bits and pieces for the track display plugin
gtkpod_app_iface.c
- TRACKS SELECTED signal in gtkpod app interface for signalling what tracks
have been selected by other views.
advhelloworld.plugin
- Remove icon assignment to stop useless error message
sort_window.*
- Link to track display plugin
configure.in | 1 +
libgtkpod/gtkpod_app_iface.c | 51 +++++++++++++++++++++++++--
libgtkpod/gtkpod_app_iface.h | 16 +++++++--
plugins/advhelloworld/advhelloworld.plugin | 1 -
plugins/track_display/sort_window.c | 1 +
plugins/track_display/sort_window.h | 1 +
6 files changed, 63 insertions(+), 8 deletions(-)
---
diff --git a/configure.in b/configure.in
index a679706..a2966e3 100644
--- a/configure.in
+++ b/configure.in
@@ -302,6 +302,7 @@ plugins/playlist_display/icons/hicolor/48x48/places/Makefile
plugins/playlist_display/icons/hicolor/scalable/Makefile
plugins/playlist_display/icons/hicolor/scalable/places/Makefile
plugins/sorttab_display/Makefile
+plugins/track_display/Makefile
])
echo "
diff --git a/libgtkpod/gtkpod_app_iface.c b/libgtkpod/gtkpod_app_iface.c
index c322e58..09b7bbc 100644
--- a/libgtkpod/gtkpod_app_iface.c
+++ b/libgtkpod/gtkpod_app_iface.c
@@ -40,13 +40,19 @@ static void gtkpod_app_base_init(GtkPodAppInterface* klass)
{
if (!initialized) {
klass->current_itdb = NULL;
klass->current_playlist = NULL;
+ klass->sort_enablement = TRUE;
+
+ gtkpod_app_signals[ITDB_UPDATED]
+ = g_signal_new("itdb_updated", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, _gtkpod_app_marshal_VOID__POINTER_POINTER,
G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_POINTER);
gtkpod_app_signals[PLAYLIST_SELECTED]
= g_signal_new("playlist_selected", G_OBJECT_CLASS_TYPE
(klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE, 1, G_TYPE_POINTER);
- gtkpod_app_signals[ITDB_UPDATED] = g_signal_new("itdb_updated",
G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST,
- // G_STRUCT_OFFSET (GtkPodAppInterface, itdb_updated),
- 0, NULL, NULL, _gtkpod_app_marshal_VOID__POINTER_POINTER, G_TYPE_NONE,
2, G_TYPE_POINTER, G_TYPE_POINTER);
+ gtkpod_app_signals[TRACKS_SELECTED]
+ = g_signal_new("tracks_selected", G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE, 1, G_TYPE_POINTER);
+
+ gtkpod_app_signals[SORT_ENABLEMENT]
+ = g_signal_new("sort_enablement", G_OBJECT_CLASS_TYPE
(klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN,
G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
initialized = TRUE;
}
@@ -163,8 +169,45 @@ Playlist* gtkpod_get_current_playlist() {
void gtkpod_set_current_playlist(Playlist* playlist) {
g_return_if_fail (GTKPOD_IS_APP(gtkpod_app));
GTKPOD_APP_GET_INTERFACE (gtkpod_app)->current_playlist = playlist;
- if (playlist) // if playlist not null then set its itdb as current
+ if (playlist) {// if playlist not null then set its itdb as current
gtkpod_set_current_itdb(playlist->itdb);
+ gtkpod_set_current_tracks(playlist->members);
+ }
g_signal_emit(gtkpod_app, gtkpod_app_signals[PLAYLIST_SELECTED], 0,
playlist);
}
+
+GList *gtkpod_get_current_tracks() {
+ g_return_val_if_fail (GTKPOD_IS_APP(gtkpod_app), NULL);
+ GList *current_tracks = GTKPOD_APP_GET_INTERFACE
(gtkpod_app)->current_tracks;
+ if (current_tracks && g_list_length(current_tracks) > 0) {
+ return current_tracks;
+ }
+
+ /* current_tracks is null or empty */
+ Playlist *playlist = gtkpod_get_current_playlist();
+ if (playlist) {
+ return playlist->members;
+ }
+
+ return NULL;
+}
+
+void gtkpod_set_current_tracks(GList *tracks) {
+ g_return_if_fail (GTKPOD_IS_APP(gtkpod_app));
+ GTKPOD_APP_GET_INTERFACE (gtkpod_app)->current_tracks = tracks;
+
+ g_signal_emit(gtkpod_app, gtkpod_app_signals[TRACKS_SELECTED], 0, tracks);
+}
+
+void gtkpod_set_sort_enablement(gboolean enable) {
+ g_return_if_fail (GTKPOD_IS_APP(gtkpod_app));
+ GTKPOD_APP_GET_INTERFACE (gtkpod_app)->sort_enablement = enable;
+
+ g_signal_emit(gtkpod_app, gtkpod_app_signals[SORT_ENABLEMENT], 0, enable);
+}
+
+gboolean gtkpod_get_sort_enablement() {
+ g_return_val_if_fail (GTKPOD_IS_APP(gtkpod_app), TRUE);
+ return GTKPOD_APP_GET_INTERFACE (gtkpod_app)->sort_enablement;
+}
diff --git a/libgtkpod/gtkpod_app_iface.h b/libgtkpod/gtkpod_app_iface.h
index 229ec08..0e86d18 100644
--- a/libgtkpod/gtkpod_app_iface.h
+++ b/libgtkpod/gtkpod_app_iface.h
@@ -66,9 +66,11 @@ void CONF_NULL_HANDLER (gpointer d1, gpointer d2);
enum
{
- PLAYLIST_SELECTED,
- ITDB_UPDATED,
- LAST_SIGNAL
+ TRACKS_SELECTED,
+ PLAYLIST_SELECTED,
+ ITDB_UPDATED,
+ SORT_ENABLEMENT,
+ LAST_SIGNAL
};
typedef struct _GtkPodApp GtkPodApp; /* dummy object */
@@ -80,6 +82,10 @@ struct _GtkPodAppInterface {
iTunesDB *current_itdb;
/* pointer to the currently selected playlist */
Playlist *current_playlist;
+ /* pointer to the currently displayed set of tracks */
+ GList *current_tracks;
+ /* flag indicating whether sorting is enabled/disabled */
+ gboolean sort_enablement;
void (*itdb_updated)(GtkPodApp *obj, iTunesDB *oldItdb, iTunesDB *newItbd);
void (*statusbar_message)(GtkPodApp *obj, gchar* message, ...);
@@ -109,6 +115,10 @@ iTunesDB* gtkpod_get_current_itdb();
void gtkpod_set_current_itdb(iTunesDB* itdb);
Playlist* gtkpod_get_current_playlist();
void gtkpod_set_current_playlist(Playlist* playlist);
+GList *gtkpod_get_current_tracks();
+void gtkpod_set_current_tracks(GList *tracks);
+void gtkpod_set_sort_enablement(gboolean enable);
+gboolean gtkpod_get_sort_enablement();
/* full path to 'gtkpod.glade' */
gchar *gtkpod_xml_file;
diff --git a/plugins/advhelloworld/advhelloworld.plugin
b/plugins/advhelloworld/advhelloworld.plugin
index 2f92828..a9b4895 100644
--- a/plugins/advhelloworld/advhelloworld.plugin
+++ b/plugins/advhelloworld/advhelloworld.plugin
@@ -1,5 +1,4 @@
[Anjuta Plugin]
Location=advhelloworld:AdvHelloWorldPlugin
-Icon=advhelloworld.png
Name=AdvHelloWorld Plugin
Description=An Advanced HelloWorld plugin for gtkpod
diff --git a/plugins/track_display/sort_window.c
b/plugins/track_display/sort_window.c
new file mode 120000
index 0000000..387586e
--- /dev/null
+++ b/plugins/track_display/sort_window.c
@@ -0,0 +1 @@
+../../src/sort_window.c
\ No newline at end of file
diff --git a/plugins/track_display/sort_window.h
b/plugins/track_display/sort_window.h
new file mode 120000
index 0000000..5e6e47a
--- /dev/null
+++ b/plugins/track_display/sort_window.h
@@ -0,0 +1 @@
+../../src/sort_window.h
\ No newline at end of file
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2