}
}
+/*--------------------------*/
+
+CheckOption::CheckOption (string const & i, string const & n, Glib::RefPtr<Gtk::Action> act)
+{
+ _button = manage (new CheckButton);
+ _label = manage (new Label);
+ _label->set_markup (n);
+ _button->add (*_label);
+ _button->signal_toggled().connect (sigc::mem_fun (*this, &CheckOption::toggled));
+
+ Gtkmm2ext::Activatable::set_related_action (act);
+ assert (_action);
+
+ action_sensitivity_changed ();
+
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (_action);
+ if (tact) {
+ action_toggled ();
+ tact->signal_toggled().connect (sigc::mem_fun (*this, &CheckOption::action_toggled));
+ }
+
+ _action->connect_property_changed ("sensitive", sigc::mem_fun (*this, &CheckOption::action_sensitivity_changed));
+}
+
+void
+CheckOption::action_toggled ()
+{
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (_action);
+ if (tact) {
+ _button->set_active (tact->get_active());
+ }
+}
+
+void
+CheckOption::add_to_page (OptionEditorPage* p)
+{
+ add_widget_to_page (p, _button);
+}
+
+void
+CheckOption::toggled ()
+{
+ Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (_action);
+
+ tact->set_active (_button->get_active ());
+}
+
+
/*--------------------------*/
BoolOption::BoolOption (string const & i, string const & n, sigc::slot<bool> g, sigc::slot<bool, bool> s)
, _get (g)
, _set (s)
{
- _db_slider = manage (new HSliderController (&_db_adjustment, boost::shared_ptr<PBD::Controllable>(), 220, 18));
+ _db_slider = manage (new ArdourWidgets::HSliderController (&_db_adjustment, boost::shared_ptr<PBD::Controllable>(), 220, 18));
_label.set_text (n + ":");
_label.set_alignment (0, 0.5);
ClockOption::set_state_from_config ()
{
Timecode::Time TC;
- framepos_t when;
+ samplepos_t when;
if (!Timecode::parse_timecode_format(_get(), TC)) {
_clock.set (0, true);
}
/*--------------------------*/
+WidgetOption::WidgetOption (string const & i, string const & n, Gtk::Widget& w)
+ : Option (i, n)
+ , _widget (&w)
+{
+}
+
+void
+WidgetOption::add_to_page (OptionEditorPage* p)
+{
+ add_widget_to_page (p, _widget);
+}
+
+/*--------------------------*/
+
OptionEditorPage::OptionEditorPage ()
: table (1, 3)
{