optimize some performance bottlenecks; remove jack_nframes_t that crept back into...
[ardour.git] / libs / ardour / io.cc
index 7ed6158b850aff72d751c9468077727762bf92f8..67f365a400ab6b61316463f15b506bb2fb08b548 100644 (file)
@@ -27,6 +27,7 @@
 #include <glibmm/thread.h>
 
 #include <pbd/xml++.h>
+#include <pbd/replace_all.h>
 
 #include <ardour/audioengine.h>
 #include <ardour/io.h>
@@ -1354,8 +1355,10 @@ IO::set_state (const XMLNode& node)
                        set_automation_state (*(*iter)->children().front());
                }
 
-               if ((*iter)->name() == X_("gaincontrol")) {
-                       _gain_control.set_state (**iter);
+               if ((*iter)->name() == X_("controllable")) {
+                       if ((prop = (*iter)->property("name")) != 0 && prop->value() == "gaincontrol") {
+                               _gain_control.set_state (**iter);
+                       }
                }
        }
 
@@ -1441,7 +1444,7 @@ IO::load_automation (string path)
 
        while (in.getline (line, sizeof(line), '\n')) {
                char type;
-               jack_nframes_t when;
+               nframes_t when;
                double value;
 
                if (++linecnt == 1) {
@@ -1815,6 +1818,12 @@ IO::set_name (string name, void* src)
                return 0;
        }
 
+       /* replace all colons in the name. i wish we didn't have to do this */
+
+       if (replace_all (name, ":", "-")) {
+               warning << _("you cannot use colons to name objects with I/O connections") << endmsg;
+       }
+
        for (PortSet::iterator i = _inputs.begin(); i != _inputs.end(); ++i) {
                string current_name = i->short_name();
                current_name.replace (current_name.find (_name), _name.length(), name);