Fix a couple of places where set_position_internal was not being used, meaning that...
authorCarl Hetherington <carl@carlh.net>
Tue, 7 Dec 2010 19:05:05 +0000 (19:05 +0000)
committerCarl Hetherington <carl@carlh.net>
Tue, 7 Dec 2010 19:05:05 +0000 (19:05 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@8211 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/region.cc

index 09c2552c4834d954e6729a85dfbd4211c2d6dfe6..5c25d34c60cd866c9c46c6254b84b861ba598ddf 100644 (file)
@@ -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);
        }