From 99933fac4940303903fcf4fbb022f48824196ed9 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 19 Dec 2013 00:57:07 -0800 Subject: Allow creating instrument objects --- Alc/ALc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Alc/ALc.c') diff --git a/Alc/ALc.c b/Alc/ALc.c index be4a150b..9dcc5be0 100644 --- a/Alc/ALc.c +++ b/Alc/ALc.c @@ -287,6 +287,9 @@ static const ALCfunction alcFunctions[] = { DECL(alGenPresetsSOFT), DECL(alDeletePresetsSOFT), DECL(alIsPresetSOFT), + DECL(alGenInstrumentsSOFT), + DECL(alDeleteInstrumentsSOFT), + DECL(alIsInstrumentSOFT), DECL(alMidiSoundfontSOFT), DECL(alMidiEventSOFT), DECL(alMidiSysExSOFT), @@ -1966,6 +1969,13 @@ static ALCvoid FreeDevice(ALCdevice *device) } ResetUIntMap(&device->PresetMap); + if(device->InstrumentMap.size > 0) + { + WARN("(%p) Deleting %d Instrument(s)\n", device, device->InstrumentMap.size); + ReleaseALInstruments(device); + } + ResetUIntMap(&device->InstrumentMap); + free(device->Bs2b); device->Bs2b = NULL; @@ -2904,6 +2914,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName) InitUIntMap(&device->FilterMap, ~0); InitUIntMap(&device->SfontMap, ~0); InitUIntMap(&device->PresetMap, ~0); + InitUIntMap(&device->InstrumentMap, ~0); //Set output format device->FmtChans = DevFmtChannelsDefault; @@ -3190,6 +3201,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *deviceName, InitUIntMap(&device->FilterMap, ~0); InitUIntMap(&device->SfontMap, ~0); InitUIntMap(&device->PresetMap, ~0); + InitUIntMap(&device->InstrumentMap, ~0); device->DeviceName = NULL; @@ -3369,6 +3381,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(const ALCchar *deviceN InitUIntMap(&device->FilterMap, ~0); InitUIntMap(&device->SfontMap, ~0); InitUIntMap(&device->PresetMap, ~0); + InitUIntMap(&device->InstrumentMap, ~0); factory = ALCloopbackFactory_getFactory(); device->Backend = V(factory,createBackend)(device, ALCbackend_Loopback); -- cgit v1.2.3