mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-14 00:20:41 +00:00
Merge pull request #1115 from albedozero/system_realtime
Modify select drivers to pass system realtime messages
This commit is contained in:
commit
41f00ec8cb
3 changed files with 43 additions and 21 deletions
|
@ -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 */
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue