gui: Move o_seek() into controls.cpp

Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
Anna Schumaker 2014-09-11 08:16:26 -04:00
parent 5e7a25e007
commit 8152327f65
3 changed files with 10 additions and 8 deletions

View File

@ -70,12 +70,21 @@ void o_next()
o_play();
}
bool o_seek(Gtk::ScrollType type, double value)
{
audio :: seek_to(value);
return true;
}
void controls_init()
{
Gtk::Scale *pos_scale = lib :: get_widget<Gtk::Scale>("o_position_scale");
o_position = lib :: get_widget<Gtk::Label>("o_cur_position");
o_pos_bar = lib :: get_object<Gtk::Adjustment>("o_progress");
pos_scale->signal_change_value().connect(sigc::ptr_fun(o_seek));
connect_button("o_play", o_play);
connect_button("o_pause", o_pause);
connect_button("o_stop", audio::stop);

View File

@ -31,12 +31,6 @@ static void on_config_pause()
audio :: pause_after(enabled->get_active(), count->get_value());
}
static bool on_seek(Gtk::ScrollType type, double value)
{
audio :: seek_to(value);
return true;
}
static void set_label_text(Gtk::Label *label, const std::string &size,
const std::string &text)
{
@ -146,7 +140,6 @@ Gtk::Window *setup_gui()
/* Controls */
Gtk::SpinButton *count = lib :: get_widget<Gtk::SpinButton>("o_pause_count");
Gtk::CheckButton *enabled = lib :: get_widget<Gtk::CheckButton>("o_pause_enabled");
Gtk::Scale *position = lib :: get_widget<Gtk::Scale>("o_position_scale");
cb->on_track_loaded = on_track_loaded;
cb->on_pause_count_changed = on_pause_count_changed;
@ -155,7 +148,6 @@ Gtk::Window *setup_gui()
count->signal_changed().connect(sigc::ptr_fun(on_config_pause));
enabled->signal_toggled().connect(sigc::ptr_fun(on_config_pause));
position->signal_change_value().connect(sigc::ptr_fun(on_seek));
/* Favorite and ban buttons */

View File

@ -8,6 +8,7 @@ void o_fix_buttons();
void o_toggle();
void o_next();
void o_seek();
void controls_init();