diff options
author | nick_m <mainsbridge@gmail.com> | 2016-10-30 23:21:42 +1100 |
---|---|---|
committer | nick_m <mainsbridge@gmail.com> | 2016-11-11 03:37:08 +1100 |
commit | 0e867b544b6d1b5f82f46cec7171998b2f2ca3bc (patch) | |
tree | cc9605fbd8ed505aedb3e1d04cfa301a84ad8b33 /libs/ardour/region.cc | |
parent | ae63243bf3af8ab4dad8535ac2811df399c9a34a (diff) |
Refactor tempo api, include quarter-note distance in frames method.
- moves frame rounding up to TempoMap, which is needed
in order to calculate pulse distance without frame rounding.
- the time unit for tempo is still minute, but this now also
applies to meter sections. (new audio locked meter sections no
longer require a frame position).
- there is no longer a discontinuity
in the pulse for audio-locked meter/tempi.
- temporarily add debugging output in Region::set_position()
to test for region beat not matching region frame.
Diffstat (limited to 'libs/ardour/region.cc')
-rw-r--r-- | libs/ardour/region.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/ardour/region.cc b/libs/ardour/region.cc index 25e01d501d..7581e23671 100644 --- a/libs/ardour/region.cc +++ b/libs/ardour/region.cc @@ -596,12 +596,24 @@ Region::set_position (framepos_t pos, int32_t sub_num) if (position_lock_style() == AudioTime) { set_position_internal (pos, true, sub_num); + if (_session.tempo_map().frame_at_beat (_beat) != _position) { + std::cout << name () + << " Region::set_position AudioTime position error!!! FRAME AT BEAT : " <<_session.tempo_map().frame_at_beat (_beat) + << " position : " << _position << " has playlist : " << (playlist() == 0) << std::endl; + } } else { if (!_session.loading()) { _beat = _session.tempo_map().exact_beat_at_frame (pos, sub_num); } + /* will set pulse accordingly */ set_position_internal (pos, false, sub_num); + + if (_session.tempo_map().frame_at_beat (_beat) != _position) { + std::cout << name () + << " Region::set_position MusicTime position error!!! FRAME AT BEAT : " <<_session.tempo_map().frame_at_beat (_beat) + << " position : " << _position << " beat : " << _beat << " has playlist : " << (playlist() == 0) << std::endl; + } } /* do this even if the position is the same. this helps out |