summaryrefslogtreecommitdiff
path: root/libs/ardour/location.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-08-09 22:23:32 +0000
committerCarl Hetherington <carl@carlh.net>2010-08-09 22:23:32 +0000
commit69c9e2296c1436e3959b6702110c03738d2a5549 (patch)
tree29e463916e001d7b0f1a1a820cdc1424f59a1361 /libs/ardour/location.cc
parent78986385e17b82a6704c8792fb21a42cd86add9a (diff)
Fix up state save/load of location lock/glue settings.
git-svn-id: svn://localhost/ardour2/branches/3.0@7579 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/location.cc')
-rw-r--r--libs/ardour/location.cc28
1 files changed, 23 insertions, 5 deletions
diff --git a/libs/ardour/location.cc b/libs/ardour/location.cc
index ea267db25e..d9d5911555 100644
--- a/libs/ardour/location.cc
+++ b/libs/ardour/location.cc
@@ -357,6 +357,7 @@ Location::get_state ()
node->add_property ("end", buf);
node->add_property ("flags", enum_2_string (_flags));
node->add_property ("locked", (_locked ? "yes" : "no"));
+ node->add_property ("position-lock-style", enum_2_string (_position_lock_style));
return *node;
}
@@ -427,24 +428,27 @@ Location::set_state (const XMLNode& node, int /*version*/)
cd_node = *cd_iter;
if (cd_node->name() != "CD-Info") {
- continue;
+ continue;
}
if ((prop = cd_node->property ("name")) != 0) {
- cd_name = prop->value();
+ cd_name = prop->value();
} else {
- throw failed_constructor ();
+ throw failed_constructor ();
}
if ((prop = cd_node->property ("value")) != 0) {
- cd_value = prop->value();
+ cd_value = prop->value();
} else {
- throw failed_constructor ();
+ throw failed_constructor ();
}
cd_info[cd_name] = cd_value;
+ }
+ if ((prop = node.property ("position-lock-style")) != 0) {
+ _position_lock_style = PositionLockStyle (string_2_enum (prop->value(), _position_lock_style));
}
recompute_bbt_from_frames ();
@@ -490,6 +494,20 @@ Location::recompute_frames_from_bbt ()
set (map.frame_time (_bbt_start), map.frame_time (_bbt_end), false);
}
+void
+Location::lock ()
+{
+ _locked = true;
+ LockChanged (this);
+}
+
+void
+Location::unlock ()
+{
+ _locked = false;
+ LockChanged (this);
+}
+
/*---------------------------------------------------------------------- */
Locations::Locations (Session& s)