summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorHans Baier <hansfbaier@googlemail.com>2009-01-28 09:49:42 +0000
committerHans Baier <hansfbaier@googlemail.com>2009-01-28 09:49:42 +0000
commitb04ead74ffede30a725b17099ae569c0460273fb (patch)
treef3672a35c98da6d01af80e6f656a5fa4547d68a5 /libs
parentd9416a3a6a69a975bb8f1aae50d218e4f71d2f19 (diff)
* Set Discrete mode as default until Linear mode works properly
git-svn-id: svn://localhost/ardour2/branches/3.0@4455 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/smf_source.cc5
-rw-r--r--libs/evoral/src/ControlList.cpp12
2 files changed, 12 insertions, 5 deletions
diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc
index cc521336e3..cf01cb808b 100644
--- a/libs/ardour/smf_source.cc
+++ b/libs/ardour/smf_source.cc
@@ -664,7 +664,12 @@ SMFSource::load_model(bool lock, bool force_reload)
Evoral::ControlSet::Controls controls = _model->controls();
for (Evoral::ControlSet::Controls::iterator c = controls.begin(); c != controls.end(); ++c) {
(*c).second->list()->set_interpolation(
+ // to be enabled when ControlList::rt_safe_earliest_event_linear_unlocked works properly
+ #if 0
EventTypeMap::instance().interpolation_of((*c).first));
+ #else
+ Evoral::ControlList::Discrete);
+ #endif
}
_model->end_write(false);
diff --git a/libs/evoral/src/ControlList.cpp b/libs/evoral/src/ControlList.cpp
index b8388f3753..98083f58da 100644
--- a/libs/evoral/src/ControlList.cpp
+++ b/libs/evoral/src/ControlList.cpp
@@ -1001,6 +1001,8 @@ ControlList::rt_safe_earliest_event_discrete_unlocked (double start, double end,
/** Get the earliest time the line crosses an integer (Linear interpolation).
*
+ * In other words: send out multiple events to interpolate the line
+ * defined by its control points
* If an event is found, \a x and \a y are set to its coordinates.
*
* \param inclusive Include events with timestamp exactly equal to \a start
@@ -1009,7 +1011,7 @@ ControlList::rt_safe_earliest_event_discrete_unlocked (double start, double end,
bool
ControlList::rt_safe_earliest_event_linear_unlocked (double start, double end, double& x, double& y, bool inclusive) const
{
- //cerr << "earliest_event(" << start << ", " << end << ", " << x << ", " << y << ", " << inclusive << endl;
+ cerr << "earliest_event(start: " << start << ", end: " << end << ", x: " << x << ", y: " << y << ", inclusive: " << inclusive << ")" << endl;
const_iterator length_check_iter = _events.begin();
if (_events.empty()) // 0 events
@@ -1052,12 +1054,12 @@ ControlList::rt_safe_earliest_event_linear_unlocked (double start, double end, d
* (Optimize for immediate call this cycle within range) */
_search_cache.left = x;
//++_search_cache.range.first;
- assert(inclusive ? x >= start : x > start);
+ assert(x >= start);
return true;
}
if (fabs(first->value - next->value) <= 1) {
- if (next->when <= end && (!inclusive || next->when > start)) {
+ if (next->when <= end && (next->when > start)) {
x = next->when;
y = next->value;
/* Move left of cache to this point
@@ -1094,9 +1096,9 @@ ControlList::rt_safe_earliest_event_linear_unlocked (double start, double end, d
x = first->when + (y - first->value) / (double)slope;
}
- /*cerr << first->value << " @ " << first->when << " ... "
+ cerr << first->value << " @ " << first->when << " ... "
<< next->value << " @ " << next->when
- << " = " << y << " @ " << x << endl;*/
+ << " = " << y << " @ " << x << endl;
assert( (y >= first->value && y <= next->value)
|| (y <= first->value && y >= next->value) );