monitor send gets access to the (shared) pannable of the track/bus, thus ensuring...
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 14 Jun 2011 19:00:08 +0000 (19:00 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 14 Jun 2011 19:00:08 +0000 (19:00 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@9731 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/ardour/delivery.h
libs/ardour/ardour/internal_send.h
libs/ardour/ardour/route.h
libs/ardour/delivery.cc
libs/ardour/globals.cc
libs/ardour/internal_send.cc
libs/ardour/route.cc
libs/panners/2in2out/panner_2in2out.cc

index 789f1847ba139b07579479ac65cb6ac77b6c7c7f..4501e58b4b210a555379bd3f45679914254d67c8 100644 (file)
@@ -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 ();
 
index 39dca9a6bed9ffd36c26dbca69b9af0643c627a9..c2cf4b79901e62d5cdbd4c9ff136a3d11901707e 100644 (file)
@@ -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;
index d7f76cbf2438fcb543735936a7f2675ea7e34376..fb6d66a2465b7287fe2c62c78fc5a0f4deaef2d0 100644 (file)
@@ -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;
index 619be9a07764cb35d0a04cfaf77aa3e7d211d69e..231080a0ad51f04c64f151ca09ddde72b5f81208 100644 (file)
@@ -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>();
        }
 }
+
index 83d0990bf4fde0ef81229326035ad8c8bed4d2f6..7238a1f0e6caf851a92fe16cf3dc1291d15c0d18 100644 (file)
@@ -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;
index ed7c5e6bc3c91edd64451522eb98a7e700d92d28..d0497aa0070f42c323c10b7451bb8a2846f8eca8 100644 (file)
@@ -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 ();
+       }
+}      
index 8931bca198b292ac1b951c55e935ed0ba54672a7..9de9e6cf5cef91004e1eb29ccab7ac6c1a92a6ad 100644 (file)
@@ -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);
                }
        }
 
index df859a1eff67e7967e32886e07891b4b185e666d..0c5184efe6351983ed95bd23f5a4b3803d643071 100644 (file)
@@ -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 */
                        }