Use PLATFORM_WINDOWS (in preference to WIN32) for consistency with the other libraries
[ardour.git] / libs / ardour / port.cc
index 8fadad4fcc91f81e340b039da540db0278c6e5cc..19bebd103fe4e3c3d13fb439b1b53f71ccc68585 100644 (file)
@@ -21,8 +21,6 @@
 #include "libardour-config.h"
 #endif
 
-#include <jack/weakjack.h> // so that we can test for new functions at runtime
-
 #include "pbd/compose.h"
 #include "pbd/error.h"
 #include "pbd/failed_constructor.h"
@@ -122,7 +120,7 @@ Port::disconnect_all ()
 bool
 Port::connected_to (std::string const & o) const
 {
-       if (!port_engine.connected()) {
+       if (!port_engine.available()) {
                return false;
        }
 
@@ -132,7 +130,7 @@ Port::connected_to (std::string const & o) const
 int
 Port::get_connections (std::vector<std::string> & c) const
 {
-       if (!port_engine.connected()) {
+       if (!port_engine.available()) {
                c.insert (c.end(), _connections.begin(), _connections.end());
                return c.size();
        }
@@ -153,8 +151,10 @@ Port::connect (std::string const & other)
        }
 
        if (sends_output ()) {
+               DEBUG_TRACE (DEBUG::Ports, string_compose ("Connect %1 to %2\n", our_name, other_name));
                r = port_engine.connect (our_name, other_name);
        } else {
+               DEBUG_TRACE (DEBUG::Ports, string_compose ("Connect %1 to %2\n", other_name, our_name));
                r = port_engine.connect (other_name, our_name);
        }
 
@@ -378,7 +378,7 @@ Port::get_connected_latency_range (LatencyRange& range, bool playback) const
 
                                 boost::shared_ptr<Port> remote_port = AudioEngine::instance()->get_port_by_name (*c);
                                 if (remote_port) {
-                                        lr = remote_port->private_latency_range ((playback ? JackPlaybackLatency : JackCaptureLatency));
+                                        lr = remote_port->private_latency_range ((playback ? true : false));
                                         DEBUG_TRACE (DEBUG::Latency, string_compose (
                                                              "\t%1 <-LOCAL-> %2 : latter has latency range %3 .. %4\n",
                                                              name(), *c, lr.min, lr.max));
@@ -420,6 +420,8 @@ Port::reconnect ()
 {
        /* caller must hold process lock; intended to be used only after reestablish() */
 
+       DEBUG_TRACE (DEBUG::Ports, string_compose ("Connect %1 to %2 destinations\n",name(), _connections.size()));
+
        for (std::set<string>::iterator i = _connections.begin(); i != _connections.end(); ++i) {
                if (connect (*i)) {
                        return -1;