/* -*- c -*- */
/*
    TiMidity++ -- MIDI to WAVE converter and player
    Copyright (C) 1999-2002 Masanao Izumo <mo@goice.co.jp>
    Copyright (C) 1995 Tuukka Toivonen <tt@cgs.fi>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

*/
#ifndef ___MID_DEFS_
#define ___MID_DEFS_

#ifdef DEFINE_GLOBALS
/* #define MID_OFFICIAL_NAME */
char *mid2name(int mid)
{
    int i;
    static struct manufacture_id_t
    {
	int id;
	char *name;
    } manufacture_id_table[] =
    {
	{0x00, "Undefined"},
	{0x01, "Sequential Circuits"},
#if 0
	{0x02, "Big Briar"},
#else
	{0x02, "IDP"},
#endif
	{0x03, "Voyetra/Octave Plateau"},
	{0x04, "Moog Music"},
	{0x05, "Passport Designs"},
	{0x06, "Lexicon"},
	{0x07, "Kurzweil"},
	{0x08, "Fender"},
	{0x09, "Gulbransen"},
	{0x0A, "AKG Acoustics"},
	{0x0B, "Voyce Music"},
	{0x0C, "Waveframe"},
	{0x0D, "ADA"},
	{0x0E, "Garfield Electronics"},
	{0x0F, "Ensoniq"},
	{0x10, "Oberheim"},
	{0x11, "Apple Computer"},
	{0x12, "Grey Matter"},
	{0x13, "Digidesign"},
	{0x14, "Palm Tree Instruments"},
	{0x15, "J L Cooper"},
	{0x16, "Lowrey"},
	{0x17, "Adams-Smith"},
	{0x18, "E-mu Systems"},
	{0x19, "Harmony Systems"},
	{0x1A, "ART"},
	{0x1B, "Baldwin"},
	{0x1C, "Eventide"},
	{0x1D, "Inventronics"},
	{0x1E, "Key Concepts"},
	{0x1F, "Clarity"},
	{0x20, "Passac"},
	{0x21, "SIEL"},
	{0x22, "Synthaxe"},
	{0x23, "Stepp"},
	{0x24, "Hohner"},
	{0x25, "Twister"},
	{0x26, "Solton"},
	{0x27, "Jellinghaus"},
	{0x28, "Southworth"},
	{0x29, "PPG"},
	{0x2A, "JEN"},
	{0x2B, "Solid State Logic"},
	{0x2C, "Audio Veritrieb"},
	{0x2D, "Hinton Instruments"},
	{0x2E, "Soundtracs"},
	{0x2F, "Elka"},
	{0x30, "Dynacord"},
	{0x33, "Clavia Digital Instruments"},
	{0x34, "Audio Architecture"},
	{0x39, "Soundcraft Electronics"},
	{0x3B, "Wersi"},
	{0x3C, "Avab Electronik"},
	{0x3D, "Digigram"},
	{0x3E, "Waldorf Electronics"},
	{0x40, "Kawai"},

/* GS */
#ifdef MID_OFFICIAL_NAME
	{0x41, "Roland"},
#else
	{0x41, "GS"},
#endif

	{0x42, "Korg"},

/* XG */
#if MID_OFFICIAL_NAME
	{0x43, "Yamaha"},
#else
	{0x43, "XG"},
#endif

	{0x44, "Casio"},
	{0x45, "Moridaira"},
	{0x46, "Kamiya"},
	{0x47, "Akai"},
	{0x48, "Japan Victor"},
	{0x49, "Meisosha"},
	{0x4A, "Hoshino Gakki"},
	{0x4B, "Fujitsu Electric"},
	{0x4C, "Sony"},
	{0x4D, "Nishin Onpa"},
	{0x4E, "TEAC"},
	{0x50, "Matsushita Electric"},
	{0x51, "Fostex"},
	{0x52, "Zoom"},
	{0x53, "Midori Electronics"},
	{0x54, "Matsushita Communication Industrial"},
	{0x55, "Suzuki Musical Instrument Mfg."},
	{0x7D, "Non-Commercial"},
/* GM */
#if MID_OFFICIAL_NAME
	{0x7E, "Non-Realtime"},
#else
	{0x7E, "GM"},
#endif

	{0x7F, "Realtime"},
	{-1, NULL}
    };

    if(mid == 0)
	return NULL;
    for(i = 1; manufacture_id_table[i].id != -1; i++)
	if(mid == manufacture_id_table[i].id)
	    return manufacture_id_table[i].name;
    return NULL;
}
#else
extern char *mid2name(int mid);
#endif

#endif /* ___MID_DEFS_ */
