summaryrefslogtreecommitdiff
path: root/libs/ardour/region.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-12-07 19:05:05 +0000
committerCarl Hetherington <carl@carlh.net>2010-12-07 19:05:05 +0000
commitf8e16276d9a598eb6425ae393dc0bd62cd2df05b (patch)
treead68f56e5d5e46402501d834686115eb6a4b0803 /libs/ardour/region.cc
parent6df5d5d87aa8bd8d3e15a0aaceadf8bd44bcf762 (diff)
Fix a couple of places where set_position_internal was not being used, meaning that a region's _bbt_time member was not updated and so regions could move about unexpectedly when locked to bars and beats.
git-svn-id: svn://localhost/ardour2/branches/3.0@8211 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/region.cc')
-rw-r--r--libs/ardour/region.cc33
1 files changed, 20 insertions, 13 deletions
diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc
index 09c2552c48..5c25d34c60 100644
--- a/libs/ardour/region.cc
+++ b/libs/ardour/region.cc
@@ -577,6 +577,11 @@ Region::update_position_after_tempo_map_change ()
TempoMap& map (_session.tempo_map());
framepos_t pos = map.frame_time (_bbt_time);
set_position_internal (pos, false);
+
+ /* do this even if the position is the same. this helps out
+ a GUI that has moved its representation already.
+ */
+ send_change (Properties::position);
}
void
@@ -587,6 +592,12 @@ Region::set_position (framepos_t pos, void* /*src*/)
}
set_position_internal (pos, true);
+
+ /* do this even if the position is the same. this helps out
+ a GUI that has moved its representation already.
+ */
+ send_change (Properties::position);
+
}
void
@@ -613,11 +624,6 @@ Region::set_position_internal (framepos_t pos, bool allow_bbt_recompute)
//invalidate_transients ();
}
-
- /* do this even if the position is the same. this helps out
- a GUI that has moved its representation already.
- */
- send_change (Properties::position);
}
void
@@ -628,8 +634,7 @@ Region::set_position_on_top (framepos_t pos, void* /*src*/)
}
if (_position != pos) {
- _last_position = _position;
- _position = pos;
+ set_position_internal (pos, true);
}
boost::shared_ptr<Playlist> pl (playlist());
@@ -664,22 +669,24 @@ Region::nudge_position (frameoffset_t n, void* /*src*/)
return;
}
- _last_position = _position;
+ framepos_t new_position = _position;
if (n > 0) {
if (_position > max_framepos - n) {
- _position = max_framepos;
+ new_position = max_framepos;
} else {
- _position += n;
+ new_position += n;
}
} else {
if (_position < -n) {
- _position = 0;
+ new_position = 0;
} else {
- _position += n;
+ new_position += n;
}
}
+ set_position_internal (new_position, true);
+
send_change (Properties::position);
}
@@ -934,7 +941,7 @@ Region::trim_to_internal (framepos_t position, framecnt_t length, void */*src*/)
if (!property_changes_suspended()) {
_last_position = _position;
}
- _position = position;
+ set_position_internal (position, true);
what_changed.add (Properties::position);
}