summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-01-22 11:57:51 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-01-22 11:57:51 +0000
commitd3f41d095010928a01bf5cc04a9926173acb4658 (patch)
tree56d9257259430a1a9523e5e764843022003569c8 /libs/ardour
parentad4506daadd7bb0a399e683509d3cb5e29a49b9d (diff)
plugin status fixes from 2.X
git-svn-id: svn://localhost/ardour2/branches/3.0@6539 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/ardour/plugin_manager.h7
-rw-r--r--libs/ardour/plugin_manager.cc49
2 files changed, 36 insertions, 20 deletions
diff --git a/libs/ardour/ardour/plugin_manager.h b/libs/ardour/ardour/plugin_manager.h
index 14c4190787..302b6d2bc9 100644
--- a/libs/ardour/ardour/plugin_manager.h
+++ b/libs/ardour/ardour/plugin_manager.h
@@ -86,7 +86,12 @@ class PluginManager : public boost::noncopyable {
}
bool operator<(const PluginStatus& other) const {
- return other.type < type || other.unique_id < unique_id;
+ if (other.type < type) {
+ return true;
+ } else if (other.type == type && other.unique_id < unique_id) {
+ return true;
+ }
+ return false;
}
};
typedef std::set<PluginStatus> PluginStatusList;
diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc
index 9b5898ddb9..b0d40f6124 100644
--- a/libs/ardour/plugin_manager.cc
+++ b/libs/ardour/plugin_manager.cc
@@ -40,6 +40,7 @@
#include <glibmm/miscutils.h>
#include "pbd/pathscanner.h"
+#include "pbd/whitespace.h"
#include "ardour/ladspa.h"
#include "ardour/session.h"
@@ -600,7 +601,7 @@ PluginManager::save_statuses ()
break;
}
- ofs << ' ' << (*i).unique_id << ' ';
+ ofs << ' ';
switch ((*i).status) {
case Normal:
@@ -613,7 +614,9 @@ PluginManager::save_statuses ()
ofs << "Hidden";
break;
}
-
+
+ ofs << ' ';
+ ofs << (*i).unique_id;;
ofs << endl;
}
@@ -630,12 +633,13 @@ PluginManager::load_statuses ()
if (!ifs) {
return;
}
-
+
std::string stype;
- std::string id;
std::string sstatus;
+ std::string id;
PluginType type;
PluginStatusType status;
+ char buf[1024];
while (ifs) {
@@ -644,15 +648,31 @@ PluginManager::load_statuses ()
break;
}
- ifs >> id;
+
+ ifs >> sstatus;
if (!ifs) {
break;
+
}
- ifs >> sstatus;
+ /* rest of the line is the plugin ID */
+
+ ifs.getline (buf, sizeof (buf), '\n');
if (!ifs) {
break;
+ }
+ if (sstatus == "Normal") {
+ status = Normal;
+ } else if (sstatus == "Favorite") {
+ status = Favorite;
+ } else if (sstatus == "Hidden") {
+ status = Hidden;
+ } else {
+ error << string_compose (_("unknown plugin status type \"%1\" - all entries ignored"), sstatus)
+ << endmsg;
+ statuses.clear ();
+ break;
}
if (stype == "LADSPA") {
@@ -668,21 +688,12 @@ PluginManager::load_statuses ()
<< endmsg;
continue;
}
- if (sstatus == "Normal") {
- status = Normal;
- } else if (sstatus == "Favorite") {
- status = Favorite;
- } else if (sstatus == "Hidden") {
- status = Hidden;
- } else {
- error << string_compose (_("unknown plugin status type \"%1\" - ignored"), stype)
- << endmsg;
- continue;
- }
-
+
+ id = buf;
+ strip_whitespace_edges (id);
set_status (type, id, status);
}
-
+
ifs.close ();
}