diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-06-14 19:00:08 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-06-14 19:00:08 +0000 |
commit | 19610514166e42a3c860accf576beb3ac1381a42 (patch) | |
tree | 2e6d00995428aed7188f7fab774230f01d438b9e | |
parent | a5674e92712aacae648e8d55ec7b767b6d988542 (diff) |
monitor send gets access to the (shared) pannable of the track/bus, thus ensuring that the monitor feed is panned. required a few fixes along the way
git-svn-id: svn://localhost/ardour2/branches/3.0@9731 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | libs/ardour/ardour/delivery.h | 2 | ||||
-rw-r--r-- | libs/ardour/ardour/internal_send.h | 3 | ||||
-rw-r--r-- | libs/ardour/ardour/route.h | 4 | ||||
-rw-r--r-- | libs/ardour/delivery.cc | 6 | ||||
-rw-r--r-- | libs/ardour/globals.cc | 3 | ||||
-rw-r--r-- | libs/ardour/internal_send.cc | 41 | ||||
-rw-r--r-- | libs/ardour/route.cc | 3 | ||||
-rw-r--r-- | libs/panners/2in2out/panner_2in2out.cc | 7 |
8 files changed, 55 insertions, 14 deletions
diff --git a/libs/ardour/ardour/delivery.h b/libs/ardour/ardour/delivery.h index 789f1847ba..4501e58b4b 100644 --- a/libs/ardour/ardour/delivery.h +++ b/libs/ardour/ardour/delivery.h @@ -74,7 +74,7 @@ public: void flush_buffers (framecnt_t nframes, framepos_t time); void no_outs_cuz_we_no_monitor(bool); - void cycle_start (pframes_t); + virtual void cycle_start (pframes_t); void transport_stopped (framepos_t frame); void realtime_locate (); diff --git a/libs/ardour/ardour/internal_send.h b/libs/ardour/ardour/internal_send.h index 39dca9a6be..c2cf4b7990 100644 --- a/libs/ardour/ardour/internal_send.h +++ b/libs/ardour/ardour/internal_send.h @@ -39,6 +39,7 @@ class InternalSend : public Send XMLNode& get_state(void); int set_state(const XMLNode& node, int version); + void cycle_start (pframes_t); void run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool); bool feeds (boost::shared_ptr<Route> other) const; bool can_support_io_configuration (const ChanCount& in, ChanCount& out) const; @@ -52,6 +53,8 @@ class InternalSend : public Send return mixbufs; } + void set_can_pan (bool yn); + private: BufferSet mixbufs; boost::shared_ptr<Route> _send_to; diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index d7f76cbf24..fb6d66a246 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -215,7 +215,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember, /* special processors */ - boost::shared_ptr<Delivery> monitor_send() const { return _monitor_send; } + boost::shared_ptr<InternalSend> monitor_send() const { return _monitor_send; } boost::shared_ptr<Delivery> main_outs() const { return _main_outs; } boost::shared_ptr<InternalReturn> internal_return() const { return _intreturn; } boost::shared_ptr<MonitorProcessor> monitor_control() const { return _monitor_control; } @@ -438,7 +438,7 @@ class Route : public SessionObject, public Automatable, public RouteGroupMember, ProcessorList _processors; mutable Glib::RWLock _processor_lock; boost::shared_ptr<Delivery> _main_outs; - boost::shared_ptr<Delivery> _monitor_send; + boost::shared_ptr<InternalSend> _monitor_send; boost::shared_ptr<InternalReturn> _intreturn; boost::shared_ptr<MonitorProcessor> _monitor_control; boost::shared_ptr<Pannable> _pannable; diff --git a/libs/ardour/delivery.cc b/libs/ardour/delivery.cc index 619be9a077..231080a0ad 100644 --- a/libs/ardour/delivery.cc +++ b/libs/ardour/delivery.cc @@ -393,11 +393,6 @@ Delivery::unpan () void Delivery::reset_panner () { - if (_role == Listen) { - /* monitor out gets no panner */ - return; - } - if (panners_legal) { if (!no_panner_reset) { @@ -606,3 +601,4 @@ Delivery::panner () const return boost::shared_ptr<Panner>(); } } + diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc index 83d0990bf4..7238a1f0e6 100644 --- a/libs/ardour/globals.cc +++ b/libs/ardour/globals.cc @@ -161,7 +161,8 @@ setup_hardware_optimization (bool try_optimization) compute_peak = x86_sse_compute_peak; find_peaks = x86_sse_find_peaks; apply_gain_to_buffer = x86_sse_apply_gain_to_buffer; - mix_buffers_with_gain = x86_sse_mix_buffers_with_gain; + // mix_buffers_with_gain = x86_sse_mix_buffers_with_gain; + mix_buffers_with_gain = default_mix_buffers_with_gain; mix_buffers_no_gain = x86_sse_mix_buffers_no_gain; generic_mix_functions = false; diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc index ed7c5e6bc3..d0497aa007 100644 --- a/libs/ardour/internal_send.cc +++ b/libs/ardour/internal_send.cc @@ -24,6 +24,8 @@ #include "ardour/audio_buffer.h" #include "ardour/internal_send.h" #include "ardour/meter.h" +#include "ardour/panner.h" +#include "ardour/panner_shell.h" #include "ardour/route.h" #include "ardour/session.h" @@ -106,7 +108,18 @@ InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame // in-place, which a send must never do. assert(mixbufs.available() >= bufs.count()); - mixbufs.read_from (bufs, nframes); + + boost::shared_ptr<Panner> panner; + + if (_panshell) { + panner = _panshell->panner(); + } + + if (panner && !panner->bypassed()) { + _panshell->run (bufs, mixbufs, start_frame, end_frame, nframes); + } else { + mixbufs.read_from (bufs, nframes); + } /* gain control */ @@ -140,8 +153,6 @@ InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame _amp->run (mixbufs, start_frame, end_frame, nframes, true); - /* XXX NEED TO PAN */ - /* consider metering */ if (_metering) { @@ -304,3 +315,27 @@ InternalSend::send_to_property_changed (const PropertyChange& what_changed) set_name (_send_to->name ()); } } + +void +InternalSend::set_can_pan (bool yn) +{ + boost::shared_ptr<Panner> panner; + + if (_panshell) { + panner = _panshell->panner (); + } + + if (panner) { + panner->set_bypassed (!yn); + } +} + +void +InternalSend::cycle_start (pframes_t nframes) +{ + Delivery::cycle_start (nframes); + + for (BufferSet::audio_iterator b = mixbufs.audio_begin(); b != mixbufs.audio_end(); ++b) { + (*b).prepare (); + } +} diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 8931bca198..9de9e6cf5c 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -3780,6 +3780,7 @@ Route::setup_invisible_processors () new_processors.insert (amp, _monitor_send); break; } + _monitor_send->set_can_pan (false); break; case AfterFaderListen: switch (Config->get_afl_position ()) { @@ -3790,10 +3791,12 @@ Route::setup_invisible_processors () new_processors.insert (new_processors.end(), _monitor_send); break; } + _monitor_send->set_can_pan (true); break; } } else { new_processors.insert (new_processors.end(), _monitor_send); + _monitor_send->set_can_pan (false); } } diff --git a/libs/panners/2in2out/panner_2in2out.cc b/libs/panners/2in2out/panner_2in2out.cc index df859a1eff..0c5184efe6 100644 --- a/libs/panners/2in2out/panner_2in2out.cc +++ b/libs/panners/2in2out/panner_2in2out.cc @@ -49,6 +49,7 @@ #include "ardour/runtime_functions.h" #include "ardour/session.h" #include "ardour/utils.h" +#include "ardour/mix.h" #include "panner_2in2out.h" @@ -269,7 +270,8 @@ Panner2in2out::distribute_one (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gai if (pan != 0.0f) { /* pan is 1 but also not 0, so we must do it "properly" */ - + + //obufs.get_audio(1).read_from (srcbuf, nframes); mix_buffers_with_gain(dst,src,nframes,pan); /* mark that we wrote into the buffer */ @@ -328,7 +330,8 @@ Panner2in2out::distribute_one (AudioBuffer& srcbuf, BufferSet& obufs, gain_t gai /* pan is not 1 but also not 0, so we must do it "properly" */ mix_buffers_with_gain(dst,src,nframes,pan); - + // obufs.get_audio(1).read_from (srcbuf, nframes); + /* XXX it would be nice to mark the buffer as written to */ } |