do not crash when loading old history files with MIDI edits; add all notes in region...
[ardour.git] / libs / ardour / port.cc
index d5021026de593cbaa11d378059f20c96ee7eb92e..4b4f0a939ad5d55da3c66cfa7014b76800bd4ea4 100644 (file)
 
 */
 
+#ifdef WAF_BUILD
+#include "libardour-config.h"
+#endif
+
 #include "ardour/port.h"
 #include "ardour/audioengine.h"
 #include "pbd/failed_constructor.h"
@@ -210,6 +214,7 @@ Port::total_latency () const
 int
 Port::reestablish ()
 {
+       cerr << "RE-REGISTER: " << _name.c_str() << endl;
        _jack_port = jack_port_register (_engine->jack(), _name.c_str(), type().to_jack_type(), _flags, 0);
 
        if (_jack_port == 0) {
@@ -237,15 +242,18 @@ Port::reconnect ()
        return 0;
 }
 
-/** @param n Short name */
+/** @param n Short port name (no JACK client name) */
 int
 Port::set_name (std::string const & n)
 {
-       assert (_name.find_first_of (':') == std::string::npos);
+       if (n == _name) {
+               return 0;
+       }
 
        int const r = jack_port_set_name (_jack_port, n.c_str());
+
        if (r == 0) {
-               _name = n;
+               _name = n; 
        }
 
        return r;