diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-01-02 04:04:14 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-01-02 04:04:14 +0000 |
commit | 69c7dac1a1ee70c5a4053acdc9dd139c986698a2 (patch) | |
tree | a5a13945a48d27e7ff4adf0ca916ffcab2bb0ef7 /libs/ardour/ardour/tempo.h | |
parent | 084fc8b3273d6daeb299773811c7d2bd0e1d5598 (diff) |
new approach to tempo/meter: compute and store the entire map (every bar|beat point), thus enabling us to use the same computation to set the BBT points AND the metric markers (tempo + meter) on the audio timeline. It is known that snapping to the BBT grid doesn't work correctly right now, but this probably caused by the separate code in TempoMap::round_to_type() and i'll dig into that tomorrow. Note that the Bar|beat point list is evaluated "lazily" - we'll never store more than anyone actually needs to display or know, other than 1 minute's worth starting from frame zero
git-svn-id: svn://localhost/ardour2/branches/3.0@11129 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/tempo.h')
-rw-r--r-- | libs/ardour/ardour/tempo.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libs/ardour/ardour/tempo.h b/libs/ardour/ardour/tempo.h index c286d367c0..87dc77780e 100644 --- a/libs/ardour/ardour/tempo.h +++ b/libs/ardour/ardour/tempo.h @@ -218,8 +218,9 @@ class TempoMap : public PBD::StatefulDestructible (obj.*method)(*metrics); } - BBTPointList *get_points (framepos_t start, framepos_t end) const; - + const BBTPointList& map() const { return _map ; } + void map (BBTPointList&, framepos_t start, framepos_t end); + void bbt_time (framepos_t when, Timecode::BBT_Time&) const; framecnt_t frame_time (const Timecode::BBT_Time&) const; framecnt_t bbt_duration_at (framepos_t, const Timecode::BBT_Time&, int dir) const; @@ -282,13 +283,15 @@ class TempoMap : public PBD::StatefulDestructible static Meter _default_meter; Metrics* metrics; - framecnt_t _frame_rate; + framecnt_t _frame_rate; framepos_t last_bbt_when; bool last_bbt_valid; Timecode::BBT_Time last_bbt; mutable Glib::RWLock lock; + BBTPointList _map; + + void recompute_map (bool reassign_tempo_bbt, framepos_t end = -1); - void timestamp_metrics (bool reassign_bar_references); void timestamp_metrics_from_audio_time (); framepos_t round_to_type (framepos_t fr, int dir, BBTPointType); @@ -304,7 +307,6 @@ class TempoMap : public PBD::StatefulDestructible framecnt_t count_frames_between (const Timecode::BBT_Time&, const Timecode::BBT_Time&) const; framecnt_t count_frames_with_metrics (const TempoMetric&, const TempoMetric&, const Timecode::BBT_Time&, const Timecode::BBT_Time&) const; - framecnt_t count_frames_between_metrics (const Meter& meter, const Tempo& tempo, const Timecode::BBT_Time& start, const Timecode::BBT_Time& end) const; int move_metric_section (MetricSection&, const Timecode::BBT_Time& to); void do_insert (MetricSection* section); |