|
@@ -155,11 +155,15 @@ Audio::Audio()
|
|
{
|
|
{
|
|
for (auto c : capture)
|
|
for (auto c : capture)
|
|
delete c;
|
|
delete c;
|
|
|
|
+
|
|
#ifdef ALC_EXT_EFX
|
|
#ifdef ALC_EXT_EFX
|
|
if (alDeleteAuxiliaryEffectSlots)
|
|
if (alDeleteAuxiliaryEffectSlots)
|
|
|
|
+ {
|
|
for (auto slot : effectSlots)
|
|
for (auto slot : effectSlots)
|
|
alDeleteAuxiliaryEffectSlots(1, &slot);
|
|
alDeleteAuxiliaryEffectSlots(1, &slot);
|
|
|
|
+ }
|
|
#endif
|
|
#endif
|
|
|
|
+
|
|
alcMakeContextCurrent(nullptr);
|
|
alcMakeContextCurrent(nullptr);
|
|
alcDestroyContext(context);
|
|
alcDestroyContext(context);
|
|
alcCloseDevice(device);
|
|
alcCloseDevice(device);
|
|
@@ -177,15 +181,22 @@ Audio::~Audio()
|
|
|
|
|
|
delete poolThread;
|
|
delete poolThread;
|
|
delete pool;
|
|
delete pool;
|
|
|
|
+
|
|
for (auto c : capture)
|
|
for (auto c : capture)
|
|
delete c;
|
|
delete c;
|
|
|
|
+
|
|
#ifdef ALC_EXT_EFX
|
|
#ifdef ALC_EXT_EFX
|
|
for (auto e : effects)
|
|
for (auto e : effects)
|
|
|
|
+ {
|
|
if (e != nullptr)
|
|
if (e != nullptr)
|
|
delete e;
|
|
delete e;
|
|
|
|
+ }
|
|
|
|
+
|
|
if (alDeleteAuxiliaryEffectSlots)
|
|
if (alDeleteAuxiliaryEffectSlots)
|
|
|
|
+ {
|
|
for (auto slot : effectSlots)
|
|
for (auto slot : effectSlots)
|
|
alDeleteAuxiliaryEffectSlots(1, &slot);
|
|
alDeleteAuxiliaryEffectSlots(1, &slot);
|
|
|
|
+ }
|
|
#endif
|
|
#endif
|
|
alcMakeContextCurrent(nullptr);
|
|
alcMakeContextCurrent(nullptr);
|
|
alcDestroyContext(context);
|
|
alcDestroyContext(context);
|
|
@@ -458,7 +469,7 @@ bool Audio::setSceneEffect(int slot, std::map<Effect::Parameter, float> ¶ms)
|
|
#ifdef ALC_EXT_EFX
|
|
#ifdef ALC_EXT_EFX
|
|
if (alAuxiliaryEffectSloti)
|
|
if (alAuxiliaryEffectSloti)
|
|
{
|
|
{
|
|
- if (result == true)
|
|
|
|
|
|
+ if (result)
|
|
{
|
|
{
|
|
if (params.find(Effect::EFFECT_VOLUME) != params.end())
|
|
if (params.find(Effect::EFFECT_VOLUME) != params.end())
|
|
alAuxiliaryEffectSlotf(effectSlots[slot], AL_EFFECTSLOT_GAIN, params[Effect::EFFECT_VOLUME]);
|
|
alAuxiliaryEffectSlotf(effectSlots[slot], AL_EFFECTSLOT_GAIN, params[Effect::EFFECT_VOLUME]);
|