Skip to content

Commit

Permalink
Use ALSA command mapping as described
Browse files Browse the repository at this point in the history
  • Loading branch information
joncampbell123 committed Mar 31, 2024
1 parent fbb209b commit 6a875c4
Showing 1 changed file with 36 additions and 3 deletions.
39 changes: 36 additions & 3 deletions src/gui/midi_alsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,42 @@ class MidiHandler_alsa : public MidiHandler {
}
break;
default:
snd_seq_ev_set_fixed(&ev);
LOG(LOG_MISC,LOG_DEBUG)("ALSA:Unknown Command: %02X %02X %02X", msg[0],msg[1],msg[2]);
send_event(1);
switch (msg[0]) {
case 0xF8:
snd_seq_ev_set_fixed(&ev);
ev.type = SND_SEQ_EVENT_CLOCK;
send_event(1);
break;
case 0xFA:
snd_seq_ev_set_fixed(&ev);
ev.type = SND_SEQ_EVENT_START;
send_event(1);
break;
case 0xFB:
snd_seq_ev_set_fixed(&ev);
ev.type = SND_SEQ_EVENT_CONTINUE;
send_event(1);
break;
case 0xFC:
snd_seq_ev_set_fixed(&ev);
ev.type = SND_SEQ_EVENT_STOP;
send_event(1);
break;
case 0xFE:
snd_seq_ev_set_fixed(&ev);
ev.type = SND_SEQ_EVENT_SENSING;
send_event(1);
break;
case 0xFF:
snd_seq_ev_set_fixed(&ev);
ev.type = SND_SEQ_EVENT_RESET;
send_event(1);
break;
default:
LOG(LOG_MISC,LOG_DEBUG)("ALSA:Unknown Command: %02X %02X %02X", msg[0],msg[1],msg[2]);
send_event(1);
break;
}
break;
}
}
Expand Down

0 comments on commit 6a875c4

Please sign in to comment.