mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 00:04:56 +01:00
Some comments and minor cleanup.
git-svn-id: svn://localhost/ardour2/branches/3.0@6988 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
299951a5ee
commit
ed9d42c55d
1 changed files with 6 additions and 4 deletions
|
|
@ -1151,21 +1151,25 @@ ControlList::cut (iterator start, iterator end)
|
||||||
return nal;
|
return nal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @param op 0 = cut, 1 = copy, 2 = clear */
|
||||||
boost::shared_ptr<ControlList>
|
boost::shared_ptr<ControlList>
|
||||||
ControlList::cut_copy_clear (double start, double end, int op)
|
ControlList::cut_copy_clear (double start, double end, int op)
|
||||||
{
|
{
|
||||||
boost::shared_ptr<ControlList> nal = create (_parameter);
|
boost::shared_ptr<ControlList> nal = create (_parameter);
|
||||||
|
|
||||||
iterator s, e;
|
iterator s, e;
|
||||||
ControlEvent cp (start, 0.0);
|
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
|
|
||||||
{
|
{
|
||||||
Glib::Mutex::Lock lm (_lock);
|
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()) {
|
if ((s = lower_bound (_events.begin(), _events.end(), &cp, time_comparator)) == _events.end()) {
|
||||||
return nal;
|
return nal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* and the last that is at or after `end' */
|
||||||
cp.when = end;
|
cp.when = end;
|
||||||
e = upper_bound (_events.begin(), _events.end(), &cp, time_comparator);
|
e = upper_bound (_events.begin(), _events.end(), &cp, time_comparator);
|
||||||
|
|
||||||
|
|
@ -1174,9 +1178,7 @@ ControlList::cut_copy_clear (double start, double end, int op)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (iterator x = s; x != e; ) {
|
for (iterator x = s; x != e; ) {
|
||||||
iterator tmp;
|
iterator tmp = x;
|
||||||
|
|
||||||
tmp = x;
|
|
||||||
++tmp;
|
++tmp;
|
||||||
|
|
||||||
changed = true;
|
changed = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue