Files
haiku-beta6/headers/os/midi/MidiSynth.h
T

94 lines
2.3 KiB
C++
Raw Normal View History

2002-10-26 18:51:58 +00:00
#ifndef _MIDI_SYNTH_H
#define _MIDI_SYNTH_H
#include <BeBuild.h>
#include <Midi.h>
#include <Synth.h>
#include <MidiDefs.h>
class BMidiSynth : public BMidi
{
public:
2002-11-01 16:11:03 +00:00
BMidiSynth();
virtual ~BMidiSynth();
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
status_t EnableInput(bool enable, bool loadInstruments);
bool IsInputEnabled(void) const;
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
/* set volume. You can overdrive by passing values larger than 1.0 */
void SetVolume(double volume);
double Volume(void) const;
2002-10-26 18:51:58 +00:00
/* set note offset in semi tones */
2002-11-01 16:11:03 +00:00
/* (12 is down an octave, -12 is up an octave) */
void SetTransposition(int16 offset);
int16 Transposition(void) const;
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
/* Mute and unmute channels (0 to 15) */
void MuteChannel(int16 channel, bool do_mute);
void GetMuteMap(char* pChannels) const;
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
void SoloChannel(int16 channel, bool do_solo);
void GetSoloMap(char* pChannels) const;
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
/* Use these functions to drive the synth engine directly */
status_t LoadInstrument(int16 instrument);
status_t UnloadInstrument(int16 instrument);
status_t RemapInstrument(int16 from, int16 to);
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
void FlushInstrumentCache(bool startStopCache);
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
/* get current midi tick in microseconds */
uint32 Tick(void) const;
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
/* The channel variable is 1 to 16. Channel 10 is percussion for example. */
/* The programNumber variable is a number from 0-127 */
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
virtual void NoteOff(
uchar channel, uchar note, uchar velocity, uint32 time = B_NOW);
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
virtual void NoteOn(
uchar channel, uchar note, uchar velocity, uint32 time = B_NOW);
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
virtual void KeyPressure(
uchar channel, uchar note, uchar pressure, uint32 time = B_NOW);
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
virtual void ControlChange(
uchar channel, uchar controlNumber, uchar controlValue,
uint32 time = B_NOW);
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
virtual void ProgramChange(
uchar channel, uchar programNumber, uint32 time = B_NOW);
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
virtual void ChannelPressure(
uchar channel, uchar pressure, uint32 time = B_NOW);
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
virtual void PitchBend(
uchar channel, uchar lsb, uchar msb, uint32 time = B_NOW);
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
virtual void AllNotesOff(bool controlOnly, uint32 time = B_NOW);
2002-10-26 18:51:58 +00:00
protected:
2002-11-01 16:11:03 +00:00
void* fSongVariables;
void* fPerformanceVariables;
bool fMidiQueue;
2002-10-26 18:51:58 +00:00
private:
2002-11-01 16:11:03 +00:00
virtual void _ReservedMidiSynth1();
virtual void _ReservedMidiSynth2();
virtual void _ReservedMidiSynth3();
virtual void _ReservedMidiSynth4();
friend class BSynth;
2002-10-26 18:51:58 +00:00
2002-11-01 16:11:03 +00:00
virtual void Run();
2002-10-26 18:51:58 +00:00
bool fInputEnabled;
2002-11-01 16:11:03 +00:00
uint32 _reserved[4];
2002-10-26 18:51:58 +00:00
};
2002-11-01 16:11:03 +00:00
#endif // _MIDI_SYNTH_H