diff options
author | Carl Hetherington <carl@carlh.net> | 2012-02-27 17:17:19 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2012-02-27 17:17:19 +0000 |
commit | 3a4650cba74ca858447da5e52988802ff786b81a (patch) | |
tree | f6cde8b99582c4ad012295298c34d8f47fbe5170 /libs/ardour | |
parent | aef76e95d645e4b08f6e3ee54683249b7f995f65 (diff) |
Display amp automation in dB using a logarithmic fader.
git-svn-id: svn://localhost/ardour2/branches/3.0@11535 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/amp.cc | 13 | ||||
-rw-r--r-- | libs/ardour/ardour/amp.h | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/libs/ardour/amp.cc b/libs/ardour/amp.cc index b038cde695..b74a57dbce 100644 --- a/libs/ardour/amp.cc +++ b/libs/ardour/amp.cc @@ -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); +} + diff --git a/libs/ardour/ardour/amp.h b/libs/ardour/ardour/amp.h index 398d43ee3e..fa2eb98ebf 100644 --- a/libs/ardour/ardour/amp.h +++ b/libs/ardour/ardour/amp.h @@ -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; |