Initial revision 6759
[qball-mpd.git] / src / .svn / text-base / conf.h.svn-base
blobf5ef075257cecf6ad55236de0067e257aa5583b0
1 /* the Music Player Daemon (MPD)
2  * Copyright (C) 2003-2007 by Warren Dukes (warren.dukes@gmail.com)
3  * This project's homepage is: http://www.musicpd.org
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
19 #ifndef CONF_H
20 #define CONF_H
22 #include "../config.h"
24 #define CONF_MUSIC_DIR                  "music_directory"
25 #define CONF_PLAYLIST_DIR               "playlist_directory"
26 #define CONF_DB_FILE                    "db_file"
27 #define CONF_LOG_FILE                   "log_file"
28 #define CONF_ERROR_FILE                 "error_file"
29 #define CONF_PID_FILE                   "pid_file"
30 #define CONF_STATE_FILE                 "state_file"
31 #define CONF_USER                       "user"
32 #define CONF_BIND_TO_ADDRESS            "bind_to_address"
33 #define CONF_PORT                       "port"
34 #define CONF_LOG_LEVEL                  "log_level"
35 #define CONF_ZEROCONF_NAME              "zeroconf_name"
36 #define CONF_ZEROCONF_ENABLED                   "zeroconf_enabled"
37 #define CONF_PASSWORD                   "password"
38 #define CONF_DEFAULT_PERMS              "default_permissions"
39 #define CONF_AUDIO_OUTPUT               "audio_output"
40 #define CONF_AUDIO_OUTPUT_FORMAT        "audio_output_format"
41 #define CONF_MIXER_TYPE                 "mixer_type"
42 #define CONF_MIXER_DEVICE               "mixer_device"
43 #define CONF_MIXER_CONTROL              "mixer_control"
44 #define CONF_REPLAYGAIN                 "replaygain"
45 #define CONF_REPLAYGAIN_PREAMP          "replaygain_preamp"
46 #define CONF_VOLUME_NORMALIZATION       "volume_normalization"
47 #define CONF_SAMPLERATE_CONVERTER       "samplerate_converter"
48 #define CONF_AUDIO_BUFFER_SIZE          "audio_buffer_size"
49 #define CONF_BUFFER_BEFORE_PLAY         "buffer_before_play"
50 #define CONF_HTTP_BUFFER_SIZE           "http_buffer_size"
51 #define CONF_HTTP_PREBUFFER_SIZE        "http_prebuffer_size"
52 #define CONF_HTTP_PROXY_HOST            "http_proxy_host"
53 #define CONF_HTTP_PROXY_PORT            "http_proxy_port"
54 #define CONF_HTTP_PROXY_USER            "http_proxy_user"
55 #define CONF_HTTP_PROXY_PASSWORD        "http_proxy_password"
56 #define CONF_CONN_TIMEOUT               "connection_timeout"
57 #define CONF_MAX_CONN                   "max_connections"
58 #define CONF_MAX_PLAYLIST_LENGTH        "max_playlist_length"
59 #define CONF_MAX_COMMAND_LIST_SIZE      "max_command_list_size"
60 #define CONF_MAX_OUTPUT_BUFFER_SIZE     "max_output_buffer_size"
61 #define CONF_FS_CHARSET                 "filesystem_charset"
62 #define CONF_ID3V1_ENCODING             "id3v1_encoding"
63 #define CONF_METADATA_TO_USE            "metadata_to_use"
64 #define CONF_SAVE_ABSOLUTE_PATHS        "save_absolute_paths_in_playlists"
65 #define CONF_GAPLESS_MP3_PLAYBACK       "gapless_mp3_playback"
67 typedef struct _BlockParam {
68         char *name;
69         char *value;
70         int line;
71 } BlockParam;
73 typedef struct _ConfigParam {
74         char *value;
75         unsigned int line;
76         BlockParam *blockParams;
77         int numberOfBlockParams;
78 } ConfigParam;
80 void initConf(void);
81 void finishConf(void);
83 void readConf(char *file);
85 /* don't free the returned value
86    set _last_ to NULL to get first entry */
87 ConfigParam *getNextConfigParam(char *name, ConfigParam * last);
89 #define getConfigParam(name)    getNextConfigParam(name, NULL)
91 char *getConfigParamValue(char *name);
93 int getBoolConfigParam(char *name);
95 BlockParam *getBlockParam(ConfigParam * param, char *name);
97 ConfigParam *parseConfigFilePath(char *name, int force);
99 #endif