new automation state model, sort of working, but not really
[ardour.git] / libs / ardour / plugin.cc
index 8d200b0ee413b30a273de56d59d90e81335bd72e..3b471014eb503199216d69200fb4f7d405c224c7 100644 (file)
@@ -95,15 +95,17 @@ Plugin::get_nth_control (uint32_t n)
                Plugin::ParameterDescriptor desc;
 
                get_parameter_descriptor (n, desc);
-               
-               controls[n] = new PortControllable (*this, n, desc.lower, desc.upper, desc.toggled, desc.logarithmic);
+       
+               controls[n] = new PortControllable (describe_parameter (n), *this, n, 
+                                                   desc.lower, desc.upper, desc.toggled, desc.logarithmic);
        } 
 
        return controls[n];
 }
 
-Plugin::PortControllable::PortControllable (Plugin& p, uint32_t port_id, float low, float up, bool t, bool loga)
-       : plugin (p), absolute_port (port_id)
+Plugin::PortControllable::PortControllable (string name, Plugin& p, uint32_t port_id, 
+                                           float low, float up, bool t, bool loga)
+       : Controllable (name), plugin (p), absolute_port (port_id)
 {
        toggled = t;
        logarithmic = loga;
@@ -224,13 +226,13 @@ Plugin::save_preset (string name, string domain)
        free(lrdf_add_preset(source.c_str(), name.c_str(), unique_id(), &defaults));
 
        string path = string_compose("%1/.%2", envvar, domain);
-       if (mkdir(path.c_str(), 0775) && errno != EEXIST) {
+       if (g_mkdir_with_parents (path.c_str(), 0775)) {
                warning << string_compose(_("Could not create %1.  Preset not saved. (%2)"), path, strerror(errno)) << endmsg;
                return false;
        }
        
        path += "/rdf";
-       if (mkdir(path.c_str(), 0775) && errno != EEXIST) {
+       if (g_mkdir_with_parents (path.c_str(), 0775)) {
                warning << string_compose(_("Could not create %1.  Preset not saved. (%2)"), path, strerror(errno)) << endmsg;
                return false;
        }