mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 08:14:58 +01:00
Fix crash when deleting all points from a line.
This commit is contained in:
parent
55c616519b
commit
e55b68298b
1 changed files with 10 additions and 1 deletions
|
|
@ -64,6 +64,7 @@ ControlList::ControlList (const Parameter& id)
|
||||||
_default_value = id.normal();
|
_default_value = id.normal();
|
||||||
_lookup_cache.left = -1;
|
_lookup_cache.left = -1;
|
||||||
_lookup_cache.range.first = _events.end();
|
_lookup_cache.range.first = _events.end();
|
||||||
|
_lookup_cache.range.second = _events.end();
|
||||||
_search_cache.left = -1;
|
_search_cache.left = -1;
|
||||||
_search_cache.first = _events.end();
|
_search_cache.first = _events.end();
|
||||||
_sort_pending = false;
|
_sort_pending = false;
|
||||||
|
|
@ -85,6 +86,7 @@ ControlList::ControlList (const ControlList& other)
|
||||||
_max_yval = other._max_yval;
|
_max_yval = other._max_yval;
|
||||||
_default_value = other._default_value;
|
_default_value = other._default_value;
|
||||||
_lookup_cache.range.first = _events.end();
|
_lookup_cache.range.first = _events.end();
|
||||||
|
_lookup_cache.range.second = _events.end();
|
||||||
_search_cache.first = _events.end();
|
_search_cache.first = _events.end();
|
||||||
_sort_pending = false;
|
_sort_pending = false;
|
||||||
new_write_pass = true;
|
new_write_pass = true;
|
||||||
|
|
@ -109,6 +111,7 @@ ControlList::ControlList (const ControlList& other, double start, double end)
|
||||||
_max_yval = other._max_yval;
|
_max_yval = other._max_yval;
|
||||||
_default_value = other._default_value;
|
_default_value = other._default_value;
|
||||||
_lookup_cache.range.first = _events.end();
|
_lookup_cache.range.first = _events.end();
|
||||||
|
_lookup_cache.range.second = _events.end();
|
||||||
_search_cache.first = _events.end();
|
_search_cache.first = _events.end();
|
||||||
_sort_pending = false;
|
_sort_pending = false;
|
||||||
|
|
||||||
|
|
@ -935,7 +938,10 @@ void
|
||||||
ControlList::mark_dirty () const
|
ControlList::mark_dirty () const
|
||||||
{
|
{
|
||||||
_lookup_cache.left = -1;
|
_lookup_cache.left = -1;
|
||||||
|
_lookup_cache.range.first = _events.end();
|
||||||
|
_lookup_cache.range.second = _events.end();
|
||||||
_search_cache.left = -1;
|
_search_cache.left = -1;
|
||||||
|
_search_cache.first = _events.end();
|
||||||
|
|
||||||
if (_curve) {
|
if (_curve) {
|
||||||
_curve->mark_dirty();
|
_curve->mark_dirty();
|
||||||
|
|
@ -1283,7 +1289,10 @@ ControlList::build_search_cache_if_necessary (double start) const
|
||||||
{
|
{
|
||||||
/* Only do the range lookup if x is in a different range than last time
|
/* Only do the range lookup if x is in a different range than last time
|
||||||
* this was called (or if the search cache has been marked "dirty" (left<0) */
|
* this was called (or if the search cache has been marked "dirty" (left<0) */
|
||||||
if (!_events.empty() && ((_search_cache.left < 0) || (_search_cache.left > start))) {
|
if (_events.empty()) {
|
||||||
|
_search_cache.first = _events.end();
|
||||||
|
_search_cache.left = 0;
|
||||||
|
} else if ((_search_cache.left < 0) || (_search_cache.left > start)) {
|
||||||
|
|
||||||
const ControlEvent start_point (start, 0);
|
const ControlEvent start_point (start, 0);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue