gui/gst: Completely define the play button in glade

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2015-12-24 12:23:10 -05:00
parent 6723ef88c7
commit aacc1f876a
4 changed files with 5 additions and 10 deletions

View File

@ -14,7 +14,6 @@ extern "C" {
#include <gui/ocarina.h>
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);

View File

@ -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

View File

@ -27,7 +27,6 @@ void post_init_queue_tabs();
/* gst.cpp */
namespace gst
{
void play();
void toggle();
void init_pre();
void init();

View File

@ -543,6 +543,7 @@ Manager</property>
<property name="can_focus">False</property>
<property name="receives_default">True</property>
<property name="focus_on_click">False</property>
<signal name="clicked" handler="audio_play" swapped="no"/>
<child>
<object class="GtkImage" id="image1">
<property name="visible">True</property>