File: cfgparser.h

package info (click to toggle)
gbsplay 0.0.102-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 704 kB
  • sloc: ansic: 8,341; sh: 1,319; makefile: 543; xml: 13
file content (47 lines) | stat: -rw-r--r-- 1,088 bytes parent folder | download | duplicates (2)
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
/*
 * gbsplay is a Gameboy sound player
 *
 * 2003-2025 (C) by Tobias Diedrich <ranma+gbsplay@tdiedrich.de>
 *                  Christian Garbs <mitch@cgarbs.de>
 *
 * Licensed under GNU GPL v1 or, at your option, any later version.
 */

#ifndef _CFGPARSER_H_
#define _CFGPARSER_H_

#include "plugout.h"

#define CFG_FILTER_OFF "off"
#define CFG_FILTER_DMG "dmg"
#define CFG_FILTER_CGB "cgb"

enum play_mode {
	PLAY_MODE_LINEAR  = 1,
	PLAY_MODE_RANDOM  = 2,
	PLAY_MODE_SHUFFLE = 3,
};

struct player_cfg {
	long fadeout;
	char *filter_type;
	enum gbs_loop_mode loop_mode;
	enum play_mode play_mode;
	long rate;
	long refresh_delay;
	enum plugout_endian requested_endian;
	long silence_timeout;
	char *sound_name;
	long subsong_gap;
	long subsong_timeout;
	long verbosity;
};

// this is a global variable, but for the config options this seems acceptable
// currently the commandline arguments are handled in player.c so write access is needed there as well
extern struct player_cfg cfg;

void  cfg_parse(const char* const fname);
char* get_userconfig(const char* const cfgfile);

#endif