aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ambdec.h
blob: d6d154fb307f8f40f3949ff3858236e881692787 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef AMBDEC_H
#define AMBDEC_H

#include <string>

#include "alMain.h"

/* Helpers to read .ambdec configuration files. */

enum class AmbDecScale {
    N3D,
    SN3D,
    FuMa,
};
struct AmbDecConf {
    std::string Description;
    ALuint Version; /* Must be 3 */

    ALuint ChanMask;
    ALuint FreqBands; /* Must be 1 or 2 */
    ALsizei NumSpeakers;
    AmbDecScale CoeffScale;

    ALfloat XOverFreq;
    ALfloat XOverRatio;

    struct {
        std::string Name;
        ALfloat Distance;
        ALfloat Azimuth;
        ALfloat Elevation;
        std::string Connection;
    } Speakers[MAX_OUTPUT_CHANNELS];

    /* Unused when FreqBands == 1 */
    ALfloat LFOrderGain[MAX_AMBI_ORDER+1];
    ALfloat LFMatrix[MAX_OUTPUT_CHANNELS][MAX_AMBI_COEFFS];

    ALfloat HFOrderGain[MAX_AMBI_ORDER+1];
    ALfloat HFMatrix[MAX_OUTPUT_CHANNELS][MAX_AMBI_COEFFS];

    int load(const char *fname);
};

#endif /* AMBDEC_H */