13
0

Display amp automation in dB using a logarithmic fader.

git-svn-id: svn://localhost/ardour2/branches/3.0@11535 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2012-02-27 17:17:19 +00:00
parent aef76e95d6
commit 3a4650cba7
3 changed files with 24 additions and 3 deletions

View File

@ -76,9 +76,15 @@ AutomationController::create(
const Evoral::Parameter& param,
boost::shared_ptr<AutomationControl> ac)
{
Gtk::Adjustment* adjustment = manage (new Gtk::Adjustment (param.normal(), param.min(), param.max(),
(param.max() - param.min())/100.0,
(param.max() - param.min())/10.0));
Gtk::Adjustment* adjustment = manage (
new Gtk::Adjustment (
ac->internal_to_interface (param.normal()),
ac->internal_to_interface (param.min()),
ac->internal_to_interface (param.max()),
(param.max() - param.min()) / 100.0,
(param.max() - param.min()) / 10.0
)
);
assert (ac);
assert(ac->parameter() == param);

View File

@ -458,3 +458,16 @@ Amp::visible() const
{
return true;
}
std::string
Amp::value_as_string (boost::shared_ptr<AutomationControl> ac) const
{
if (ac == _gain_control) {
char buffer[32];
snprintf (buffer, sizeof (buffer), "%.2fdB", ac->internal_to_user (ac->get_value ()));
return buffer;
}
return Automatable::value_as_string (ac);
}

View File

@ -98,6 +98,8 @@ public:
return _gain_control;
}
std::string value_as_string (boost::shared_ptr<AutomationControl>) const;
private:
bool _denormal_protection;
bool _apply_gain;