Fix event type and parameter type confusion

I'm not sure if this is really the best way to do event types (should it
just be a completely static enum in evoral, or completely dynamic and
provided by the type map, or a mix like currently?), but previously the
event type was frequently set to either total garbage, or parameter
types, which are a different thing.

This fixes all those cases, and makes Evoral::EventType an enum so the
compiler will warn about implicit conversions from int.
This commit is contained in:
David Robillard
2016-11-07 05:14:55 -05:00
parent bfbc4566ad
commit 398a318934
20 changed files with 91 additions and 76 deletions

View File

@@ -25,7 +25,7 @@ SequenceTest::preserveEventOrderingTest ()
for (Notes::const_iterator i = test_notes.begin(); i != test_notes.end(); ++i) {
uint8_t buffer[3];
Event<Time>* event = new Event<Time>(
DummyTypeMap::CONTROL, (*i)->on_event().time(), 3, buffer, true
(Evoral::EventType)DummyTypeMap::CONTROL, (*i)->on_event().time(), 3, buffer, true
);
event->buffer()[0] = MIDI_CMD_CONTROL;
@@ -77,12 +77,12 @@ SequenceTest::iteratorSeekTest ()
bool on = true;
for (Sequence<Time>::const_iterator i = seq->begin(Evoral::Beats(600)); i != seq->end(); ++i) {
if (on) {
CPPUNIT_ASSERT((*i)->is_note_on());
CPPUNIT_ASSERT(i->is_note_on());
CPPUNIT_ASSERT_EQUAL(i->time(), Time((num_notes + 6) * 100));
++num_notes;
on = false;
} else {
CPPUNIT_ASSERT((*i)->is_note_off());
CPPUNIT_ASSERT(i->is_note_off());
on = true;
}
}