summaryrefslogtreecommitdiff
path: root/libs/ardour/location.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-01-02 17:36:38 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-01-02 17:36:38 +0000
commit8fabcf4f760e68e10573efc0ef1da9d6d8453885 (patch)
treee7362b6dbb266b639c5e4855bd9eadf522d58911 /libs/ardour/location.cc
parentb529cbc5dc0b92f01ff01d5f40786ff025fbb63b (diff)
finish use of EnumWriter for saving flags etc. throughout the session file
git-svn-id: svn://localhost/ardour2/trunk@1259 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/location.cc')
-rw-r--r--libs/ardour/location.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/libs/ardour/location.cc b/libs/ardour/location.cc
index e09a59d42f..5a75c2bc16 100644
--- a/libs/ardour/location.cc
+++ b/libs/ardour/location.cc
@@ -28,6 +28,7 @@
#include <pbd/stl_delete.h>
#include <pbd/xml++.h>
+#include <pbd/enumwriter.h>
#include <ardour/location.h>
#include <ardour/session.h>
@@ -217,12 +218,12 @@ Location::set_flag_internal (bool yn, Flags flag)
{
if (yn) {
if (!(_flags & flag)) {
- _flags |= flag;
+ _flags = Flags (_flags | flag);
return true;
}
} else {
if (_flags & flag) {
- _flags &= ~flag;
+ _flags = Flags (_flags & ~flag);
return true;
}
}
@@ -273,8 +274,7 @@ Location::get_state (void)
node->add_property ("start", buf);
snprintf (buf, sizeof (buf), "%u", end());
node->add_property ("end", buf);
- snprintf (buf, sizeof (buf), "%" PRIu32, (uint32_t) _flags);
- node->add_property ("flags", buf);
+ node->add_property ("flags", enum_2_string (_flags));
return *node;
}
@@ -327,14 +327,12 @@ Location::set_state (const XMLNode& node)
_end = atoi (prop->value().c_str());
- _flags = 0;
-
if ((prop = node.property ("flags")) == 0) {
error << _("XML node for Location has no flags information") << endmsg;
return -1;
}
- _flags = Flags (atoi (prop->value().c_str()));
+ _flags = Flags (string_2_enum (prop->value(), _flags));
for (cd_iter = cd_list.begin(); cd_iter != cd_list.end(); ++cd_iter) {