diff options
author | Carl Hetherington <carl@carlh.net> | 2010-09-28 18:47:24 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-09-28 18:47:24 +0000 |
commit | f761f13f6b0d52355ac4a26d6075d9a0b377ac8b (patch) | |
tree | c182dbb7ffdd839361a72ec36f9c80cb7265a79c /libs/evoral/src/Sequence.cpp | |
parent | 0ff828822f88c70db31183c66505fdfd640bb87d (diff) |
Don't cut output rate of non-interpolated controllers.
git-svn-id: svn://localhost/ardour2/branches/3.0@7852 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/evoral/src/Sequence.cpp')
-rw-r--r-- | libs/evoral/src/Sequence.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/libs/evoral/src/Sequence.cpp b/libs/evoral/src/Sequence.cpp index b6a7dceca1..62293aa3c1 100644 --- a/libs/evoral/src/Sequence.cpp +++ b/libs/evoral/src/Sequence.cpp @@ -39,15 +39,14 @@ using namespace std; using namespace PBD; -/** Minimum time between MIDI outputs from a single controller, +/** Minimum time between MIDI outputs from a single interpolated controller, expressed in beats. This is to limit the rate at which MIDI messages - are generated, particularly for quickly-changing controllers which - are being interpolated. + are generated. It is only applied to interpolated controllers. XXX: This is a hack. The time should probably be expressed in seconds rather than beats, and should be configurable etc. etc. */ -static double const time_between_controller_outputs = 1.0 / 256; +static double const time_between_interpolated_controller_outputs = 1.0 / 256; namespace Evoral { @@ -262,10 +261,14 @@ Sequence<Time>::const_iterator::operator++() break; case CONTROL: // Increment current controller iterator - if (_force_discrete) { - ret = _control_iter->list->rt_safe_earliest_event_discrete_unlocked (_control_iter->x + time_between_controller_outputs, x, y, false); + if (_force_discrete || _control_iter->list->interpolation() == ControlList::Discrete) { + ret = _control_iter->list->rt_safe_earliest_event_discrete_unlocked ( + _control_iter->x, x, y, false + ); } else { - ret = _control_iter->list->rt_safe_earliest_event_unlocked (_control_iter->x + time_between_controller_outputs, x, y, false); + ret = _control_iter->list->rt_safe_earliest_event_linear_unlocked ( + _control_iter->x + time_between_interpolated_controller_outputs, x, y, false + ); } assert(!ret || x > _control_iter->x); if (ret) { |