Tweaks to Mixer and Monitor keybindings:
[ardour.git] / gtk2_ardour / option_editor.h
index 132d260c05fbb4685decf2b593399593ca260bb1..d6738889f3dd45a5d8d7618aef5528135c6a1b9e 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "widgets/slider_controller.h"
 
+#include "actions.h"
 #include "ardour_window.h"
 #include "audio_clock.h"
 #include "ardour/types.h"
@@ -187,6 +188,34 @@ protected:
        std::string _name;
 };
 
+/** Just a Gtk Checkbutton, masquerading as an option component */
+class CheckOption : public OptionEditorComponent , public Gtkmm2ext::Activatable
+{
+public:
+       CheckOption (std::string const &, std::string const &, Glib::RefPtr<Gtk::Action> act );
+       void set_state_from_config () {}
+       void parameter_changed (std::string const &) {}
+       void add_to_page (OptionEditorPage*);
+
+       void set_sensitive (bool yn) {
+               _button->set_sensitive (yn);
+       }
+
+       Gtk::Widget& tip_widget() { return *_button; }
+
+       void action_toggled ();
+       void action_sensitivity_changed () {}
+       void action_visibility_changed () {}
+
+protected:
+       virtual void toggled ();
+
+       sigc::slot<bool>       _get; ///< slot to get the configuration variable's value
+       sigc::slot<bool, bool> _set;  ///< slot to set the configuration variable's value
+       Gtk::CheckButton*      _button; ///< UI button
+       Gtk::Label*            _label; ///< label for button, so we can use markup
+};
+
 /** Component which provides the UI to handle a boolean option using a GTK CheckButton */
 class BoolOption : public Option
 {