gui/audio: Wire up the "spin button" increment and decrement buttons
Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
994234caf2
commit
cd7364300e
10
gui/audio.c
10
gui/audio.c
|
@ -92,6 +92,16 @@ void __gui_audio_pause_changed(GtkComboBox *combo, gpointer data)
|
|||
audio_pause_after(gtk_combo_box_get_active(combo) - 1);
|
||||
}
|
||||
|
||||
void __gui_audio_pause_inc(GtkButton *button, gpointer data)
|
||||
{
|
||||
audio_pause_after(audio_get_pause_count() + 1);
|
||||
}
|
||||
|
||||
void __gui_audio_pause_dec(GtkButton *button, gpointer data)
|
||||
{
|
||||
audio_pause_after(audio_get_pause_count() - 1);
|
||||
}
|
||||
|
||||
void __gui_audio_seek(GtkRange *range, GtkScrollType type,
|
||||
double value, gpointer data)
|
||||
{
|
||||
|
|
|
@ -750,6 +750,7 @@ audio-volume-medium</property>
|
|||
<property name="sensitive">False</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="receives_default">True</property>
|
||||
<signal name="clicked" handler="__gui_audio_pause_dec" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
|
@ -757,6 +758,8 @@ audio-volume-medium</property>
|
|||
<property name="icon_name">list-remove-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<accelerator key="minus" signal="clicked"/>
|
||||
<accelerator key="KP_Subtract" signal="clicked"/>
|
||||
<style>
|
||||
<class name="down"/>
|
||||
</style>
|
||||
|
@ -772,6 +775,7 @@ audio-volume-medium</property>
|
|||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="receives_default">True</property>
|
||||
<signal name="clicked" handler="__gui_audio_pause_inc" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
|
@ -779,6 +783,8 @@ audio-volume-medium</property>
|
|||
<property name="icon_name">list-add-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<accelerator key="plus" signal="clicked"/>
|
||||
<accelerator key="KP_Add" signal="clicked"/>
|
||||
<style>
|
||||
<class name="up"/>
|
||||
</style>
|
||||
|
|
|
@ -85,6 +85,17 @@ static void test_audio_buttons()
|
|||
|
||||
gtk_button_clicked(gui_prev_button());
|
||||
g_assert(audio_cur_track() == track_get(0));
|
||||
|
||||
g_assert_cmpint(audio_get_pause_count(), ==, -1);
|
||||
gtk_button_clicked(gui_pause_up());
|
||||
g_assert_cmpint(audio_get_pause_count(), ==, 0);
|
||||
gtk_button_clicked(gui_pause_up());
|
||||
g_assert_cmpint(audio_get_pause_count(), ==, 1);
|
||||
gtk_button_clicked(gui_pause_down());
|
||||
g_assert_cmpint(audio_get_pause_count(), ==, 0);
|
||||
gtk_button_clicked(gui_pause_down());
|
||||
g_assert_cmpint(audio_get_pause_count(), ==, -1);
|
||||
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(gui_pause_after()), 3);
|
||||
g_assert_cmpstr(gtk_entry_get_text(gui_pause_entry()), ==, "Pause after 2 tracks");
|
||||
g_assert_true(gtk_widget_get_sensitive(GTK_WIDGET(gui_pause_down())));
|
||||
|
|
Loading…
Reference in New Issue
Block a user