Add missed parent class call to Sequence::control_list_marked_dirty. Fixes #4335.
[ardour.git] / libs / ardour / route.cc
index 8931bca198b292ac1b951c55e935ed0ba54672a7..e64f21636c55331e60d7497ede1bf4118fd45643 100644 (file)
@@ -570,6 +570,11 @@ Route::set_listen (bool yn, void* src)
                return;
        }
 
+       if (_route_group && src != _route_group && _route_group->is_active() && _route_group->is_solo()) {
+               _route_group->foreach_route (boost::bind (&Route::set_listen, _1, yn, _route_group));
+               return;
+       }
+
        if (_monitor_send) {
                if (yn != _monitor_send->active()) {
                        if (yn) {
@@ -821,7 +826,7 @@ dump_processors(const string& name, const list<boost::shared_ptr<Processor> >& p
        cerr << name << " {" << endl;
        for (list<boost::shared_ptr<Processor> >::const_iterator p = procs.begin();
                        p != procs.end(); ++p) {
-               cerr << "\t" << (*p)->name() << " ID = " << (*p)->id() << endl;
+               cerr << "\t" << (*p)->name() << " ID = " << (*p)->id() << " @ " << (*p) << endl;
        }
        cerr << "}" << endl;
 }
@@ -860,8 +865,6 @@ Route::add_processor (boost::shared_ptr<Processor> processor, ProcessorList::ite
        DEBUG_TRACE (DEBUG::Processors, string_compose (
                             "%1 adding processor %2\n", name(), processor->name()));
 
-       ChanCount old_pms = processor_max_streams;
-
        if (!_session.engine().connected() || !processor) {
                return 1;
        }
@@ -911,7 +914,7 @@ Route::add_processor (boost::shared_ptr<Processor> processor, ProcessorList::ite
 
                if ((pi = boost::dynamic_pointer_cast<PluginInsert>(processor)) != 0) {
 
-                       if (pi->natural_input_streams() == ChanCount::ZERO) {
+                       if (pi->has_no_inputs ()) {
                                /* generator plugin */
                                _have_internal_generator = true;
                        }
@@ -967,6 +970,7 @@ Route::add_processor_from_xml_2X (const XMLNode& node, int version)
                                if (prop->value() == "ladspa" || prop->value() == "Ladspa" ||
                                                prop->value() == "lv2" ||
                                                prop->value() == "vst" ||
+                                               prop->value() == "lxvst" ||
                                                prop->value() == "audiounit") {
 
                                        processor.reset (new PluginInsert (_session));
@@ -1018,8 +1022,6 @@ Route::add_processors (const ProcessorList& others, boost::shared_ptr<Processor>
                loc = _processors.end ();
        }
 
-       ChanCount old_pms = processor_max_streams;
-
        if (!_session.engine().connected()) {
                return 1;
        }
@@ -1044,7 +1046,7 @@ Route::add_processors (const ProcessorList& others, boost::shared_ptr<Processor>
                                pi->set_count (1);
                        }
 
-                       ProcessorList::iterator inserted = _processors.insert (loc, *i);
+                       _processors.insert (loc, *i);
 
                        if ((*i)->active()) {
                                (*i)->activate ();
@@ -1066,7 +1068,7 @@ Route::add_processors (const ProcessorList& others, boost::shared_ptr<Processor>
                        boost::shared_ptr<PluginInsert> pi;
 
                        if ((pi = boost::dynamic_pointer_cast<PluginInsert>(*i)) != 0) {
-                               if (pi->is_generator()) {
+                               if (pi->has_no_inputs ()) {
                                        _have_internal_generator = true;
                                        break;
                                }
@@ -1216,8 +1218,6 @@ Route::ab_plugins (bool forward)
 void
 Route::clear_processors (Placement p)
 {
-       const ChanCount old_pms = processor_max_streams;
-
        if (!_session.engine().connected()) {
                return;
        }
@@ -1298,8 +1298,6 @@ Route::remove_processor (boost::shared_ptr<Processor> processor, ProcessorStream
                return 0;
        }
 
-       ChanCount old_pms = processor_max_streams;
-
        if (!_session.engine().connected()) {
                return 1;
        }
@@ -1369,7 +1367,7 @@ Route::remove_processor (boost::shared_ptr<Processor> processor, ProcessorStream
                        boost::shared_ptr<PluginInsert> pi;
 
                        if ((pi = boost::dynamic_pointer_cast<PluginInsert>(*i)) != 0) {
-                               if (pi->is_generator()) {
+                               if (pi->has_no_inputs ()) {
                                        _have_internal_generator = true;
                                        break;
                                }
@@ -1459,7 +1457,7 @@ Route::remove_processors (const ProcessorList& to_be_deleted, ProcessorStreams*
                        boost::shared_ptr<PluginInsert> pi;
 
                        if ((pi = boost::dynamic_pointer_cast<PluginInsert>(*i)) != 0) {
-                               if (pi->is_generator()) {
+                               if (pi->has_no_inputs ()) {
                                        _have_internal_generator = true;
                                        break;
                                }
@@ -1591,7 +1589,8 @@ Route::configure_processors_unlocked (ProcessorStreams* err)
        }
 
        /* make sure we have sufficient scratch buffers to cope with the new processor
-          configuration */
+          configuration 
+       */
        _session.ensure_buffers (n_process_buffers ());
 
        DEBUG_TRACE (DEBUG::Processors, string_compose ("%1: configuration complete\n", _name));
@@ -2384,6 +2383,7 @@ Route::set_processor_state (const XMLNode& node)
                                } else if (prop->value() == "ladspa" || prop->value() == "Ladspa" ||
                                           prop->value() == "lv2" ||
                                           prop->value() == "vst" ||
+                                                  prop->value() == "lxvst" ||
                                           prop->value() == "audiounit") {
 
                                        processor.reset (new PluginInsert(_session));
@@ -2440,7 +2440,7 @@ Route::set_processor_state (const XMLNode& node)
                        boost::shared_ptr<PluginInsert> pi;
 
                        if ((pi = boost::dynamic_pointer_cast<PluginInsert>(*i)) != 0) {
-                               if (pi->is_generator()) {
+                               if (pi->has_no_inputs ()) {
                                        _have_internal_generator = true;
                                        break;
                                }
@@ -2765,7 +2765,7 @@ Route::pans_required () const
 
 int
 Route::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
-               bool session_state_changing, bool /*can_record*/, bool /*rec_monitors_input*/)
+               bool session_state_changing, bool /*can_record*/)
 {
        Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
        if (!lm.locked()) {
@@ -2801,45 +2801,9 @@ Route::no_roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame,
        return 0;
 }
 
-framecnt_t
-Route::check_initial_delay (framecnt_t nframes, framecnt_t& transport_frame)
-{
-       if (_roll_delay > nframes) {
-
-               _roll_delay -= nframes;
-               silence_unlocked (nframes);
-               /* transport frame is not legal for caller to use */
-               return 0;
-
-       } else if (_roll_delay > 0) {
-
-               nframes -= _roll_delay;
-               silence_unlocked (_roll_delay);
-               transport_frame += _roll_delay;
-
-               /* shuffle all the port buffers for things that lead "out" of this Route
-                  to reflect that we just wrote _roll_delay frames of silence.
-               */
-
-               Glib::RWLock::ReaderLock lm (_processor_lock);
-               for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
-                       boost::shared_ptr<IOProcessor> iop = boost::dynamic_pointer_cast<IOProcessor> (*i);
-                       if (iop) {
-                               iop->increment_port_buffer_offset (_roll_delay);
-                       }
-               }
-               _output->increment_port_buffer_offset (_roll_delay);
-
-               _roll_delay = 0;
-
-       }
-
-       return nframes;
-}
-
 int
 Route::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick,
-            bool /*can_record*/, bool /*rec_monitors_input*/, bool& /* need_butler */)
+            bool /*can_record*/, bool& /* need_butler */)
 {
        Glib::RWLock::ReaderLock lm (_processor_lock, Glib::TRY_LOCK);
        if (!lm.locked()) {
@@ -2872,7 +2836,7 @@ Route::roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, in
 
 int
 Route::silent_roll (pframes_t nframes, framepos_t /*start_frame*/, framepos_t /*end_frame*/,
-                   bool /*can_record*/, bool /*rec_monitors_input*/, bool& /* need_butler */)
+                   bool /*can_record*/, bool& /* need_butler */)
 {
        silence (nframes);
        return 0;
@@ -3780,6 +3744,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 +3755,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);
                }
        }