#include "pbd/compose.h"
#include "pbd/error.h"
+#include "evoral/Beats.hpp"
#include "evoral/Control.hpp"
#include "evoral/ControlList.hpp"
#include "evoral/ControlSet.hpp"
#include "evoral/TypeMap.hpp"
#include "evoral/midi_util.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace std;
using namespace PBD;
switch (_type) {
case NOTE_ON:
DEBUG_TRACE(DEBUG::Sequence, "iterator = note on\n");
- *_event = (*_note_iter)->on_event();
+ _event->assign ((*_note_iter)->on_event());
_active_notes.push(*_note_iter);
break;
case NOTE_OFF:
DEBUG_TRACE(DEBUG::Sequence, "iterator = note off\n");
assert(!_active_notes.empty());
- *_event = _active_notes.top()->off_event();
+ _event->assign (_active_notes.top()->off_event());
// We don't pop the active note until we increment past it
break;
case SYSEX:
DEBUG_TRACE(DEBUG::Sequence, "iterator = sysex\n");
- *_event = *(*_sysex_iter);
+ _event->assign (*(*_sysex_iter));
break;
case CONTROL:
DEBUG_TRACE(DEBUG::Sequence, "iterator = control\n");
break;
case PATCH_CHANGE:
DEBUG_TRACE(DEBUG::Sequence, "iterator = program change\n");
- *_event = (*_patch_change_iter)->message (_active_patch_change_message);
+ _event->assign ((*_patch_change_iter)->message (_active_patch_change_message));
break;
default:
_is_end = true;
uint8_t midi_type = _type_map.parameter_midi_type(iter.list->parameter());
ev->set_event_type(_type_map.midi_event_type(midi_type));
+ ev->set_id(-1);
switch (midi_type) {
case MIDI_CMD_CONTROL:
assert(iter.list.get());
*/
typename Sequence<Time>::Notes::iterator i;
-
+
for (i = note_lower_bound(note->time()); i != _notes.end() && (*i)->time() == note->time(); ++i) {
if (*i == note) {
* in this scenario, we have no choice other than to linear
* search the list of notes and find the note by ID.
*/
-
+
for (i = _notes.begin(); i != _notes.end(); ++i) {
if ((*i)->id() == note->id()) {
-
+
DEBUG_TRACE (DEBUG::Sequence, string_compose ("%1\tID-based pass, erasing note #%2 %3 @ %4\n", this, (*i)->id(), (int)(*i)->note(), (*i)->time()));
_notes.erase (i);
-
+
if (note->note() == _lowest_note || note->note() == _highest_note) {
-
+
_lowest_note = 127;
_highest_note = 0;
-
+
for (typename Sequence<Time>::Notes::iterator ii = _notes.begin(); ii != _notes.end(); ++ii) {
if ((*ii)->note() < _lowest_note)
_lowest_note = (*ii)->note();
_highest_note = (*ii)->note();
}
}
-
+
erased = true;
id_matched = true;
break;
}
}
}
-
+
if (erased) {
Pitches& p (pitches (note->channel()));
-
+
typename Pitches::iterator j;
/* if we had to ID-match above, we can't expect to find it in
* notes by channel+time. We care only about its note number
* so the search_note has all other properties unset.
*/
-
+
NotePtr search_note (new Note<Time>(0, Time(), Time(), note->note(), 0));
for (j = p.lower_bound (search_note); j != p.end() && (*j)->note() == note->note(); ++j) {
-
+
if ((*j) == note) {
DEBUG_TRACE (DEBUG::Sequence, string_compose ("%1\terasing pitch %2 @ %3\n", this, (int)(*j)->note(), (*j)->time()));
p.erase (j);
}
_edited = true;
-
+
} else {
cerr << "Unable to find note to erase matching " << *note.get() << endmsg;
}