summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2019-04-08 17:42:00 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2019-04-08 18:08:43 +0200
commit723343269d161b2bba7aee4597357ffc32f26f04 (patch)
tree65b25278bcf029ce5f34420a0caaee634b0c9c04 /plugin
parent10d483417fa70bb4c357d598f3bdfcf4f0b75f21 (diff)
Move midi note process to one common place in AudioInputEngineMidi::processNote and use it in the four input engines (plugin, midifile, ossmidi and jackmidi)
Diffstat (limited to 'plugin')
-rw-r--r--plugin/drumgizmo_plugin.cc30
1 files changed, 2 insertions, 28 deletions
diff --git a/plugin/drumgizmo_plugin.cc b/plugin/drumgizmo_plugin.cc
index 67436af..40121e2 100644
--- a/plugin/drumgizmo_plugin.cc
+++ b/plugin/drumgizmo_plugin.cc
@@ -372,34 +372,8 @@ void DrumGizmoPlugin::Input::run(size_t pos, size_t len, std::vector<event_t>& e
for(auto& event : *plugin.input_events)
{
- switch(event.type)
- {
- case MidiEventType::NoteOn:
- {
- int i = mmap.lookup(event.key);
- if(event.velocity != 0 && (i != -1))
- {
- events.push_back({EventType::OnSet, (size_t)i,
- (size_t)event.getTime(), event.velocity / 127.0f});
- }
- }
- break;
-
- case MidiEventType::Aftertouch:
- {
- int i = mmap.lookup(event.key);
- if(event.velocity == 0 && i != -1)
- {
- events.push_back({EventType::Choke, (size_t)i,
- (size_t)event.getTime(), .0f});
- }
- }
- break;
-
- case MidiEventType::NoteOff:
- case MidiEventType::Unknown:
- break;
- }
+ processNote((const std::uint8_t*)event.getData(), event.getSize(),
+ event.getTime(), events);
}
}