Don't cut output rate of non-interpolated controllers.

git-svn-id: svn://localhost/ardour2/branches/3.0@7852 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2010-09-28 18:47:24 +00:00
parent 0ff828822f
commit f761f13f6b
2 changed files with 11 additions and 9 deletions

View file

@ -213,6 +213,7 @@ public:
bool rt_safe_earliest_event (double start, double& x, double& y, bool start_inclusive=false) const; bool rt_safe_earliest_event (double start, double& x, double& y, bool start_inclusive=false) const;
bool rt_safe_earliest_event_unlocked (double start, double& x, double& y, bool start_inclusive=false) const; bool rt_safe_earliest_event_unlocked (double start, double& x, double& y, bool start_inclusive=false) const;
bool rt_safe_earliest_event_linear_unlocked (double start, double& x, double& y, bool inclusive) const;
bool rt_safe_earliest_event_discrete_unlocked (double start, double& x, double& y, bool inclusive) const; bool rt_safe_earliest_event_discrete_unlocked (double start, double& x, double& y, bool inclusive) const;
void create_curve(); void create_curve();
@ -249,8 +250,6 @@ protected:
void build_search_cache_if_necessary (double start) const; void build_search_cache_if_necessary (double start) const;
bool rt_safe_earliest_event_linear_unlocked (double start, double& x, double& y, bool inclusive) const;
boost::shared_ptr<ControlList> cut_copy_clear (double, double, int op); boost::shared_ptr<ControlList> cut_copy_clear (double, double, int op);
bool erase_range_internal (double start, double end, EventList &); bool erase_range_internal (double start, double end, EventList &);

View file

@ -39,15 +39,14 @@
using namespace std; using namespace std;
using namespace PBD; 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 expressed in beats. This is to limit the rate at which MIDI messages
are generated, particularly for quickly-changing controllers which are generated. It is only applied to interpolated controllers.
are being interpolated.
XXX: This is a hack. The time should probably be expressed in XXX: This is a hack. The time should probably be expressed in
seconds rather than beats, and should be configurable etc. etc. 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 { namespace Evoral {
@ -262,10 +261,14 @@ Sequence<Time>::const_iterator::operator++()
break; break;
case CONTROL: case CONTROL:
// Increment current controller iterator // Increment current controller iterator
if (_force_discrete) { if (_force_discrete || _control_iter->list->interpolation() == ControlList::Discrete) {
ret = _control_iter->list->rt_safe_earliest_event_discrete_unlocked (_control_iter->x + time_between_controller_outputs, x, y, false); ret = _control_iter->list->rt_safe_earliest_event_discrete_unlocked (
_control_iter->x, x, y, false
);
} else { } 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); assert(!ret || x > _control_iter->x);
if (ret) { if (ret) {