1
//=========================================================
4
// $Id: minstrument.h,v 1.1.1.1 2003/10/29 10:05:10 wschweer Exp $
6
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
7
//=========================================================
9
#ifndef __MINSTRUMENT_H__
10
#define __MINSTRUMENT_H__
12
#include "globaldefs.h"
23
//---------------------------------------------------------
25
//---------------------------------------------------------
28
signed char typ; // 1 - GM 2 - GS 4 - XG
29
signed char hbank, lbank, prog;
35
//---------------------------------------------------------
37
//---------------------------------------------------------
39
class MidiInstrument {
43
EventList* _midiReset;
44
EventList* _midiState;
49
virtual ~MidiInstrument();
50
MidiInstrument(const QString& txt);
51
const QString& iname() const { return _name; }
52
void setIName(const QString& txt) { _name = txt; }
54
EventList* midiInit() const { return _midiInit; }
55
EventList* midiReset() const { return _midiReset; }
56
EventList* midiState() const { return _midiState; }
58
void readMidiState(Xml& xml);
59
virtual bool guiVisible() const { return false; }
60
virtual void showGui(bool) {}
61
virtual bool hasGui() const { return false; }
62
virtual void writeToGui(const MidiPlayEvent*) {}
64
virtual void reset(int, MType);
65
virtual const char* getPatchName(int,int,int,int,MType);
66
virtual void populatePatchPopup(QPopupMenu*, int, MType) {}
69
//---------------------------------------------------------
71
//---------------------------------------------------------
73
class MidiInstrumentList : public std::list<MidiInstrument*> {
76
MidiInstrumentList() {}
79
typedef std::list<MidiInstrument*>::iterator iMidiInstrument;
80
typedef std::list<Patch> PatchList;
82
//---------------------------------------------------------
84
//---------------------------------------------------------
92
//---------------------------------------------------------
94
//---------------------------------------------------------
96
class MidiIDFInstrument : public MidiInstrument {
97
std::vector<PatchGroup> pg;
100
MidiIDFInstrument() {};
101
virtual void reset(int port, MType type);
102
virtual const char* getPatchName(int, int, int, int, MType);
103
virtual void populatePatchPopup(QPopupMenu*, int, MType);
107
extern MidiInstrumentList midiInstruments;
108
extern MidiInstrument* genericMidiInstrument;
109
extern void initMidiInstruments();
110
extern MidiInstrument* registerMidiInstrument(const QString&);
111
extern void removeMidiInstrument(const QString& name);