diff options
author | Ben Loftis <ben@harrisonconsoles.com> | 2015-04-21 08:35:20 -0500 |
---|---|---|
committer | Ben Loftis <ben@harrisonconsoles.com> | 2015-04-21 08:35:20 -0500 |
commit | 91fac4c96dc6210dcc056da70dc608700d7eb570 (patch) | |
tree | 93c24f138224d39975e6da4abaa4b36a521b970b /libs/ardour/tempo.cc | |
parent | f44e2e55fdd6e4d265f3eff715b071a27da8b5eb (diff) | |
parent | d3d7428a189d031739f901472f016b2907752640 (diff) |
merge fix for tempo branch
Diffstat (limited to 'libs/ardour/tempo.cc')
-rw-r--r-- | libs/ardour/tempo.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/libs/ardour/tempo.cc b/libs/ardour/tempo.cc index 521b91147d..c5f7272b7e 100644 --- a/libs/ardour/tempo.cc +++ b/libs/ardour/tempo.cc @@ -1620,6 +1620,33 @@ TempoMap::tempo_at (framepos_t frame) const return m.tempo(); } +const MeterSection& +TempoMap::meter_section_at (framepos_t frame) const +{ + Glib::Threads::RWLock::ReaderLock lm (lock); + Metrics::const_iterator i; + MeterSection* prev = 0; + + for (i = metrics.begin(); i != metrics.end(); ++i) { + MeterSection* t; + + if ((t = dynamic_cast<MeterSection*> (*i)) != 0) { + + if ((*i)->frame() > frame) { + break; + } + + prev = t; + } + } + + if (prev == 0) { + fatal << endmsg; + abort(); /*NOTREACHED*/ + } + + return *prev; +} const Meter& TempoMap::meter_at (framepos_t frame) const |