aboutsummaryrefslogtreecommitdiffstats
path: root/utils/makemhr/loaddef.h
blob: 24d75a65a19647ca199c2acf2d051749b30e89eb (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
#ifndef LOADDEF_H
#define LOADDEF_H

#include <stdio.h>

#include "makemhr.h"


// Constants for accessing the token reader's ring buffer.
#define TR_RING_BITS                 (16)
#define TR_RING_SIZE                 (1 << TR_RING_BITS)
#define TR_RING_MASK                 (TR_RING_SIZE - 1)


// Token reader state for parsing the data set definition.
struct TokenReaderT {
    FILE *mFile;
    const char *mName;
    uint        mLine;
    uint        mColumn;
    char   mRing[TR_RING_SIZE];
    size_t mIn;
    size_t mOut;
};

void TrSetup(FILE *fp, const char *filename, TokenReaderT *tr);
int ProcessMetrics(TokenReaderT *tr, const uint fftSize, const uint truncSize, const ChannelModeT chanMode, HrirDataT *hData);
int ProcessSources(TokenReaderT *tr, HrirDataT *hData);

#endif /* LOADDEF_H */