Commit read-only stack security fix for 64bit processors.
[ardour.git] / libs / ardour / plugin.cc
index bedc32a0b359f53e951ef1f344458fea05b05b71..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;
        }
@@ -261,7 +263,7 @@ ARDOUR::find_plugin(Session& session, string name, long unique_id, PluginType ty
                break;
 #endif
 
-#ifdef HAVE_COREAUDIO
+#ifdef HAVE_AUDIOUNITS
        case ARDOUR::AudioUnit:
                plugs = AUPluginInfo::discover ();
                unique_id = 0; // Neither do AU.
@@ -282,3 +284,4 @@ ARDOUR::find_plugin(Session& session, string name, long unique_id, PluginType ty
        
        return PluginPtr ((Plugin*) 0);
 }
+