rationalize (a bit) engine start/stop/restart so that it is possible to start up...
[ardour.git] / libs / ardour / bundle.cc
index 0ac62d70762d6a78fbccd8b692bfecee97728810..be4b04e36a4966b69691256cb4b32394ff2fa876 100644 (file)
@@ -450,20 +450,19 @@ Bundle::connected_to (boost::shared_ptr<Bundle> other, AudioEngine & engine)
 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;
                        }
                }
        }