diff options
-rw-r--r-- | libs/ardour/ardour/route.h | 2 | ||||
-rw-r--r-- | libs/ardour/route.cc | 21 |
2 files changed, 22 insertions, 1 deletions
diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index 5d52fc0c52..ff10c30ce1 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -188,6 +188,7 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou /* Processors */ boost::shared_ptr<Amp> amp() const { return _amp; } + boost::shared_ptr<Amp> trim() const { return _trim; } PeakMeter& peak_meter() { return *_meter.get(); } const PeakMeter& peak_meter() const { return *_meter.get(); } boost::shared_ptr<PeakMeter> shared_peak_meter() const { return _meter; } @@ -567,6 +568,7 @@ class LIBARDOUR_API Route : public SessionObject, public Automatable, public Rou virtual void maybe_declick (BufferSet&, framecnt_t, int); boost::shared_ptr<Amp> _amp; + boost::shared_ptr<Amp> _trim; boost::shared_ptr<PeakMeter> _meter; boost::shared_ptr<DelayLine> _delayline; diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index c2a7c62f6d..dc969723cb 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -37,6 +37,7 @@ #include "ardour/amp.h" #include "ardour/audio_buffer.h" +#include "ardour/audio_track.h" #include "ardour/audio_port.h" #include "ardour/audioengine.h" #include "ardour/buffer.h" @@ -157,6 +158,17 @@ Route::init () _amp.reset (new Amp (_session)); add_processor (_amp, PostFader); + /* and input trim */ + _trim.reset (new Amp (_session, "trim")); + _trim->set_display_to_user (false); + + if (dynamic_cast<AudioTrack*>(this)) { + /* we can't do this in the AudioTrack's constructor + * because _trim does not exit then + */ + _trim->activate(); + } + /* create standard processors: meter, main outs, monitor out; they will be added to _processors by setup_invisible_processors () */ @@ -1664,7 +1676,7 @@ Route::remove_processors (const ProcessorList& to_be_deleted, ProcessorStreams* /* these can never be removed */ - if (processor == _amp || processor == _meter || processor == _main_outs || processor == _delayline) { + if (processor == _amp || processor == _meter || processor == _main_outs || processor == _delayline || processor == _trim) { ++i; continue; } @@ -2634,6 +2646,9 @@ Route::set_processor_state (const XMLNode& node) if (prop->value() == "amp") { _amp->set_state (**niter, Stateful::current_state_version); new_order.push_back (_amp); + } else if (prop->value() == "trim") { + _trim->set_state (**niter, Stateful::current_state_version); + new_order.push_back (_trim); } else if (prop->value() == "meter") { _meter->set_state (**niter, Stateful::current_state_version); new_order.push_back (_meter); @@ -4233,6 +4248,10 @@ Route::setup_invisible_processors () new_processors.push_front (_intreturn); } + if (_trim && _trim->active()) { + assert (!_trim->display_to_user ()); + new_processors.push_front (_trim); + } /* EXPORT PROCESSOR */ if (_capturing_processor) { |