summaryrefslogtreecommitdiff
path: root/libs/ardour/location.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/location.cc')
-rw-r--r--libs/ardour/location.cc21
1 files changed, 16 insertions, 5 deletions
diff --git a/libs/ardour/location.cc b/libs/ardour/location.cc
index bec87e5dd6..3d04c66824 100644
--- a/libs/ardour/location.cc
+++ b/libs/ardour/location.cc
@@ -15,7 +15,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id$
*/
#include <algorithm>
@@ -662,7 +661,7 @@ struct LocationStartLaterComparison
};
Location *
-Locations::first_location_before (nframes_t frame)
+Locations::first_location_before (nframes_t frame, bool include_special_ranges)
{
LocationList locs;
@@ -677,6 +676,9 @@ Locations::first_location_before (nframes_t frame)
/* locs is now sorted latest..earliest */
for (LocationList::iterator i = locs.begin(); i != locs.end(); ++i) {
+ if (!include_special_ranges && ((*i)->is_auto_loop() || (*i)->is_auto_punch())) {
+ continue;
+ }
if (!(*i)->is_hidden() && (*i)->start() < frame) {
return (*i);
}
@@ -686,7 +688,7 @@ Locations::first_location_before (nframes_t frame)
}
Location *
-Locations::first_location_after (nframes_t frame)
+Locations::first_location_after (nframes_t frame, bool include_special_ranges)
{
LocationList locs;
@@ -701,6 +703,9 @@ Locations::first_location_after (nframes_t frame)
/* locs is now sorted earliest..latest */
for (LocationList::iterator i = locs.begin(); i != locs.end(); ++i) {
+ if (!include_special_ranges && ((*i)->is_auto_loop() || (*i)->is_auto_punch())) {
+ continue;
+ }
if (!(*i)->is_hidden() && (*i)->start() > frame) {
return (*i);
}
@@ -710,7 +715,7 @@ Locations::first_location_after (nframes_t frame)
}
nframes_t
-Locations::first_mark_before (nframes_t frame)
+Locations::first_mark_before (nframes_t frame, bool include_special_ranges)
{
LocationList locs;
@@ -725,6 +730,9 @@ Locations::first_mark_before (nframes_t frame)
/* locs is now sorted latest..earliest */
for (LocationList::iterator i = locs.begin(); i != locs.end(); ++i) {
+ if (!include_special_ranges && ((*i)->is_auto_loop() || (*i)->is_auto_punch())) {
+ continue;
+ }
if (!(*i)->is_hidden()) {
if ((*i)->is_mark()) {
/* MARK: start == end */
@@ -747,7 +755,7 @@ Locations::first_mark_before (nframes_t frame)
}
nframes_t
-Locations::first_mark_after (nframes_t frame)
+Locations::first_mark_after (nframes_t frame, bool include_special_ranges)
{
LocationList locs;
@@ -762,6 +770,9 @@ Locations::first_mark_after (nframes_t frame)
/* locs is now sorted earliest..latest */
for (LocationList::iterator i = locs.begin(); i != locs.end(); ++i) {
+ if (!include_special_ranges && ((*i)->is_auto_loop() || (*i)->is_auto_punch())) {
+ continue;
+ }
if (!(*i)->is_hidden()) {
if ((*i)->is_mark()) {
/* MARK, start == end so just compare start */