#include "ardour/audio_buffer.h"
#include "ardour/buffer_set.h"
#include "ardour/midi_buffer.h"
+#include "ardour/rc_configuration.h"
#include "ardour/session.h"
#include "i18n.h"
using namespace PBD;
using std::min;
-/* gain range of -inf to +6dB, default 0dB */
-const float Amp::max_gain_coefficient = 1.99526231f;
-
Amp::Amp (Session& s)
: Processor(s, "Amp")
, _apply_gain(true)
, _gain_automation_buffer(0)
{
Evoral::Parameter p (GainAutomation);
- p.set_range (0, max_gain_coefficient, 1, false);
boost::shared_ptr<AutomationList> gl (new AutomationList (p));
_gain_control = boost::shared_ptr<GainControl> (new GainControl (X_("gaincontrol"), s, this, p, gl));
_gain_control->set_flags (Controllable::GainLike);
void
Amp::GainControl::set_value (double val)
{
- AutomationControl::set_value (min (val, (double) max_gain_coefficient));
+ AutomationControl::set_value (min (val, (double) Config->get_max_gain()));
_amp->session().set_dirty ();
}
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).