From c834713526a4397c2bd76401694967e92bf6aa64 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 30 Nov 2013 23:47:42 -0800 Subject: Add methods to set and get the MIDI gain --- OpenAL32/Include/alMain.h | 3 +++ OpenAL32/Include/alMidi.h | 6 ++++++ 2 files changed, 9 insertions(+) (limited to 'OpenAL32/Include') diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 304672f5..e19ab487 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -30,6 +30,7 @@ #ifndef ALC_SOFT_midi_interface #define ALC_SOFT_midi_interface 1 #define AL_MIDI_CLOCK_SOFT 0x9999 +#define AL_MIDI_GAIN_SOFT 0x9998 #define AL_NOTEOFF_SOFT 0x0080 #define AL_NOTEON_SOFT 0x0090 #define AL_AFTERTOUCH_SOFT 0x00A0 @@ -44,6 +45,7 @@ typedef void (AL_APIENTRY*LPALMIDISYSEXSOFT)(ALuint64SOFT time, const ALbyte *da typedef void (AL_APIENTRY*LPALMIDIPLAYSOFT)(void); typedef void (AL_APIENTRY*LPALMIDIPAUSESOFT)(void); typedef void (AL_APIENTRY*LPALMIDISTOPSOFT)(void); +typedef void (AL_APIENTRY*LPALMIDIGAINSOFT)(ALfloat value); typedef ALint64SOFT (AL_APIENTRY*LPALGETINTEGER64SOFT)(ALenum pname); typedef void (AL_APIENTRY*LPALGETINTEGER64VSOFT)(ALenum pname, ALint64SOFT *values); #ifdef AL_ALEXT_PROTOTYPES @@ -54,6 +56,7 @@ AL_API void AL_APIENTRY alMidiSysExSOFT(ALuint64SOFT time, const ALbyte *data, A AL_API void AL_APIENTRY alMidiPlaySOFT(void); AL_API void AL_APIENTRY alMidiPauseSOFT(void); AL_API void AL_APIENTRY alMidiStopSOFT(void); +AL_API void AL_APIENTRY alMidiGainSOFT(ALfloat value); AL_API ALint64SOFT AL_APIENTRY alGetInteger64SOFT(ALenum pname); AL_API void AL_APIENTRY alGetInteger64vSOFT(ALenum pname, ALint64SOFT *values); #endif diff --git a/OpenAL32/Include/alMidi.h b/OpenAL32/Include/alMidi.h index 51bdeb07..847af04e 100644 --- a/OpenAL32/Include/alMidi.h +++ b/OpenAL32/Include/alMidi.h @@ -26,11 +26,13 @@ typedef struct MidiSynth { */ RWLock Lock; + volatile ALfloat Gain; volatile ALenum State; const struct MidiSynthVtable *vtbl; } MidiSynth; +ALfloat MidiSynth_getGain(const MidiSynth *self); ALuint64 MidiSynth_getTime(const MidiSynth *self); @@ -40,7 +42,9 @@ struct MidiSynthVtable { ALboolean (*const isSoundfont)(MidiSynth *self, const char *filename); ALenum (*const loadSoundfont)(MidiSynth *self, const char *filename); + void (*const setGain)(MidiSynth *self, ALfloat gain); void (*const setState)(MidiSynth *self, ALenum state); + void (*const reset)(MidiSynth *self); void (*const update)(MidiSynth *self, ALCdevice *device); @@ -53,6 +57,7 @@ struct MidiSynthVtable { DECLARE_THUNK(T, MidiSynth, void, Destruct) \ DECLARE_THUNK1(T, MidiSynth, ALboolean, isSoundfont, const char*) \ DECLARE_THUNK1(T, MidiSynth, ALenum, loadSoundfont, const char*) \ +DECLARE_THUNK1(T, MidiSynth, void, setGain, ALfloat) \ DECLARE_THUNK1(T, MidiSynth, void, setState, ALenum) \ DECLARE_THUNK(T, MidiSynth, void, reset) \ DECLARE_THUNK1(T, MidiSynth, void, update, ALCdevice*) \ @@ -64,6 +69,7 @@ static const struct MidiSynthVtable T##_MidiSynth_vtable = { \ \ T##_MidiSynth_isSoundfont, \ T##_MidiSynth_loadSoundfont, \ + T##_MidiSynth_setGain, \ T##_MidiSynth_setState, \ T##_MidiSynth_reset, \ T##_MidiSynth_update, \ -- cgit v1.2.3