_flags = Flags (_flags & ~IsStart);
_flags = Flags (_flags & ~IsEnd);
+
+ /* copy is not locked even if original was */
+
+ _locked = false;
}
Location::Location (const XMLNode& node)
_end = other._end;
_flags = other._flags;
+ /* copy is not locked even if original was */
+
+ _locked = false;
+
/* "changed" not emitted on purpose */
return this;
int
Location::set_start (nframes_t s)
{
+ if (_locked) {
+ return -1;
+ }
+
if (is_mark()) {
if (_start != s) {
int
Location::set_end (nframes_t e)
{
+ if (_locked) {
+ return -1;
+ }
+
if (is_mark()) {
if (_start != e) {
_start = e;
int
Location::set (nframes_t start, nframes_t end)
{
+ if (_locked) {
+ return -1;
+ }
+
if (is_mark() && start != end) {
return -1;
} else if (((is_auto_punch() || is_auto_loop()) && start >= end) || (start > end)) {
return 0;
}
+int
+Location::move_to (nframes_t pos)
+{
+ if (_locked) {
+ return -1;
+ }
+
+ if (_start != pos) {
+ _start = pos;
+ _end = _start + length();
+
+ changed (this); /* EMIT SIGNAL */
+ }
+
+ return 0;
+}
+
void
Location::set_hidden (bool yn, void *src)
{
void
Location::set_cd (bool yn, void *src)
{
+ // XXX this really needs to be session start
+ // but its not available here - leave to GUI
+
+ if (_start == 0) {
+ error << _("You cannot put a CD marker at this position") << endmsg;
+ return;
+ }
+
if (set_flag_internal (yn, IsCDMarker)) {
FlagsChanged (this, src); /* EMIT SIGNAL */
}
snprintf (buf, sizeof (buf), "%u", end());
node->add_property ("end", buf);
node->add_property ("flags", enum_2_string (_flags));
+ node->add_property ("locked", (_locked ? "yes" : "no"));
return *node;
}
_flags = Flags (string_2_enum (prop->value(), _flags));
+ if ((prop = node.property ("locked")) != 0) {
+ _locked = (prop->value() == "yes");
+ } else {
+ _locked = false;
+ }
+
for (cd_iter = cd_list.begin(); cd_iter != cd_list.end(); ++cd_iter) {
cd_node = *cd_iter;