summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorBen Loftis <ben@harrisonconsoles.com>2014-12-09 16:17:47 -0600
committerBen Loftis <ben@harrisonconsoles.com>2014-12-09 16:18:47 -0600
commite66752cec1dd19e674b9a2c87436c937c4886295 (patch)
tree1b83ab9014dcd5484d9cfda2c5089bb887a652a8 /libs
parent1e0c1751a53999a8b9ac6978393486afbf317529 (diff)
add set-session-extents-from-edit-range
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/session.h1
-rw-r--r--libs/ardour/session.cc19
2 files changed, 20 insertions, 0 deletions
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 86d8c66593..9af744e2ec 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -384,6 +384,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
void set_auto_punch_location (Location *);
void set_auto_loop_location (Location *);
+ void set_session_extents (framepos_t start, framepos_t end);
int location_name(std::string& result, std::string base = std::string(""));
pframes_t get_block_size() const { return current_block_size; }
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 9c5b6fdccf..4710ea1534 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -1247,6 +1247,25 @@ Session::set_auto_punch_location (Location* location)
}
void
+Session::set_session_extents (framepos_t start, framepos_t end)
+{
+ Location* existing;
+ if ((existing = _locations->session_range_location()) == 0) {
+ //if there is no existing session, we need to make a new session location (should never happen)
+ existing = new Location (*this, 0, 0, _("session"), Location::IsSessionRange);
+ }
+
+ if (end <= start) {
+ error << _("Session: you can't use that location for session start/end)") << endmsg;
+ return;
+ }
+
+ existing->set( start, end );
+
+ set_dirty();
+}
+
+void
Session::set_auto_loop_location (Location* location)
{
Location* existing;