A lot of fixes - everything now seems to work properly.

This commit is contained in:
OBattler
2022-02-03 03:10:06 +01:00
parent 296e25c685
commit 6f2b93923c
59 changed files with 551 additions and 521 deletions

View File

@@ -68,29 +68,46 @@ uint8_t MIDI_evt_len[256] = {
typedef struct
{
const char *internal_name;
const device_t *device;
} MIDI_DEVICE, MIDI_IN_DEVICE;
static const device_t midi_none_device = {
"None",
"none",
0, 0,
NULL, NULL, NULL,
{ NULL }, NULL, NULL,
NULL
};
static const MIDI_DEVICE devices[] =
{
{ "none", NULL },
{ &midi_none_device },
#ifdef USE_FLUIDSYNTH
{ "fluidsynth", &fluidsynth_device },
{ &fluidsynth_device },
#endif
#ifdef USE_MUNT
{ "mt32", &mt32_device },
{ "cm32l", &cm32l_device },
{ &mt32_device },
{ &cm32l_device },
#endif
{ SYSTEM_MIDI_INTERNAL_NAME, &rtmidi_device },
{ "", NULL }
{ &rtmidi_device },
{ NULL }
};
static const device_t midi_in_none_device = {
"None",
"none",
0, 0,
NULL, NULL, NULL,
{ NULL }, NULL, NULL,
NULL
};
static const MIDI_IN_DEVICE midi_in_devices[] =
{
{ "none", NULL },
{ MIDI_INPUT_INTERNAL_NAME, &rtmidi_input_device },
{ "", NULL }
{ &midi_in_none_device },
{ &rtmidi_input_device },
{ NULL }
};
@@ -123,7 +140,7 @@ midi_device_has_config(int card)
char *
midi_device_get_internal_name(int card)
{
return (char *) devices[card].device->internal_name;
return device_get_internal_name(devices[card].device);
}
@@ -132,7 +149,7 @@ midi_device_get_from_internal_name(char *s)
{
int c = 0;
while (strlen(devices[c].device->internal_name)) {
while (devices[c].device != NULL) {
if (!strcmp(devices[c].device->internal_name, s))
return c;
c++;
@@ -252,7 +269,7 @@ midi_in_device_has_config(int card)
char *
midi_in_device_get_internal_name(int card)
{
return (char *) midi_in_devices[card].device->internal_name;
return device_get_internal_name(midi_in_devices[card].device);
}
@@ -261,7 +278,7 @@ midi_in_device_get_from_internal_name(char *s)
{
int c = 0;
while (strlen(midi_in_devices[c].device->internal_name)) {
while (midi_in_devices[c].device != NULL) {
if (!strcmp(midi_in_devices[c].device->internal_name, s))
return c;
c++;