fix -Wreorder
[ardour.git] / libs / backends / wavesaudio / waves_dataport.cc
index d1dacc90ebb89780422f389564f822a5dd671e94..5e958279f9b7445d654ce67f03402a3ffbe8f481 100644 (file)
@@ -26,16 +26,16 @@ WavesDataPort::WavesDataPort (const std::string& inport_name, PortFlags inflags)
     : _name (inport_name)
     , _flags (inflags)
 {
-    _capture_latency_range.min = 
-    _capture_latency_range.max = 
-    _playback_latency_range.min = 
+    _capture_latency_range.min =
+    _capture_latency_range.max =
+    _playback_latency_range.min =
     _playback_latency_range.max = 0;
 }
 
 
 WavesDataPort::~WavesDataPort ()
 {
-    disconnect_all ();
+    _disconnect_all ();
 }
 
 
@@ -63,11 +63,11 @@ int WavesDataPort::connect (WavesDataPort *port)
 
     if (this == port) {
         std::cerr << "WavesDataPort::connect (): attempt to connect port to itself!" << std::endl;
-        return -1; 
+        return -1;
     }
 
     if (is_connected (port)) {
-        std::cerr << "WavesDataPort::connect (): the ports are already connected!" << std::endl;
+        // std::cerr << "WavesDataPort::connect (): the ports are already connected!" << std::endl;
         return -1;
     }
 
@@ -106,7 +106,7 @@ int WavesDataPort::disconnect (WavesDataPort *port)
 void WavesDataPort::_disconnect (WavesDataPort *port, bool api_call)
 {
     std::vector<WavesDataPort*>::iterator it = std::find (_connections.begin (), _connections.end (), port);
-    
+
     if (it != _connections.end ()) { // actually, it's supposed to be always true.
         _connections.erase (it);
     }
@@ -115,14 +115,22 @@ void WavesDataPort::_disconnect (WavesDataPort *port, bool api_call)
         port->_disconnect (this, false);
     }
 
-       if (is_input() && _connections.empty())
-       {
+       if (is_input() && _connections.empty()) {
                _wipe_buffer();
        }
 }
 
 
 void WavesDataPort::disconnect_all ()
+{
+    _disconnect_all ();
+
+       if (is_input()) {
+               _wipe_buffer();
+       }
+}
+
+void WavesDataPort::_disconnect_all ()
 {
     while (!_connections.empty ()) {
         _connections.back ()->_disconnect (this, false);
@@ -130,7 +138,6 @@ void WavesDataPort::disconnect_all ()
     }
 }
 
-
 bool WavesDataPort::is_physically_connected () const
 {
     for (std::vector<WavesDataPort*>::const_iterator it = _connections.begin (); it != _connections.end (); ++it) {