mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 15:54:57 +01:00
implement deleting of sysex events
git-svn-id: svn://localhost/ardour2/branches/3.0@13238 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
9707a0e827
commit
97c23848d7
9 changed files with 134 additions and 16 deletions
|
|
@ -494,7 +494,7 @@ Sequence<Time>::Sequence(const Sequence<Time>& other)
|
|||
|
||||
for (typename SysExes::const_iterator i = other._sysexes.begin(); i != other._sysexes.end(); ++i) {
|
||||
boost::shared_ptr<Event<Time> > n (new Event<Time> (**i, true));
|
||||
_sysexes.push_back (n);
|
||||
_sysexes.insert (n);
|
||||
}
|
||||
|
||||
for (typename PatchChanges::const_iterator i = other._patch_changes.begin(); i != other._patch_changes.end(); ++i) {
|
||||
|
|
@ -788,6 +788,24 @@ Sequence<Time>::remove_patch_change_unlocked (const constPatchChangePtr p)
|
|||
}
|
||||
}
|
||||
|
||||
template<typename Time>
|
||||
void
|
||||
Sequence<Time>::remove_sysex_unlocked (const SysExPtr sysex)
|
||||
{
|
||||
typename Sequence<Time>::SysExes::iterator i = sysex_lower_bound (sysex->time ());
|
||||
while (i != _sysexes.end() && (*i)->time() == sysex->time()) {
|
||||
|
||||
typename Sequence<Time>::SysExes::iterator tmp = i;
|
||||
++tmp;
|
||||
|
||||
if (*i == sysex) {
|
||||
_sysexes.erase (i);
|
||||
}
|
||||
|
||||
i = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
/** Append \a ev to model. NOT realtime safe.
|
||||
*
|
||||
* The timestamp of event is expected to be relative to
|
||||
|
|
@ -984,7 +1002,7 @@ Sequence<Time>::append_sysex_unlocked(const MIDIEvent<Time>& ev, event_id_t /* e
|
|||
|
||||
boost::shared_ptr<MIDIEvent<Time> > event(new MIDIEvent<Time>(ev, true));
|
||||
/* XXX sysex events should use IDs */
|
||||
_sysexes.push_back(event);
|
||||
_sysexes.insert(event);
|
||||
}
|
||||
|
||||
template<typename Time>
|
||||
|
|
@ -1011,6 +1029,17 @@ Sequence<Time>::add_patch_change_unlocked (PatchChangePtr p)
|
|||
_patch_changes.insert (p);
|
||||
}
|
||||
|
||||
template<typename Time>
|
||||
void
|
||||
Sequence<Time>::add_sysex_unlocked (SysExPtr s)
|
||||
{
|
||||
if (s->id () < 0) {
|
||||
s->set_id (Evoral::next_event_id ());
|
||||
}
|
||||
|
||||
_sysexes.insert (s);
|
||||
}
|
||||
|
||||
template<typename Time>
|
||||
bool
|
||||
Sequence<Time>::contains (const NotePtr& note) const
|
||||
|
|
@ -1105,6 +1134,17 @@ Sequence<Time>::patch_change_lower_bound (Time t) const
|
|||
return i;
|
||||
}
|
||||
|
||||
/** Return the earliest sysex with time >= t */
|
||||
template<typename Time>
|
||||
typename Sequence<Time>::SysExes::const_iterator
|
||||
Sequence<Time>::sysex_lower_bound (Time t) const
|
||||
{
|
||||
SysExPtr search (new Event<Time> (0, t));
|
||||
typename Sequence<Time>::SysExes::const_iterator i = _sysexes.lower_bound (search);
|
||||
assert (i == _sysexes.end() || (*i)->time() >= t);
|
||||
return i;
|
||||
}
|
||||
|
||||
template<typename Time>
|
||||
void
|
||||
Sequence<Time>::get_notes (Notes& n, NoteOperator op, uint8_t val, int chan_mask) const
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue