From aacc1f876ae78234ac0dc6301a84c83bb7f4cfb0 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Thu, 24 Dec 2015 12:23:10 -0500 Subject: [PATCH] gui/gst: Completely define the play button in glade Signed-off-by: Anna Schumaker --- gui/gst.cpp | 11 +++-------- gui/queue/model.cpp | 2 +- include/gui/ocarina.h | 1 - share/ocarina/ocarina6.glade | 1 + 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/gui/gst.cpp b/gui/gst.cpp index e1bb15c9..1d1843cd 100644 --- a/gui/gst.cpp +++ b/gui/gst.cpp @@ -14,7 +14,6 @@ extern "C" { #include -static GtkButton *o_play; static GtkScale *o_seek; static GtkSpinButton *o_count; @@ -65,10 +64,10 @@ static void on_load(struct track *track) static void on_change_state(GstState state) { if (state == GST_STATE_PLAYING) { - gtk_widget_hide(GTK_WIDGET(o_play)); + gtk_widget_hide(gui_builder_widget("o_play")); gtk_widget_show(gui_builder_widget("o_pause")); } else { - gtk_widget_show(GTK_WIDGET(o_play)); + gtk_widget_show(gui_builder_widget("o_play")); gtk_widget_hide(gui_builder_widget("o_pause")); } } @@ -122,19 +121,16 @@ static bool on_timeout() return true; } -void gst :: play() { audio_play(); } - void gst :: toggle() { if (audio_cur_state() == GST_STATE_PLAYING) audio_pause(); else - gst :: play(); + audio_play(); } void gst :: init_pre() { - o_play = GTK_BUTTON(gui_builder_widget("o_play")); o_seek = GTK_SCALE(gui_builder_widget("o_seek")); o_count = GTK_SPIN_BUTTON(gui_builder_widget("o_pause_count")); @@ -147,7 +143,6 @@ void gst :: init_pre() o_title = GTK_LABEL(gui_builder_widget("o_title")); o_progress = GTK_ADJUSTMENT(gui_builder_object("o_progress")); - g_signal_connect(o_play, "clicked", gst :: play, NULL); g_signal_connect(o_seek, "change-value", G_CALLBACK(on_seek), NULL); g_signal_connect(o_count, "changed", G_CALLBACK(on_pause_count), NULL); diff --git a/gui/queue/model.cpp b/gui/queue/model.cpp index 7b32f085..679ac855 100644 --- a/gui/queue/model.cpp +++ b/gui/queue/model.cpp @@ -59,7 +59,7 @@ void QueueModel::on_path_selected(const Gtk::TreePath &path) { audio_load(track_get(path_to_id(path))); queue_selected(_queue, path[0]); - gst :: play(); + audio_play(); } unsigned int QueueModel :: iter_to_id(const Gtk::TreeIter &iter) const diff --git a/include/gui/ocarina.h b/include/gui/ocarina.h index 8f833d2e..aea5d765 100644 --- a/include/gui/ocarina.h +++ b/include/gui/ocarina.h @@ -27,7 +27,6 @@ void post_init_queue_tabs(); /* gst.cpp */ namespace gst { - void play(); void toggle(); void init_pre(); void init(); diff --git a/share/ocarina/ocarina6.glade b/share/ocarina/ocarina6.glade index 4ee0d3eb..58481dc3 100644 --- a/share/ocarina/ocarina6.glade +++ b/share/ocarina/ocarina6.glade @@ -543,6 +543,7 @@ Manager False True False + True