force AFL monitor/listen send to be at the very end of the Route processor list;...
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 18 Mar 2010 01:31:54 +0000 (01:31 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 18 Mar 2010 01:31:54 +0000 (01:31 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@6773 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/monitor_processor.cc
libs/ardour/route.cc
libs/ardour/send.cc

index aa1609a8445ff7f2ffccad74c724d757a2568a1d..8399c0382ad290b3d61ab360cf3e3aa9e011dec3 100644 (file)
@@ -268,6 +268,8 @@ MonitorProcessor::run (BufferSet& bufs, sframes_t /*start_frame*/, sframes_t /*e
         }
 
         if (_mono) {
+                DEBUG_TRACE (DEBUG::Monitor, "mono-izing\n");
+
                 /* chn is now the number of channels, use as a scaling factor when mixing
                  */
                 gain_t scale = 1.0/chn;
index 41bd1207b5f65769405a13bf8b660df38b6e9160..448e295c1a4558cd2a60dd55ca8c8a82a968db24 100644 (file)
@@ -88,17 +88,33 @@ Route::Route (Session& sess, string name, Flag flg, DataType default_type)
 
        add_processor (_meter, PostFader);
 
+       _main_outs.reset (new Delivery (_session, _output, _mute_master, _name, Delivery::Main));
+        
+        add_processor (_main_outs, PostFader);
+
        if (is_control()) {
                /* where we listen to tracks */
                _intreturn.reset (new InternalReturn (_session));
                add_processor (_intreturn, PreFader);
 
+                ProcessorList::iterator i;
+
+                for (i = _processors.begin(); i != _processors.end(); ++i) {
+                        if (*i == _intreturn) {
+                                ++i;
+                                break;
+                        }
+                }
+
+                /* the thing that provides proper control over a control/monitor/listen bus 
+                   (such as per-channel cut, dim, solo, invert, etc).
+                   It always goes right after the internal return;
+                 */
                 _monitor_control.reset (new MonitorProcessor (_session));
-                add_processor (_monitor_control, PostFader);
+                add_processor (_monitor_control, i);
        }
 
-       _main_outs.reset (new Delivery (_session, _output, _mute_master, _name, Delivery::Main));
-       add_processor (_main_outs, PostFader);
+
 
        /* now that we have _meter, its safe to connect to this */
 
@@ -744,7 +760,7 @@ Route::add_processor (boost::shared_ptr<Processor> processor, Placement placemen
 
 
 /** Add a processor to the route.
- * If @a iter is not NULL, it must point to an iterator in _processors and the new
+ * @a iter must point to an iterator in _processors and the new
  * processor will be inserted immediately before this location.  Otherwise,
  * @a position is used.
  */
@@ -2427,7 +2443,13 @@ Route::listen_via (boost::shared_ptr<Route> route, Placement placement, bool /*a
                _control_outs = listener;
        }
 
-       add_processor (listener, placement);
+        if (placement == PostFader) {
+                /* put it *really* at the end, not just after the panner (main outs)
+                 */
+                add_processor (listener, _processors.end());
+        } else {
+                add_processor (listener, PreFader);
+        }
 
        return 0;
 }
@@ -2803,7 +2825,6 @@ Route::put_control_outs_at (Placement p)
        {
                Glib::RWLock::WriterLock lm (_processor_lock);
                ProcessorList as_it_was (_processors);
-               // Move meter in the processors list
                ProcessorList::iterator loc = find(_processors.begin(), _processors.end(), _control_outs);
                _processors.erase(loc);
                
@@ -2815,13 +2836,11 @@ Route::put_control_outs_at (Placement p)
                        }
                        break;
                case PostFader:
-                       loc = find(_processors.begin(), _processors.end(), _amp);
-                       assert (loc != _processors.end());
-                       loc++;
+                       loc = _processors.end();
                        break;
                }
                
-               _processors.insert(loc, _control_outs);
+               _processors.insert (loc, _control_outs);
 
                if (configure_processors_unlocked (0)) {
                        _processors = as_it_was;
index 037ae9b043001938e2964d62bc213c526163f091..c664d6761789ea7065d3caba83f03e28a3ead233 100644 (file)
@@ -259,9 +259,10 @@ Send::display_to_user () const
 {
        /* we ignore Deliver::_display_to_user */
 
-//     if (_role == Listen || _role == MainListen) {
-//             return false;
-//     }
+       if (_role == Listen) {
+                /* don't make the monitor/control/listen send visible */
+               return false;
+       }
 
        return true;
 }