#include "pbd/xml++.h"
#include "pbd/error.h"
-#include "pbd/pathscanner.h"
+#include "pbd/file_utils.h"
+#include "pbd/stl_delete.h"
#include "pbd/replace_all.h"
#include "ardour/filesystem_paths.h"
#include "i18n.h"
-using namespace Mackie;
using namespace PBD;
using namespace ARDOUR;
+using namespace ArdourSurface;
+using namespace Mackie;
+
using std::string;
using std::vector;
void
DeviceProfile::reload_device_profiles ()
{
- DeviceProfile dp;
vector<string> s;
- vector<string *> *devprofiles;
- PathScanner scanner;
+ vector<string> devprofiles;
Searchpath spath (devprofile_search_path());
- devprofiles = scanner (spath.to_string(), devprofile_filter, 0, false, true);
+ find_files_matching_filter (devprofiles, spath, devprofile_filter, 0, false, true);
device_profiles.clear ();
- if (!devprofiles) {
+ if (devprofiles.empty()) {
error << "No MCP device info files found using " << spath.to_string() << endmsg;
return;
}
- if (devprofiles->empty()) {
- error << "No MCP device info files found using " << spath.to_string() << endmsg;
- return;
- }
-
- for (vector<string*>::iterator i = devprofiles->begin(); i != devprofiles->end(); ++i) {
- string fullpath = *(*i);
+ for (vector<string>::iterator i = devprofiles.begin(); i != devprofiles.end(); ++i) {
+ string fullpath = *i;
+ DeviceProfile dp; // has to be initial every loop or info from last added.
XMLTree tree;
device_profiles[dp.name()] = dp;
}
}
-
- delete devprofiles;
}
int
}
/* name is mandatory */
-
+
if ((child = node.child ("Name")) == 0 || (prop = child->property ("value")) == 0) {
return -1;
} else {
int id = Button::name_to_id (prop->value());
if (id < 0) {
- error << string_compose ("Unknow button ID \"%1\"", prop->value()) << endmsg;
+ error << string_compose ("Unknown button ID \"%1\"", prop->value()) << endmsg;
continue;
}