zenilib: zenilib/jni/external/openal-soft/Alc/alcModulator.c File Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Macros | Typedefs | Functions
alcModulator.c File Reference
`#include "config.h"`
`#include <math.h>`
`#include <stdlib.h>`
`#include "alMain.h"`
`#include "alFilter.h"`
`#include "alAuxEffectSlot.h"`
`#include "alError.h"`
`#include "alu.h"`

Go to the source code of this file.

## Macros

#define | DECL_TEMPLATE(func)
#define | WAVEFORM_FRACBITS 16
#define | WAVEFORM_FRACMASK (WAVEFORM_FRACONE-1)
#define | WAVEFORM_FRACONE (1<<WAVEFORM_FRACBITS)

## Typedefs

typedef struct ALmodulatorState | ALmodulatorState

## Functions

static __inline ALfloat | hpFilter1P (FILTER *iir, ALuint offset, ALfloat input)
ALeffectState * | ModulatorCreate (void)
static ALvoid | ModulatorDestroy (ALeffectState *effect)
static ALboolean | ModulatorDeviceUpdate (ALeffectState *effect, ALCdevice *Device)
static ALvoid | ModulatorProcess (ALeffectState *effect, ALuint SamplesToDo, const ALfloat *RESTRICT SamplesIn, ALfloat(*RESTRICT SamplesOut)[BUFFERSIZE])
static ALvoid | ModulatorUpdate (ALeffectState *effect, ALCdevice *Device, const ALeffectslot *Slot)
static __inline ALfloat | Saw (ALuint index)
static __inline ALfloat | Sin (ALuint index)
static __inline ALfloat | Square (ALuint index)

## Macro Definition Documentation

#define DECL_TEMPLATE | ( |  | func | ) |

Value:
static void Process##func(ALmodulatorState *state, ALuint SamplesToDo, \
const ALfloat *RESTRICT SamplesIn, \
ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE]) \
{ \
const ALuint step = state->step; \
ALuint index = state->index; \
ALfloat samp; \
ALuint i, k; \
\
for(i = 0;i < SamplesToDo;i++) \
{ \
samp = SamplesIn[i]; \
\
index += step; \
index &= WAVEFORM_FRACMASK; \
samp *= func(index); \
\
samp = hpFilter1P(&state->iirFilter, 0, samp); \
\
for(k = 0;k < MaxChannels;k++) \
SamplesOut[k][i] += state->Gain[k] * samp; \
} \
state->index = index; \
}
hpFilter1P
static __inline ALfloat hpFilter1P(FILTER *iir, ALuint offset, ALfloat input)
Definition: alcModulator.c:72
k
int32_t k
Definition: e_log.c:102
func
GLenum func
Definition: SDL_opengl.h:5654
ALfloat
float ALfloat
Definition: al.h:68
WAVEFORM_FRACMASK
#define WAVEFORM_FRACMASK
Definition: alcModulator.c:54
for
for(;;)
Definition: glslang_tab.cpp:4773
index
GLuint index
Definition: glew.h:1800
ALuint
unsigned int ALuint
Definition: al.h:59
const
#define const
Definition: zconf.h:91
ALmodulatorState
struct ALmodulatorState ALmodulatorState
i
int i
Definition: pngrutil.c:1377
BUFFERSIZE
#define BUFFERSIZE
Definition: alMain.h:556
MaxChannels
Definition: alMain.h:491

Definition at line 85 of file alcModulator.c.

#define WAVEFORM_FRACBITS 16

Definition at line 52 of file alcModulator.c.

Referenced by Square().

#define WAVEFORM_FRACMASK (WAVEFORM_FRACONE-1)

Definition at line 54 of file alcModulator.c.

#define WAVEFORM_FRACONE (1<<WAVEFORM_FRACBITS)

Definition at line 53 of file alcModulator.c.

Referenced by ModulatorUpdate(), Saw(), and Sin().

## Typedef Documentation

typedef struct ALmodulatorState ALmodulatorState

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 Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Or go to http://www.gnu.org/copyleft/lgpl.html

## Function Documentation

static __inline ALfloat hpFilter1P | ( | FILTER * | iir,
|  | ALuint | offset,
|  | ALfloat | input
| ) |  |

static

Definition at line 72 of file alcModulator.c.

References FILTER::coeff, FILTER::history, and sort_controllers::output.

ALeffectState* ModulatorCreate | ( | void |  | ) |

Definition at line 184 of file alcModulator.c.

References malloc, ModulatorDestroy(), ModulatorDeviceUpdate(), ModulatorProcess(), ModulatorUpdate(), and NULL.

Referenced by InitializeEffect().

static ALvoid ModulatorDestroy | ( | ALeffectState * | effect | ) |

static

Definition at line 118 of file alcModulator.c.

References free.

Referenced by ModulatorCreate().

static ALboolean ModulatorDeviceUpdate | ( | ALeffectState * | effect,
|  | ALCdevice * | Device
| ) |  |

static

Definition at line 124 of file alcModulator.c.

References AL_TRUE.

Referenced by ModulatorCreate().

static ALvoid ModulatorProcess | ( | ALeffectState * | effect,
|  | ALuint | SamplesToDo,
|  | const ALfloat *RESTRICT | SamplesIn,
|  | ALfloat(*) | SamplesOut[BUFFERSIZE]
| ) |  |

static

Definition at line 164 of file alcModulator.c.

Referenced by ModulatorCreate().

static ALvoid ModulatorUpdate | ( | ALeffectState * | effect,
|  | ALCdevice * | Device,
|  | const ALeffectslot * | Slot
| ) |  |

static

Definition at line 131 of file alcModulator.c.

References AL_RING_MODULATOR_SAWTOOTH, AL_RING_MODULATOR_SINUSOID, AL_RING_MODULATOR_SQUARE, ALeffectslot::effect, F_PI, fastf2u(), ALeffect::Frequency, ALCdevice_struct::Frequency, ALeffectslot::Gain, ALeffect::HighPassCutoff, MaxChannels, ALeffect::Modulator, ALCdevice_struct::NumChan, ALCdevice_struct::Speaker2Chan, ALeffect::Waveform, and WAVEFORM_FRACONE.

Referenced by ModulatorCreate().

static __inline ALfloat Saw | ( | ALuint | index | ) |

static

Definition at line 61 of file alcModulator.c.

References WAVEFORM_FRACONE.

static __inline ALfloat Sin | ( | ALuint | index | ) |

static

Definition at line 56 of file alcModulator.c.

References F_PI, and WAVEFORM_FRACONE.

static __inline ALfloat Square | ( | ALuint | index | ) |

static

Definition at line 66 of file alcModulator.c.

References WAVEFORM_FRACBITS.