summaryrefslogtreecommitdiff
path: root/libs/ardour/session_click.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-01-02 04:04:14 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-01-02 04:04:14 +0000
commit69c7dac1a1ee70c5a4053acdc9dd139c986698a2 (patch)
treea5a13945a48d27e7ff4adf0ca916ffcab2bb0ef7 /libs/ardour/session_click.cc
parent084fc8b3273d6daeb299773811c7d2bd0e1d5598 (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/session_click.cc')
-rw-r--r--libs/ardour/session_click.cc13
1 files changed, 4 insertions, 9 deletions
diff --git a/libs/ardour/session_click.cc b/libs/ardour/session_click.cc
index 22f9de449d..86a5d4ad78 100644
--- a/libs/ardour/session_click.cc
+++ b/libs/ardour/session_click.cc
@@ -41,7 +41,7 @@ Pool Click::pool ("click", sizeof (Click), 128);
void
Session::click (framepos_t start, framecnt_t nframes)
{
- TempoMap::BBTPointList *points;
+ TempoMap::BBTPointList points;
Sample *buf;
if (_click_io == 0) {
@@ -59,18 +59,13 @@ Session::click (framepos_t start, framecnt_t nframes)
BufferSet& bufs = get_scratch_buffers(ChanCount(DataType::AUDIO, 1));
buf = bufs.get_audio(0).data();
- points = _tempo_map->get_points (start, end);
+ _tempo_map->map (points, start, end);
- if (points == 0) {
+ if (points.empty()) {
goto run_clicks;
}
- if (points->empty()) {
- delete points;
- goto run_clicks;
- }
-
- for (TempoMap::BBTPointList::iterator i = points->begin(); i != points->end(); ++i) {
+ for (TempoMap::BBTPointList::iterator i = points.begin(); i != points.end(); ++i) {
switch ((*i).type) {
case TempoMap::Beat:
if (click_emphasis_data == 0 || (click_emphasis_data && (*i).beat != 1)) {