gui: Move init() steps into controls.cpp
Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
922830a2ab
commit
1c437c4957
|
@ -4,6 +4,7 @@
|
|||
#include <lib/lib.h>
|
||||
#include <core/audio.h>
|
||||
#include <core/driver.h>
|
||||
#include <gui/ocarina.h>
|
||||
|
||||
|
||||
static inline bool audio_playing()
|
||||
|
@ -48,14 +49,14 @@ static void enable_timeout()
|
|||
}
|
||||
|
||||
|
||||
void o_play()
|
||||
static void o_play()
|
||||
{
|
||||
audio :: play();
|
||||
o_fix_buttons();
|
||||
enable_timeout();
|
||||
}
|
||||
|
||||
void o_pause()
|
||||
static void o_pause()
|
||||
{
|
||||
audio :: pause();
|
||||
o_fix_buttons();
|
||||
|
@ -74,3 +75,13 @@ void o_next()
|
|||
audio :: next();
|
||||
o_play();
|
||||
}
|
||||
|
||||
|
||||
void controls_init()
|
||||
{
|
||||
connect_button("o_play", o_play);
|
||||
connect_button("o_pause", o_pause);
|
||||
connect_button("o_stop", audio::stop);
|
||||
connect_button("o_prev", audio::prev);
|
||||
connect_button("o_next", o_next);
|
||||
}
|
||||
|
|
|
@ -203,11 +203,7 @@ Gtk::Window *setup_gui()
|
|||
cb->on_track_loaded = on_track_loaded;
|
||||
cb->on_pause_count_changed = on_pause_count_changed;
|
||||
|
||||
connect_button("o_play", o_play);
|
||||
connect_button("o_pause", o_pause);
|
||||
connect_button("o_stop", audio::stop);
|
||||
connect_button("o_prev", audio::prev);
|
||||
connect_button("o_next", o_next);
|
||||
controls_init();
|
||||
|
||||
count->signal_changed().connect(sigc::ptr_fun(on_config_pause));
|
||||
enabled->signal_toggled().connect(sigc::ptr_fun(on_config_pause));
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
|
||||
void o_fix_buttons();
|
||||
|
||||
void o_play();
|
||||
void o_pause();
|
||||
void o_toggle();
|
||||
void o_next();
|
||||
|
||||
void controls_init();
|
||||
|
||||
#endif /* OCARINA_GUI_CONTROLS_H */
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#ifndef OCARINA_H
|
||||
#define OCARINA_H
|
||||
|
||||
#include <core/queue.h>
|
||||
#include <lib/lib.h>
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue