summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-02-08 21:34:18 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-02-08 21:34:18 +0100
commitfbe7e0e731c0b7749865b88fc752d4565051c9c2 (patch)
tree0c200ec75e3ea06f5c879f2307bbd672a03b6bc2 /plugins
parent1630250351e46acc0a2be6a444599afac0d742e2 (diff)
playlist switching WIP
Diffstat (limited to 'plugins')
-rw-r--r--plugins/gtkui/Makefile.am2
-rw-r--r--plugins/gtkui/gtkplaylist.c3
-rw-r--r--plugins/gtkui/gtkui.c15
-rw-r--r--plugins/gtkui/tabs.c2
4 files changed, 20 insertions, 2 deletions
diff --git a/plugins/gtkui/Makefile.am b/plugins/gtkui/Makefile.am
index 3ef740f5..235d8cfa 100644
--- a/plugins/gtkui/Makefile.am
+++ b/plugins/gtkui/Makefile.am
@@ -10,7 +10,7 @@ gtkui_la_SOURCES = gtkui.c gtkui.h\
fileman.c\
pluginconf.c\
parser.c parser.h\
- tabs.c
+ tabs.c tabs.h
gtkui_la_LDFLAGS = -module
diff --git a/plugins/gtkui/gtkplaylist.c b/plugins/gtkui/gtkplaylist.c
index 868e26a2..2c423e11 100644
--- a/plugins/gtkui/gtkplaylist.c
+++ b/plugins/gtkui/gtkplaylist.c
@@ -444,6 +444,9 @@ gtkpl_draw_playlist (gtkplaylist_t *ps, int x, int y, int w, int h) {
it = it_copy;
int idx = 0;
for (row = row1; row < row2; row++, idx++) {
+ if (!it) {
+ break;
+ }
gtkpl_draw_pl_row (ps, row, it);
it = PL_NEXT (it, ps->iterator);
}
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c
index 8b1d3b1b..28bc8c9f 100644
--- a/plugins/gtkui/gtkui.c
+++ b/plugins/gtkui/gtkui.c
@@ -320,6 +320,19 @@ gtkui_on_playlistchanged (DB_event_t *ev, uintptr_t data) {
g_idle_add (playlistchanged_cb, NULL);
}
+static gboolean
+playlistswitch_cb (gpointer none) {
+ playlist_refresh ();
+ search_refresh ();
+ tabbar_draw (lookup_widget (mainwin, "tabbar"));
+ return FALSE;
+}
+
+static int
+gtkui_on_playlistswitch (DB_event_t *ev, uintptr_t data) {
+ g_idle_add (playlistswitch_cb, NULL);
+}
+
static int
gtkui_on_frameupdate (DB_event_t *ev, uintptr_t data) {
g_idle_add (update_songinfo, NULL);
@@ -479,6 +492,7 @@ gtkui_start (void) {
deadbeef->ev_subscribe (DB_PLUGIN (&plugin), DB_EV_VOLUMECHANGED, DB_CALLBACK (gtkui_on_volumechanged), 0);
deadbeef->ev_subscribe (DB_PLUGIN (&plugin), DB_EV_CONFIGCHANGED, DB_CALLBACK (gtkui_on_configchanged), 0);
deadbeef->ev_subscribe (DB_PLUGIN (&plugin), DB_EV_OUTPUTCHANGED, DB_CALLBACK (gtkui_on_outputchanged), 0);
+ deadbeef->ev_subscribe (DB_PLUGIN (&plugin), DB_EV_PLAYLISTSWITCH, DB_CALLBACK (gtkui_on_playlistswitch), 0);
// gtk must be running in separate thread
gtk_tid = deadbeef->thread_start (gtkui_thread, NULL);
@@ -503,6 +517,7 @@ gtkui_stop (void) {
deadbeef->ev_unsubscribe (DB_PLUGIN (&plugin), DB_EV_VOLUMECHANGED, DB_CALLBACK (gtkui_on_volumechanged), 0);
deadbeef->ev_unsubscribe (DB_PLUGIN (&plugin), DB_EV_CONFIGCHANGED, DB_CALLBACK (gtkui_on_configchanged), 0);
deadbeef->ev_unsubscribe (DB_PLUGIN (&plugin), DB_EV_OUTPUTCHANGED, DB_CALLBACK (gtkui_on_outputchanged), 0);
+ deadbeef->ev_unsubscribe (DB_PLUGIN (&plugin), DB_EV_PLAYLISTSWITCH, DB_CALLBACK (gtkui_on_playlistswitch), 0);
trace ("quitting gtk\n");
g_idle_add (quit_gtk_cb, NULL);
trace ("waiting for gtk thread to finish\n");
diff --git a/plugins/gtkui/tabs.c b/plugins/gtkui/tabs.c
index be6e703c..d302d582 100644
--- a/plugins/gtkui/tabs.c
+++ b/plugins/gtkui/tabs.c
@@ -151,7 +151,7 @@ on_tabbar_button_press_event (GtkWidget *widget,
fw += w;
if (fw > event->x) {
deadbeef->plt_set_curr (idx);
- tabbar_draw (widget);
+// tabbar_draw (widget);
break;
}
}