gui/gst: Completely define the pause button in glade
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
8ae31ed483
commit
6723ef88c7
10
gui/gst.cpp
10
gui/gst.cpp
|
@ -14,7 +14,6 @@ extern "C" {
|
|||
#include <gui/ocarina.h>
|
||||
|
||||
|
||||
static GtkButton *o_pause;
|
||||
static GtkButton *o_play;
|
||||
static GtkScale *o_seek;
|
||||
|
||||
|
@ -67,10 +66,10 @@ static void on_change_state(GstState state)
|
|||
{
|
||||
if (state == GST_STATE_PLAYING) {
|
||||
gtk_widget_hide(GTK_WIDGET(o_play));
|
||||
gtk_widget_show(GTK_WIDGET(o_pause));
|
||||
gtk_widget_show(gui_builder_widget("o_pause"));
|
||||
} else {
|
||||
gtk_widget_show(GTK_WIDGET(o_play));
|
||||
gtk_widget_hide(GTK_WIDGET(o_pause));
|
||||
gtk_widget_hide(gui_builder_widget("o_pause"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -124,19 +123,17 @@ static bool on_timeout()
|
|||
}
|
||||
|
||||
void gst :: play() { audio_play(); }
|
||||
void gst :: pause() { audio_pause(); }
|
||||
|
||||
void gst :: toggle()
|
||||
{
|
||||
if (audio_cur_state() == GST_STATE_PLAYING)
|
||||
gst :: pause();
|
||||
audio_pause();
|
||||
else
|
||||
gst :: play();
|
||||
}
|
||||
|
||||
void gst :: init_pre()
|
||||
{
|
||||
o_pause = GTK_BUTTON(gui_builder_widget("o_pause"));
|
||||
o_play = GTK_BUTTON(gui_builder_widget("o_play"));
|
||||
o_seek = GTK_SCALE(gui_builder_widget("o_seek"));
|
||||
|
||||
|
@ -150,7 +147,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_pause, "clicked", gst :: pause, NULL);
|
||||
g_signal_connect(o_play, "clicked", gst :: play, NULL);
|
||||
g_signal_connect(o_seek, "change-value", G_CALLBACK(on_seek), NULL);
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ void post_init_queue_tabs();
|
|||
namespace gst
|
||||
{
|
||||
void play();
|
||||
void pause();
|
||||
void toggle();
|
||||
void init_pre();
|
||||
void init();
|
||||
|
|
|
@ -562,6 +562,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_pause" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkImage" id="image2">
|
||||
<property name="visible">True</property>
|
||||
|
|
Loading…
Reference in New Issue