SAF
Loading...
Searching...
No Matches
panner.h
Go to the documentation of this file.
1/*
2 * Copyright 2017-2018 Leo McCormack
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14 * PERFORMANCE OF THIS SOFTWARE.
15 */
16
54#ifndef __PANNER_H_INCLUDED__
55#define __PANNER_H_INCLUDED__
56
57#include "_common.h"
58
59#ifdef __cplusplus
60extern "C" {
61#endif /* __cplusplus */
62
63/* ========================================================================== */
64/* Presets + Constants */
65/* ========================================================================== */
66
68#define PANNER_SPREAD_MIN_VALUE ( 0.0f )
69
71#define PANNER_SPREAD_MAX_VALUE ( 90.0f )
72
73
74/* ========================================================================== */
75/* Main Functions */
76/* ========================================================================== */
77
83void panner_create(void** const phPan);
84
90void panner_destroy(void** const phPan);
91
100void panner_init(void* const hPan,
101 int samplerate);
102
118void panner_initCodec(void* const hPan);
119
144void panner_process(void* const hPan,
145 const float *const * inputs,
146 float* const* outputs,
147 int nInputs,
148 int nOutputs,
149 int nSamples);
150
151
152/* ========================================================================== */
153/* Set Functions */
154/* ========================================================================== */
155
160void panner_refreshSettings(void* const hPan);
161
163void panner_setSourceAzi_deg(void* const hPan, int index, float newAzi_deg);
164
166void panner_setSourceElev_deg(void* const hPan, int index, float newElev_deg);
167
169void panner_setNumSources(void* const hPan, int new_nSources);
170
172void panner_setLoudspeakerAzi_deg(void* const hPan, int index, float newAzi_deg);
173
175void panner_setLoudspeakerElev_deg(void* const hPan, int index, float newElev_deg);
176
178void panner_setNumLoudspeakers(void* const hPan, int new_nLoudspeakers);
179
184void panner_setOutputConfigPreset(void* const hPan, int newPresetID);
185
189void panner_setInputConfigPreset(void* const hPan, int newPresetID);
190
200void panner_setDTT(void* const hPan, float newValue);
201
203void panner_setSpread(void* const hPan, float newValue);
204
206void panner_setYaw(void* const hPan, float newYaw);
207
209void panner_setPitch(void* const hPan, float newPitch);
210
212void panner_setRoll(void* const hPan, float newRoll);
213
218void panner_setFlipYaw(void* const hPan, int newState);
219
224void panner_setFlipPitch(void* const hPan, int newState);
225
230void panner_setFlipRoll(void* const hPan, int newState);
231
232
233/* ========================================================================== */
234/* Get Functions */
235/* ========================================================================== */
236
241int panner_getFrameSize(void);
242
244CODEC_STATUS panner_getCodecStatus(void* const hPan);
245
251float panner_getProgressBar0_1(void* const hPan);
252
259void panner_getProgressBarText(void* const hPan, char* text);
260
262float panner_getSourceAzi_deg(void* const hPan, int index);
263
265float panner_getSourceElev_deg(void* const hPan, int index);
266
268int panner_getNumSources(void* const hPan);
269
272
274float panner_getLoudspeakerAzi_deg(void* const hPan, int index);
275
277float panner_getLoudspeakerElev_deg(void* const hPan, int index);
278
280int panner_getNumLoudspeakers(void* const hPan);
281
284
286int panner_getDAWsamplerate(void* const hPan);
287
289float panner_getDTT(void* const hPan);
290
292float panner_getSpread(void* const hPan);
293
295float panner_getYaw(void* const hPan);
296
298float panner_getPitch(void* const hPan);
299
301float panner_getRoll(void* const hPan);
302
307int panner_getFlipYaw(void* const hPan);
308
313int panner_getFlipPitch(void* const hPan);
314
319int panner_getFlipRoll(void* const hPan);
320
326
327
328#ifdef __cplusplus
329} /* extern "C" */
330#endif /* __cplusplus */
331
332#endif /* __PANNER_H_INCLUDED__ */
A bunch of things that are common to many of the saf examples.
CODEC_STATUS
Current status of the codec.
Definition _common.h:201
void panner_setNumSources(void *const hPan, int new_nSources)
Sets the number of inputs/sources to pan.
Definition panner.c:373
void panner_setLoudspeakerElev_deg(void *const hPan, int index, float newElev_deg)
Sets the elevation of a specific loudspeaker index, in DEGREES.
Definition panner.c:406
float panner_getSourceAzi_deg(void *const hPan, int index)
Returns the input/source azimuth for a given index, in DEGREES.
Definition panner.c:563
int panner_getMaxNumSources(void)
Returns the maximum number of inputs/sources permitted by panner.
Definition panner.c:581
int panner_getNumLoudspeakers(void *const hPan)
Returns the number of loudspeakers in the current layout.
Definition panner.c:598
void panner_setFlipRoll(void *const hPan, int newState)
Sets a flag as to whether to "flip" the sign of the current 'roll' angle (0: do not flip sign,...
Definition panner.c:528
float panner_getLoudspeakerAzi_deg(void *const hPan, int index)
Returns the loudspeaker azimuth for a given index, in DEGREES.
Definition panner.c:586
float panner_getProgressBar0_1(void *const hPan)
(Optional) Returns current intialisation/processing progress, between 0..1
Definition panner.c:551
int panner_getDAWsamplerate(void *const hPan)
Returns the DAW/Host sample rate.
Definition panner.c:609
void panner_create(void **const phPan)
Creates an instance of the panner.
Definition panner.c:47
float panner_getDTT(void *const hPan)
Returns the room coefficient value 0..1.
Definition panner.c:615
void panner_setSpread(void *const hPan, float newValue)
Sets the degree of spread, in DEGREES.
Definition panner.c:475
float panner_getYaw(void *const hPan)
Returns the 'yaw' rotation angle, in DEGREES.
Definition panner.c:627
void panner_setSourceAzi_deg(void *const hPan, int index, float newAzi_deg)
Sets the azimuth of a specific input/source index, in DEGREES.
Definition panner.c:347
void panner_process(void *const hPan, const float *const *inputs, float *const *outputs, int nInputs, int nOutputs, int nSamples)
Pans the input signals/sources to the loudspeaker channels using VBAP [1], and optional spreading [2]...
Definition panner.c:176
void panner_setFlipYaw(void *const hPan, int newState)
Sets a flag as to whether to "flip" the sign of the current 'yaw' angle (0: do not flip sign,...
Definition panner.c:510
void panner_setLoudspeakerAzi_deg(void *const hPan, int index, float newAzi_deg)
Sets the azimuth of a specific loudspeaker index, in DEGREES.
Definition panner.c:388
int panner_getFlipYaw(void *const hPan)
Returns a flag as to whether to "flip" the sign of the current 'yaw' angle (0: do not flip sign,...
Definition panner.c:645
float panner_getRoll(void *const hPan)
Returns the 'roll' rotation angle, in DEGREES.
Definition panner.c:639
void panner_init(void *const hPan, int samplerate)
Initialises an instance of panner with default settings.
Definition panner.c:121
void panner_setOutputConfigPreset(void *const hPan, int newPresetID)
Sets a preset for the output configuration (see LOUDSPEAKER_ARRAY_PRESETS enum)
Definition panner.c:438
void panner_setRoll(void *const hPan, float newRoll)
Sets the 'roll' rotation angle, in DEGREES.
Definition panner.c:503
int panner_getFlipRoll(void *const hPan)
Returns a flag as to whether to "flip" the sign of the current 'roll' angle (0: do not flip sign,...
Definition panner.c:657
float panner_getLoudspeakerElev_deg(void *const hPan, int index)
Returns the loudspeaker elevation for a given index, in DEGREES.
Definition panner.c:592
int panner_getFrameSize(void)
Returns the processing framesize (i.e., number of samples processed with every _process() call )
Definition panner.c:540
void panner_setDTT(void *const hPan, float newValue)
Sets the room coefficient value 0..1 [1]; 0: normal room, 0.5: dry listening room,...
Definition panner.c:461
void panner_destroy(void **const phPan)
Destroys an instance of the panner.
Definition panner.c:91
float panner_getPitch(void *const hPan)
Returns the 'pitch' rotation angle, in DEGREES.
Definition panner.c:633
void panner_setInputConfigPreset(void *const hPan, int newPresetID)
Sets a preset for the input configuration (see SOURCE_CONFIG_PRESETS enum)
Definition panner.c:450
CODEC_STATUS panner_getCodecStatus(void *const hPan)
Returns current codec status (see CODEC_STATUS enum)
Definition panner.c:545
int panner_getProcessingDelay(void)
Returns the processing delay in samples (may be used for delay compensation features)
Definition panner.c:663
void panner_getProgressBarText(void *const hPan, char *text)
(Optional) Returns current intialisation/processing progress text
Definition panner.c:557
int panner_getFlipPitch(void *const hPan)
Returns a flag as to whether to "flip" the sign of the current 'pitch' angle (0: do not flip sign,...
Definition panner.c:651
int panner_getMaxNumLoudspeakers(void)
Returns the maximum number of loudspeakers permitted.
Definition panner.c:604
void panner_setPitch(void *const hPan, float newPitch)
Sets the 'pitch' rotation angle, in DEGREES.
Definition panner.c:496
float panner_getSourceElev_deg(void *const hPan, int index)
Returns the input/source elevation for a given index, in DEGREES.
Definition panner.c:569
void panner_initCodec(void *const hPan)
Intialises the codec variables, based on current global/user parameters.
Definition panner.c:140
void panner_setSourceElev_deg(void *const hPan, int index, float newElev_deg)
Sets the elevation of a specific input/source index, in DEGREES.
Definition panner.c:361
void panner_refreshSettings(void *const hPan)
Sets all intialisation flags to 1; re-initialising all settings/variables as panner is currently conf...
Definition panner.c:337
float panner_getSpread(void *const hPan)
Returns the spread value, in DEGREES.
Definition panner.c:621
void panner_setNumLoudspeakers(void *const hPan, int new_nLoudspeakers)
Sets the number of loudspeakers to pan to.
Definition panner.c:422
int panner_getNumSources(void *const hPan)
Returns the number of inputs/sources in the current layout.
Definition panner.c:575
void panner_setYaw(void *const hPan, float newYaw)
Sets the 'yaw' rotation angle, in DEGREES.
Definition panner.c:489
void panner_setFlipPitch(void *const hPan, int newState)
Sets a flag as to whether to "flip" the sign of the current 'pitch' angle (0: do not flip sign,...
Definition panner.c:519