Use ARDOUR::user_config_directory in ARDOUR::user_template_directory
[ardour.git] / libs / ardour / location.cc
index bec87e5dd6b6d41863304aa3e5e0183720bdde81..3d04c66824009351d9113624ffdbe65b5f56c1b6 100644 (file)
@@ -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 */