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
This commit is contained in:
Carl Hetherington 2012-06-19 22:05:04 +00:00
parent 46f594ac83
commit 1173bae7c2
3 changed files with 89 additions and 2 deletions

View file

@ -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)

View file

@ -192,7 +192,7 @@ private:
};
/** Component which provides the UI to handle an enumerated option using a GTK CheckButton.
/** Component which provides the UI to handle an enumerated option using a GTK ComboBox.
* The template parameter is the enumeration.
*/
template <class T>
@ -273,6 +273,37 @@ private:
};
/** Component which provides the UI to handle a boolean option which needs
* to be represented as a ComboBox to be clear to the user.
*/
class BoolComboOption : public Option
{
public:
BoolComboOption (
std::string const &,
std::string const &,
std::string const &,
std::string const &,
sigc::slot<bool>,
sigc::slot<bool, bool>
);
void set_state_from_config ();
void add_to_page (OptionEditorPage *);
void changed ();
void set_sensitive (bool);
private:
sigc::slot<bool> _get;
sigc::slot<bool, bool> _set;
Gtk::Label* _label;
Gtk::ComboBoxText* _combo;
};
/** Component which provides the UI to handle an numeric option using a GTK SpinButton */
template <class T>
class SpinOption : public Option

View file

@ -1063,9 +1063,11 @@ RCOptionEditor::RCOptionEditor ()
));
add_option (_("Editor"),
new BoolOption (
new BoolComboOption (
"show-region-gain-envelopes",
_("Show gain envelopes in audio regions"),
_("in all modes"),
_("only in region gain mode"),
sigc::mem_fun (*_rc_config, &RCConfiguration::get_show_region_gain),
sigc::mem_fun (*_rc_config, &RCConfiguration::set_show_region_gain)
));