diff options
author | Chris Robinson <[email protected]> | 2013-12-27 02:59:50 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-12-27 02:59:50 -0800 |
commit | f85d733f9dc569bd6b3f37a0a4b8be7b3c783ad6 (patch) | |
tree | a67fa24599e54bee27a36e14e2cde8bca3348465 /OpenAL32/alMidi.c | |
parent | 2b772a5607c2147d68eb8e45b04b2f381ec6c0ad (diff) |
Add a method to set and get soundfonts
The main purpose of this is to select soundfonts for playback, eventually,
instead of the existing method that takes a filename.
Diffstat (limited to 'OpenAL32/alMidi.c')
-rw-r--r-- | OpenAL32/alMidi.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/OpenAL32/alMidi.c b/OpenAL32/alMidi.c index 19cfb179..29e9e974 100644 --- a/OpenAL32/alMidi.c +++ b/OpenAL32/alMidi.c @@ -52,6 +52,38 @@ AL_API void AL_APIENTRY alMidiSoundfontSOFT(const char *filename) ALCcontext_DecRef(context); } +AL_API void AL_APIENTRY alMidiSoundfontsSOFT(ALsizei count, const ALuint *ids) +{ + ALCdevice *device; + ALCcontext *context; + MidiSynth *synth; + ALenum err; + + context = GetContextRef(); + if(!context) return; + + if(count < 0) + SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done); + + device = context->Device; + synth = device->Synth; + + WriteLock(&synth->Lock); + if(synth->State == AL_PLAYING || synth->State == AL_PAUSED) + alSetError(context, AL_INVALID_OPERATION); + else + { + err = V(synth,selectSoundfonts)(device, count, ids); + if(err != AL_NO_ERROR) + alSetError(context, err); + } + WriteUnlock(&synth->Lock); + +done: + ALCcontext_DecRef(context); +} + + AL_API void AL_APIENTRY alMidiEventSOFT(ALuint64SOFT time, ALenum event, ALsizei channel, ALsizei param1, ALsizei param2) { ALCdevice *device; |