summaryrefslogtreecommitdiff
path: root/libs/pbd
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-10-15 18:56:11 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-10-15 18:56:11 +0000
commit8713667ec1a6cc9ba56c07f763e5a422cc47fbef (patch)
tree56727634d8a1567679a7ba76cff93bf06e7c271f /libs/pbd
parent79f91c7a205d981d2b8cc15e32a6da02d8423065 (diff)
rework Stateful::set_state() patch to avoid default version argument
git-svn-id: svn://localhost/ardour2/branches/3.0@5787 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd')
-rw-r--r--libs/pbd/pbd/command.h2
-rw-r--r--libs/pbd/pbd/controllable.h2
-rw-r--r--libs/pbd/pbd/memento_command.h4
-rw-r--r--libs/pbd/pbd/stateful.h5
-rw-r--r--libs/pbd/stateful.cc3
5 files changed, 11 insertions, 5 deletions
diff --git a/libs/pbd/pbd/command.h b/libs/pbd/pbd/command.h
index f913dec5b7..8e85e28882 100644
--- a/libs/pbd/pbd/command.h
+++ b/libs/pbd/pbd/command.h
@@ -38,7 +38,7 @@ public:
virtual void redo() { (*this)(); }
virtual XMLNode &get_state();
- virtual int set_state(const XMLNode&, int version = 3000) { /* noop */ return 0; }
+ virtual int set_state(const XMLNode&, int version) { /* noop */ return 0; }
protected:
Command() {}
diff --git a/libs/pbd/pbd/controllable.h b/libs/pbd/pbd/controllable.h
index 4afcb53740..1ab649f8b9 100644
--- a/libs/pbd/pbd/controllable.h
+++ b/libs/pbd/pbd/controllable.h
@@ -51,7 +51,7 @@ class Controllable : public PBD::StatefulDestructible {
sigc::signal<void> Changed;
- int set_state (const XMLNode&, int version = 3000);
+ int set_state (const XMLNode&, int version);
XMLNode& get_state ();
std::string name() const { return _name; }
diff --git a/libs/pbd/pbd/memento_command.h b/libs/pbd/pbd/memento_command.h
index b1347c169d..c1e5d75f9c 100644
--- a/libs/pbd/pbd/memento_command.h
+++ b/libs/pbd/pbd/memento_command.h
@@ -54,13 +54,13 @@ public:
void operator() () {
if (after) {
- obj.set_state(*after);
+ obj.set_state(*after, Stateful::current_state_version);
}
}
void undo() {
if (before) {
- obj.set_state(*before);
+ obj.set_state(*before, Stateful::current_state_version);
}
}
diff --git a/libs/pbd/pbd/stateful.h b/libs/pbd/pbd/stateful.h
index 324d9c1222..0204c8084a 100644
--- a/libs/pbd/pbd/stateful.h
+++ b/libs/pbd/pbd/stateful.h
@@ -38,7 +38,7 @@ class Stateful {
virtual XMLNode& get_state (void) = 0;
- virtual int set_state (const XMLNode&, int version = 3000) = 0;
+ virtual int set_state (const XMLNode&, int version) = 0;
/* Extra XML nodes */
@@ -47,6 +47,9 @@ class Stateful {
const PBD::ID& id() const { return _id; }
+ static int current_state_version;
+ static int loading_state_version;
+
protected:
void add_instant_xml (XMLNode&, const sys::path& directory_path);
diff --git a/libs/pbd/stateful.cc b/libs/pbd/stateful.cc
index 12ae4306ed..58be141a27 100644
--- a/libs/pbd/stateful.cc
+++ b/libs/pbd/stateful.cc
@@ -31,6 +31,9 @@ using namespace std;
namespace PBD {
+int Stateful::current_state_version = 0;
+int Stateful::loading_state_version = 0;
+
Stateful::Stateful ()
{
_extra_xml = 0;