Skip to content

Commit

Permalink
Fix issue #19 Cannot change instrument when external MIDI keyboard w/…
Browse files Browse the repository at this point in the history
… clock is connected, fix issue #20  Incorrect highlighting in instrument combobox when advancing instrument via click
  • Loading branch information
brummer10 committed Dec 28, 2022
1 parent df83bf7 commit 72675e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions Fluida/fluida_ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,13 +491,11 @@ void plugin_port_event(LV2UI_Handle handle, uint32_t port_index,
if (format == ps->uris.atom_eventTransfer) {
const LV2_Atom* atom = (LV2_Atom*)buffer;
if (atom->type == uris->midi_MidiEvent) {
bool block = false;
const uint8_t* const msg = (const uint8_t*)(atom + 1);
MidiKeyboard *keys = (MidiKeyboard*)ui->widget[12]->private_struct;
int channel = msg[0]&0x0f;
switch (lv2_midi_message_type(msg)) {
case LV2_MIDI_MSG_CLOCK:
block = true;
break;
case LV2_MIDI_MSG_NOTE_ON:
set_key_in_matrix(keys->in_key_matrix[channel], msg[1], true);
Expand All @@ -508,7 +506,7 @@ void plugin_port_event(LV2UI_Handle handle, uint32_t port_index,
default:
break;
}
if (!block) expose_widget(ui->widget[12]);
expose_widget(ui->widget[12]);
} else if (atom->type == ps->uris.atom_Object) {
const LV2_Atom_Object* obj = (LV2_Atom_Object*)atom;
if (obj->body.otype == uris->patch_Set) {
Expand Down

0 comments on commit 72675e8

Please sign in to comment.