summaryrefslogtreecommitdiff
path: root/libs/ardour/location.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-08-09 14:12:15 +0000
committerCarl Hetherington <carl@carlh.net>2010-08-09 14:12:15 +0000
commite1cd6653daf70e310cc02ae59d3fc6739780a04d (patch)
treeb45aa042235b1e2c4564e5991bde6831fa587969 /libs/ardour/location.cc
parent6f512fe1e9b52f39c79880b288825f3d39d014f7 (diff)
In marks_either_side, don't return a marker that is exactly at the position that we request. Fixes #3386.
git-svn-id: svn://localhost/ardour2/branches/3.0@7571 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/location.cc')
-rw-r--r--libs/ardour/location.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/libs/ardour/location.cc b/libs/ardour/location.cc
index 3f62d8949d..6fba55e16f 100644
--- a/libs/ardour/location.cc
+++ b/libs/ardour/location.cc
@@ -792,10 +792,11 @@ Locations::first_location_after (nframes64_t frame, bool include_special_ranges)
}
/** Look for the `marks' (either locations which are marks, or start/end points of range markers) either
- * side of a frame.
+ * side of a frame. Note that if frame is exactly on a `mark', that mark will not be considered for returning
+ * as before/after.
* @param frame Frame to look for.
* @param before Filled in with the position of the last `mark' before `frame' (or max_frames if none exists)
- * @param after Filled in with the position of the last `mark' after `frame' (or max_frames if none exists)
+ * @param after Filled in with the position of the next `mark' after `frame' (or max_frames if none exists)
*/
void
Locations::marks_either_side (nframes64_t const frame, nframes64_t& before, nframes64_t& after) const
@@ -809,6 +810,8 @@ Locations::marks_either_side (nframes64_t const frame, nframes64_t& before, nfra
locs = locations;
}
+ /* Get a list of positions; don't store any that are exactly on our requested position */
+
std::list<nframes64_t> positions;
for (LocationList::const_iterator i = locs.begin(); i != locs.end(); ++i) {
@@ -818,10 +821,16 @@ Locations::marks_either_side (nframes64_t const frame, nframes64_t& before, nfra
if (!(*i)->is_hidden()) {
if ((*i)->is_mark ()) {
- positions.push_back ((*i)->start ());
+ if ((*i)->start() != frame) {
+ positions.push_back ((*i)->start ());
+ }
} else {
- positions.push_back ((*i)->start ());
- positions.push_back ((*i)->end ());
+ if ((*i)->start() != frame) {
+ positions.push_back ((*i)->start ());
+ }
+ if ((*i)->end() != frame) {
+ positions.push_back ((*i)->end ());
+ }
}
}
}