summaryrefslogtreecommitdiff
path: root/plugins/gtkui
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-11-11 21:28:02 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-11-11 21:28:02 +0100
commit76b5d753192aba0ed20e8eaff81a3c22a7f7025f (patch)
tree1d265b833ec575cea45fe4a0d9f0de81f75c9c86 /plugins/gtkui
parent526cbb98cf3f38657afc75ba9e468e3d9dd5232f (diff)
moved playcursor control to playlist module
improved plugin event triggering moved some playback control from gui to streamer
Diffstat (limited to 'plugins/gtkui')
-rw-r--r--plugins/gtkui/gtkplaylist.c15
-rw-r--r--plugins/gtkui/gtkplaylist.h1
-rw-r--r--plugins/gtkui/gtkui.c34
3 files changed, 25 insertions, 25 deletions
diff --git a/plugins/gtkui/gtkplaylist.c b/plugins/gtkui/gtkplaylist.c
index cef45ea4..65334248 100644
--- a/plugins/gtkui/gtkplaylist.c
+++ b/plugins/gtkui/gtkplaylist.c
@@ -1740,21 +1740,6 @@ gtkpl_add_files (gtkplaylist_t *ps, GSList *lst) {
GDK_THREADS_LEAVE();
}
-void
-gtkpl_playsong (gtkplaylist_t *ps) {
- if (p_ispaused ()) {
- p_unpause ();
- }
- else if (ps->row != -1) {
- p_stop ();
- streamer_set_nextsong (ps->row, 1);
- }
- else {
- p_stop ();
- streamer_set_nextsong (0, 1);
- }
-}
-
int
gtkpl_get_idx_of (gtkplaylist_t *ps, playItem_t *it) {
playItem_t *c = playlist_head[ps->iterator];
diff --git a/plugins/gtkui/gtkplaylist.h b/plugins/gtkui/gtkplaylist.h
index 2e827839..477afa60 100644
--- a/plugins/gtkui/gtkplaylist.h
+++ b/plugins/gtkui/gtkplaylist.h
@@ -81,7 +81,6 @@ typedef struct {
// current state
int scrollpos;
int hscrollpos;
- int row;
double clicktime; // for doubleclick detection
int nvisiblerows;
int nvisiblefullrows;
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c
index c5a87056..32c58e95 100644
--- a/plugins/gtkui/gtkui.c
+++ b/plugins/gtkui/gtkui.c
@@ -227,11 +227,6 @@ guiplug_shutdown (void) {
}
void
-guiplug_songchanged (int from, int to) {
- gtkpl_songchanged_wrapper (from, to);
-}
-
-void
guiplug_start_current_track (void) {
gtkpl_playsong (&main_playlist);
if (playlist_current_ptr) {
@@ -321,10 +316,31 @@ guiplug_frameupdate (void) {
update_songinfo ();
}
-void
-guiplug_reset_selection (void) {
- search_playlist.row = -1;
- main_playlist.row = -1;
+static int
+gtkui_on_activate (DB_event_t *ev, uintptr_t data) {
+ GDK_THREADS_ENTER();
+ gtk_widget_show (mainwin);
+ gtk_window_present (GTK_WINDOW (mainwin));
+ GDK_THREADS_LEAVE();
+}
+
+static int
+gtkui_on_songchanged (DB_event_song_t *ev, uintptr_t data) {
+ gtkpl_songchanged_wrapper (from, to);
+}
+
+static int
+gtkui_start (void) {
+ deadbeef->ev_subscribe (DB_PLUGIN (&plugin), DB_EV_ACTIVATE, DB_CALLBACK (gtkui_on_activate), 0);
+ deadbeef->ev_subscribe (DB_PLUGIN (&plugin), DB_EV_SONGCHANGED, DB_CALLBACK (gtkui_on_songchanged), 0);
+ return 0;
+}
+
+static int
+gtkui_stop (void) {
+ deadbeef->ev_unsubscribe (DB_PLUGIN (&plugin), DB_EV_ACTIVATE, DB_CALLBACK (gtkui_on_activate), 0);
+ deadbeef->ev_unsubscribe (DB_PLUGIN (&plugin), DB_EV_SONGCHANGED, DB_CALLBACK (gtkui_on_songchanged), 0);
+ return 0;
}
// define plugin interface