2002-10-26 22:51:58 +04:00
|
|
|
|
|
|
|
#ifndef _MIDI_SYNTH_H
|
|
|
|
#define _MIDI_SYNTH_H
|
|
|
|
|
|
|
|
#include <BeBuild.h>
|
|
|
|
#include <Midi.h>
|
|
|
|
#include <Synth.h>
|
|
|
|
#include <MidiDefs.h>
|
|
|
|
|
2005-11-18 01:53:30 +03:00
|
|
|
class BSynth;
|
|
|
|
|
2002-10-26 22:51:58 +04:00
|
|
|
class BMidiSynth : public BMidi
|
|
|
|
{
|
|
|
|
public:
|
2003-03-18 01:24:09 +03:00
|
|
|
|
2002-11-01 19:11:03 +03:00
|
|
|
BMidiSynth();
|
|
|
|
virtual ~BMidiSynth();
|
2002-10-26 22:51:58 +04:00
|
|
|
|
2002-11-01 19:11:03 +03:00
|
|
|
status_t EnableInput(bool enable, bool loadInstruments);
|
|
|
|
bool IsInputEnabled(void) const;
|
2002-10-26 22:51:58 +04:00
|
|
|
|
2002-11-01 19:11:03 +03:00
|
|
|
void SetVolume(double volume);
|
|
|
|
double Volume(void) const;
|
2002-10-26 22:51:58 +04:00
|
|
|
|
2002-11-01 19:11:03 +03:00
|
|
|
void SetTransposition(int16 offset);
|
|
|
|
int16 Transposition(void) const;
|
2002-10-26 22:51:58 +04:00
|
|
|
|
2002-11-01 19:11:03 +03:00
|
|
|
void MuteChannel(int16 channel, bool do_mute);
|
|
|
|
void GetMuteMap(char* pChannels) const;
|
2002-10-26 22:51:58 +04:00
|
|
|
|
2002-11-01 19:11:03 +03:00
|
|
|
void SoloChannel(int16 channel, bool do_solo);
|
|
|
|
void GetSoloMap(char* pChannels) const;
|
2002-10-26 22:51:58 +04:00
|
|
|
|
2002-11-01 19:11:03 +03:00
|
|
|
status_t LoadInstrument(int16 instrument);
|
|
|
|
status_t UnloadInstrument(int16 instrument);
|
|
|
|
status_t RemapInstrument(int16 from, int16 to);
|
2002-10-26 22:51:58 +04:00
|
|
|
|
2002-11-01 19:11:03 +03:00
|
|
|
void FlushInstrumentCache(bool startStopCache);
|
2002-10-26 22:51:58 +04:00
|
|
|
|
2002-11-01 19:11:03 +03:00
|
|
|
uint32 Tick(void) const;
|
2002-10-26 22:51:58 +04:00
|
|
|
|
2002-11-01 19:11:03 +03:00
|
|
|
virtual void NoteOff(
|
|
|
|
uchar channel, uchar note, uchar velocity, uint32 time = B_NOW);
|
2002-10-26 22:51:58 +04:00
|
|
|
|
2002-11-01 19:11:03 +03:00
|
|
|
virtual void NoteOn(
|
|
|
|
uchar channel, uchar note, uchar velocity, uint32 time = B_NOW);
|
2002-10-26 22:51:58 +04:00
|
|
|
|
2002-11-01 19:11:03 +03:00
|
|
|
virtual void KeyPressure(
|
|
|
|
uchar channel, uchar note, uchar pressure, uint32 time = B_NOW);
|
2002-10-26 22:51:58 +04:00
|
|
|
|
2002-11-01 19:11:03 +03:00
|
|
|
virtual void ControlChange(
|
|
|
|
uchar channel, uchar controlNumber, uchar controlValue,
|
|
|
|
uint32 time = B_NOW);
|
2002-10-26 22:51:58 +04:00
|
|
|
|
2002-11-01 19:11:03 +03:00
|
|
|
virtual void ProgramChange(
|
|
|
|
uchar channel, uchar programNumber, uint32 time = B_NOW);
|
2002-10-26 22:51:58 +04:00
|
|
|
|
2002-11-01 19:11:03 +03:00
|
|
|
virtual void ChannelPressure(
|
|
|
|
uchar channel, uchar pressure, uint32 time = B_NOW);
|
2002-10-26 22:51:58 +04:00
|
|
|
|
2002-11-01 19:11:03 +03:00
|
|
|
virtual void PitchBend(
|
|
|
|
uchar channel, uchar lsb, uchar msb, uint32 time = B_NOW);
|
2002-10-26 22:51:58 +04:00
|
|
|
|
2003-03-18 01:24:09 +03:00
|
|
|
virtual void AllNotesOff(bool justChannel, uint32 time = B_NOW);
|
2002-10-26 22:51:58 +04:00
|
|
|
|
|
|
|
protected:
|
2003-03-18 01:24:09 +03:00
|
|
|
|
2002-11-01 19:11:03 +03:00
|
|
|
void* fSongVariables;
|
|
|
|
void* fPerformanceVariables;
|
|
|
|
bool fMidiQueue;
|
2004-05-13 20:47:34 +04:00
|
|
|
|
2002-10-26 22:51:58 +04:00
|
|
|
private:
|
|
|
|
|
2003-03-18 01:24:09 +03:00
|
|
|
friend class BSynth;
|
|
|
|
|
2002-11-01 19:11:03 +03:00
|
|
|
virtual void _ReservedMidiSynth1();
|
|
|
|
virtual void _ReservedMidiSynth2();
|
|
|
|
virtual void _ReservedMidiSynth3();
|
|
|
|
virtual void _ReservedMidiSynth4();
|
|
|
|
|
|
|
|
virtual void Run();
|
2002-10-26 22:51:58 +04:00
|
|
|
|
2006-06-19 17:24:04 +04:00
|
|
|
bigtime_t fCreationTime;
|
|
|
|
int16 fTranspose;
|
|
|
|
bool fInputEnabled;
|
2002-10-26 22:51:58 +04:00
|
|
|
};
|
|
|
|
|
2002-11-01 19:11:03 +03:00
|
|
|
#endif // _MIDI_SYNTH_H
|