refactor MIDISceneChange color property addition by moving it into SceneChange to...
[ardour.git] / libs / ardour / audio_unit.cc
index 1a24977399e504d8c4a1ca8522b0c7f723d49f7f..add2407f841cfc87f9602aed7f4911c934fc3e64 100644 (file)
@@ -28,7 +28,7 @@
 #include "pbd/xml++.h"
 #include "pbd/convert.h"
 #include "pbd/whitespace.h"
-#include "pbd/pathscanner.h"
+#include "pbd/file_utils.h"
 #include "pbd/locale_guard.h"
 
 #include <glibmm/threads.h>
@@ -2049,20 +2049,19 @@ AUPlugin::current_preset() const
 void
 AUPlugin::find_presets ()
 {
-       vector<string*>* preset_files;
-       PathScanner scanner;
+       vector<string> preset_files;
 
        user_preset_map.clear ();
 
-       preset_files = scanner (preset_search_path, au_preset_filter, this, true, true, -1, true);
+       find_files_matching_filter (preset_files, preset_search_path, au_preset_filter, this, true, true, true);
 
-       if (!preset_files) {
+       if (preset_files.empty()) {
                return;
        }
 
-       for (vector<string*>::iterator x = preset_files->begin(); x != preset_files->end(); ++x) {
+       for (vector<string>::iterator x = preset_files.begin(); x != preset_files.end(); ++x) {
 
-               string path = *(*x);
+               string path = *x;
                string preset_name;
 
                /* make an initial guess at the preset name using the path */
@@ -2079,11 +2078,8 @@ AUPlugin::find_presets ()
                        user_preset_map[preset_name] = path;
                }
 
-               delete *x;
        }
 
-       delete preset_files;
-
        /* now fill the vector<string> with the names we have */
 
        for (UserPresetMap::iterator i = user_preset_map.begin(); i != user_preset_map.end(); ++i) {
@@ -2278,6 +2274,7 @@ AUPluginInfo::discover_by_description (PluginInfoList& plugs, CAComponentDescrip
                }
 
                AUPluginInfo::get_names (temp, info->name, info->creator);
+               ARDOUR::PluginScanMessage(_("AU"), info->name, false);
 
                info->type = ARDOUR::AudioUnit;
                info->unique_id = stringify_descriptor (*info->descriptor);