summaryrefslogtreecommitdiff
path: root/libs
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
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')
-rw-r--r--libs/ardour/ardour/tempo.h2
-rw-r--r--libs/ardour/tempo.cc15
2 files changed, 17 insertions, 0 deletions
diff --git a/libs/ardour/ardour/tempo.h b/libs/ardour/ardour/tempo.h
index c4915072c5..23f18eda57 100644
--- a/libs/ardour/ardour/tempo.h
+++ b/libs/ardour/ardour/tempo.h
@@ -281,6 +281,8 @@ class TempoMap : public PBD::StatefulDestructible
void change_existing_tempo_at (nframes_t, double bpm, double note_type);
void change_initial_tempo (double bpm, double note_type);
+ void insert_time( nframes_t where, nframes_t amount);
+
int n_tempos () const;
int n_meters () const;
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);