1
//=========================================================
4
// $Id: midiport.h,v 1.1.1.1 2003/10/29 10:04:59 wschweer Exp $
6
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
7
//=========================================================
10
#define __MIDIPORT_H__
15
const int MIDI_PORTS = 16; // max Number of Midi Ports
18
#define MIDI_CHANNELS 16 // Channels per Port
23
//---------------------------------------------------------
25
//---------------------------------------------------------
28
int pitch; // -8192 -- + 8191
30
signed char controller[128];
33
//---------------------------------------------------------
35
//---------------------------------------------------------
38
ChannelState _iState[MIDI_CHANNELS]; // Initial State
39
ChannelState _cState[MIDI_CHANNELS]; // Current State
43
MidiInstrument* _instrument;
44
int _rwFlags; // bits: 1 play, 2 capture, 3 duplex
49
bool guiVisible() const;
54
int rwFlags() const { return _rwFlags; }
55
void setrwFlags(int val);
57
ChannelState* iState(int ch) { return &_iState[ch]; }
58
ChannelState* cState(int ch) { return &_cState[ch]; }
59
MidiDevice* device() const { return _device; }
60
const QString& state() const { return _state; }
61
void setState(const QString& s) { _state = s; }
62
void resetCstate(int channel, bool active);
63
void resetIstate(int channel, bool active);
64
void setMidiDevice(MidiDevice* dev);
65
const QString& portname() const;
66
MidiInstrument* instrument() const { return _instrument; }
67
void setInstrument(MidiInstrument* i) { _instrument = i; }
73
void programChange(int chn, int hbank, int lbank, int prg);
74
void programChange(int chn, int prg);
75
void setCtrl(int chan, int ctrl, int val);
76
void nrpn(int chan, int ctrl, int val);
77
void rpn(int chan, int ctrl, int val);
78
void bender(int chn, int val);
81
void putStart() const;
82
void putContinue() const;
83
void putEvent(const MidiPlayEvent*);
84
void sysex(const unsigned char* p, int n);
86
int masterVol() const { return _masterVol; }
88
void setMasterVol(int chan);
92
extern MidiPort midiPorts[MIDI_PORTS];
93
extern void initMidiPorts();
97
extern QPopupMenu* midiPortsPopup(QWidget*);