2010-08-03 07:21:36 +00:00
|
|
|
/**
|
|
|
|
* OpenAL cross platform audio library
|
|
|
|
* Copyright (C) 1999-2010 by authors.
|
|
|
|
* 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 12:11:03 +00:00
|
|
|
* Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2010-08-03 07:21:36 +00:00
|
|
|
* Or go to http://www.gnu.org/copyleft/lgpl.html
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <math.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
#include "alMain.h"
|
|
|
|
#include "AL/al.h"
|
|
|
|
#include "AL/alc.h"
|
|
|
|
#include "alu.h"
|
2014-11-11 01:53:42 +00:00
|
|
|
#include "bool.h"
|
2010-08-03 07:21:36 +00:00
|
|
|
|
|
|
|
|
2015-08-18 14:44:17 +00:00
|
|
|
#define ZERO_ORDER_SCALE 0.0f
|
|
|
|
#define FIRST_ORDER_SCALE 1.0f
|
|
|
|
#define SECOND_ORDER_SCALE (1.0f / 1.22474f)
|
|
|
|
#define THIRD_ORDER_SCALE (1.0f / 1.30657f)
|
|
|
|
|
2014-11-07 10:18:24 +00:00
|
|
|
void ComputeAngleGains(const ALCdevice *device, ALfloat angle, ALfloat elevation, ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
|
2012-04-28 14:28:36 +00:00
|
|
|
{
|
2014-10-03 01:05:42 +00:00
|
|
|
ALfloat dir[3] = {
|
2014-11-05 11:06:32 +00:00
|
|
|
sinf(angle) * cosf(elevation),
|
2014-10-03 01:05:42 +00:00
|
|
|
sinf(elevation),
|
|
|
|
-cosf(angle) * cosf(elevation)
|
|
|
|
};
|
|
|
|
ComputeDirectionalGains(device, dir, ingain, gains);
|
2012-04-28 14:28:36 +00:00
|
|
|
}
|
|
|
|
|
2014-11-07 10:18:24 +00:00
|
|
|
void ComputeDirectionalGains(const ALCdevice *device, const ALfloat dir[3], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
|
Use an ambisonics-based panning method
For mono sources, third-order ambisonics is utilized to generate panning gains.
The general idea is that a panned mono sound can be encoded into b-format
ambisonics as:
w[i] = sample[i] * 0.7071;
x[i] = sample[i] * dir[0];
y[i] = sample[i] * dir[1];
...
and subsequently rendered using:
output[chan][i] = w[i] * w_coeffs[chan] +
x[i] * x_coeffs[chan] +
y[i] * y_coeffs[chan] +
...;
By reordering the math, channel gains can be generated by doing:
gain[chan] = 0.7071 * w_coeffs[chan] +
dir[0] * x_coeffs[chan] +
dir[1] * y_coeffs[chan] +
...;
which then get applied as normal:
output[chan][i] = sample[i] * gain[chan];
One of the reasons to use ambisonics for panning is that it provides arguably
better reproduction for sounds emanating from between two speakers. As well,
this makes it easier to pan in all 3 dimensions, with for instance a "3D7.1" or
8-channel cube speaker configuration by simply providing the necessary
coefficients (this will need some work since some methods still use angle-based
panpot, particularly multi-channel sources).
Unfortunately, the math to reliably generate the coefficients for a given
speaker configuration is too costly to do at run-time. They have to be pre-
generated based on a pre-specified speaker arangement, which means the config
options for tweaking speaker angles are no longer supportable. Eventually I
hope to provide config options for custom coefficients, which can either be
generated and written in manually, or via alsoft-config from user-specified
speaker positions.
The current default set of coefficients were generated using the MATLAB scripts
(compatible with GNU Octave) from the excellent Ambisonic Decoder Toolbox, at
https://bitbucket.org/ambidecodertoolbox/adt/
2014-09-30 14:33:13 +00:00
|
|
|
{
|
|
|
|
ALfloat coeffs[MAX_AMBI_COEFFS];
|
|
|
|
ALuint i, j;
|
|
|
|
/* Convert from OpenAL coords to Ambisonics. */
|
2014-10-03 03:25:30 +00:00
|
|
|
ALfloat x = -dir[2];
|
|
|
|
ALfloat y = -dir[0];
|
|
|
|
ALfloat z = dir[1];
|
|
|
|
|
Use an ambisonics-based panning method
For mono sources, third-order ambisonics is utilized to generate panning gains.
The general idea is that a panned mono sound can be encoded into b-format
ambisonics as:
w[i] = sample[i] * 0.7071;
x[i] = sample[i] * dir[0];
y[i] = sample[i] * dir[1];
...
and subsequently rendered using:
output[chan][i] = w[i] * w_coeffs[chan] +
x[i] * x_coeffs[chan] +
y[i] * y_coeffs[chan] +
...;
By reordering the math, channel gains can be generated by doing:
gain[chan] = 0.7071 * w_coeffs[chan] +
dir[0] * x_coeffs[chan] +
dir[1] * y_coeffs[chan] +
...;
which then get applied as normal:
output[chan][i] = sample[i] * gain[chan];
One of the reasons to use ambisonics for panning is that it provides arguably
better reproduction for sounds emanating from between two speakers. As well,
this makes it easier to pan in all 3 dimensions, with for instance a "3D7.1" or
8-channel cube speaker configuration by simply providing the necessary
coefficients (this will need some work since some methods still use angle-based
panpot, particularly multi-channel sources).
Unfortunately, the math to reliably generate the coefficients for a given
speaker configuration is too costly to do at run-time. They have to be pre-
generated based on a pre-specified speaker arangement, which means the config
options for tweaking speaker angles are no longer supportable. Eventually I
hope to provide config options for custom coefficients, which can either be
generated and written in manually, or via alsoft-config from user-specified
speaker positions.
The current default set of coefficients were generated using the MATLAB scripts
(compatible with GNU Octave) from the excellent Ambisonic Decoder Toolbox, at
https://bitbucket.org/ambidecodertoolbox/adt/
2014-09-30 14:33:13 +00:00
|
|
|
coeffs[0] = 0.7071f; /* sqrt(1.0 / 2.0) */
|
2014-10-03 03:25:30 +00:00
|
|
|
coeffs[1] = x; /* X */
|
|
|
|
coeffs[2] = y; /* Y */
|
|
|
|
coeffs[3] = z; /* Z */
|
|
|
|
coeffs[4] = 0.5f * (3.0f*z*z - 1.0f); /* 0.5 * (3*Z*Z - 1) */
|
|
|
|
coeffs[5] = 2.0f * z * x; /* 2*Z*X */
|
|
|
|
coeffs[6] = 2.0f * y * z; /* 2*Y*Z */
|
|
|
|
coeffs[7] = x*x - y*y; /* X*X - Y*Y */
|
|
|
|
coeffs[8] = 2.0f * x * y; /* 2*X*Y */
|
|
|
|
coeffs[9] = 0.5f * z * (5.0f*z*z - 3.0f); /* 0.5 * Z * (5*Z*Z - 3) */
|
|
|
|
coeffs[10] = 0.7262f * x * (5.0f*z*z - 1.0f); /* sqrt(135.0 / 256.0) * X * (5*Z*Z - 1) */
|
|
|
|
coeffs[11] = 0.7262f * y * (5.0f*z*z - 1.0f); /* sqrt(135.0 / 256.0) * Y * (5*Z*Z - 1) */
|
|
|
|
coeffs[12] = 2.5981f * z * (x*x - y*y); /* sqrt(27.0 / 4.0) * Z * (X*X - Y*Y) */
|
|
|
|
coeffs[13] = 5.1962f * x * y * z; /* sqrt(27) * X * Y * Z */
|
|
|
|
coeffs[14] = x * (x*x - 3.0f*y*y); /* X * (X*X - 3*Y*Y) */
|
|
|
|
coeffs[15] = y * (3.0f*x*x - y*y); /* Y * (3*X*X - Y*Y) */
|
Use an ambisonics-based panning method
For mono sources, third-order ambisonics is utilized to generate panning gains.
The general idea is that a panned mono sound can be encoded into b-format
ambisonics as:
w[i] = sample[i] * 0.7071;
x[i] = sample[i] * dir[0];
y[i] = sample[i] * dir[1];
...
and subsequently rendered using:
output[chan][i] = w[i] * w_coeffs[chan] +
x[i] * x_coeffs[chan] +
y[i] * y_coeffs[chan] +
...;
By reordering the math, channel gains can be generated by doing:
gain[chan] = 0.7071 * w_coeffs[chan] +
dir[0] * x_coeffs[chan] +
dir[1] * y_coeffs[chan] +
...;
which then get applied as normal:
output[chan][i] = sample[i] * gain[chan];
One of the reasons to use ambisonics for panning is that it provides arguably
better reproduction for sounds emanating from between two speakers. As well,
this makes it easier to pan in all 3 dimensions, with for instance a "3D7.1" or
8-channel cube speaker configuration by simply providing the necessary
coefficients (this will need some work since some methods still use angle-based
panpot, particularly multi-channel sources).
Unfortunately, the math to reliably generate the coefficients for a given
speaker configuration is too costly to do at run-time. They have to be pre-
generated based on a pre-specified speaker arangement, which means the config
options for tweaking speaker angles are no longer supportable. Eventually I
hope to provide config options for custom coefficients, which can either be
generated and written in manually, or via alsoft-config from user-specified
speaker positions.
The current default set of coefficients were generated using the MATLAB scripts
(compatible with GNU Octave) from the excellent Ambisonic Decoder Toolbox, at
https://bitbucket.org/ambidecodertoolbox/adt/
2014-09-30 14:33:13 +00:00
|
|
|
|
2014-11-07 10:18:24 +00:00
|
|
|
for(i = 0;i < MAX_OUTPUT_CHANNELS;i++)
|
Use an ambisonics-based panning method
For mono sources, third-order ambisonics is utilized to generate panning gains.
The general idea is that a panned mono sound can be encoded into b-format
ambisonics as:
w[i] = sample[i] * 0.7071;
x[i] = sample[i] * dir[0];
y[i] = sample[i] * dir[1];
...
and subsequently rendered using:
output[chan][i] = w[i] * w_coeffs[chan] +
x[i] * x_coeffs[chan] +
y[i] * y_coeffs[chan] +
...;
By reordering the math, channel gains can be generated by doing:
gain[chan] = 0.7071 * w_coeffs[chan] +
dir[0] * x_coeffs[chan] +
dir[1] * y_coeffs[chan] +
...;
which then get applied as normal:
output[chan][i] = sample[i] * gain[chan];
One of the reasons to use ambisonics for panning is that it provides arguably
better reproduction for sounds emanating from between two speakers. As well,
this makes it easier to pan in all 3 dimensions, with for instance a "3D7.1" or
8-channel cube speaker configuration by simply providing the necessary
coefficients (this will need some work since some methods still use angle-based
panpot, particularly multi-channel sources).
Unfortunately, the math to reliably generate the coefficients for a given
speaker configuration is too costly to do at run-time. They have to be pre-
generated based on a pre-specified speaker arangement, which means the config
options for tweaking speaker angles are no longer supportable. Eventually I
hope to provide config options for custom coefficients, which can either be
generated and written in manually, or via alsoft-config from user-specified
speaker positions.
The current default set of coefficients were generated using the MATLAB scripts
(compatible with GNU Octave) from the excellent Ambisonic Decoder Toolbox, at
https://bitbucket.org/ambidecodertoolbox/adt/
2014-09-30 14:33:13 +00:00
|
|
|
gains[i] = 0.0f;
|
2014-11-07 11:12:32 +00:00
|
|
|
for(i = 0;i < device->NumChannels;i++)
|
Use an ambisonics-based panning method
For mono sources, third-order ambisonics is utilized to generate panning gains.
The general idea is that a panned mono sound can be encoded into b-format
ambisonics as:
w[i] = sample[i] * 0.7071;
x[i] = sample[i] * dir[0];
y[i] = sample[i] * dir[1];
...
and subsequently rendered using:
output[chan][i] = w[i] * w_coeffs[chan] +
x[i] * x_coeffs[chan] +
y[i] * y_coeffs[chan] +
...;
By reordering the math, channel gains can be generated by doing:
gain[chan] = 0.7071 * w_coeffs[chan] +
dir[0] * x_coeffs[chan] +
dir[1] * y_coeffs[chan] +
...;
which then get applied as normal:
output[chan][i] = sample[i] * gain[chan];
One of the reasons to use ambisonics for panning is that it provides arguably
better reproduction for sounds emanating from between two speakers. As well,
this makes it easier to pan in all 3 dimensions, with for instance a "3D7.1" or
8-channel cube speaker configuration by simply providing the necessary
coefficients (this will need some work since some methods still use angle-based
panpot, particularly multi-channel sources).
Unfortunately, the math to reliably generate the coefficients for a given
speaker configuration is too costly to do at run-time. They have to be pre-
generated based on a pre-specified speaker arangement, which means the config
options for tweaking speaker angles are no longer supportable. Eventually I
hope to provide config options for custom coefficients, which can either be
generated and written in manually, or via alsoft-config from user-specified
speaker positions.
The current default set of coefficients were generated using the MATLAB scripts
(compatible with GNU Octave) from the excellent Ambisonic Decoder Toolbox, at
https://bitbucket.org/ambidecodertoolbox/adt/
2014-09-30 14:33:13 +00:00
|
|
|
{
|
|
|
|
for(j = 0;j < MAX_AMBI_COEFFS;j++)
|
2015-08-18 14:44:17 +00:00
|
|
|
gains[i] += device->AmbiCoeffs[i][j]*coeffs[j];
|
2014-11-26 06:20:00 +00:00
|
|
|
gains[i] *= ingain;
|
Use an ambisonics-based panning method
For mono sources, third-order ambisonics is utilized to generate panning gains.
The general idea is that a panned mono sound can be encoded into b-format
ambisonics as:
w[i] = sample[i] * 0.7071;
x[i] = sample[i] * dir[0];
y[i] = sample[i] * dir[1];
...
and subsequently rendered using:
output[chan][i] = w[i] * w_coeffs[chan] +
x[i] * x_coeffs[chan] +
y[i] * y_coeffs[chan] +
...;
By reordering the math, channel gains can be generated by doing:
gain[chan] = 0.7071 * w_coeffs[chan] +
dir[0] * x_coeffs[chan] +
dir[1] * y_coeffs[chan] +
...;
which then get applied as normal:
output[chan][i] = sample[i] * gain[chan];
One of the reasons to use ambisonics for panning is that it provides arguably
better reproduction for sounds emanating from between two speakers. As well,
this makes it easier to pan in all 3 dimensions, with for instance a "3D7.1" or
8-channel cube speaker configuration by simply providing the necessary
coefficients (this will need some work since some methods still use angle-based
panpot, particularly multi-channel sources).
Unfortunately, the math to reliably generate the coefficients for a given
speaker configuration is too costly to do at run-time. They have to be pre-
generated based on a pre-specified speaker arangement, which means the config
options for tweaking speaker angles are no longer supportable. Eventually I
hope to provide config options for custom coefficients, which can either be
generated and written in manually, or via alsoft-config from user-specified
speaker positions.
The current default set of coefficients were generated using the MATLAB scripts
(compatible with GNU Octave) from the excellent Ambisonic Decoder Toolbox, at
https://bitbucket.org/ambidecodertoolbox/adt/
2014-09-30 14:33:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-11-07 10:18:24 +00:00
|
|
|
void ComputeAmbientGains(const ALCdevice *device, ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
|
2014-11-04 11:33:35 +00:00
|
|
|
{
|
|
|
|
ALuint i;
|
|
|
|
|
2014-11-07 10:18:24 +00:00
|
|
|
for(i = 0;i < MAX_OUTPUT_CHANNELS;i++)
|
2014-11-04 11:33:35 +00:00
|
|
|
gains[i] = 0.0f;
|
2014-11-07 11:12:32 +00:00
|
|
|
for(i = 0;i < device->NumChannels;i++)
|
2014-11-15 12:11:22 +00:00
|
|
|
{
|
|
|
|
// The W coefficients are based on a mathematical average of the
|
|
|
|
// output, scaled by sqrt(2) to compensate for FuMa-style Ambisonics
|
|
|
|
// scaling the W channel input by sqrt(0.5). The square root of the
|
|
|
|
// base average provides for a more perceptual average volume, better
|
|
|
|
// suited to non-directional gains.
|
2015-08-18 14:44:17 +00:00
|
|
|
gains[i] = sqrtf(device->AmbiCoeffs[i][0]/1.4142f) * ingain;
|
2014-11-15 12:11:22 +00:00
|
|
|
}
|
2014-11-04 11:33:35 +00:00
|
|
|
}
|
|
|
|
|
2014-11-07 10:18:24 +00:00
|
|
|
void ComputeBFormatGains(const ALCdevice *device, const ALfloat mtx[4], ALfloat ingain, ALfloat gains[MAX_OUTPUT_CHANNELS])
|
2014-11-01 00:18:45 +00:00
|
|
|
{
|
2014-11-01 05:43:13 +00:00
|
|
|
ALuint i, j;
|
2014-11-01 00:18:45 +00:00
|
|
|
|
2014-11-07 10:18:24 +00:00
|
|
|
for(i = 0;i < MAX_OUTPUT_CHANNELS;i++)
|
2014-11-01 00:18:45 +00:00
|
|
|
gains[i] = 0.0f;
|
2014-11-07 11:12:32 +00:00
|
|
|
for(i = 0;i < device->NumChannels;i++)
|
2014-11-01 00:18:45 +00:00
|
|
|
{
|
2015-08-18 14:44:17 +00:00
|
|
|
float scale = device->AmbiScale;
|
|
|
|
gains[i] += device->AmbiCoeffs[i][0] * mtx[0];
|
|
|
|
for(j = 1;j < 4;j++)
|
|
|
|
gains[i] += device->AmbiCoeffs[i][j] * scale * mtx[j];
|
2014-11-05 10:54:11 +00:00
|
|
|
gains[i] *= ingain;
|
2014-11-01 00:18:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-04-29 12:04:46 +00:00
|
|
|
|
2014-11-16 07:20:38 +00:00
|
|
|
DECL_CONST static inline const char *GetLabelFromChannel(enum Channel channel)
|
2014-11-15 08:19:56 +00:00
|
|
|
{
|
|
|
|
switch(channel)
|
|
|
|
{
|
|
|
|
case FrontLeft: return "front-left";
|
|
|
|
case FrontRight: return "front-right";
|
|
|
|
case FrontCenter: return "front-center";
|
|
|
|
case LFE: return "lfe";
|
|
|
|
case BackLeft: return "back-left";
|
|
|
|
case BackRight: return "back-right";
|
|
|
|
case BackCenter: return "back-center";
|
|
|
|
case SideLeft: return "side-left";
|
|
|
|
case SideRight: return "side-right";
|
2014-11-22 12:20:17 +00:00
|
|
|
|
|
|
|
case TopFrontLeft: return "top-front-left";
|
|
|
|
case TopFrontRight: return "top-front-right";
|
|
|
|
case TopBackLeft: return "top-back-left";
|
|
|
|
case TopBackRight: return "top-back-right";
|
|
|
|
case BottomFrontLeft: return "bottom-front-left";
|
|
|
|
case BottomFrontRight: return "bottom-front-right";
|
|
|
|
case BottomBackLeft: return "bottom-back-left";
|
|
|
|
case BottomBackRight: return "bottom-back-right";
|
|
|
|
|
2014-11-26 06:20:00 +00:00
|
|
|
case Aux0: return "aux-0";
|
|
|
|
case Aux1: return "aux-1";
|
|
|
|
case Aux2: return "aux-2";
|
|
|
|
case Aux3: return "aux-3";
|
|
|
|
|
2014-11-15 08:19:56 +00:00
|
|
|
case InvalidChannel: break;
|
|
|
|
}
|
|
|
|
return "(unknown)";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-11-05 11:46:00 +00:00
|
|
|
typedef struct ChannelMap {
|
|
|
|
enum Channel ChanName;
|
|
|
|
ChannelConfig Config;
|
|
|
|
} ChannelMap;
|
|
|
|
|
2015-08-18 14:44:17 +00:00
|
|
|
static void SetChannelMap(ALCdevice *device, const ChannelMap *chanmap, size_t count, ALfloat ambiscale)
|
2014-11-13 03:26:53 +00:00
|
|
|
{
|
|
|
|
size_t i, j;
|
|
|
|
|
2015-08-18 14:44:17 +00:00
|
|
|
device->AmbiScale = ambiscale;
|
2014-11-13 03:26:53 +00:00
|
|
|
for(i = 0;i < MAX_OUTPUT_CHANNELS && device->ChannelName[i] != InvalidChannel;i++)
|
|
|
|
{
|
|
|
|
if(device->ChannelName[i] == LFE)
|
|
|
|
{
|
|
|
|
for(j = 0;j < MAX_AMBI_COEFFS;j++)
|
2015-08-18 14:44:17 +00:00
|
|
|
device->AmbiCoeffs[i][j] = 0.0f;
|
2014-11-13 03:26:53 +00:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
for(j = 0;j < count;j++)
|
|
|
|
{
|
|
|
|
if(device->ChannelName[i] == chanmap[j].ChanName)
|
|
|
|
{
|
2015-08-18 14:44:17 +00:00
|
|
|
size_t k;
|
|
|
|
for(k = 0;k < MAX_AMBI_COEFFS;++k)
|
|
|
|
device->AmbiCoeffs[i][k] = chanmap[j].Config[k];
|
2014-11-13 03:26:53 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(j == count)
|
2014-11-15 08:19:56 +00:00
|
|
|
ERR("Failed to match %s channel ("SZFMT") in config\n", GetLabelFromChannel(device->ChannelName[i]), i);
|
2014-11-13 03:26:53 +00:00
|
|
|
}
|
|
|
|
device->NumChannels = i;
|
|
|
|
}
|
|
|
|
|
2014-11-11 01:53:42 +00:00
|
|
|
static bool LoadChannelSetup(ALCdevice *device)
|
|
|
|
{
|
2014-11-15 08:19:56 +00:00
|
|
|
static const enum Channel mono_chans[1] = {
|
|
|
|
FrontCenter
|
|
|
|
}, stereo_chans[2] = {
|
|
|
|
FrontLeft, FrontRight
|
|
|
|
}, quad_chans[4] = {
|
|
|
|
FrontLeft, FrontRight,
|
|
|
|
BackLeft, BackRight
|
|
|
|
}, surround51_chans[5] = {
|
|
|
|
FrontLeft, FrontRight, FrontCenter,
|
|
|
|
SideLeft, SideRight
|
|
|
|
}, surround51rear_chans[5] = {
|
|
|
|
FrontLeft, FrontRight, FrontCenter,
|
|
|
|
BackLeft, BackRight
|
|
|
|
}, surround61_chans[6] = {
|
|
|
|
FrontLeft, FrontRight,
|
|
|
|
FrontCenter, BackCenter,
|
|
|
|
SideLeft, SideRight
|
|
|
|
}, surround71_chans[7] = {
|
|
|
|
FrontLeft, FrontRight, FrontCenter,
|
|
|
|
BackLeft, BackRight,
|
|
|
|
SideLeft, SideRight
|
2014-11-11 01:53:42 +00:00
|
|
|
};
|
2014-11-13 03:26:53 +00:00
|
|
|
ChannelMap chanmap[MAX_OUTPUT_CHANNELS];
|
2014-11-15 08:19:56 +00:00
|
|
|
const enum Channel *channels = NULL;
|
2014-11-11 01:53:42 +00:00
|
|
|
const char *layout = NULL;
|
2015-08-18 14:44:17 +00:00
|
|
|
ALfloat ambiscale = 1.0f;
|
2014-11-11 01:53:42 +00:00
|
|
|
size_t count = 0;
|
2015-08-18 14:44:17 +00:00
|
|
|
int order;
|
2014-11-11 01:53:42 +00:00
|
|
|
size_t i;
|
|
|
|
|
|
|
|
switch(device->FmtChans)
|
|
|
|
{
|
|
|
|
case DevFmtMono:
|
|
|
|
layout = "mono";
|
2014-11-15 08:19:56 +00:00
|
|
|
channels = mono_chans;
|
|
|
|
count = COUNTOF(mono_chans);
|
2014-11-11 01:53:42 +00:00
|
|
|
break;
|
|
|
|
case DevFmtStereo:
|
|
|
|
layout = "stereo";
|
2014-11-15 08:19:56 +00:00
|
|
|
channels = stereo_chans;
|
|
|
|
count = COUNTOF(stereo_chans);
|
2014-11-11 01:53:42 +00:00
|
|
|
break;
|
|
|
|
case DevFmtQuad:
|
|
|
|
layout = "quad";
|
2014-11-15 08:19:56 +00:00
|
|
|
channels = quad_chans;
|
|
|
|
count = COUNTOF(quad_chans);
|
2014-11-11 01:53:42 +00:00
|
|
|
break;
|
|
|
|
case DevFmtX51:
|
|
|
|
layout = "surround51";
|
2014-11-15 08:19:56 +00:00
|
|
|
channels = surround51_chans;
|
|
|
|
count = COUNTOF(surround51_chans);
|
2014-11-11 01:53:42 +00:00
|
|
|
break;
|
|
|
|
case DevFmtX51Rear:
|
|
|
|
layout = "surround51rear";
|
2014-11-15 08:19:56 +00:00
|
|
|
channels = surround51rear_chans;
|
|
|
|
count = COUNTOF(surround51rear_chans);
|
2014-11-11 01:53:42 +00:00
|
|
|
break;
|
|
|
|
case DevFmtX61:
|
|
|
|
layout = "surround61";
|
2014-11-15 08:19:56 +00:00
|
|
|
channels = surround61_chans;
|
|
|
|
count = COUNTOF(surround61_chans);
|
2014-11-11 01:53:42 +00:00
|
|
|
break;
|
|
|
|
case DevFmtX71:
|
|
|
|
layout = "surround71";
|
2014-11-15 08:19:56 +00:00
|
|
|
channels = surround71_chans;
|
|
|
|
count = COUNTOF(surround71_chans);
|
2014-11-11 01:53:42 +00:00
|
|
|
break;
|
2014-11-26 06:20:00 +00:00
|
|
|
case DevFmtBFormat3D:
|
|
|
|
break;
|
2014-11-11 01:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if(!layout)
|
|
|
|
return false;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
char name[32];
|
2015-08-18 14:44:17 +00:00
|
|
|
snprintf(name, sizeof(name), "%s/order", layout);
|
|
|
|
if(!ConfigValueInt("layouts", name, &order))
|
|
|
|
return false;
|
|
|
|
if(order == 3)
|
|
|
|
ambiscale = THIRD_ORDER_SCALE;
|
|
|
|
else if(order == 2)
|
|
|
|
ambiscale = SECOND_ORDER_SCALE;
|
|
|
|
else if(order == 1)
|
|
|
|
ambiscale = FIRST_ORDER_SCALE;
|
|
|
|
else if(order == 0)
|
|
|
|
ambiscale = ZERO_ORDER_SCALE;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ERR("Unhandled order value %d (expected 0, 1, 2, or 3) for layout %s\n", order, name);
|
2014-11-11 01:53:42 +00:00
|
|
|
return false;
|
2015-08-18 14:44:17 +00:00
|
|
|
}
|
2014-11-11 01:53:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
for(i = 0;i < count;i++)
|
|
|
|
{
|
2014-11-15 08:19:56 +00:00
|
|
|
const char *channame;
|
2014-11-11 01:53:42 +00:00
|
|
|
char chanlayout[32];
|
|
|
|
const char *value;
|
2015-08-18 14:44:17 +00:00
|
|
|
int props = 0;
|
|
|
|
char eol = 0;
|
|
|
|
int j;
|
2014-11-11 01:53:42 +00:00
|
|
|
|
2014-11-15 08:19:56 +00:00
|
|
|
chanmap[i].ChanName = channels[i];
|
|
|
|
channame = GetLabelFromChannel(channels[i]);
|
|
|
|
|
2014-11-11 01:53:42 +00:00
|
|
|
snprintf(chanlayout, sizeof(chanlayout), "%s/%s", layout, channame);
|
|
|
|
if(!ConfigValueStr("layouts", chanlayout, &value))
|
|
|
|
{
|
|
|
|
ERR("Missing channel %s\n", channame);
|
|
|
|
return false;
|
|
|
|
}
|
2015-08-18 14:44:17 +00:00
|
|
|
if(order == 3)
|
|
|
|
props = sscanf(value, " %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %c",
|
|
|
|
&chanmap[i].Config[0], &chanmap[i].Config[1], &chanmap[i].Config[2],
|
|
|
|
&chanmap[i].Config[3], &chanmap[i].Config[4], &chanmap[i].Config[5],
|
|
|
|
&chanmap[i].Config[6], &chanmap[i].Config[7], &chanmap[i].Config[8],
|
|
|
|
&chanmap[i].Config[9], &chanmap[i].Config[10], &chanmap[i].Config[11],
|
|
|
|
&chanmap[i].Config[12], &chanmap[i].Config[13], &chanmap[i].Config[14],
|
|
|
|
&chanmap[i].Config[15], &eol
|
|
|
|
);
|
|
|
|
else if(order == 2)
|
|
|
|
props = sscanf(value, " %f %f %f %f %f %f %f %f %f %c",
|
|
|
|
&chanmap[i].Config[0], &chanmap[i].Config[1], &chanmap[i].Config[2],
|
|
|
|
&chanmap[i].Config[3], &chanmap[i].Config[4], &chanmap[i].Config[5],
|
|
|
|
&chanmap[i].Config[6], &chanmap[i].Config[7], &chanmap[i].Config[8],
|
|
|
|
&eol
|
|
|
|
);
|
|
|
|
else if(order == 1)
|
|
|
|
props = sscanf(value, " %f %f %f %f %c",
|
|
|
|
&chanmap[i].Config[0], &chanmap[i].Config[1], &chanmap[i].Config[2],
|
|
|
|
&chanmap[i].Config[3], &eol
|
|
|
|
);
|
|
|
|
else if(order == 0)
|
|
|
|
props = sscanf(value, " %f %c", &chanmap[i].Config[0], &eol);
|
2014-11-11 01:53:42 +00:00
|
|
|
if(props == 0)
|
|
|
|
{
|
2014-11-15 08:19:56 +00:00
|
|
|
ERR("Failed to parse %s channel's properties\n", channame);
|
2014-11-11 01:53:42 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-08-18 14:44:17 +00:00
|
|
|
if(props > (order+1)*(order+1))
|
2014-11-11 01:53:42 +00:00
|
|
|
{
|
2015-08-18 14:44:17 +00:00
|
|
|
ERR("Excess elements in %s channel %s (expected %d)\n", layout, channame, (order+1)*(order+1));
|
2014-11-11 01:53:42 +00:00
|
|
|
return false;
|
|
|
|
}
|
2015-08-18 14:44:17 +00:00
|
|
|
|
|
|
|
for(j = props;j < 16;++j)
|
|
|
|
chanmap[i].Config[j] = 0.0f;
|
2014-11-11 01:53:42 +00:00
|
|
|
}
|
2015-08-18 14:44:17 +00:00
|
|
|
SetChannelMap(device, chanmap, count, ambiscale);
|
2014-11-11 01:53:42 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-09-11 00:53:01 +00:00
|
|
|
ALvoid aluInitPanning(ALCdevice *device)
|
2010-08-03 07:21:36 +00:00
|
|
|
{
|
2014-11-05 11:46:00 +00:00
|
|
|
static const ChannelMap MonoCfg[1] = {
|
2015-08-18 14:44:17 +00:00
|
|
|
{ FrontCenter, { 1.4142f } },
|
2014-10-03 03:25:30 +00:00
|
|
|
}, StereoCfg[2] = {
|
2015-08-18 14:44:17 +00:00
|
|
|
{ FrontLeft, { 0.7071f, 0.0f, 0.5f, 0.0f } },
|
|
|
|
{ FrontRight, { 0.7071f, 0.0f, -0.5f, 0.0f } },
|
2014-10-03 03:25:30 +00:00
|
|
|
}, QuadCfg[4] = {
|
2015-08-18 14:44:17 +00:00
|
|
|
{ FrontLeft, { 0.353553f, 0.306184f, 0.306184f, 0.0f, 0.0f, 0.0f, 0.0f, 0.000000f, 0.117186f } },
|
|
|
|
{ FrontRight, { 0.353553f, 0.306184f, -0.306184f, 0.0f, 0.0f, 0.0f, 0.0f, 0.000000f, -0.117186f } },
|
|
|
|
{ BackLeft, { 0.353553f, -0.306184f, 0.306184f, 0.0f, 0.0f, 0.0f, 0.0f, 0.000000f, -0.117186f } },
|
|
|
|
{ BackRight, { 0.353553f, -0.306184f, -0.306184f, 0.0f, 0.0f, 0.0f, 0.0f, 0.000000f, 0.117186f } },
|
2014-11-13 03:26:53 +00:00
|
|
|
}, X51SideCfg[5] = {
|
2015-08-18 14:44:17 +00:00
|
|
|
{ FrontLeft, { 0.208954f, 0.212846f, 0.238350f, 0.0f, 0.0f, 0.0f, 0.0f, -0.017738f, 0.204014f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -0.051023f, 0.047490f } },
|
|
|
|
{ FrontRight, { 0.208954f, 0.212846f, -0.238350f, 0.0f, 0.0f, 0.0f, 0.0f, -0.017738f, -0.204014f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -0.051023f, -0.047490f } },
|
|
|
|
{ FrontCenter, { 0.109403f, 0.179490f, 0.000000f, 0.0f, 0.0f, 0.0f, 0.0f, 0.142031f, 0.000000f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.072024f, 0.000000f } },
|
|
|
|
{ SideLeft, { 0.470936f, -0.369626f, 0.349386f, 0.0f, 0.0f, 0.0f, 0.0f, -0.031375f, -0.058144f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -0.007119f, -0.043968f } },
|
|
|
|
{ SideRight, { 0.470936f, -0.369626f, -0.349386f, 0.0f, 0.0f, 0.0f, 0.0f, -0.031375f, 0.058144f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -0.007119f, 0.043968f } },
|
2014-11-13 03:26:53 +00:00
|
|
|
}, X51RearCfg[5] = {
|
2015-08-18 14:44:17 +00:00
|
|
|
{ FrontLeft, { 0.208954f, 0.212846f, 0.238350f, 0.0f, 0.0f, 0.0f, 0.0f, -0.017738f, 0.204014f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -0.051023f, 0.047490f } },
|
|
|
|
{ FrontRight, { 0.208954f, 0.212846f, -0.238350f, 0.0f, 0.0f, 0.0f, 0.0f, -0.017738f, -0.204014f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -0.051023f, -0.047490f } },
|
|
|
|
{ FrontCenter, { 0.109403f, 0.179490f, 0.000000f, 0.0f, 0.0f, 0.0f, 0.0f, 0.142031f, 0.000000f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.072024f, 0.000000f } },
|
|
|
|
{ BackLeft, { 0.470936f, -0.369626f, 0.349386f, 0.0f, 0.0f, 0.0f, 0.0f, -0.031375f, -0.058144f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -0.007119f, -0.043968f } },
|
|
|
|
{ BackRight, { 0.470936f, -0.369626f, -0.349386f, 0.0f, 0.0f, 0.0f, 0.0f, -0.031375f, 0.058144f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -0.007119f, 0.043968f } },
|
2014-11-13 03:26:53 +00:00
|
|
|
}, X61Cfg[6] = {
|
2015-08-18 14:44:17 +00:00
|
|
|
{ FrontLeft, { 0.167065f, 0.200583f, 0.172695f, 0.0f, 0.0f, 0.0f, 0.0f, 0.029855f, 0.186407f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -0.039241f, 0.068910f } },
|
|
|
|
{ FrontRight, { 0.167065f, 0.200583f, -0.172695f, 0.0f, 0.0f, 0.0f, 0.0f, 0.029855f, -0.186407f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -0.039241f, -0.068910f } },
|
|
|
|
{ FrontCenter, { 0.109403f, 0.179490f, 0.000000f, 0.0f, 0.0f, 0.0f, 0.0f, 0.142031f, 0.000000f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.072024f, 0.000000f } },
|
|
|
|
{ BackCenter, { 0.353556f, -0.461940f, 0.000000f, 0.0f, 0.0f, 0.0f, 0.0f, 0.165723f, 0.000000f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.000000f, 0.000000f } },
|
|
|
|
{ SideLeft, { 0.289151f, -0.081301f, 0.401292f, 0.0f, 0.0f, 0.0f, 0.0f, -0.188208f, -0.071420f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.010099f, -0.032897f } },
|
|
|
|
{ SideRight, { 0.289151f, -0.081301f, -0.401292f, 0.0f, 0.0f, 0.0f, 0.0f, -0.188208f, 0.071420f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.010099f, 0.032897f } },
|
2014-11-13 03:26:53 +00:00
|
|
|
}, X71Cfg[7] = {
|
2015-08-18 14:44:17 +00:00
|
|
|
{ FrontLeft, { 0.167065f, 0.200583f, 0.172695f, 0.0f, 0.0f, 0.0f, 0.0f, 0.029855f, 0.186407f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -0.039241f, 0.068910f } },
|
|
|
|
{ FrontRight, { 0.167065f, 0.200583f, -0.172695f, 0.0f, 0.0f, 0.0f, 0.0f, 0.029855f, -0.186407f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -0.039241f, -0.068910f } },
|
|
|
|
{ FrontCenter, { 0.109403f, 0.179490f, 0.000000f, 0.0f, 0.0f, 0.0f, 0.0f, 0.142031f, 0.000000f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.072024f, 0.000000f } },
|
|
|
|
{ BackLeft, { 0.224752f, -0.295009f, 0.170325f, 0.0f, 0.0f, 0.0f, 0.0f, 0.105349f, -0.182473f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.000000f, 0.065799f } },
|
|
|
|
{ BackRight, { 0.224752f, -0.295009f, -0.170325f, 0.0f, 0.0f, 0.0f, 0.0f, 0.105349f, 0.182473f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.000000f, -0.065799f } },
|
|
|
|
{ SideLeft, { 0.224739f, 0.000000f, 0.340644f, 0.0f, 0.0f, 0.0f, 0.0f, -0.210697f, 0.000000f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.000000f, -0.065795f } },
|
|
|
|
{ SideRight, { 0.224739f, 0.000000f, -0.340644f, 0.0f, 0.0f, 0.0f, 0.0f, -0.210697f, 0.000000f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.000000f, 0.065795f } },
|
2014-11-26 06:20:00 +00:00
|
|
|
}, BFormat3D[4] = {
|
2015-08-18 14:44:17 +00:00
|
|
|
{ Aux0, { 1.0f, 0.0f, 0.0f, 0.0f } },
|
|
|
|
{ Aux1, { 0.0f, 1.0f, 0.0f, 0.0f } },
|
|
|
|
{ Aux2, { 0.0f, 0.0f, 1.0f, 0.0f } },
|
|
|
|
{ Aux3, { 0.0f, 0.0f, 0.0f, 1.0f } },
|
2014-10-03 03:25:30 +00:00
|
|
|
};
|
2014-11-07 07:05:21 +00:00
|
|
|
const ChannelMap *chanmap = NULL;
|
2015-08-18 14:44:17 +00:00
|
|
|
ALfloat ambiscale = 1.0f;
|
2014-11-07 07:05:21 +00:00
|
|
|
size_t count = 0;
|
2014-10-03 03:25:30 +00:00
|
|
|
|
2015-08-18 14:44:17 +00:00
|
|
|
device->AmbiScale = 1.0f;
|
|
|
|
memset(device->AmbiCoeffs, 0, sizeof(device->AmbiCoeffs));
|
2014-11-07 11:12:32 +00:00
|
|
|
device->NumChannels = 0;
|
2010-08-03 07:21:36 +00:00
|
|
|
|
2014-11-22 12:20:17 +00:00
|
|
|
if(device->Hrtf)
|
|
|
|
{
|
|
|
|
ALuint i;
|
|
|
|
|
2015-02-09 23:59:29 +00:00
|
|
|
count = COUNTOF(BFormat3D);
|
|
|
|
chanmap = BFormat3D;
|
2015-08-18 14:44:17 +00:00
|
|
|
ambiscale = 1.0f;
|
2014-11-22 12:20:17 +00:00
|
|
|
|
|
|
|
for(i = 0;i < count;i++)
|
2015-02-09 23:59:29 +00:00
|
|
|
device->ChannelName[i] = chanmap[i].ChanName;
|
|
|
|
for(;i < MAX_OUTPUT_CHANNELS;i++)
|
|
|
|
device->ChannelName[i] = InvalidChannel;
|
2015-08-18 14:44:17 +00:00
|
|
|
SetChannelMap(device, chanmap, count, ambiscale);
|
2015-02-10 19:22:28 +00:00
|
|
|
|
2015-02-09 23:59:29 +00:00
|
|
|
{
|
2015-02-10 19:22:28 +00:00
|
|
|
ALfloat (*coeffs_list[4])[2] = {
|
|
|
|
device->Hrtf_Params[0].Coeffs, device->Hrtf_Params[1].Coeffs,
|
|
|
|
device->Hrtf_Params[2].Coeffs, device->Hrtf_Params[3].Coeffs
|
|
|
|
};
|
|
|
|
ALuint *delay_list[4] = {
|
|
|
|
device->Hrtf_Params[0].Delay, device->Hrtf_Params[1].Delay,
|
|
|
|
device->Hrtf_Params[2].Delay, device->Hrtf_Params[3].Delay
|
|
|
|
};
|
|
|
|
GetBFormatHrtfCoeffs(device->Hrtf, 4, coeffs_list, delay_list);
|
2015-02-09 23:59:29 +00:00
|
|
|
}
|
2014-11-22 12:20:17 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-11-11 01:53:42 +00:00
|
|
|
if(LoadChannelSetup(device))
|
|
|
|
return;
|
|
|
|
|
2014-09-11 00:53:01 +00:00
|
|
|
switch(device->FmtChans)
|
2010-08-03 07:21:36 +00:00
|
|
|
{
|
2010-12-05 03:50:00 +00:00
|
|
|
case DevFmtMono:
|
2014-11-05 10:54:11 +00:00
|
|
|
count = COUNTOF(MonoCfg);
|
2014-11-05 11:46:00 +00:00
|
|
|
chanmap = MonoCfg;
|
2015-08-18 14:44:17 +00:00
|
|
|
ambiscale = ZERO_ORDER_SCALE;
|
2010-08-03 07:21:36 +00:00
|
|
|
break;
|
|
|
|
|
2010-12-05 03:50:00 +00:00
|
|
|
case DevFmtStereo:
|
2014-11-05 10:54:11 +00:00
|
|
|
count = COUNTOF(StereoCfg);
|
2014-11-05 11:46:00 +00:00
|
|
|
chanmap = StereoCfg;
|
2015-08-18 14:44:17 +00:00
|
|
|
ambiscale = FIRST_ORDER_SCALE;
|
2010-08-03 07:21:36 +00:00
|
|
|
break;
|
|
|
|
|
2010-12-05 03:50:00 +00:00
|
|
|
case DevFmtQuad:
|
2014-11-05 10:54:11 +00:00
|
|
|
count = COUNTOF(QuadCfg);
|
2014-11-05 11:46:00 +00:00
|
|
|
chanmap = QuadCfg;
|
2015-08-18 14:44:17 +00:00
|
|
|
ambiscale = SECOND_ORDER_SCALE;
|
2010-08-03 07:21:36 +00:00
|
|
|
break;
|
|
|
|
|
2010-12-05 03:50:00 +00:00
|
|
|
case DevFmtX51:
|
2014-11-05 10:54:11 +00:00
|
|
|
count = COUNTOF(X51SideCfg);
|
2014-11-05 11:46:00 +00:00
|
|
|
chanmap = X51SideCfg;
|
2015-08-18 14:44:17 +00:00
|
|
|
ambiscale = THIRD_ORDER_SCALE;
|
2011-05-29 02:35:32 +00:00
|
|
|
break;
|
|
|
|
|
2014-11-07 08:54:16 +00:00
|
|
|
case DevFmtX51Rear:
|
|
|
|
count = COUNTOF(X51RearCfg);
|
|
|
|
chanmap = X51RearCfg;
|
2015-08-18 14:44:17 +00:00
|
|
|
ambiscale = THIRD_ORDER_SCALE;
|
2014-11-07 08:54:16 +00:00
|
|
|
break;
|
|
|
|
|
2010-12-05 03:50:00 +00:00
|
|
|
case DevFmtX61:
|
2014-11-05 10:54:11 +00:00
|
|
|
count = COUNTOF(X61Cfg);
|
2014-11-05 11:46:00 +00:00
|
|
|
chanmap = X61Cfg;
|
2015-08-18 14:44:17 +00:00
|
|
|
ambiscale = THIRD_ORDER_SCALE;
|
2010-08-03 07:21:36 +00:00
|
|
|
break;
|
|
|
|
|
2010-12-05 03:50:00 +00:00
|
|
|
case DevFmtX71:
|
2014-11-05 10:54:11 +00:00
|
|
|
count = COUNTOF(X71Cfg);
|
2014-11-05 11:46:00 +00:00
|
|
|
chanmap = X71Cfg;
|
2015-08-18 14:44:17 +00:00
|
|
|
ambiscale = THIRD_ORDER_SCALE;
|
2010-08-03 07:21:36 +00:00
|
|
|
break;
|
2014-11-26 06:20:00 +00:00
|
|
|
|
|
|
|
case DevFmtBFormat3D:
|
|
|
|
count = COUNTOF(BFormat3D);
|
|
|
|
chanmap = BFormat3D;
|
2015-08-18 14:44:17 +00:00
|
|
|
ambiscale = 1.0f;
|
2014-11-26 06:20:00 +00:00
|
|
|
break;
|
2010-08-03 07:21:36 +00:00
|
|
|
}
|
2014-11-13 03:26:53 +00:00
|
|
|
|
2015-08-18 14:44:17 +00:00
|
|
|
SetChannelMap(device, chanmap, count, ambiscale);
|
2010-08-03 07:21:36 +00:00
|
|
|
}
|