-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.h
54 lines (45 loc) · 1.07 KB
/
config.h
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
46
47
48
49
50
51
52
53
54
#pragma once
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#define MAX_ERROR_LEN 1024
#ifdef ALSA
#define HAS_ALSA true
#else
#define HAS_ALSA false
#endif
#ifdef PULSE
#define HAS_PULSE true
#else
#define HAS_PULSE false
#endif
#ifdef SNDIO
#define HAS_SNDIO true
#else
#define HAS_SNDIO false
#endif
// These are in order of least-favourable to most-favourable choices, in case
// multiple are supported and configured.
enum input_method {
INPUT_FIFO,
INPUT_ALSA,
INPUT_PULSE,
INPUT_SNDIO,
INPUT_SHMEM,
INPUT_MAX
};
struct config_params {
char *plot_l_col, *plot_r_col, *ax_col, *ax_2_col, *text_col, *audio_col, *osc_col;
char *audio_source, *text_font, *audio_font, *vis;
double persistence, noise_floor;
double *userEQ;
enum input_method im;
bool fullscreen;
int col, bgcol, fifoSample, fifoSampleBits, height, width, rotate;
};
struct error_s {
char message[MAX_ERROR_LEN];
int length;
};
bool load_config(char configPath[PATH_MAX], struct config_params *p, struct error_s *error);