From 69c9e2296c1436e3959b6702110c03738d2a5549 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 9 Aug 2010 22:23:32 +0000 Subject: 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 --- libs/ardour/location.cc | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'libs/ardour/location.cc') 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) -- cgit v1.2.3