1 2 #ifndef _MIDI_SYNTH_H 3 #define _MIDI_SYNTH_H 4 5 #include <BeBuild.h> 6 #include <Midi.h> 7 #include <Synth.h> 8 #include <MidiDefs.h> 9 10 class BMidiSynth : public BMidi 11 { 12 public: 13 14 BMidiSynth(); 15 virtual ~BMidiSynth(); 16 17 status_t EnableInput(bool enable, bool loadInstruments); 18 bool IsInputEnabled(void) const; 19 20 void SetVolume(double volume); 21 double Volume(void) const; 22 23 void SetTransposition(int16 offset); 24 int16 Transposition(void) const; 25 26 void MuteChannel(int16 channel, bool do_mute); 27 void GetMuteMap(char* pChannels) const; 28 29 void SoloChannel(int16 channel, bool do_solo); 30 void GetSoloMap(char* pChannels) const; 31 32 status_t LoadInstrument(int16 instrument); 33 status_t UnloadInstrument(int16 instrument); 34 status_t RemapInstrument(int16 from, int16 to); 35 36 void FlushInstrumentCache(bool startStopCache); 37 38 uint32 Tick(void) const; 39 40 virtual void NoteOff( 41 uchar channel, uchar note, uchar velocity, uint32 time = B_NOW); 42 43 virtual void NoteOn( 44 uchar channel, uchar note, uchar velocity, uint32 time = B_NOW); 45 46 virtual void KeyPressure( 47 uchar channel, uchar note, uchar pressure, uint32 time = B_NOW); 48 49 virtual void ControlChange( 50 uchar channel, uchar controlNumber, uchar controlValue, 51 uint32 time = B_NOW); 52 53 virtual void ProgramChange( 54 uchar channel, uchar programNumber, uint32 time = B_NOW); 55 56 virtual void ChannelPressure( 57 uchar channel, uchar pressure, uint32 time = B_NOW); 58 59 virtual void PitchBend( 60 uchar channel, uchar lsb, uchar msb, uint32 time = B_NOW); 61 62 virtual void AllNotesOff(bool justChannel, uint32 time = B_NOW); 63 64 protected: 65 66 void* fSongVariables; 67 void* fPerformanceVariables; 68 bool fMidiQueue; 69 70 private: 71 72 friend class BSynth; 73 74 virtual void _ReservedMidiSynth1(); 75 virtual void _ReservedMidiSynth2(); 76 virtual void _ReservedMidiSynth3(); 77 virtual void _ReservedMidiSynth4(); 78 79 virtual void Run(); 80 81 bigtime_t creationTime; 82 int16 transpose; 83 bool inputEnabled; 84 85 uint32 _reserved; 86 }; 87 88 #endif // _MIDI_SYNTH_H 89