Browse Source

Handle extended manufacturer IDs

master
Damien Goutte-Gattat 10 years ago
parent
commit
aaad352ab2
  1. 8
      src/sysex.c

8
src/sysex.c

@ -105,8 +105,9 @@ sysex_identify(midi_io_t *midi, midi_device_id_t *devid)
p = &reply[5];
devid->manufacturer = *p++;
if ( devid->manufacturer == 0x00 ) { /* extended manufacturer ID */
devid->manufacturer = *p++;
devid->manufacturer += *p++ << 8;
devid->manufacturer = 1 << 16;
devid->manufacturer += *p++ << 8;
devid->manufacturer += *p++;
}
devid->family = *p++;
@ -133,8 +134,11 @@ sysex_get_manufacturer(unsigned int id)
struct manufacturer *cursor;
static struct manufacturer manufacturers[] = {
#define MANUFACTURER(id, name) { id, name },
#define MANUFACTURER_EXTENDED(high_id, low_id, name) \
{ (1 << 16) + (high_id << 8) + low_id, name },
#include <manufacturers.h>
#undef MANUFACTURER
#undef MANUFACTURER_EXTENDED
{ 0x0, NULL }
};

Loading…
Cancel
Save