2010-04-08 08:54:28 -07:00
|
|
|
/**
|
|
|
|
* OpenAL cross platform audio library
|
|
|
|
* Copyright (C) 2009 by Chris Robinson.
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
2014-08-18 14:11:03 +02:00
|
|
|
* Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2010-04-08 08:54:28 -07:00
|
|
|
* Or go to http://www.gnu.org/copyleft/lgpl.html
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <math.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2018-11-19 21:04:50 -08:00
|
|
|
#include <cmath>
|
|
|
|
#include <algorithm>
|
|
|
|
|
2010-04-08 08:54:28 -07:00
|
|
|
#include "alMain.h"
|
2018-11-17 23:02:27 -08:00
|
|
|
#include "alcontext.h"
|
2010-04-08 08:54:28 -07:00
|
|
|
#include "alAuxEffectSlot.h"
|
|
|
|
#include "alError.h"
|
|
|
|
#include "alu.h"
|
2018-03-22 07:05:40 -07:00
|
|
|
#include "filters/defs.h"
|
2018-11-17 23:21:37 -08:00
|
|
|
#include "vecmat.h"
|
2010-04-08 08:54:28 -07:00
|
|
|
|
|
|
|
|
2018-03-04 22:44:20 -08:00
|
|
|
#define MAX_UPDATE_SAMPLES 128
|
|
|
|
|
2018-11-17 01:53:39 -08:00
|
|
|
struct ALmodulatorState final : public ALeffectState {
|
2018-11-19 21:04:50 -08:00
|
|
|
void (*mGetSamples)(ALfloat*RESTRICT, ALsizei, const ALsizei, ALsizei){};
|
2010-04-08 10:37:09 -07:00
|
|
|
|
2018-11-19 21:04:50 -08:00
|
|
|
ALsizei mIndex{0};
|
|
|
|
ALsizei mStep{1};
|
2010-04-08 10:37:09 -07:00
|
|
|
|
2018-01-11 04:48:18 -08:00
|
|
|
struct {
|
2018-04-04 18:07:46 -07:00
|
|
|
BiquadFilter Filter;
|
2010-05-12 04:56:03 -07:00
|
|
|
|
2018-11-19 21:04:50 -08:00
|
|
|
ALfloat CurrentGains[MAX_OUTPUT_CHANNELS]{};
|
|
|
|
ALfloat TargetGains[MAX_OUTPUT_CHANNELS]{};
|
|
|
|
} mChans[MAX_EFFECT_CHANNELS];
|
2018-11-17 01:53:39 -08:00
|
|
|
};
|
2010-04-08 08:54:28 -07:00
|
|
|
|
2016-08-25 03:42:43 -07:00
|
|
|
static ALvoid ALmodulatorState_Destruct(ALmodulatorState *state);
|
|
|
|
static ALboolean ALmodulatorState_deviceUpdate(ALmodulatorState *state, ALCdevice *device);
|
2017-09-21 05:42:35 -07:00
|
|
|
static ALvoid ALmodulatorState_update(ALmodulatorState *state, const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props);
|
2018-10-29 11:32:50 -07:00
|
|
|
static ALvoid ALmodulatorState_process(ALmodulatorState *state, ALsizei SamplesToDo, const ALfloat (*RESTRICT SamplesIn)[BUFFERSIZE], ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE], ALsizei NumChannels);
|
2016-08-25 03:42:43 -07:00
|
|
|
DECLARE_DEFAULT_ALLOCATORS(ALmodulatorState)
|
|
|
|
|
|
|
|
DEFINE_ALEFFECTSTATE_VTABLE(ALmodulatorState);
|
|
|
|
|
|
|
|
|
2013-05-18 00:43:09 -07:00
|
|
|
#define WAVEFORM_FRACBITS 24
|
2011-09-23 23:11:35 -07:00
|
|
|
#define WAVEFORM_FRACONE (1<<WAVEFORM_FRACBITS)
|
|
|
|
#define WAVEFORM_FRACMASK (WAVEFORM_FRACONE-1)
|
2010-04-08 10:37:09 -07:00
|
|
|
|
2017-05-02 04:54:59 -07:00
|
|
|
static inline ALfloat Sin(ALsizei index)
|
2010-04-08 10:37:09 -07:00
|
|
|
{
|
2018-11-19 21:04:50 -08:00
|
|
|
return std::sin((ALfloat)index * (F_TAU / (ALfloat)WAVEFORM_FRACONE));
|
2010-04-08 10:37:09 -07:00
|
|
|
}
|
|
|
|
|
2017-05-02 04:54:59 -07:00
|
|
|
static inline ALfloat Saw(ALsizei index)
|
2010-04-08 10:37:09 -07:00
|
|
|
{
|
2018-05-31 19:43:02 -07:00
|
|
|
return (ALfloat)index*(2.0f/WAVEFORM_FRACONE) - 1.0f;
|
2010-04-08 10:37:09 -07:00
|
|
|
}
|
|
|
|
|
2017-05-02 04:54:59 -07:00
|
|
|
static inline ALfloat Square(ALsizei index)
|
2010-04-08 10:37:09 -07:00
|
|
|
{
|
2018-05-31 19:43:02 -07:00
|
|
|
return (ALfloat)(((index>>(WAVEFORM_FRACBITS-2))&2) - 1);
|
2010-04-08 10:37:09 -07:00
|
|
|
}
|
|
|
|
|
2018-07-21 14:21:00 -07:00
|
|
|
static inline ALfloat One(ALsizei UNUSED(index))
|
|
|
|
{
|
|
|
|
return 1.0f;
|
|
|
|
}
|
|
|
|
|
2011-07-01 01:48:04 -07:00
|
|
|
#define DECL_TEMPLATE(func) \
|
2018-10-29 11:32:50 -07:00
|
|
|
static void Modulate##func(ALfloat *RESTRICT dst, ALsizei index, \
|
2018-03-04 22:44:20 -08:00
|
|
|
const ALsizei step, ALsizei todo) \
|
2011-07-01 01:48:04 -07:00
|
|
|
{ \
|
2017-05-02 04:54:59 -07:00
|
|
|
ALsizei i; \
|
2016-01-29 23:28:38 -08:00
|
|
|
for(i = 0;i < todo;i++) \
|
2011-07-01 01:48:04 -07:00
|
|
|
{ \
|
2016-01-29 23:28:38 -08:00
|
|
|
index += step; \
|
|
|
|
index &= WAVEFORM_FRACMASK; \
|
2018-03-04 22:44:20 -08:00
|
|
|
dst[i] = func(index); \
|
2011-07-01 01:48:04 -07:00
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
DECL_TEMPLATE(Sin)
|
|
|
|
DECL_TEMPLATE(Saw)
|
|
|
|
DECL_TEMPLATE(Square)
|
2018-07-21 14:21:00 -07:00
|
|
|
DECL_TEMPLATE(One)
|
2011-07-01 01:48:04 -07:00
|
|
|
|
|
|
|
#undef DECL_TEMPLATE
|
|
|
|
|
|
|
|
|
2016-08-25 03:42:43 -07:00
|
|
|
static void ALmodulatorState_Construct(ALmodulatorState *state)
|
|
|
|
{
|
2018-11-17 01:53:39 -08:00
|
|
|
new (state) ALmodulatorState{};
|
2016-08-25 03:42:43 -07:00
|
|
|
ALeffectState_Construct(STATIC_CAST(ALeffectState, state));
|
|
|
|
SET_VTABLE2(ALmodulatorState, ALeffectState, state);
|
|
|
|
}
|
|
|
|
|
2016-05-12 18:26:33 -07:00
|
|
|
static ALvoid ALmodulatorState_Destruct(ALmodulatorState *state)
|
2010-04-08 08:54:28 -07:00
|
|
|
{
|
2016-05-12 18:26:33 -07:00
|
|
|
ALeffectState_Destruct(STATIC_CAST(ALeffectState,state));
|
2018-11-17 01:53:39 -08:00
|
|
|
state->~ALmodulatorState();
|
2010-04-08 08:54:28 -07:00
|
|
|
}
|
|
|
|
|
2018-01-11 04:48:18 -08:00
|
|
|
static ALboolean ALmodulatorState_deviceUpdate(ALmodulatorState *state, ALCdevice *UNUSED(device))
|
2010-04-08 08:54:28 -07:00
|
|
|
{
|
2018-11-19 21:04:50 -08:00
|
|
|
for(auto &e : state->mChans)
|
2018-01-11 04:48:18 -08:00
|
|
|
{
|
2018-11-19 21:04:50 -08:00
|
|
|
BiquadFilter_clear(&e.Filter);
|
|
|
|
std::fill(std::begin(e.CurrentGains), std::end(e.CurrentGains), 0.0f);
|
2018-01-11 04:48:18 -08:00
|
|
|
}
|
2010-04-08 08:54:28 -07:00
|
|
|
return AL_TRUE;
|
|
|
|
}
|
|
|
|
|
2017-09-21 05:42:35 -07:00
|
|
|
static ALvoid ALmodulatorState_update(ALmodulatorState *state, const ALCcontext *context, const ALeffectslot *slot, const ALeffectProps *props)
|
2010-04-08 08:54:28 -07:00
|
|
|
{
|
2017-09-21 05:42:35 -07:00
|
|
|
const ALCdevice *device = context->Device;
|
2018-05-31 22:21:00 -07:00
|
|
|
ALfloat f0norm;
|
2017-05-02 04:54:59 -07:00
|
|
|
ALsizei i;
|
2010-04-08 09:36:20 -07:00
|
|
|
|
2018-11-19 21:04:50 -08:00
|
|
|
state->mStep = fastf2i(props->Modulator.Frequency / (ALfloat)device->Frequency *
|
|
|
|
WAVEFORM_FRACONE);
|
|
|
|
state->mStep = clampi(state->mStep, 0, WAVEFORM_FRACONE-1);
|
2018-07-21 14:21:00 -07:00
|
|
|
|
2018-11-19 21:04:50 -08:00
|
|
|
if(state->mStep == 0)
|
|
|
|
state->mGetSamples = ModulateOne;
|
2018-07-21 14:21:00 -07:00
|
|
|
else if(props->Modulator.Waveform == AL_RING_MODULATOR_SINUSOID)
|
2018-11-19 21:04:50 -08:00
|
|
|
state->mGetSamples = ModulateSin;
|
2016-05-13 18:28:01 -07:00
|
|
|
else if(props->Modulator.Waveform == AL_RING_MODULATOR_SAWTOOTH)
|
2018-11-19 21:04:50 -08:00
|
|
|
state->mGetSamples = ModulateSaw;
|
2016-05-12 18:26:33 -07:00
|
|
|
else /*if(Slot->Params.EffectProps.Modulator.Waveform == AL_RING_MODULATOR_SQUARE)*/
|
2018-11-19 21:04:50 -08:00
|
|
|
state->mGetSamples = ModulateSquare;
|
2010-04-08 10:37:09 -07:00
|
|
|
|
2018-05-31 22:21:00 -07:00
|
|
|
f0norm = props->Modulator.HighPassCutoff / (ALfloat)device->Frequency;
|
2018-07-21 14:22:52 -07:00
|
|
|
f0norm = clampf(f0norm, 1.0f/512.0f, 0.49f);
|
2018-05-31 22:21:00 -07:00
|
|
|
/* Bandwidth value is constant in octaves. */
|
2018-11-19 21:04:50 -08:00
|
|
|
BiquadFilter_setParams(&state->mChans[0].Filter, BiquadType::HighPass, 1.0f,
|
2018-05-31 22:21:00 -07:00
|
|
|
f0norm, calc_rcpQ_from_bandwidth(f0norm, 0.75f));
|
2018-01-11 04:48:18 -08:00
|
|
|
for(i = 1;i < MAX_EFFECT_CHANNELS;i++)
|
2018-11-19 21:04:50 -08:00
|
|
|
BiquadFilter_copyParams(&state->mChans[i].Filter, &state->mChans[0].Filter);
|
2011-07-16 03:35:51 -07:00
|
|
|
|
2018-11-19 21:04:50 -08:00
|
|
|
state->OutBuffer = device->FOAOut.Buffer;
|
|
|
|
state->OutChannels = device->FOAOut.NumChannels;
|
2016-01-29 23:44:43 -08:00
|
|
|
for(i = 0;i < MAX_EFFECT_CHANNELS;i++)
|
2018-11-17 23:21:37 -08:00
|
|
|
ComputePanGains(&device->FOAOut, aluMatrixf::Identity.m[i], slot->Params.Gain,
|
2018-11-19 21:04:50 -08:00
|
|
|
state->mChans[i].TargetGains);
|
2010-04-08 08:54:28 -07:00
|
|
|
}
|
|
|
|
|
2018-10-29 11:32:50 -07:00
|
|
|
static ALvoid ALmodulatorState_process(ALmodulatorState *state, ALsizei SamplesToDo, const ALfloat (*RESTRICT SamplesIn)[BUFFERSIZE], ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE], ALsizei NumChannels)
|
2010-04-08 08:54:28 -07:00
|
|
|
{
|
2018-11-19 21:04:50 -08:00
|
|
|
const ALsizei step = state->mStep;
|
2017-05-02 04:54:59 -07:00
|
|
|
ALsizei base;
|
2011-07-01 01:48:04 -07:00
|
|
|
|
2016-01-29 23:28:38 -08:00
|
|
|
for(base = 0;base < SamplesToDo;)
|
|
|
|
{
|
2018-05-29 22:55:21 -07:00
|
|
|
alignas(16) ALfloat modsamples[MAX_UPDATE_SAMPLES];
|
2018-03-04 22:44:20 -08:00
|
|
|
ALsizei td = mini(MAX_UPDATE_SAMPLES, SamplesToDo-base);
|
|
|
|
ALsizei c, i;
|
|
|
|
|
2018-11-19 21:04:50 -08:00
|
|
|
state->mGetSamples(modsamples, state->mIndex, step, td);
|
|
|
|
state->mIndex += (step*td) & WAVEFORM_FRACMASK;
|
|
|
|
state->mIndex &= WAVEFORM_FRACMASK;
|
2016-01-29 23:28:38 -08:00
|
|
|
|
2018-03-04 22:44:20 -08:00
|
|
|
for(c = 0;c < MAX_EFFECT_CHANNELS;c++)
|
2016-01-29 23:28:38 -08:00
|
|
|
{
|
2018-05-29 22:55:21 -07:00
|
|
|
alignas(16) ALfloat temps[MAX_UPDATE_SAMPLES];
|
|
|
|
|
2018-11-19 21:04:50 -08:00
|
|
|
BiquadFilter_process(&state->mChans[c].Filter, temps, &SamplesIn[c][base], td);
|
2018-03-04 22:44:20 -08:00
|
|
|
for(i = 0;i < td;i++)
|
2018-05-29 22:55:21 -07:00
|
|
|
temps[i] *= modsamples[i];
|
2016-01-29 23:44:43 -08:00
|
|
|
|
2018-11-19 21:04:50 -08:00
|
|
|
MixSamples(temps, NumChannels, SamplesOut, state->mChans[c].CurrentGains,
|
|
|
|
state->mChans[c].TargetGains, SamplesToDo-base, base, td);
|
2016-01-29 23:28:38 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
base += td;
|
2010-04-08 08:54:28 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-05-21 12:47:18 -07:00
|
|
|
|
2018-11-17 01:53:39 -08:00
|
|
|
struct ModulatorStateFactory final : public EffectStateFactory {
|
2018-11-19 06:43:37 -08:00
|
|
|
ALeffectState *create() override;
|
2018-11-17 01:53:39 -08:00
|
|
|
};
|
2013-10-07 14:49:36 -07:00
|
|
|
|
2018-11-19 06:43:37 -08:00
|
|
|
ALeffectState *ModulatorStateFactory::create()
|
2010-04-08 08:54:28 -07:00
|
|
|
{
|
|
|
|
ALmodulatorState *state;
|
2016-08-25 03:42:43 -07:00
|
|
|
NEW_OBJ0(state, ALmodulatorState)();
|
2018-11-19 06:43:37 -08:00
|
|
|
return state;
|
2010-04-08 08:54:28 -07:00
|
|
|
}
|
2013-03-13 21:53:42 -07:00
|
|
|
|
2018-02-28 19:37:12 -08:00
|
|
|
EffectStateFactory *ModulatorStateFactory_getFactory(void)
|
2013-05-21 12:47:18 -07:00
|
|
|
{
|
2018-11-17 01:53:39 -08:00
|
|
|
static ModulatorStateFactory ModulatorFactory{};
|
2018-11-19 06:43:37 -08:00
|
|
|
return &ModulatorFactory;
|
2013-05-21 12:47:18 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-05-29 11:17:45 -07:00
|
|
|
void ALmodulator_setParamf(ALeffect *effect, ALCcontext *context, ALenum param, ALfloat val)
|
2013-03-13 21:53:42 -07:00
|
|
|
{
|
2013-05-25 22:07:31 -07:00
|
|
|
ALeffectProps *props = &effect->Props;
|
2013-03-13 21:53:42 -07:00
|
|
|
switch(param)
|
|
|
|
{
|
|
|
|
case AL_RING_MODULATOR_FREQUENCY:
|
2013-05-26 08:54:34 -07:00
|
|
|
if(!(val >= AL_RING_MODULATOR_MIN_FREQUENCY && val <= AL_RING_MODULATOR_MAX_FREQUENCY))
|
2018-01-25 15:59:59 -08:00
|
|
|
SETERR_RETURN(context, AL_INVALID_VALUE,, "Modulator frequency out of range");
|
2013-05-26 08:54:34 -07:00
|
|
|
props->Modulator.Frequency = val;
|
2013-03-13 21:53:42 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
case AL_RING_MODULATOR_HIGHPASS_CUTOFF:
|
2013-05-26 08:54:34 -07:00
|
|
|
if(!(val >= AL_RING_MODULATOR_MIN_HIGHPASS_CUTOFF && val <= AL_RING_MODULATOR_MAX_HIGHPASS_CUTOFF))
|
2018-01-25 15:59:59 -08:00
|
|
|
SETERR_RETURN(context, AL_INVALID_VALUE,, "Modulator high-pass cutoff out of range");
|
2013-05-26 08:54:34 -07:00
|
|
|
props->Modulator.HighPassCutoff = val;
|
2013-03-13 21:53:42 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2018-01-25 15:59:59 -08:00
|
|
|
alSetError(context, AL_INVALID_ENUM, "Invalid modulator float property 0x%04x", param);
|
2013-03-13 21:53:42 -07:00
|
|
|
}
|
|
|
|
}
|
2013-05-29 11:17:45 -07:00
|
|
|
void ALmodulator_setParamfv(ALeffect *effect, ALCcontext *context, ALenum param, const ALfloat *vals)
|
2018-01-24 17:07:01 -08:00
|
|
|
{ ALmodulator_setParamf(effect, context, param, vals[0]); }
|
2013-05-29 11:17:45 -07:00
|
|
|
void ALmodulator_setParami(ALeffect *effect, ALCcontext *context, ALenum param, ALint val)
|
2013-03-13 21:53:42 -07:00
|
|
|
{
|
2013-05-25 22:07:31 -07:00
|
|
|
ALeffectProps *props = &effect->Props;
|
2013-03-13 21:53:42 -07:00
|
|
|
switch(param)
|
|
|
|
{
|
|
|
|
case AL_RING_MODULATOR_FREQUENCY:
|
|
|
|
case AL_RING_MODULATOR_HIGHPASS_CUTOFF:
|
2013-05-29 11:17:45 -07:00
|
|
|
ALmodulator_setParamf(effect, context, param, (ALfloat)val);
|
2013-03-13 21:53:42 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
case AL_RING_MODULATOR_WAVEFORM:
|
2013-05-26 08:54:34 -07:00
|
|
|
if(!(val >= AL_RING_MODULATOR_MIN_WAVEFORM && val <= AL_RING_MODULATOR_MAX_WAVEFORM))
|
2018-01-25 15:59:59 -08:00
|
|
|
SETERR_RETURN(context, AL_INVALID_VALUE,, "Invalid modulator waveform");
|
2013-05-26 08:54:34 -07:00
|
|
|
props->Modulator.Waveform = val;
|
2013-03-13 21:53:42 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2018-01-25 15:59:59 -08:00
|
|
|
alSetError(context, AL_INVALID_ENUM, "Invalid modulator integer property 0x%04x", param);
|
2013-03-13 21:53:42 -07:00
|
|
|
}
|
|
|
|
}
|
2013-05-29 11:17:45 -07:00
|
|
|
void ALmodulator_setParamiv(ALeffect *effect, ALCcontext *context, ALenum param, const ALint *vals)
|
2018-01-24 17:07:01 -08:00
|
|
|
{ ALmodulator_setParami(effect, context, param, vals[0]); }
|
2013-03-13 21:53:42 -07:00
|
|
|
|
2013-10-07 12:56:41 -07:00
|
|
|
void ALmodulator_getParami(const ALeffect *effect, ALCcontext *context, ALenum param, ALint *val)
|
2013-03-13 21:53:42 -07:00
|
|
|
{
|
2013-05-25 22:07:31 -07:00
|
|
|
const ALeffectProps *props = &effect->Props;
|
2013-03-13 21:53:42 -07:00
|
|
|
switch(param)
|
|
|
|
{
|
|
|
|
case AL_RING_MODULATOR_FREQUENCY:
|
2013-05-25 22:07:31 -07:00
|
|
|
*val = (ALint)props->Modulator.Frequency;
|
2013-03-13 21:53:42 -07:00
|
|
|
break;
|
|
|
|
case AL_RING_MODULATOR_HIGHPASS_CUTOFF:
|
2013-05-25 22:07:31 -07:00
|
|
|
*val = (ALint)props->Modulator.HighPassCutoff;
|
2013-03-13 21:53:42 -07:00
|
|
|
break;
|
|
|
|
case AL_RING_MODULATOR_WAVEFORM:
|
2013-05-25 22:07:31 -07:00
|
|
|
*val = props->Modulator.Waveform;
|
2013-03-13 21:53:42 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2018-01-25 15:59:59 -08:00
|
|
|
alSetError(context, AL_INVALID_ENUM, "Invalid modulator integer property 0x%04x", param);
|
2013-03-13 21:53:42 -07:00
|
|
|
}
|
|
|
|
}
|
2013-10-07 12:56:41 -07:00
|
|
|
void ALmodulator_getParamiv(const ALeffect *effect, ALCcontext *context, ALenum param, ALint *vals)
|
2018-01-24 17:07:01 -08:00
|
|
|
{ ALmodulator_getParami(effect, context, param, vals); }
|
2013-10-07 12:56:41 -07:00
|
|
|
void ALmodulator_getParamf(const ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *val)
|
2013-03-13 21:53:42 -07:00
|
|
|
{
|
2013-10-07 12:56:41 -07:00
|
|
|
const ALeffectProps *props = &effect->Props;
|
2013-03-13 21:53:42 -07:00
|
|
|
switch(param)
|
|
|
|
{
|
|
|
|
case AL_RING_MODULATOR_FREQUENCY:
|
2013-05-25 22:07:31 -07:00
|
|
|
*val = props->Modulator.Frequency;
|
2013-03-13 21:53:42 -07:00
|
|
|
break;
|
|
|
|
case AL_RING_MODULATOR_HIGHPASS_CUTOFF:
|
2013-05-25 22:07:31 -07:00
|
|
|
*val = props->Modulator.HighPassCutoff;
|
2013-03-13 21:53:42 -07:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2018-01-25 15:59:59 -08:00
|
|
|
alSetError(context, AL_INVALID_ENUM, "Invalid modulator float property 0x%04x", param);
|
2013-03-13 21:53:42 -07:00
|
|
|
}
|
|
|
|
}
|
2013-10-07 12:56:41 -07:00
|
|
|
void ALmodulator_getParamfv(const ALeffect *effect, ALCcontext *context, ALenum param, ALfloat *vals)
|
2018-01-24 17:07:01 -08:00
|
|
|
{ ALmodulator_getParamf(effect, context, param, vals); }
|
2013-05-24 23:26:59 -07:00
|
|
|
|
|
|
|
DEFINE_ALEFFECT_VTABLE(ALmodulator);
|