{
mark_dirty ();
- if (_frozen)
+ if (_frozen) {
_changed_when_thawed = true;
+ }
}
void
{
_lookup_cache.left = -1;
_search_cache.left = -1;
- if (_curve)
+
+ if (_curve) {
_curve->mark_dirty();
+ }
+
+ Dirty (); /* EMIT SIGNAL */
}
void
bool
ControlList::rt_safe_earliest_event_unlocked(double start, double end, double& x, double& y, bool inclusive) const
{
- if (_interpolation == Discrete)
+ if (_interpolation == Discrete) {
return rt_safe_earliest_event_discrete_unlocked(start, end, x, y, inclusive);
- else
+ } else {
return rt_safe_earliest_event_linear_unlocked(start, end, x, y, inclusive);
+ }
}
//<< ", x: " << x << ", y: " << y << ", inclusive: " << inclusive << ")" << endl;
const_iterator length_check_iter = _events.begin();
- if (_events.empty()) // 0 events
+ if (_events.empty()) { // 0 events
return false;
- else if (_events.end() == ++length_check_iter) // 1 event
+ } else if (_events.end() == ++length_check_iter) { // 1 event
return rt_safe_earliest_event_discrete_unlocked(start, end, x, y, inclusive);
+ }
// Hack to avoid infinitely repeating the same event
build_search_cache_if_necessary(start, end);
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) );
return nal;
}
+/** @param op 0 = cut, 1 = copy, 2 = clear */
boost::shared_ptr<ControlList>
ControlList::cut_copy_clear (double start, double end, int op)
{
boost::shared_ptr<ControlList> nal = create (_parameter);
+
iterator s, e;
- ControlEvent cp (start, 0.0);
bool changed = false;
{
Glib::Mutex::Lock lm (_lock);
+ /* find the first event in our list that is at or before `start' in time */
+ ControlEvent cp (start, 0.0);
if ((s = lower_bound (_events.begin(), _events.end(), &cp, time_comparator)) == _events.end()) {
return nal;
}
+ /* and the last that is at or after `end' */
cp.when = end;
e = upper_bound (_events.begin(), _events.end(), &cp, time_comparator);
}
for (iterator x = s; x != e; ) {
- iterator tmp;
-
- tmp = x;
+ iterator tmp = x;
++tmp;
changed = true;
maybe_signal_changed ();
}
+void
+ControlList::set_interpolation (InterpolationStyle s)
+{
+ if (_interpolation == s) {
+ return;
+ }
+
+ _interpolation = s;
+ InterpolationChanged (s); /* EMIT SIGNAL */
+}
+
} // namespace Evoral