Introduce global default-fade-shape configuration variable
[ardour.git] / libs / ardour / bundle.cc
index cf393644fca18c30f81b239214e3fc8493d634e3..834a98d347d4d2a1d3deaebc655f816dec6fee6c 100644 (file)
@@ -206,6 +206,7 @@ Bundle::remove_channel (uint32_t ch)
        Glib::Threads::Mutex::Lock lm (_channel_mutex);
        _channel.erase (_channel.begin () + ch);
 
+       lm.release();
        emit_changed (ConfigurationChanged);
 }
 
@@ -217,6 +218,7 @@ Bundle::remove_channels ()
 
        _channel.clear ();
 
+       lm.release();
        emit_changed (ConfigurationChanged);
 }
 
@@ -441,27 +443,26 @@ Bundle::connected_to (boost::shared_ptr<Bundle> other, AudioEngine & engine)
        return true;
 }
 
-/** This must not be called in code executed as a response to a JACK event,
- *  as it uses jack_port_get_all_connections().
+/** This must not be called in code executed as a response to a backend event,
+ *  as it uses the backend port_get_all_connections().
  *  @return true if any of this bundle's channels are connected to anything.
  */
 bool
 Bundle::connected_to_anything (AudioEngine& engine)
 {
+       PortManager& pm (engine);
+
        for (uint32_t i = 0; i < nchannels().n_total(); ++i) {
                Bundle::PortList const & ports = channel_ports (i);
 
                for (uint32_t j = 0; j < ports.size(); ++j) {
-                       /* ports[j] may not be an Ardour port, so use JACK directly
+
+                       /* ports[j] may not be an Ardour port, so use the port manager directly
                           rather than doing it with Port.
                        */
-                       jack_port_t* jp = jack_port_by_name (engine.jack(), ports[j].c_str());
-                       if (jp) {
-                               const char ** c = jack_port_get_all_connections (engine.jack(), jp);
-                               if (c) {
-                                       jack_free (c);
-                                       return true;
-                               }
+
+                       if (pm.connected (ports[j])) {
+                               return true;
                        }
                }
        }