Merge pull request #1115 from albedozero/system_realtime

Modify select drivers to pass system realtime messages
This commit is contained in:
Tom M 2022-06-11 17:35:34 +02:00 committed by GitHub
commit 41f00ec8cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 21 deletions

View file

@ -1347,6 +1347,26 @@ fluid_alsa_seq_run(void *d)
}
break;
case SND_SEQ_EVENT_START:
evt.type = MIDI_START;
break;
case SND_SEQ_EVENT_CONTINUE:
evt.type = MIDI_CONTINUE;
break;
case SND_SEQ_EVENT_STOP:
evt.type = MIDI_STOP;
break;
case SND_SEQ_EVENT_CLOCK:
evt.type = MIDI_SYNC;
break;
case SND_SEQ_EVENT_RESET:
evt.type = MIDI_SYSTEM_RESET;
break;
default:
continue; /* unhandled event, next loop iteration */
}

View file

@ -145,6 +145,8 @@ fluid_winmidi_callback(HMIDIIN hmi, UINT wMsg, DWORD_PTR dwInstance,
break;
case MIM_DATA:
if(msg_param < 0xF0) /* Voice category message */
{
event.type = msg_type(msg_param);
event.channel = msg_chan(msg_param) + dev_infos->channel_map;
@ -161,6 +163,11 @@ fluid_winmidi_callback(HMIDIIN hmi, UINT wMsg, DWORD_PTR dwInstance,
event.param1 = (msg_p2(msg_param) << 7) | msg_p1(msg_param);
event.param2 = 0;
}
}
else /* System message */
{
event.type = msg_param;
}
(*dev->driver.handler)(dev->driver.data, &event);
break;

View file

@ -2641,17 +2641,12 @@ fluid_midi_parser_parse(fluid_midi_parser_t *parser, unsigned char c)
/* Real-time messages (0xF8-0xFF) can occur anywhere, even in the middle
* of another message. */
if(c >= 0xF8)
{
if(c == MIDI_SYSTEM_RESET)
{
parser->event.type = c;
parser->status = 0; /* clear the status */
return &parser->event;
}
return NULL;
}
/* Status byte? - If previous message not yet complete, it is discarded (re-sync). */
if(c & 0x80)
{