summaryrefslogtreecommitdiff
path: root/gtk2_ardour/option_editor.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-06-19 22:05:04 +0000
committerCarl Hetherington <carl@carlh.net>2012-06-19 22:05:04 +0000
commit1173bae7c20e1d7763ae092b1b98c92835b1562f (patch)
treee40aea1f6c5c3ea5c1c032500f255c07d102398e /gtk2_ardour/option_editor.cc
parent46f594ac839e81d3e9eee821084f22290a0cc61f (diff)
Clarify the meaning of the show-region-gain-envelopes option.
git-svn-id: svn://localhost/ardour2/branches/3.0@12790 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/option_editor.cc')
-rw-r--r--gtk2_ardour/option_editor.cc54
1 files changed, 54 insertions, 0 deletions
diff --git a/gtk2_ardour/option_editor.cc b/gtk2_ardour/option_editor.cc
index e1946002c1..a6fcc734c5 100644
--- a/gtk2_ardour/option_editor.cc
+++ b/gtk2_ardour/option_editor.cc
@@ -163,6 +163,60 @@ EntryOption::activated ()
_set (_entry->get_text ());
}
+/** Construct a BoolComboOption.
+ * @param i id
+ * @param n User-visible name.
+ * @param t Text to give for the variable being true.
+ * @param f Text to give for the variable being false.
+ * @param g Slot to get the variable's value.
+ * @param s Slot to set the variable's value.
+ */
+BoolComboOption::BoolComboOption (
+ string const & i, string const & n, string const & t, string const & f,
+ sigc::slot<bool> g, sigc::slot<bool, bool> s
+ )
+ : Option (i, n)
+ , _get (g)
+ , _set (s)
+{
+ _label = manage (new Label (n + ":"));
+ _label->set_alignment (0, 0.5);
+ _combo = manage (new ComboBoxText);
+
+ /* option 0 is the false option */
+ _combo->append_text (f);
+ /* and option 1 is the true */
+ _combo->append_text (t);
+
+ _combo->signal_changed().connect (sigc::mem_fun (*this, &BoolComboOption::changed));
+}
+
+void
+BoolComboOption::set_state_from_config ()
+{
+ _combo->set_active (_get() ? 1 : 0);
+}
+
+void
+BoolComboOption::add_to_page (OptionEditorPage* p)
+{
+ add_widgets_to_page (p, _label, _combo);
+}
+
+void
+BoolComboOption::changed ()
+{
+ _set (_combo->get_active_row_number () == 0 ? false : true);
+}
+
+void
+BoolComboOption::set_sensitive (bool yn)
+{
+ _combo->set_sensitive (yn);
+}
+
+
+
FaderOption::FaderOption (string const & i, string const & n, sigc::slot<gain_t> g, sigc::slot<bool, gain_t> s)
: Option (i, n)
, _db_adjustment (gain_to_slider_position_with_max (1.0, Config->get_max_gain()), 0, 1, 0.01, 0.1)