gui/audio: Move audio_ops struct towards the top
This keeps all the audio operations together, and matches how we define operations structs throughout the rest of Ocarina. Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
parent
f8c0668e5e
commit
2a845feb38
22
gui/audio.c
22
gui/audio.c
|
@ -23,7 +23,7 @@ static inline void __gui_audio_set_label_markup(GtkLabel *label,
|
|||
g_free(markup);
|
||||
}
|
||||
|
||||
static void __audio_load(struct track *track)
|
||||
static void __gui_audio_load(struct track *track)
|
||||
{
|
||||
gchar *duration = string_sec2str(track->tr_length);
|
||||
|
||||
|
@ -42,18 +42,26 @@ static void __audio_load(struct track *track)
|
|||
g_free(duration);
|
||||
}
|
||||
|
||||
static void __audio_change_state(GstState state)
|
||||
static void __gui_audio_change_state(GstState state)
|
||||
{
|
||||
bool playing = (state == GST_STATE_PLAYING);
|
||||
gtk_widget_set_visible(GTK_WIDGET(gui_play_button()), !playing);
|
||||
gtk_widget_set_visible(GTK_WIDGET(gui_pause_button()), playing);
|
||||
}
|
||||
|
||||
static void __audio_config_pause(int n)
|
||||
static void __gui_audio_config_pause(int n)
|
||||
{
|
||||
gtk_combo_box_set_active(GTK_COMBO_BOX(gui_pause_after()), n + 1);
|
||||
}
|
||||
|
||||
|
||||
struct audio_ops audio_ops = {
|
||||
.on_load = __gui_audio_load,
|
||||
.on_state_change = __gui_audio_change_state,
|
||||
.on_config_pause = __gui_audio_config_pause,
|
||||
};
|
||||
|
||||
|
||||
void __gui_audio_pause_changed(GtkComboBox *combo, gpointer data)
|
||||
{
|
||||
audio_pause_after(gtk_combo_box_get_active(combo) - 1);
|
||||
|
@ -90,14 +98,6 @@ gboolean __gui_audio_can_accel(GtkWidget *widget, guint signal_id)
|
|||
gtk_widget_is_sensitive(widget);
|
||||
}
|
||||
|
||||
|
||||
|
||||
struct audio_ops audio_ops = {
|
||||
__audio_load,
|
||||
__audio_change_state,
|
||||
__audio_config_pause,
|
||||
};
|
||||
|
||||
void gui_audio_init()
|
||||
{
|
||||
GtkScaleButton *volume = GTK_SCALE_BUTTON(gui_builder_widget("o_volume"));
|
||||
|
|
Loading…
Reference in New Issue