Browse Source

Translate manufacturer ID to plain name

Use a built-in list of manufacturers to translate a manufacturer ID
into a human-readable name. Not all manufacturers are included in
the list for now.
master
Damien Goutte-Gattat 10 years ago
parent
commit
e67084d372
  1. 2
      src/Makefile.am
  2. 57
      src/manufacturers.h
  3. 27
      src/sysex.c
  4. 3
      src/sysex.h

2
src/Makefile.am

@ -1,6 +1,6 @@
bin_PROGRAMS = asysex
asysex_SOURCES = asysex.c midi.h midi.c sysex.h sysex.c
asysex_SOURCES = asysex.c midi.h midi.c sysex.h sysex.c manufacturers.h
AM_CPPFLAGS = -I$(top_srcdir)/lib
AM_LDFLAGS = -L$(top_builddir)/lib

57
src/manufacturers.h

@ -0,0 +1,57 @@
MANUFACTURER(0x1, "Sequential Circuits")
MANUFACTURER(0x2, "Big Briar")
MANUFACTURER(0x3, "Octave / Plateau")
MANUFACTURER(0x4, "Moog")
MANUFACTURER(0x5, "Passport Designs")
MANUFACTURER(0x6, "Lexicon")
MANUFACTURER(0x7, "Kurzweil")
MANUFACTURER(0x8, "Fender")
MANUFACTURER(0x9, "Gulbransen")
MANUFACTURER(0xA, "Delta Labs")
MANUFACTURER(0xB, "Sound Comp.")
MANUFACTURER(0xC, "General Electro")
MANUFACTURER(0xD, "Techmar")
MANUFACTURER(0xE, "Matthews Research")
MANUFACTURER(0x10, "Oberheim")
MANUFACTURER(0x11, "PAIA")
MANUFACTURER(0x12, "Simmons")
MANUFACTURER(0x13, "DigiDesign")
MANUFACTURER(0x14, "Fairlight")
MANUFACTURER(0x15, "JL Cooper")
MANUFACTURER(0x16, "Lowery")
MANUFACTURER(0x17, "Lin")
MANUFACTURER(0x18, "Emu")
MANUFACTURER(0x19, "Peavy")
MANUFACTURER(0x20, "Bon Tempi")
MANUFACTURER(0x21, "S.I.E.L.")
MANUFACTURER(0x23, "SyntheAxe")
MANUFACTURER(0x24, "Hohner")
MANUFACTURER(0x25, "Crumar")
MANUFACTURER(0x26, "Solton")
MANUFACTURER(0x27, "Jellinghaus Ms")
MANUFACTURER(0x28, "CTS")
MANUFACTURER(0x29, "PPG")
MANUFACTURER(0x2F, "Elka")
MANUFACTURER(0x36, "Cheetah")
MANUFACTURER(0x3E, "Waldorf")
MANUFACTURER(0x40, "Kawai Musical Instruments")
MANUFACTURER(0x41, "Roland")
MANUFACTURER(0x42, "Korg")
MANUFACTURER(0x43, "Yamaha")
MANUFACTURER(0x44, "Casio Computer")
MANUFACTURER(0x46, "Kamiya Studio")
MANUFACTURER(0x47, "Akai Eletric")
MANUFACTURER(0x48, "Victor Company of Japan")
MANUFACTURER(0x4B, "Fujitsu")
MANUFACTURER(0x4C, "Sony")
MANUFACTURER(0x4E, "Teac")
MANUFACTURER(0x50, "Matsushita Electric Industrial")
MANUFACTURER(0x51, "Fostex")
MANUFACTURER(0x52, "Zoom")
MANUFACTURER(0x54, "Matsushita Communication Industrial")
MANUFACTURER(0x55, "Suzuki Musical Instruments")
MANUFACTURER(0x56, "Fuji Sound")
MANUFACTURER(0x57, "Acoustic Technical Laboratory")
MANUFACTURER(0x59, "Faith")
MANUFACTURER(0x5A, "Internet")
MANUFACTURER(0x5F, "SD Card Association")

27
src/sysex.c

@ -120,3 +120,30 @@ sysex_identify(midi_io_t *midi, midi_device_id_t *devid)
return 1;
}
struct manufacturer
{
unsigned int id;
const char *name;
};
const char *
sysex_get_manufacturer(unsigned int id)
{
struct manufacturer *cursor;
static struct manufacturer manufacturers[] = {
#define MANUFACTURER(id, name) { id, name },
#include <manufacturers.h>
#undef MANUFACTURER
{ 0x0, NULL }
};
cursor = manufacturers;
while ( cursor->name ) {
if ( cursor->id == id )
return cursor->name;
cursor += 1;
}
return "Unknown manufacturer";
}

3
src/sysex.h

@ -42,6 +42,9 @@ sysex_query(midi_io_t *, unsigned char *, size_t, unsigned char *, size_t);
int
sysex_identify(midi_io_t *, midi_device_id_t *);
const char *
sysex_get_manufacturer(unsigned int);
#ifdef __cplusplus
}

Loading…
Cancel
Save