change exposed type of various objects' gain controls; remove Amp::gain() as a shortcut
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 25 Jan 2016 16:47:21 +0000 (11:47 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 25 Jan 2016 16:47:21 +0000 (11:47 -0500)
libs/ardour/amp.cc
libs/ardour/ardour/amp.h
libs/ardour/ardour/return.h
libs/ardour/ardour/route.h
libs/ardour/ardour/send.h
libs/ardour/route.cc
libs/ardour/route_group.cc
libs/ardour/session.cc

index 49570bb511226d92c11e26be2bbe248c701c7e05..d5b9f56ca5f932a7ddc67eaeada5668815c1e2e5 100644 (file)
@@ -39,7 +39,7 @@ using namespace PBD;
 // used for low-pass filter denormal protection
 #define GAIN_COEFF_TINY (1e-10) // -200dB
 
-Amp::Amp (Session& s, const std::string& name, boost::shared_ptr<AutomationControl> gc, bool control_midi_also)
+Amp::Amp (Session& s, const std::string& name, boost::shared_ptr<GainControl> gc, bool control_midi_also)
        : Processor(s, "Amp")
        , _apply_gain(true)
        , _apply_gain_automation(false)
index 673ec2e3c355ebd2c550a16168c58b7e75dc545c..20a07c092a3f63f58408a4c528d2b6cb353ce6d5 100644 (file)
@@ -37,7 +37,7 @@ class IO;
  */
 class LIBARDOUR_API Amp : public Processor {
 public:
-       Amp(Session& s, const std::string& display_name, boost::shared_ptr<AutomationControl> control, bool control_midi_also);
+       Amp(Session& s, const std::string& display_name, boost::shared_ptr<GainControl> control, bool control_midi_also);
 
        std::string display_name () const { return _display_name; }
        void set_display_name (const std::string& name) { _display_name = name; }
@@ -69,16 +69,13 @@ public:
        static void apply_simple_gain(AudioBuffer& buf, framecnt_t nframes, gain_t target);
 
        static void declick (BufferSet& bufs, framecnt_t nframes, int dir);
-
-       gain_t gain () const { return _gain_control->get_value(); }
-
        static void update_meters();
 
-       boost::shared_ptr<AutomationControl> gain_control() {
+       boost::shared_ptr<GainControl> gain_control() {
                return _gain_control;
        }
 
-       boost::shared_ptr<const AutomationControl> gain_control() const {
+       boost::shared_ptr<const GainControl> gain_control() const {
                return _gain_control;
        }
 
@@ -93,7 +90,7 @@ private:
 
        std::string _display_name;
 
-       boost::shared_ptr<AutomationControl> _gain_control;
+       boost::shared_ptr<GainControl> _gain_control;
 
        /** Buffer that we should use for gain automation */
        gain_t* _gain_automation_buffer;
index e2e326d7d0fe9099c7050369b03d17aeba7273e7..1d60a43d38e750fd50c4eaff38de8ddb4f7848c3 100644 (file)
@@ -32,7 +32,7 @@ namespace ARDOUR {
 
 class Amp;
 class PeakMeter;
-
+class GainControl;
 
 class LIBARDOUR_API Return : public IOProcessor
 {
@@ -46,6 +46,7 @@ public:
 
        boost::shared_ptr<Amp> amp() const { return _amp; }
        boost::shared_ptr<PeakMeter> meter() const { return _meter; }
+       boost::shared_ptr<GainControl> gain_control() const { return _gain_control; }
 
        bool metering() const { return _metering; }
        void set_metering (bool yn) { _metering = yn; }
@@ -64,7 +65,7 @@ public:
 
   protected:
        bool _metering;
-       boost::shared_ptr<AutomationControl> _gain_control;
+       boost::shared_ptr<GainControl> _gain_control;
        boost::shared_ptr<Amp> _amp;
        boost::shared_ptr<PeakMeter> _meter;
 
index 5351d8490a682fce4f0de32d1a93e13ed56afbca..6bc8869d9290305038dac08029ab26ce0b0edc9d 100644 (file)
@@ -495,9 +495,9 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou
 
        boost::shared_ptr<Panner> panner() const;  /* may return null */
        boost::shared_ptr<PannerShell> panner_shell() const;
-       boost::shared_ptr<AutomationControl> gain_control() const;
+       boost::shared_ptr<GainControl> gain_control() const;
        boost::shared_ptr<Pannable> pannable() const;
-       boost::shared_ptr<AutomationControl> trim_control() const;
+       boost::shared_ptr<GainControl> trim_control() const;
 
        /**
           Return the first processor that accepts has at least one MIDI input
index 5db0b94b872c9a1e031868757c7bf9e86aedf9f5..3b0e8a4309ae8ac51c83c9a5bcb0fa1388c20da7 100644 (file)
@@ -32,6 +32,7 @@ namespace ARDOUR {
 
 class PeakMeter;
 class Amp;
+class GainControl;
 
 class LIBARDOUR_API Send : public Delivery
 {
@@ -45,6 +46,7 @@ class LIBARDOUR_API Send : public Delivery
 
        boost::shared_ptr<Amp> amp() const { return _amp; }
        boost::shared_ptr<PeakMeter> meter() const { return _meter; }
+       boost::shared_ptr<GainControl> gain_control() const { return _gain_control; }
 
        bool metering() const { return _metering; }
        void set_metering (bool yn) { _metering = yn; }
@@ -78,7 +80,7 @@ class LIBARDOUR_API Send : public Delivery
 
   protected:
        bool _metering;
-       boost::shared_ptr<AutomationControl> _gain_control;
+       boost::shared_ptr<GainControl> _gain_control;
        boost::shared_ptr<Amp> _amp;
        boost::shared_ptr<PeakMeter> _meter;
        boost::shared_ptr<DelayLine> _delayline;
index 8dfdcb25db2881253e95c11451464e5207928935..75f58b528a7cd50f378d8df966c7ecf36a46686c 100644 (file)
@@ -410,7 +410,7 @@ Route::set_gain (gain_t val, Controllable::GroupControlDisposition group_overrid
 
                if (_route_group->is_relative()) {
 
-                       gain_t usable_gain = _amp->gain();
+                       gain_t usable_gain = _gain_control->get_value();
                        if (usable_gain < 0.000001f) {
                                usable_gain = 0.000001f;
                        }
@@ -4448,13 +4448,13 @@ Route::panner_shell() const
        return _main_outs->panner_shell();
 }
 
-boost::shared_ptr<AutomationControl>
+boost::shared_ptr<GainControl>
 Route::gain_control() const
 {
        return _gain_control;
 }
 
-boost::shared_ptr<AutomationControl>
+boost::shared_ptr<GainControl>
 Route::trim_control() const
 {
        return _trim_control;
index 036aede02eb07196ffba7e9818441321994b6db7..5b5a8f25b184e4220c986811fb205116f2cb42a6 100644 (file)
@@ -178,7 +178,7 @@ gain_t
 RouteGroup::get_min_factor (gain_t factor)
 {
        for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
-               gain_t const g = (*i)->amp()->gain();
+               gain_t const g = (*i)->gain_control()->get_value();
 
                if ((g + g * factor) >= 0.0f) {
                        continue;
@@ -198,7 +198,7 @@ gain_t
 RouteGroup::get_max_factor (gain_t factor)
 {
        for (RouteList::iterator i = routes->begin(); i != routes->end(); i++) {
-               gain_t const g = (*i)->amp()->gain();
+               gain_t const g = (*i)->gain_control()->get_value();
 
                // if the current factor woulnd't raise this route above maximum
                if ((g + g * factor) <= 1.99526231f) {
index 4a18d44a4a697c9051eba7bdc96fb0ae00589d9c..75547b534897c5d077544c727ac3775daedb5fee 100644 (file)
@@ -736,7 +736,7 @@ Session::setup_click ()
        _clicking = false;
 
        boost::shared_ptr<AutomationList> gl (new AutomationList (Evoral::Parameter (GainAutomation)));
-       boost::shared_ptr<AutomationControl> gain_control = boost::shared_ptr<GainControl> (new GainControl (*this, Evoral::Parameter(GainAutomation), gl));
+       boost::shared_ptr<GainControl> gain_control = boost::shared_ptr<GainControl> (new GainControl (*this, Evoral::Parameter(GainAutomation), gl));
 
        _click_io.reset (new ClickIO (*this, X_("Click")));
        _click_gain.reset (new Amp (*this, _("Fader"), gain_control, true));