fix merge issues with master
[ardour.git] / libs / ardour / plugin_manager.cc
index 71b630c44d71a9ab4df52dc5fff948ddf27ef691..90522a7e06b2ca76efea55d2bff2b49e7f5b355f 100644 (file)
@@ -53,7 +53,7 @@
 #include "ardour/ladspa_plugin.h"
 #include "ardour/plugin.h"
 #include "ardour/plugin_manager.h"
-#include "ardour/session.h"
+#include "ardour/rc_configuration.h"
 
 #ifdef LV2_SUPPORT
 #include "ardour/lv2_plugin.h"
@@ -278,9 +278,10 @@ PluginManager::ladspa_discover_from_path (string /*path*/)
                for (x = plugin_objects->begin(); x != plugin_objects->end (); ++x) {
                        ladspa_discover (**x);
                }
+
+               vector_delete (plugin_objects);
        }
 
-       vector_delete (plugin_objects);
        return ret;
 }
 
@@ -334,9 +335,9 @@ PluginManager::add_presets(string domain)
                                warning << string_compose(_("Could not parse rdf file: %1"), *x) << endmsg;
                        }
                }
+               
+               vector_delete (presets);
        }
-
-       vector_delete (presets);
 }
 
 void
@@ -356,9 +357,9 @@ PluginManager::add_lrdf_data (const string &path)
                                warning << "Could not parse rdf file: " << uri << endmsg;
                        }
                }
-       }
 
-       vector_delete (rdf_files);
+               vector_delete (rdf_files);
+       }
 }
 
 int
@@ -452,7 +453,7 @@ PluginManager::get_ladspa_category (uint32_t plugin_id)
 
        snprintf(buf, sizeof(buf), "%s%" PRIu32, LADSPA_BASE, plugin_id);
        pattern.subject = buf;
-       pattern.predicate = (char*)RDF_TYPE;
+       pattern.predicate = const_cast<char*>(RDF_TYPE);
        pattern.object = 0;
        pattern.object_type = lrdf_uri;
 
@@ -463,7 +464,7 @@ PluginManager::get_ladspa_category (uint32_t plugin_id)
        }
 
        pattern.subject = matches1->object;
-       pattern.predicate = (char*)(LADSPA_BASE "hasLabel");
+       pattern.predicate = const_cast<char*>(LADSPA_BASE "hasLabel");
        pattern.object = 0;
        pattern.object_type = lrdf_literal;
 
@@ -510,6 +511,7 @@ PluginManager::get_ladspa_category (uint32_t plugin_id)
 void
 PluginManager::lv2_refresh ()
 {
+       DEBUG_TRACE (DEBUG::PluginManager, "LV2: refresh\n");
        delete _lv2_plugin_info;
        _lv2_plugin_info = LV2PluginInfo::discover();
 }
@@ -578,9 +580,10 @@ PluginManager::windows_vst_discover_from_path (string path)
                for (x = plugin_objects->begin(); x != plugin_objects->end (); ++x) {
                        windows_vst_discover (**x);
                }
+
+               vector_delete (plugin_objects);
        }
 
-       vector_delete (plugin_objects);
        return ret;
 }
 
@@ -596,8 +599,8 @@ PluginManager::windows_vst_discover (string path)
        }
 
        if (!finfo->canProcessReplacing) {
-               warning << string_compose (_("VST plugin %1 does not support processReplacing, and so cannot be used in ardour at this time"),
-                                   finfo->name)
+               warning << string_compose (_("VST plugin %1 does not support processReplacing, and so cannot be used in %2 at this time"),
+                                          finfo->name, PROGRAM_NAME)
                        << endl;
        }
 
@@ -683,9 +686,10 @@ PluginManager::lxvst_discover_from_path (string path)
                for (x = plugin_objects->begin(); x != plugin_objects->end (); ++x) {
                        lxvst_discover (**x);
                }
+
+               vector_delete (plugin_objects);
        }
 
-       vector_delete (plugin_objects);
        return ret;
 }
 
@@ -695,14 +699,15 @@ PluginManager::lxvst_discover (string path)
        VSTInfo* finfo;
        char buf[32];
 
+       DEBUG_TRACE (DEBUG::PluginManager, string_compose ("checking apparent LXVST plugin at %1\n", path));
+
        if ((finfo = vstfx_get_info (const_cast<char *> (path.c_str()))) == 0) {
-               warning << "Cannot get linuxVST information from " << path << endmsg;
                return -1;
        }
 
        if (!finfo->canProcessReplacing) {
-               warning << string_compose (_("linuxVST plugin %1 does not support processReplacing, and so cannot be used in ardour at this time"),
-                                   finfo->name)
+               warning << string_compose (_("linuxVST plugin %1 does not support processReplacing, and so cannot be used in %2 at this time"),
+                                          finfo->name, PROGRAM_NAME)
                        << endl;
        }
 
@@ -768,10 +773,9 @@ void
 PluginManager::save_statuses ()
 {
        ofstream ofs;
-       sys::path path = user_config_directory();
-       path /= "plugin_statuses";
+       std::string path = Glib::build_filename (user_config_directory(), "plugin_statuses");
 
-       ofs.open (path.to_string().c_str(), ios_base::openmode (ios::out|ios::trunc));
+       ofs.open (path.c_str(), ios_base::openmode (ios::out|ios::trunc));
 
        if (!ofs) {
                return;
@@ -821,9 +825,8 @@ PluginManager::save_statuses ()
 void
 PluginManager::load_statuses ()
 {
-       sys::path path = user_config_directory();
-       path /= "plugin_statuses";
-       ifstream ifs (path.to_string().c_str());
+       std::string path = Glib::build_filename (user_config_directory(), "plugin_statuses");
+       ifstream ifs (path.c_str());
 
        if (!ifs) {
                return;