en/disable internal send+returns with tracks en/disable.
authorRobin Gareus <robin@gareus.org>
Sun, 22 Jun 2014 22:48:47 +0000 (00:48 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 22 Jun 2014 22:48:47 +0000 (00:48 +0200)
gtk2_ardour/processor_box.cc
libs/ardour/ardour/internal_send.h
libs/ardour/internal_return.cc
libs/ardour/internal_send.cc
libs/ardour/route.cc

index aa8f285a43efc41d519b3dd4cdd0fee7807395c8..56d2d371ebb7d242009be0755a945941fcf21936 100644 (file)
@@ -2111,8 +2111,8 @@ ProcessorBox::paste_processor_state (const XMLNodeList& nlist, boost::shared_ptr
 
                                boost::shared_ptr<Pannable> sendpan(new Pannable (*_session));
                                XMLNode n (**niter);
-                                InternalSend* s = new InternalSend (*_session, sendpan, _route->mute_master(),
-                                                                   boost::shared_ptr<Route>(), Delivery::Aux); 
+                               InternalSend* s = new InternalSend (*_session, sendpan, _route->mute_master(),
+                                               _route, boost::shared_ptr<Route>(), Delivery::Aux);
 
                                IOProcessor::prepare_for_reset (n, s->name());
 
index a06bf399065a8c646712813d78a6c702662795b6..6feeb35c6d006b2014493ad82c91908d84803231 100644 (file)
@@ -28,7 +28,7 @@ namespace ARDOUR {
 class LIBARDOUR_API InternalSend : public Send
 {
   public:
-       InternalSend (Session&, boost::shared_ptr<Pannable>, boost::shared_ptr<MuteMaster>, boost::shared_ptr<Route> send_to, Delivery::Role role = Delivery::Aux, bool ignore_bitslot = false);
+       InternalSend (Session&, boost::shared_ptr<Pannable>, boost::shared_ptr<MuteMaster>, boost::shared_ptr<Route> send_from, boost::shared_ptr<Route> send_to, Delivery::Role role = Delivery::Aux, bool ignore_bitslot = false);
        virtual ~InternalSend ();
 
        std::string display_name() const;
@@ -46,6 +46,7 @@ class LIBARDOUR_API InternalSend : public Send
        bool configure_io (ChanCount in, ChanCount out);
        int  set_block_size (pframes_t);
 
+       boost::shared_ptr<Route> source_route() const { return _send_from; }
        boost::shared_ptr<Route> target_route() const { return _send_to; }
        const PBD::ID& target_id() const { return _send_to_id; }
 
@@ -60,6 +61,7 @@ class LIBARDOUR_API InternalSend : public Send
 
   private:
        BufferSet mixbufs;
+       boost::shared_ptr<Route> _send_from;
        boost::shared_ptr<Route> _send_to;
        PBD::ID _send_to_id;
        PBD::ScopedConnection connect_c;
index fc5963603b5ac572d7d9313b3211b0b2c07bacc4..1eae5d31719e4fde4a97f8a19e1594729e4264f1 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "ardour/internal_return.h"
 #include "ardour/internal_send.h"
+#include "ardour/route.h"
 
 using namespace std;
 using namespace ARDOUR;
@@ -41,7 +42,7 @@ InternalReturn::run (BufferSet& bufs, framepos_t /*start_frame*/, framepos_t /*e
        
        if (lm.locked ()) {
                for (list<InternalSend*>::iterator i = _sends.begin(); i != _sends.end(); ++i) {
-                       if ((*i)->active ()) {
+                       if ((*i)->active () && (!(*i)->source_route() || (*i)->source_route()->active())) {
                                bufs.merge_from ((*i)->get_buffers(), nframes);
                        }
                }
index 23d9221086f8455ad3b56439e6e9e4257f7e35e0..e5c7232f480f7d69db09b5ecec96637d31bbb031 100644 (file)
@@ -40,14 +40,21 @@ using namespace std;
 
 PBD::Signal1<void, pframes_t> InternalSend::CycleStart;
 
-InternalSend::InternalSend (Session& s, boost::shared_ptr<Pannable> p, boost::shared_ptr<MuteMaster> mm, boost::shared_ptr<Route> sendto, Delivery::Role role, bool ignore_bitslot)
+InternalSend::InternalSend (Session& s,
+               boost::shared_ptr<Pannable> p,
+               boost::shared_ptr<MuteMaster> mm,
+               boost::shared_ptr<Route> sendfrom,
+               boost::shared_ptr<Route> sendto,
+               Delivery::Role role,
+               bool ignore_bitslot)
        : Send (s, p, mm, role, ignore_bitslot)
+       , _send_from (sendfrom)
 {
-        if (sendto) {
-                if (use_target (sendto)) {
-                        throw failed_constructor();
-                }
-        }
+       if (sendto) {
+               if (use_target (sendto)) {
+                       throw failed_constructor();
+               }
+       }
 
        init_gain ();
 
index b50492031fcb43d81cae91f83e07fefd59c0c79c..6a23ca70d4be240e2ff4b1c929527b8bdb4f5579 100644 (file)
@@ -2643,7 +2643,7 @@ Route::set_processor_state (const XMLNode& node)
 
                                if (prop->value() == "intsend") {
 
-                                       processor.reset (new InternalSend (_session, _pannable, _mute_master, boost::shared_ptr<Route>(), Delivery::Aux, true));
+                                       processor.reset (new InternalSend (_session, _pannable, _mute_master, boost::shared_ptr<ARDOUR::Route>(this), boost::shared_ptr<Route>(), Delivery::Aux, true));
 
                                } else if (prop->value() == "ladspa" || prop->value() == "Ladspa" ||
                                           prop->value() == "lv2" ||
@@ -2812,7 +2812,7 @@ Route::enable_monitor_send ()
 
        /* make sure we have one */
        if (!_monitor_send) {
-               _monitor_send.reset (new InternalSend (_session, _pannable, _mute_master, _session.monitor_out(), Delivery::Listen));
+               _monitor_send.reset (new InternalSend (_session, _pannable, _mute_master, boost::shared_ptr<ARDOUR::Route>(this), _session.monitor_out(), Delivery::Listen));
                _monitor_send->set_display_to_user (false);
        }
 
@@ -2850,7 +2850,7 @@ Route::add_aux_send (boost::shared_ptr<Route> route, boost::shared_ptr<Processor
                {
                        Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
                        boost::shared_ptr<Pannable> sendpan (new Pannable (_session));
-                       listener.reset (new InternalSend (_session, sendpan, _mute_master, route, Delivery::Aux));
+                       listener.reset (new InternalSend (_session, sendpan, _mute_master, boost::shared_ptr<ARDOUR::Route>(this), route, Delivery::Aux));
                }
 
                add_processor (listener, before);