summaryrefslogtreecommitdiff
path: root/libs/ardour/tempo.cc
diff options
context:
space:
mode:
authorBen Loftis <ben@glw.com>2009-06-10 12:51:37 +0000
committerBen Loftis <ben@glw.com>2009-06-10 12:51:37 +0000
commitadb94a0d9e2d16dd0eb632d89b05cd89a4c24e11 (patch)
treebfe1e2b33f3fa75e8f37cfd467e373da6c925305 /libs/ardour/tempo.cc
parent9c8ecfd3bb241d3a0a00a72f0bb76fce23076a4a (diff)
Allow Insert Time option to move tempos and time sig changes, as per #1951 (thanks carlh)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@5150 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/tempo.cc')
-rw-r--r--libs/ardour/tempo.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc
index ab7b7c096e..4b9ac61e49 100644
--- a/libs/ardour/tempo.cc
+++ b/libs/ardour/tempo.cc
@@ -529,6 +529,21 @@ TempoMap::change_initial_tempo (double beats_per_minute, double note_type)
}
void
+TempoMap::insert_time (nframes_t where, nframes_t amount)
+{
+ for (Metrics::iterator i = metrics->begin(); i != metrics->end(); ++i) {
+ if ((*i)->frame() >= where) {
+ (*i)->set_frame ((*i)->frame() + amount);
+ }
+ }
+
+ timestamp_metrics (false);
+
+ StateChanged (Change (0));
+}
+
+
+void
TempoMap::change_existing_tempo_at (nframes_t where, double beats_per_minute, double note_type)
{
Tempo newtempo (beats_per_minute, note_type);