aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2013-12-25 19:13:59 -0800
committerChris Robinson <[email protected]>2013-12-25 19:13:59 -0800
commit94ddc5cb1889a42c9ffe98b79e431b596a9563df (patch)
treeb513f8c94347fb697775e286c735ee79dcc201dd /Alc
parentcb3f82a4bf50aef28353629f2f7d6f45b5d420dc (diff)
Add a new fontsound object type
This is basically a combined preset and intrument zone with sample header.
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALc.c13
-rw-r--r--Alc/midi/base.c47
2 files changed, 60 insertions, 0 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index c9b46e20..f1e92cec 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -298,6 +298,9 @@ static const ALCfunction alcFunctions[] = {
DECL(alGenInstrumentsSOFT),
DECL(alDeleteInstrumentsSOFT),
DECL(alIsInstrumentSOFT),
+ DECL(alGenFontsoundsSOFT),
+ DECL(alDeleteFontsoundsSOFT),
+ DECL(alIsFontsoundSOFT),
DECL(alMidiSoundfontSOFT),
DECL(alMidiEventSOFT),
DECL(alMidiSysExSOFT),
@@ -1984,6 +1987,13 @@ static ALCvoid FreeDevice(ALCdevice *device)
}
ResetUIntMap(&device->InstrumentMap);
+ if(device->FontsoundMap.size > 0)
+ {
+ WARN("(%p) Deleting %d Fontsound(s)\n", device, device->FontsoundMap.size);
+ ReleaseALFontsounds(device);
+ }
+ ResetUIntMap(&device->FontsoundMap);
+
free(device->Bs2b);
device->Bs2b = NULL;
@@ -2923,6 +2933,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName)
InitUIntMap(&device->SfontMap, ~0);
InitUIntMap(&device->PresetMap, ~0);
InitUIntMap(&device->InstrumentMap, ~0);
+ InitUIntMap(&device->FontsoundMap, ~0);
//Set output format
device->FmtChans = DevFmtChannelsDefault;
@@ -3210,6 +3221,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *deviceName,
InitUIntMap(&device->SfontMap, ~0);
InitUIntMap(&device->PresetMap, ~0);
InitUIntMap(&device->InstrumentMap, ~0);
+ InitUIntMap(&device->FontsoundMap, ~0);
device->DeviceName = NULL;
@@ -3390,6 +3402,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(const ALCchar *deviceN
InitUIntMap(&device->SfontMap, ~0);
InitUIntMap(&device->PresetMap, ~0);
InitUIntMap(&device->InstrumentMap, ~0);
+ InitUIntMap(&device->FontsoundMap, ~0);
factory = ALCloopbackFactory_getFactory();
device->Backend = V(factory,createBackend)(device, ALCbackend_Loopback);
diff --git a/Alc/midi/base.c b/Alc/midi/base.c
index 0d81952b..33c39133 100644
--- a/Alc/midi/base.c
+++ b/Alc/midi/base.c
@@ -421,6 +421,53 @@ void ALsfinstrument_Destruct(ALsfinstrument *self)
}
+void ALfontsound_Construct(ALfontsound *self)
+{
+ self->ref = 0;
+
+ self->MinKey = 0;
+ self->MaxKey = 127;
+ self->MinVelocity = 0;
+ self->MaxVelocity = 127;
+
+ self->Generators = NULL;
+ self->NumGenerators = 0;
+ self->GeneratorsMax = 0;
+
+ self->Modulators = NULL;
+ self->NumModulators = 0;
+ self->ModulatorsMax = 0;
+
+ self->Start = 0;
+ self->End = 0;
+ self->LoopStart = 0;
+ self->LoopEnd = 0;
+ self->SampleRate = 0;
+ self->PitchKey = 0;
+ self->PitchCorrection = 0;
+ self->SampleLink = 0;
+ self->SampleType = AL_NONE;
+
+ self->id = 0;
+}
+
+void ALfontsound_Destruct(ALfontsound *self)
+{
+ free(self->Modulators);
+ self->Modulators = NULL;
+ self->NumModulators = 0;
+ self->ModulatorsMax = 0;
+
+ free(self->Generators);
+ self->Generators = NULL;
+ self->NumGenerators = 0;
+ self->GeneratorsMax = 0;
+
+ FreeThunkEntry(self->id);
+ self->id = 0;
+}
+
+
void ALsfpreset_Construct(ALsfpreset *self)
{
self->ref = 0;