Use normal Processor run_in_place interface on Meter.
[ardour.git] / libs / ardour / route.cc
index 3cf8fdc985528bdc5baada9f060009be62d0a63c..8193d4ed77ae38929c502dd5f710e254e3ebe301 100644 (file)
@@ -53,7 +53,7 @@ using namespace ARDOUR;
 using namespace PBD;
 
 uint32_t Route::order_key_cnt = 0;
-
+sigc::signal<void> Route::SyncOrderKeys;
 
 Route::Route (Session& sess, string name, int input_min, int input_max, int output_min, int output_max, Flag flg, DataType default_type)
        : IO (sess, name, input_min, input_max, output_min, output_max, default_type),
@@ -161,9 +161,34 @@ void
 Route::set_order_key (const char* name, long n)
 {
        order_keys[strdup(name)] = n;
+
+       if (Config->get_sync_all_route_ordering()) {
+               for (OrderKeys::iterator x = order_keys.begin(); x != order_keys.end(); ++x) {
+                       x->second = n;
+               }
+       } 
+
        _session.set_dirty ();
 }
 
+void
+Route::sync_order_keys ()
+{
+       uint32_t key;
+       
+       if (order_keys.empty()) {
+               return;
+       }
+       
+       OrderKeys::iterator x = order_keys.begin();
+       key = x->second;
+       ++x;
+
+       for (; x != order_keys.end(); ++x) {
+               x->second = key;
+       }
+}
+
 void
 Route::inc_gain (gain_t fraction, void *src)
 {
@@ -316,7 +341,7 @@ Route::process_output_buffers (BufferSet& bufs,
           -------------------------------------------------------------------------------------------------- */
 
        if (meter && (_meter_point == MeterInput)) {
-               _meter->run(bufs, start_frame, end_frame, nframes, offset);
+               _meter->run_in_place(bufs, start_frame, end_frame, nframes, offset);
        }
 
        if (!_soloed && _mute_affects_pre_fader && (mute_gain != dmg)) {
@@ -460,13 +485,9 @@ Route::process_output_buffers (BufferSet& bufs,
                
            // OR recording 
                
-               // h/w monitoring not in use 
-               
-               (!Config->get_monitoring_model() == HardwareMonitoring && 
-
                 // AND software monitoring required
 
-                Config->get_monitoring_model() == SoftwareMonitoring)) { 
+               Config->get_monitoring_model() == SoftwareMonitoring) { 
                
                if (apply_gain_automation) {
                        
@@ -2074,7 +2095,7 @@ Route::set_control_outs (const vector<string>& ports)
        /* now connect to the named ports */
        
        for (size_t n = 0; n < limit; ++n) {
-               if (_control_outs->connect_output (_control_outs->output (n), ports[n], this)) {
+               if (_control_outs->connect_output (_control_outs->output (n), ports[n % ports.size()], this)) {
                        error << string_compose (_("could not connect %1 to %2"), _control_outs->output(n)->name(), ports[n]) << endmsg;
                        return -1;
                }