projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mackie: semi-working Sends subview mode
[ardour.git]
/
libs
/
surfaces
/
mackie
/
device_profile.cc
diff --git
a/libs/surfaces/mackie/device_profile.cc
b/libs/surfaces/mackie/device_profile.cc
index ddbb4782db779d5168a2744ad22a56683c768b93..2b9cbd5edb2d462a933fd5d2d61cfabdd7d5db39 100644
(file)
--- a/
libs/surfaces/mackie/device_profile.cc
+++ b/
libs/surfaces/mackie/device_profile.cc
@@
-24,7
+24,8
@@
#include "pbd/xml++.h"
#include "pbd/error.h"
#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 "pbd/replace_all.h"
#include "ardour/filesystem_paths.h"
@@
-34,9
+35,11
@@
#include "i18n.h"
#include "i18n.h"
-using namespace Mackie;
using namespace PBD;
using namespace ARDOUR;
using namespace PBD;
using namespace ARDOUR;
+using namespace ArdourSurface;
+using namespace Mackie;
+
using std::string;
using std::vector;
using std::string;
using std::vector;
@@
-87,27
+90,21
@@
devprofile_filter (const string &str, void* /*arg*/)
void
DeviceProfile::reload_device_profiles ()
{
void
DeviceProfile::reload_device_profiles ()
{
- DeviceProfile dp;
vector<string> s;
vector<string> s;
- vector<string *> *devprofiles;
- PathScanner scanner;
+ vector<string> devprofiles;
Searchpath spath (devprofile_search_path());
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 ();
device_profiles.clear ();
- if (!devprofiles) {
- error << "No MCP device info files found using " << spath.to_string() << endmsg;
- return;
- }
-
- if (devprofiles->empty()) {
+ if (devprofiles.empty()) {
error << "No MCP device info files found using " << spath.to_string() << endmsg;
return;
}
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;
XMLTree tree;
@@
-125,8
+122,6
@@
DeviceProfile::reload_device_profiles ()
device_profiles[dp.name()] = dp;
}
}
device_profiles[dp.name()] = dp;
}
}
-
- delete devprofiles;
}
int
}
int
@@
-140,7
+135,7
@@
DeviceProfile::set_state (const XMLNode& node, int /* version */)
}
/* name is mandatory */
}
/* name is mandatory */
-
+
if ((child = node.child ("Name")) == 0 || (prop = child->property ("value")) == 0) {
return -1;
} else {
if ((child = node.child ("Name")) == 0 || (prop = child->property ("value")) == 0) {
return -1;
} else {
@@
-162,7
+157,7
@@
DeviceProfile::set_state (const XMLNode& node, int /* version */)
int id = Button::name_to_id (prop->value());
if (id < 0) {
int id = Button::name_to_id (prop->value());
if (id < 0) {
- error << string_compose ("Unknow button ID \"%1\"", prop->value()) << endmsg;
+ error << string_compose ("Unknow
n
button ID \"%1\"", prop->value()) << endmsg;
continue;
}
continue;
}
@@
-344,7
+339,7
@@
DeviceProfile::save ()
}
fullpath = Glib::build_filename (fullpath, legalize_for_path (_name) + ".profile");
}
fullpath = Glib::build_filename (fullpath, legalize_for_path (_name) + ".profile");
-
+
XMLTree tree;
tree.set_root (&get_state());
XMLTree tree;
tree.set_root (&get_state());