From b2b736d596123de52dac700db769ac4eb576da5c Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Fri, 18 Jul 2014 08:47:45 -0500 Subject: tweaks for the monitor section. refactoring of some buttons, using new ArdourKnob instead of VolumeController. New ArdourDisplay shows a controllables user value, and provides support for preset values (hardcoded at present). Further refactoring to come, so that ArdourWidgets are derived from a common class. Controllable now has more responsibility for scaling between internal, user, and interface (knob percent) values. This also needs more refactoring and might have some unintended consequences. tested with audio and nothing seems amiss, yet. --- libs/ardour/amp.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libs/ardour/amp.cc') diff --git a/libs/ardour/amp.cc b/libs/ardour/amp.cc index 29032525f2..2265c6de03 100644 --- a/libs/ardour/amp.cc +++ b/libs/ardour/amp.cc @@ -426,6 +426,19 @@ Amp::GainControl::internal_to_user (double v) const return accurate_coefficient_to_dB (v); } +double +Amp::GainControl::user_to_internal (double u) const +{ + return dB_to_coefficient (u); +} + +std::string +Amp::GainControl::get_user_string () const +{ + char theBuf[32]; sprintf( theBuf, "%3.1f dB", accurate_coefficient_to_dB (get_value())); + return std::string(theBuf); +} + /** Write gain automation for this cycle into the buffer previously passed in to * set_gain_automation_buffer (if we are in automation playback mode and the * transport is rolling). -- cgit v1.2.3