Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
4d472c26
Commit
4d472c26
authored
Jan 17, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: no CamelCase, part I
Renamed functions, types, variables.
parent
2bbf378d
Show whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
200 additions
and
166 deletions
+200
-166
audio.c
src/audio.c
+6
-6
audio.h
src/audio.h
+2
-2
client.c
src/client.c
+5
-5
cmdline.c
src/cmdline.c
+4
-4
conf.c
src/conf.c
+60
-50
conf.h
src/conf.h
+27
-16
daemon.c
src/daemon.c
+2
-1
database.c
src/database.c
+1
-1
input_curl.c
src/input_curl.c
+8
-8
listen.c
src/listen.c
+6
-4
log.c
src/log.c
+3
-3
main.c
src/main.c
+7
-5
mapper.c
src/mapper.c
+4
-2
alsa_mixer.c
src/mixer/alsa_mixer.c
+3
-3
oss_mixer.c
src/mixer/oss_mixer.c
+3
-3
mixer_api.c
src/mixer_api.c
+1
-1
mixer_api.h
src/mixer_api.h
+2
-2
alsa_plugin.c
src/output/alsa_plugin.c
+5
-4
ao_plugin.c
src/output/ao_plugin.c
+4
-3
fifo_plugin.c
src/output/fifo_plugin.c
+2
-2
jack_plugin.c
src/output/jack_plugin.c
+2
-2
mvp_plugin.c
src/output/mvp_plugin.c
+1
-1
null_plugin.c
src/output/null_plugin.c
+1
-1
oss_plugin.c
src/output/oss_plugin.c
+5
-4
osx_plugin.c
src/output/osx_plugin.c
+1
-1
pulse_plugin.c
src/output/pulse_plugin.c
+3
-3
shout_plugin.c
src/output/shout_plugin.c
+2
-2
output_api.h
src/output_api.h
+1
-1
output_control.h
src/output_control.h
+2
-1
output_init.c
src/output_init.c
+3
-2
path.c
src/path.c
+2
-1
permission.c
src/permission.c
+4
-4
playerData.c
src/playerData.c
+3
-3
playlist.c
src/playlist.c
+2
-2
replay_gain.c
src/replay_gain.c
+2
-2
state_file.c
src/state_file.c
+1
-1
tag.c
src/tag.c
+2
-2
utils.c
src/utils.c
+1
-1
volume.c
src/volume.c
+5
-5
zeroconf.c
src/zeroconf.c
+2
-2
No files found.
src/audio.c
View file @
4d472c26
...
@@ -43,9 +43,9 @@ static unsigned int audioOutputArraySize;
...
@@ -43,9 +43,9 @@ static unsigned int audioOutputArraySize;
unsigned
int
audio_output_count
(
void
)
unsigned
int
audio_output_count
(
void
)
{
{
unsigned
int
nr
=
0
;
unsigned
int
nr
=
0
;
ConfigP
aram
*
param
=
NULL
;
struct
config_p
aram
*
param
=
NULL
;
while
((
param
=
getNextConfigP
aram
(
CONF_AUDIO_OUTPUT
,
param
)))
while
((
param
=
config_get_next_p
aram
(
CONF_AUDIO_OUTPUT
,
param
)))
nr
++
;
nr
++
;
if
(
!
nr
)
if
(
!
nr
)
nr
=
1
;
/* we'll always have at least one device */
nr
=
1
;
/* we'll always have at least one device */
...
@@ -55,7 +55,7 @@ unsigned int audio_output_count(void)
...
@@ -55,7 +55,7 @@ unsigned int audio_output_count(void)
/* make sure initPlayerData is called before this function!! */
/* make sure initPlayerData is called before this function!! */
void
initAudioDriver
(
void
)
void
initAudioDriver
(
void
)
{
{
ConfigP
aram
*
param
=
NULL
;
struct
config_p
aram
*
param
=
NULL
;
unsigned
int
i
;
unsigned
int
i
;
notify_init
(
&
audio_output_client_notify
);
notify_init
(
&
audio_output_client_notify
);
...
@@ -68,7 +68,7 @@ void initAudioDriver(void)
...
@@ -68,7 +68,7 @@ void initAudioDriver(void)
struct
audio_output
*
output
=
&
audioOutputArray
[
i
];
struct
audio_output
*
output
=
&
audioOutputArray
[
i
];
unsigned
int
j
;
unsigned
int
j
;
param
=
getNextConfigP
aram
(
CONF_AUDIO_OUTPUT
,
param
);
param
=
config_get_next_p
aram
(
CONF_AUDIO_OUTPUT
,
param
);
/* only allow param to be NULL if there just one audioOutput */
/* only allow param to be NULL if there just one audioOutput */
assert
(
param
||
(
audioOutputArraySize
==
1
));
assert
(
param
||
(
audioOutputArraySize
==
1
));
...
@@ -106,7 +106,7 @@ void getOutputAudioFormat(const struct audio_format *inAudioFormat,
...
@@ -106,7 +106,7 @@ void getOutputAudioFormat(const struct audio_format *inAudioFormat,
void
initAudioConfig
(
void
)
void
initAudioConfig
(
void
)
{
{
ConfigParam
*
param
=
getConfigP
aram
(
CONF_AUDIO_OUTPUT_FORMAT
);
struct
config_param
*
param
=
config_get_p
aram
(
CONF_AUDIO_OUTPUT_FORMAT
);
if
(
NULL
==
param
||
NULL
==
param
->
value
)
if
(
NULL
==
param
||
NULL
==
param
->
value
)
return
;
return
;
...
@@ -467,7 +467,7 @@ bool mixer_control_getvol(unsigned int device, int *volume)
...
@@ -467,7 +467,7 @@ bool mixer_control_getvol(unsigned int device, int *volume)
return
false
;
return
false
;
}
}
bool
mixer_configure_legacy
(
char
*
name
,
ConfigP
aram
*
param
)
bool
mixer_configure_legacy
(
char
*
name
,
struct
config_p
aram
*
param
)
{
{
unsigned
i
;
unsigned
i
;
struct
audio_output
*
output
;
struct
audio_output
*
output
;
...
...
src/audio.h
View file @
4d472c26
...
@@ -21,13 +21,13 @@
...
@@ -21,13 +21,13 @@
#include <stdbool.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdio.h>
#include "conf.h"
#define AUDIO_AO_DRIVER_DEFAULT "default"
#define AUDIO_AO_DRIVER_DEFAULT "default"
struct
audio_format
;
struct
audio_format
;
struct
tag
;
struct
tag
;
struct
client
;
struct
client
;
struct
config_param
;
unsigned
int
audio_output_count
(
void
);
unsigned
int
audio_output_count
(
void
);
...
@@ -73,6 +73,6 @@ void saveAudioDevicesState(FILE *fp);
...
@@ -73,6 +73,6 @@ void saveAudioDevicesState(FILE *fp);
bool
mixer_control_setvol
(
unsigned
int
device
,
int
volume
,
int
rel
);
bool
mixer_control_setvol
(
unsigned
int
device
,
int
volume
,
int
rel
);
bool
mixer_control_getvol
(
unsigned
int
device
,
int
*
volume
);
bool
mixer_control_getvol
(
unsigned
int
device
,
int
*
volume
);
bool
mixer_configure_legacy
(
char
*
name
,
ConfigP
aram
*
param
);
bool
mixer_configure_legacy
(
char
*
name
,
struct
config_p
aram
*
param
);
#endif
#endif
src/client.c
View file @
4d472c26
...
@@ -554,9 +554,9 @@ client_out_event(G_GNUC_UNUSED GIOChannel *source,
...
@@ -554,9 +554,9 @@ client_out_event(G_GNUC_UNUSED GIOChannel *source,
void
client_manager_init
(
void
)
void
client_manager_init
(
void
)
{
{
char
*
test
;
char
*
test
;
ConfigP
aram
*
param
;
struct
config_p
aram
*
param
;
param
=
getConfigP
aram
(
CONF_CONN_TIMEOUT
);
param
=
config_get_p
aram
(
CONF_CONN_TIMEOUT
);
if
(
param
)
{
if
(
param
)
{
client_timeout
=
strtol
(
param
->
value
,
&
test
,
10
);
client_timeout
=
strtol
(
param
->
value
,
&
test
,
10
);
...
@@ -567,7 +567,7 @@ void client_manager_init(void)
...
@@ -567,7 +567,7 @@ void client_manager_init(void)
}
}
}
}
param
=
getConfigP
aram
(
CONF_MAX_CONN
);
param
=
config_get_p
aram
(
CONF_MAX_CONN
);
if
(
param
)
{
if
(
param
)
{
client_max_connections
=
strtol
(
param
->
value
,
&
test
,
10
);
client_max_connections
=
strtol
(
param
->
value
,
&
test
,
10
);
...
@@ -579,7 +579,7 @@ void client_manager_init(void)
...
@@ -579,7 +579,7 @@ void client_manager_init(void)
}
else
}
else
client_max_connections
=
CLIENT_MAX_CONNECTIONS_DEFAULT
;
client_max_connections
=
CLIENT_MAX_CONNECTIONS_DEFAULT
;
param
=
getConfigP
aram
(
CONF_MAX_COMMAND_LIST_SIZE
);
param
=
config_get_p
aram
(
CONF_MAX_COMMAND_LIST_SIZE
);
if
(
param
)
{
if
(
param
)
{
long
tmp
=
strtol
(
param
->
value
,
&
test
,
10
);
long
tmp
=
strtol
(
param
->
value
,
&
test
,
10
);
...
@@ -591,7 +591,7 @@ void client_manager_init(void)
...
@@ -591,7 +591,7 @@ void client_manager_init(void)
client_max_command_list_size
=
tmp
*
1024
;
client_max_command_list_size
=
tmp
*
1024
;
}
}
param
=
getConfigP
aram
(
CONF_MAX_OUTPUT_BUFFER_SIZE
);
param
=
config_get_p
aram
(
CONF_MAX_OUTPUT_BUFFER_SIZE
);
if
(
param
)
{
if
(
param
)
{
long
tmp
=
strtol
(
param
->
value
,
&
test
,
10
);
long
tmp
=
strtol
(
param
->
value
,
&
test
,
10
);
...
...
src/cmdline.c
View file @
4d472c26
...
@@ -143,17 +143,17 @@ void parseOptions(int argc, char **argv, Options *options)
...
@@ -143,17 +143,17 @@ void parseOptions(int argc, char **argv, Options *options)
path2
=
g_build_filename
(
g_get_home_dir
(),
path2
=
g_build_filename
(
g_get_home_dir
(),
USER_CONFIG_FILE_LOCATION2
,
NULL
);
USER_CONFIG_FILE_LOCATION2
,
NULL
);
if
(
g_file_test
(
path1
,
G_FILE_TEST_IS_REGULAR
))
if
(
g_file_test
(
path1
,
G_FILE_TEST_IS_REGULAR
))
readConf
(
path1
);
config_read_file
(
path1
);
else
if
(
g_file_test
(
path2
,
G_FILE_TEST_IS_REGULAR
))
else
if
(
g_file_test
(
path2
,
G_FILE_TEST_IS_REGULAR
))
readConf
(
path2
);
config_read_file
(
path2
);
else
if
(
g_file_test
(
SYSTEM_CONFIG_FILE_LOCATION
,
else
if
(
g_file_test
(
SYSTEM_CONFIG_FILE_LOCATION
,
G_FILE_TEST_IS_REGULAR
))
G_FILE_TEST_IS_REGULAR
))
readConf
(
SYSTEM_CONFIG_FILE_LOCATION
);
config_read_file
(
SYSTEM_CONFIG_FILE_LOCATION
);
g_free
(
path1
);
g_free
(
path1
);
g_free
(
path2
);
g_free
(
path2
);
}
else
if
(
argc
==
2
)
{
}
else
if
(
argc
==
2
)
{
/* specified configuration file */
/* specified configuration file */
readConf
(
argv
[
1
]);
config_read_file
(
argv
[
1
]);
}
else
}
else
g_error
(
"too many arguments"
);
g_error
(
"too many arguments"
);
}
}
src/conf.c
View file @
4d472c26
...
@@ -37,12 +37,12 @@
...
@@ -37,12 +37,12 @@
#define CONF_BLOCK_MASK 0x02
#define CONF_BLOCK_MASK 0x02
#define CONF_LINE_TOKEN_MAX 3
#define CONF_LINE_TOKEN_MAX 3
typedef
struct
_configE
ntry
{
struct
config_e
ntry
{
const
char
*
name
;
const
char
*
name
;
unsigned
char
mask
;
unsigned
char
mask
;
GSList
*
params
;
GSList
*
params
;
}
ConfigEntry
;
};
static
GSList
*
config_entries
;
static
GSList
*
config_entries
;
...
@@ -63,9 +63,10 @@ static int get_bool(const char *value)
...
@@ -63,9 +63,10 @@ static int get_bool(const char *value)
return
CONF_BOOL_INVALID
;
return
CONF_BOOL_INVALID
;
}
}
ConfigParam
*
newConfigParam
(
const
char
*
value
,
int
line
)
struct
config_param
*
newConfigParam
(
const
char
*
value
,
int
line
)
{
{
ConfigParam
*
ret
=
g_new
(
ConfigP
aram
,
1
);
struct
config_param
*
ret
=
g_new
(
struct
config_p
aram
,
1
);
if
(
!
value
)
if
(
!
value
)
ret
->
value
=
NULL
;
ret
->
value
=
NULL
;
...
@@ -74,8 +75,8 @@ ConfigParam *newConfigParam(const char *value, int line)
...
@@ -74,8 +75,8 @@ ConfigParam *newConfigParam(const char *value, int line)
ret
->
line
=
line
;
ret
->
line
=
line
;
ret
->
num
berOfBlockP
arams
=
0
;
ret
->
num
_block_p
arams
=
0
;
ret
->
block
P
arams
=
NULL
;
ret
->
block
_p
arams
=
NULL
;
return
ret
;
return
ret
;
}
}
...
@@ -83,26 +84,26 @@ ConfigParam *newConfigParam(const char *value, int line)
...
@@ -83,26 +84,26 @@ ConfigParam *newConfigParam(const char *value, int line)
void
void
config_param_free
(
gpointer
data
,
G_GNUC_UNUSED
gpointer
user_data
)
config_param_free
(
gpointer
data
,
G_GNUC_UNUSED
gpointer
user_data
)
{
{
ConfigP
aram
*
param
=
data
;
struct
config_p
aram
*
param
=
data
;
int
i
;
int
i
;
g_free
(
param
->
value
);
g_free
(
param
->
value
);
for
(
i
=
0
;
i
<
param
->
num
berOfBlockP
arams
;
i
++
)
{
for
(
i
=
0
;
i
<
param
->
num
_block_p
arams
;
i
++
)
{
g_free
(
param
->
block
P
arams
[
i
].
name
);
g_free
(
param
->
block
_p
arams
[
i
].
name
);
g_free
(
param
->
block
P
arams
[
i
].
value
);
g_free
(
param
->
block
_p
arams
[
i
].
value
);
}
}
if
(
param
->
num
berOfBlockP
arams
)
if
(
param
->
num
_block_p
arams
)
g_free
(
param
->
block
P
arams
);
g_free
(
param
->
block
_p
arams
);
g_free
(
param
);
g_free
(
param
);
}
}
static
ConfigE
ntry
*
static
struct
config_e
ntry
*
newConfigEntry
(
const
char
*
name
,
int
repeatable
,
int
block
)
newConfigEntry
(
const
char
*
name
,
int
repeatable
,
int
block
)
{
{
ConfigEntry
*
ret
=
g_new
(
ConfigE
ntry
,
1
);
struct
config_entry
*
ret
=
g_new
(
struct
config_e
ntry
,
1
);
ret
->
name
=
name
;
ret
->
name
=
name
;
ret
->
mask
=
0
;
ret
->
mask
=
0
;
...
@@ -119,7 +120,7 @@ newConfigEntry(const char *name, int repeatable, int block)
...
@@ -119,7 +120,7 @@ newConfigEntry(const char *name, int repeatable, int block)
static
void
static
void
config_entry_free
(
gpointer
data
,
G_GNUC_UNUSED
gpointer
user_data
)
config_entry_free
(
gpointer
data
,
G_GNUC_UNUSED
gpointer
user_data
)
{
{
ConfigE
ntry
*
entry
=
data
;
struct
config_e
ntry
*
entry
=
data
;
g_slist_foreach
(
entry
->
params
,
config_param_free
,
NULL
);
g_slist_foreach
(
entry
->
params
,
config_param_free
,
NULL
);
g_slist_free
(
entry
->
params
);
g_slist_free
(
entry
->
params
);
...
@@ -127,14 +128,14 @@ config_entry_free(gpointer data, G_GNUC_UNUSED gpointer user_data)
...
@@ -127,14 +128,14 @@ config_entry_free(gpointer data, G_GNUC_UNUSED gpointer user_data)
g_free
(
entry
);
g_free
(
entry
);
}
}
static
ConfigE
ntry
*
static
struct
config_e
ntry
*
config_entry_get
(
const
char
*
name
)
config_entry_get
(
const
char
*
name
)
{
{
GSList
*
list
;
GSList
*
list
;
for
(
list
=
config_entries
;
list
!=
NULL
;
for
(
list
=
config_entries
;
list
!=
NULL
;
list
=
g_slist_next
(
list
))
{
list
=
g_slist_next
(
list
))
{
ConfigE
ntry
*
entry
=
list
->
data
;
struct
config_e
ntry
*
entry
=
list
->
data
;
if
(
strcmp
(
entry
->
name
,
name
)
==
0
)
if
(
strcmp
(
entry
->
name
,
name
)
==
0
)
return
entry
;
return
entry
;
}
}
...
@@ -144,7 +145,7 @@ config_entry_get(const char *name)
...
@@ -144,7 +145,7 @@ config_entry_get(const char *name)
static
void
registerConfigParam
(
const
char
*
name
,
int
repeatable
,
int
block
)
static
void
registerConfigParam
(
const
char
*
name
,
int
repeatable
,
int
block
)
{
{
ConfigE
ntry
*
entry
;
struct
config_e
ntry
*
entry
;
entry
=
config_entry_get
(
name
);
entry
=
config_entry_get
(
name
);
if
(
entry
!=
NULL
)
if
(
entry
!=
NULL
)
...
@@ -154,13 +155,13 @@ static void registerConfigParam(const char *name, int repeatable, int block)
...
@@ -154,13 +155,13 @@ static void registerConfigParam(const char *name, int repeatable, int block)
config_entries
=
g_slist_prepend
(
config_entries
,
entry
);
config_entries
=
g_slist_prepend
(
config_entries
,
entry
);
}
}
void
finishConf
(
void
)
void
config_global_finish
(
void
)
{
{
g_slist_foreach
(
config_entries
,
config_entry_free
,
NULL
);
g_slist_foreach
(
config_entries
,
config_entry_free
,
NULL
);
g_slist_free
(
config_entries
);
g_slist_free
(
config_entries
);
}
}
void
initConf
(
void
)
void
config_global_init
(
void
)
{
{
config_entries
=
NULL
;
config_entries
=
NULL
;
...
@@ -209,24 +210,29 @@ void initConf(void)
...
@@ -209,24 +210,29 @@ void initConf(void)
registerConfigParam
(
CONF_GAPLESS_MP3_PLAYBACK
,
0
,
0
);
registerConfigParam
(
CONF_GAPLESS_MP3_PLAYBACK
,
0
,
0
);
}
}
void
addBlockParam
(
ConfigParam
*
param
,
const
char
*
name
,
const
char
*
value
,
void
addBlockParam
(
struct
config_param
*
param
,
const
char
*
name
,
const
char
*
value
,
int
line
)
int
line
)
{
{
param
->
numberOfBlockParams
++
;
struct
block_param
*
bp
;
param
->
num_block_params
++
;
param
->
block_params
=
g_realloc
(
param
->
block_params
,
param
->
num_block_params
*
sizeof
(
param
->
block_params
[
0
]));
param
->
blockParams
=
g_realloc
(
param
->
blockParams
,
bp
=
&
param
->
block_params
[
param
->
num_block_params
-
1
];
param
->
numberOfBlockParams
*
sizeof
(
BlockParam
));
param
->
blockParams
[
param
->
numberOfBlockParams
-
1
].
name
=
g_strdup
(
name
);
bp
->
name
=
g_strdup
(
name
);
param
->
blockParams
[
param
->
numberOfBlockParams
-
1
].
value
=
bp
->
value
=
g_strdup
(
value
);
g_strdup
(
value
);
bp
->
line
=
line
;
param
->
blockParams
[
param
->
numberOfBlockParams
-
1
].
line
=
line
;
}
}
static
ConfigParam
*
readConfigBlock
(
FILE
*
fp
,
int
*
count
,
char
*
string
)
static
struct
config_param
*
config_read_fileigBlock
(
FILE
*
fp
,
int
*
count
,
char
*
string
)
{
{
ConfigP
aram
*
ret
=
newConfigParam
(
NULL
,
*
count
);
struct
config_p
aram
*
ret
=
newConfigParam
(
NULL
,
*
count
);
int
i
;
int
i
;
int
numberOfArgs
;
int
numberOfArgs
;
...
@@ -275,7 +281,7 @@ static ConfigParam *readConfigBlock(FILE * fp, int *count, char *string)
...
@@ -275,7 +281,7 @@ static ConfigParam *readConfigBlock(FILE * fp, int *count, char *string)
return
ret
;
return
ret
;
}
}
void
readConf
(
const
char
*
file
)
void
config_read_file
(
const
char
*
file
)
{
{
FILE
*
fp
;
FILE
*
fp
;
char
string
[
MAX_STRING_SIZE
+
1
];
char
string
[
MAX_STRING_SIZE
+
1
];
...
@@ -283,8 +289,8 @@ void readConf(const char *file)
...
@@ -283,8 +289,8 @@ void readConf(const char *file)
int
numberOfArgs
;
int
numberOfArgs
;
int
argsMinusComment
;
int
argsMinusComment
;
int
count
=
0
;
int
count
=
0
;
ConfigE
ntry
*
entry
;
struct
config_e
ntry
*
entry
;
ConfigP
aram
*
param
;
struct
config_p
aram
*
param
;
if
(
!
(
fp
=
fopen
(
file
,
"r"
)))
{
if
(
!
(
fp
=
fopen
(
file
,
"r"
)))
{
g_error
(
"problems opening file %s for reading: %s
\n
"
,
g_error
(
"problems opening file %s for reading: %s
\n
"
,
...
@@ -332,7 +338,7 @@ void readConf(const char *file)
...
@@ -332,7 +338,7 @@ void readConf(const char *file)
g_error
(
"improperly formatted config file at "
g_error
(
"improperly formatted config file at "
"line %i: %s
\n
"
,
count
,
string
);
"line %i: %s
\n
"
,
count
,
string
);
}
}
param
=
readConf
igBlock
(
fp
,
&
count
,
string
);
param
=
config_read_file
igBlock
(
fp
,
&
count
,
string
);
}
else
}
else
param
=
newConfigParam
(
array
[
1
],
count
);
param
=
newConfigParam
(
array
[
1
],
count
);
...
@@ -341,11 +347,12 @@ void readConf(const char *file)
...
@@ -341,11 +347,12 @@ void readConf(const char *file)
fclose
(
fp
);
fclose
(
fp
);
}
}
ConfigParam
*
getNextConfigParam
(
const
char
*
name
,
ConfigParam
*
last
)
struct
config_param
*
config_get_next_param
(
const
char
*
name
,
struct
config_param
*
last
)
{
{
ConfigE
ntry
*
entry
;
struct
config_e
ntry
*
entry
;
GSList
*
node
;
GSList
*
node
;
ConfigP
aram
*
param
;
struct
config_p
aram
*
param
;
entry
=
config_entry_get
(
name
);
entry
=
config_entry_get
(
name
);
if
(
entry
==
NULL
)
if
(
entry
==
NULL
)
...
@@ -371,7 +378,7 @@ ConfigParam *getNextConfigParam(const char *name, ConfigParam * last)
...
@@ -371,7 +378,7 @@ ConfigParam *getNextConfigParam(const char *name, ConfigParam * last)
char
*
getConfigParamValue
(
const
char
*
name
)
char
*
getConfigParamValue
(
const
char
*
name
)
{
{
ConfigParam
*
param
=
getConfigP
aram
(
name
);
struct
config_param
*
param
=
config_get_p
aram
(
name
);
if
(
!
param
)
if
(
!
param
)
return
NULL
;
return
NULL
;
...
@@ -379,28 +386,30 @@ char *getConfigParamValue(const char *name)
...
@@ -379,28 +386,30 @@ char *getConfigParamValue(const char *name)
return
param
->
value
;
return
param
->
value
;
}
}
BlockParam
*
getBlockParam
(
ConfigParam
*
param
,
const
char
*
name
)
struct
block_param
*
getBlockParam
(
struct
config_param
*
param
,
const
char
*
name
)
{
{
BlockP
aram
*
ret
=
NULL
;
struct
block_p
aram
*
ret
=
NULL
;
int
i
;
int
i
;
for
(
i
=
0
;
i
<
param
->
num
berOfBlockP
arams
;
i
++
)
{
for
(
i
=
0
;
i
<
param
->
num
_block_p
arams
;
i
++
)
{
if
(
0
==
strcmp
(
name
,
param
->
block
P
arams
[
i
].
name
))
{
if
(
0
==
strcmp
(
name
,
param
->
block
_p
arams
[
i
].
name
))
{
if
(
ret
)
{
if
(
ret
)
{
g_warning
(
"
\"
%s
\"
first defined on line %i, and "
g_warning
(
"
\"
%s
\"
first defined on line %i, and "
"redefined on line %i
\n
"
,
name
,
"redefined on line %i
\n
"
,
name
,
ret
->
line
,
param
->
block
P
arams
[
i
].
line
);
ret
->
line
,
param
->
block
_p
arams
[
i
].
line
);
}
}
ret
=
param
->
block
P
arams
+
i
;
ret
=
param
->
block
_p
arams
+
i
;
}
}
}
}
return
ret
;
return
ret
;
}
}
ConfigParam
*
parseConfigFilePath
(
const
char
*
name
,
int
force
)
struct
config_param
*
parseConfigFilePath
(
const
char
*
name
,
int
force
)
{
{
ConfigParam
*
param
=
getConfigP
aram
(
name
);
struct
config_param
*
param
=
config_get_p
aram
(
name
);
char
*
path
;
char
*
path
;
if
(
!
param
&&
force
)
if
(
!
param
&&
force
)
...
@@ -423,7 +432,7 @@ ConfigParam *parseConfigFilePath(const char *name, int force)
...
@@ -423,7 +432,7 @@ ConfigParam *parseConfigFilePath(const char *name, int force)
int
getBoolConfigParam
(
const
char
*
name
,
int
force
)
int
getBoolConfigParam
(
const
char
*
name
,
int
force
)
{
{
int
ret
;
int
ret
;
ConfigParam
*
param
=
getConfigP
aram
(
name
);
struct
config_param
*
param
=
config_get_p
aram
(
name
);
if
(
!
param
)
if
(
!
param
)
return
CONF_BOOL_UNSET
;
return
CONF_BOOL_UNSET
;
...
@@ -446,10 +455,11 @@ bool config_get_bool(const char *name, bool default_value)
...
@@ -446,10 +455,11 @@ bool config_get_bool(const char *name, bool default_value)
return
value
;
return
value
;
}
}
int
getBoolBlockParam
(
ConfigParam
*
param
,
const
char
*
name
,
int
force
)
int
getBoolBlockParam
(
struct
config_param
*
param
,
const
char
*
name
,
int
force
)
{
{
int
ret
;
int
ret
;
BlockP
aram
*
bp
=
getBlockParam
(
param
,
name
);
struct
block_p
aram
*
bp
=
getBlockParam
(
param
,
name
);
if
(
!
bp
)
if
(
!
bp
)
return
CONF_BOOL_UNSET
;
return
CONF_BOOL_UNSET
;
...
...
src/conf.h
View file @
4d472c26
...
@@ -68,46 +68,57 @@
...
@@ -68,46 +68,57 @@
#define CONF_BOOL_UNSET -1
#define CONF_BOOL_UNSET -1
#define CONF_BOOL_INVALID -2
#define CONF_BOOL_INVALID -2
typedef
struct
_BlockP
aram
{
struct
block_p
aram
{
char
*
name
;
char
*
name
;
char
*
value
;
char
*
value
;
int
line
;
int
line
;
}
BlockParam
;
};
typedef
struct
_ConfigP
aram
{
struct
config_p
aram
{
char
*
value
;
char
*
value
;
unsigned
int
line
;
unsigned
int
line
;
BlockParam
*
blockParams
;
int
numberOfBlockParams
;
}
ConfigParam
;
void
initConf
(
void
);
struct
block_param
*
block_params
;
void
finishConf
(
void
);
int
num_block_params
;
};
void
readConf
(
const
char
*
file
);
void
config_global_init
(
void
);
void
config_global_finish
(
void
);
void
config_read_file
(
const
char
*
file
);
/* don't free the returned value
/* don't free the returned value
set _last_ to NULL to get first entry */
set _last_ to NULL to get first entry */
ConfigParam
*
getNextConfigParam
(
const
char
*
name
,
ConfigParam
*
last
);
struct
config_param
*
config_get_next_param
(
const
char
*
name
,
struct
config_param
*
last
);
#define getConfigParam(name) getNextConfigParam(name, NULL)
static
inline
struct
config_param
*
config_get_param
(
const
char
*
name
)
{
return
config_get_next_param
(
name
,
NULL
);
}
char
*
getConfigParamValue
(
const
char
*
name
);
char
*
getConfigParamValue
(
const
char
*
name
);
BlockParam
*
getBlockParam
(
ConfigParam
*
param
,
const
char
*
name
);
struct
block_param
*
getBlockParam
(
struct
config_param
*
param
,
const
char
*
name
);
ConfigParam
*
parseConfigFilePath
(
const
char
*
name
,
int
force
);
struct
config_param
*
parseConfigFilePath
(
const
char
*
name
,
int
force
);
int
getBoolConfigParam
(
const
char
*
name
,
int
force
);
int
getBoolConfigParam
(
const
char
*
name
,
int
force
);
bool
config_get_bool
(
const
char
*
name
,
bool
default_value
);
bool
config_get_bool
(
const
char
*
name
,
bool
default_value
);
int
getBoolBlockParam
(
ConfigParam
*
param
,
const
char
*
name
,
int
force
);
int
getBoolBlockParam
(
struct
config_param
*
param
,
const
char
*
name
,
int
force
);
ConfigParam
*
newConfigParam
(
const
char
*
value
,
int
line
);
struct
config_param
*
newConfigParam
(
const
char
*
value
,
int
line
);
void
config_param_free
(
gpointer
data
,
gpointer
user_data
);
void
config_param_free
(
gpointer
data
,
gpointer
user_data
);
void
addBlockParam
(
ConfigParam
*
param
,
const
char
*
name
,
const
char
*
value
,
int
line
);
void
addBlockParam
(
struct
config_param
*
param
,
const
char
*
name
,
const
char
*
value
,
int
line
);
#endif
#endif
src/daemon.c
View file @
4d472c26
...
@@ -46,7 +46,8 @@ daemonize(Options *options)
...
@@ -46,7 +46,8 @@ daemonize(Options *options)
{
{
#ifndef WIN32
#ifndef WIN32
FILE
*
fp
=
NULL
;
FILE
*
fp
=
NULL
;
ConfigParam
*
pidFileParam
=
parseConfigFilePath
(
CONF_PID_FILE
,
0
);
struct
config_param
*
pidFileParam
=
parseConfigFilePath
(
CONF_PID_FILE
,
0
);
if
(
pidFileParam
)
{
if
(
pidFileParam
)
{
/* do this before daemon'izing so we can fail gracefully if we can't
/* do this before daemon'izing so we can fail gracefully if we can't
...
...
src/database.c
View file @
4d472c26
...
@@ -123,7 +123,7 @@ db_walk(const char *name,
...
@@ -123,7 +123,7 @@ db_walk(const char *name,
static
char
*
static
char
*
db_get_file
(
void
)
db_get_file
(
void
)
{
{
ConfigP
aram
*
param
=
parseConfigFilePath
(
CONF_DB_FILE
,
1
);
struct
config_p
aram
*
param
=
parseConfigFilePath
(
CONF_DB_FILE
,
1
);
assert
(
param
);
assert
(
param
);
assert
(
param
->
value
);
assert
(
param
->
value
);
...
...
src/input_curl.c
View file @
4d472c26
...
@@ -630,10 +630,10 @@ input_curl_easy_init(struct input_stream *is)
...
@@ -630,10 +630,10 @@ input_curl_easy_init(struct input_stream *is)
struct
input_curl
*
c
=
is
->
data
;
struct
input_curl
*
c
=
is
->
data
;
CURLcode
code
;
CURLcode
code
;
CURLMcode
mcode
;
CURLMcode
mcode
;
ConfigP
aram
*
proxy_host
;
struct
config_p
aram
*
proxy_host
;
ConfigP
aram
*
proxy_port
;
struct
config_p
aram
*
proxy_port
;
ConfigP
aram
*
proxy_user
;
struct
config_p
aram
*
proxy_user
;
ConfigP
aram
*
proxy_pass
;
struct
config_p
aram
*
proxy_pass
;
c
->
eof
=
false
;
c
->
eof
=
false
;
...
@@ -661,10 +661,10 @@ input_curl_easy_init(struct input_stream *is)
...
@@ -661,10 +661,10 @@ input_curl_easy_init(struct input_stream *is)
curl_easy_setopt
(
c
->
easy
,
CURLOPT_FAILONERROR
,
true
);
curl_easy_setopt
(
c
->
easy
,
CURLOPT_FAILONERROR
,
true
);
curl_easy_setopt
(
c
->
easy
,
CURLOPT_ERRORBUFFER
,
c
->
error
);
curl_easy_setopt
(
c
->
easy
,
CURLOPT_ERRORBUFFER
,
c
->
error
);
proxy_host
=
getConfigP
aram
(
CONF_HTTP_PROXY_HOST
);
proxy_host
=
config_get_p
aram
(
CONF_HTTP_PROXY_HOST
);
proxy_port
=
getConfigP
aram
(
CONF_HTTP_PROXY_PORT
);
proxy_port
=
config_get_p
aram
(
CONF_HTTP_PROXY_PORT
);
proxy_user
=
getConfigP
aram
(
CONF_HTTP_PROXY_USER
);
proxy_user
=
config_get_p
aram
(
CONF_HTTP_PROXY_USER
);
proxy_pass
=
getConfigP
aram
(
CONF_HTTP_PROXY_PASSWORD
);
proxy_pass
=
config_get_p
aram
(
CONF_HTTP_PROXY_PASSWORD
);
if
(
proxy_host
!=
NULL
)
{
if
(
proxy_host
!=
NULL
)
{
char
*
proxy_host_str
;
char
*
proxy_host_str
;
...
...
src/listen.c
View file @
4d472c26
...
@@ -127,7 +127,8 @@ static bool ipv6Supported(void)
...
@@ -127,7 +127,8 @@ static bool ipv6Supported(void)
#endif
#endif
static
void
static
void
parseListenConfigParam
(
G_GNUC_UNUSED
unsigned
int
port
,
ConfigParam
*
param
)
parseListenConfigParam
(
G_GNUC_UNUSED
unsigned
int
port
,
struct
config_param
*
param
)
{
{
const
struct
sockaddr
*
addrp
;
const
struct
sockaddr
*
addrp
;
socklen_t
addrlen
;
socklen_t
addrlen
;
...
@@ -253,8 +254,9 @@ parseListenConfigParam(G_GNUC_UNUSED unsigned int port, ConfigParam * param)
...
@@ -253,8 +254,9 @@ parseListenConfigParam(G_GNUC_UNUSED unsigned int port, ConfigParam * param)
void
listenOnPort
(
void
)
void
listenOnPort
(
void
)
{
{
int
port
=
DEFAULT_PORT
;
int
port
=
DEFAULT_PORT
;
ConfigParam
*
param
=
getNextConfigParam
(
CONF_BIND_TO_ADDRESS
,
NULL
);
struct
config_param
*
param
=
ConfigParam
*
portParam
=
getConfigParam
(
CONF_PORT
);
config_get_next_param
(
CONF_BIND_TO_ADDRESS
,
NULL
);
struct
config_param
*
portParam
=
config_get_param
(
CONF_PORT
);
if
(
portParam
)
{
if
(
portParam
)
{
char
*
test
;
char
*
test
;
...
@@ -271,7 +273,7 @@ void listenOnPort(void)
...
@@ -271,7 +273,7 @@ void listenOnPort(void)
do
{
do
{
parseListenConfigParam
(
port
,
param
);
parseListenConfigParam
(
port
,
param
);
}
while
((
param
=
getNextConfigP
aram
(
CONF_BIND_TO_ADDRESS
,
param
)));
}
while
((
param
=
config_get_next_p
aram
(
CONF_BIND_TO_ADDRESS
,
param
)));
}
}
void
closeAllListenSockets
(
void
)
void
closeAllListenSockets
(
void
)
...
...
src/log.c
View file @
4d472c26
...
@@ -219,19 +219,19 @@ parse_log_level(const char *value, unsigned line)
...
@@ -219,19 +219,19 @@ parse_log_level(const char *value, unsigned line)
void
log_init
(
bool
verbose
,
bool
use_stdout
)
void
log_init
(
bool
verbose
,
bool
use_stdout
)
{
{
ConfigP
aram
*
param
;
struct
config_p
aram
*
param
;
g_get_charset
(
&
log_charset
);
g_get_charset
(
&
log_charset
);
if
(
verbose
)
if
(
verbose
)
log_threshold
=
G_LOG_LEVEL_DEBUG
;
log_threshold
=
G_LOG_LEVEL_DEBUG
;
else
if
((
param
=
getConfigP
aram
(
CONF_LOG_LEVEL
))
!=
NULL
)
else
if
((
param
=
config_get_p
aram
(
CONF_LOG_LEVEL
))
!=
NULL
)
log_threshold
=
parse_log_level
(
param
->
value
,
param
->
line
);
log_threshold
=
parse_log_level
(
param
->
value
,
param
->
line
);
if
(
use_stdout
)
{
if
(
use_stdout
)
{
log_init_stdout
();
log_init_stdout
();
}
else
{
}
else
{
param
=
getConfigP
aram
(
CONF_LOG_FILE
);
param
=
config_get_p
aram
(
CONF_LOG_FILE
);
if
(
param
==
NULL
)
{
if
(
param
==
NULL
)
{
#ifdef HAVE_SYSLOG
#ifdef HAVE_SYSLOG
/* no configuration: default to syslog (if
/* no configuration: default to syslog (if
...
...
src/main.c
View file @
4d472c26
...
@@ -84,7 +84,7 @@ struct notify main_notify;
...
@@ -84,7 +84,7 @@ struct notify main_notify;
static
void
changeToUser
(
void
)
static
void
changeToUser
(
void
)
{
{
#ifndef WIN32
#ifndef WIN32
ConfigParam
*
param
=
getConfigP
aram
(
CONF_USER
);
struct
config_param
*
param
=
config_get_p
aram
(
CONF_USER
);
if
(
param
&&
strlen
(
param
->
value
))
{
if
(
param
&&
strlen
(
param
->
value
))
{
/* get uid */
/* get uid */
...
@@ -150,7 +150,8 @@ static void openDB(Options * options, char *argv0)
...
@@ -150,7 +150,8 @@ static void openDB(Options * options, char *argv0)
static
void
cleanUpPidFile
(
void
)
static
void
cleanUpPidFile
(
void
)
{
{
ConfigParam
*
pidFileParam
=
parseConfigFilePath
(
CONF_PID_FILE
,
0
);
struct
config_param
*
pidFileParam
=
parseConfigFilePath
(
CONF_PID_FILE
,
0
);
if
(
!
pidFileParam
)
if
(
!
pidFileParam
)
return
;
return
;
...
@@ -164,7 +165,8 @@ static void killFromPidFile(void)
...
@@ -164,7 +165,8 @@ static void killFromPidFile(void)
{
{
#ifndef WIN32
#ifndef WIN32
FILE
*
fp
;
FILE
*
fp
;
ConfigParam
*
pidFileParam
=
parseConfigFilePath
(
CONF_PID_FILE
,
0
);
struct
config_param
*
pidFileParam
=
parseConfigFilePath
(
CONF_PID_FILE
,
0
);
int
pid
;
int
pid
;
if
(
!
pidFileParam
)
{
if
(
!
pidFileParam
)
{
...
@@ -234,7 +236,7 @@ int main(int argc, char *argv[])
...
@@ -234,7 +236,7 @@ int main(int argc, char *argv[])
dirvec_init
();
dirvec_init
();
songvec_init
();
songvec_init
();
tag_pool_init
();
tag_pool_init
();
initConf
();
config_global_init
();
parseOptions
(
argc
,
argv
,
&
options
);
parseOptions
(
argc
,
argv
,
&
options
);
...
@@ -343,7 +345,7 @@ int main(int argc, char *argv[])
...
@@ -343,7 +345,7 @@ int main(int argc, char *argv[])
#endif
#endif
music_pipe_free
();
music_pipe_free
();
cleanUpPidFile
();
cleanUpPidFile
();
finishConf
();
config_global_finish
();
tag_pool_deinit
();
tag_pool_deinit
();
songvec_deinit
();
songvec_deinit
();
dirvec_deinit
();
dirvec_deinit
();
...
...
src/mapper.c
View file @
4d472c26
...
@@ -43,8 +43,10 @@ static size_t playlist_dir_length;
...
@@ -43,8 +43,10 @@ static size_t playlist_dir_length;
void
mapper_init
(
void
)
void
mapper_init
(
void
)
{
{
ConfigParam
*
music_dir_param
=
parseConfigFilePath
(
CONF_MUSIC_DIR
,
false
);
struct
config_param
*
music_dir_param
=
ConfigParam
*
playlist_dir_param
=
parseConfigFilePath
(
CONF_PLAYLIST_DIR
,
1
);
parseConfigFilePath
(
CONF_MUSIC_DIR
,
false
);
struct
config_param
*
playlist_dir_param
=
parseConfigFilePath
(
CONF_PLAYLIST_DIR
,
1
);
int
ret
;
int
ret
;
struct
stat
st
;
struct
stat
st
;
...
...
src/mixer/alsa_mixer.c
View file @
4d472c26
...
@@ -44,10 +44,10 @@ alsa_mixer_finish(struct mixer_data *data)
...
@@ -44,10 +44,10 @@ alsa_mixer_finish(struct mixer_data *data)
}
}
static
void
static
void
alsa_mixer_configure
(
struct
mixer_data
*
data
,
ConfigP
aram
*
param
)
alsa_mixer_configure
(
struct
mixer_data
*
data
,
struct
config_p
aram
*
param
)
{
{
struct
alsa_mixer
*
am
=
(
struct
alsa_mixer
*
)
data
;
struct
alsa_mixer
*
am
=
(
struct
alsa_mixer
*
)
data
;
BlockP
aram
*
bp
;
struct
block_p
aram
*
bp
;
if
(
param
==
NULL
)
if
(
param
==
NULL
)
return
;
return
;
...
@@ -149,7 +149,7 @@ alsa_mixer_control(struct mixer_data *data, int cmd, void *arg)
...
@@ -149,7 +149,7 @@ alsa_mixer_control(struct mixer_data *data, int cmd, void *arg)
struct
alsa_mixer
*
am
=
(
struct
alsa_mixer
*
)
data
;
struct
alsa_mixer
*
am
=
(
struct
alsa_mixer
*
)
data
;
switch
(
cmd
)
{
switch
(
cmd
)
{
case
AC_MIXER_CONFIGURE
:
case
AC_MIXER_CONFIGURE
:
alsa_mixer_configure
(
data
,
(
ConfigP
aram
*
)
arg
);
alsa_mixer_configure
(
data
,
(
struct
config_p
aram
*
)
arg
);
if
(
am
->
handle
)
if
(
am
->
handle
)
alsa_mixer_close
(
data
);
alsa_mixer_close
(
data
);
return
true
;
return
true
;
...
...
src/mixer/oss_mixer.c
View file @
4d472c26
...
@@ -48,10 +48,10 @@ oss_mixer_finish(struct mixer_data *data)
...
@@ -48,10 +48,10 @@ oss_mixer_finish(struct mixer_data *data)
}
}
static
void
static
void
oss_mixer_configure
(
struct
mixer_data
*
data
,
ConfigP
aram
*
param
)
oss_mixer_configure
(
struct
mixer_data
*
data
,
struct
config_p
aram
*
param
)
{
{
struct
oss_mixer
*
om
=
(
struct
oss_mixer
*
)
data
;
struct
oss_mixer
*
om
=
(
struct
oss_mixer
*
)
data
;
BlockP
aram
*
bp
;
struct
block_p
aram
*
bp
;
if
(
param
==
NULL
)
if
(
param
==
NULL
)
return
;
return
;
...
@@ -142,7 +142,7 @@ oss_mixer_control(struct mixer_data *data, int cmd, void *arg)
...
@@ -142,7 +142,7 @@ oss_mixer_control(struct mixer_data *data, int cmd, void *arg)
struct
oss_mixer
*
om
=
(
struct
oss_mixer
*
)
data
;
struct
oss_mixer
*
om
=
(
struct
oss_mixer
*
)
data
;
switch
(
cmd
)
{
switch
(
cmd
)
{
case
AC_MIXER_CONFIGURE
:
case
AC_MIXER_CONFIGURE
:
oss_mixer_configure
(
data
,
(
ConfigP
aram
*
)
arg
);
oss_mixer_configure
(
data
,
(
struct
config_p
aram
*
)
arg
);
if
(
om
->
device_fd
>=
0
)
if
(
om
->
device_fd
>=
0
)
oss_mixer_close
(
data
);
oss_mixer_close
(
data
);
return
true
;
return
true
;
...
...
src/mixer_api.c
View file @
4d472c26
...
@@ -20,7 +20,7 @@ void mixer_finish(struct mixer *mixer)
...
@@ -20,7 +20,7 @@ void mixer_finish(struct mixer *mixer)
mixer
->
plugin
=
NULL
;
mixer
->
plugin
=
NULL
;
}
}
void
mixer_configure
(
struct
mixer
*
mixer
,
ConfigP
aram
*
param
)
void
mixer_configure
(
struct
mixer
*
mixer
,
struct
config_p
aram
*
param
)
{
{
assert
(
mixer
!=
NULL
&&
mixer
->
plugin
!=
NULL
);
assert
(
mixer
!=
NULL
&&
mixer
->
plugin
!=
NULL
);
mixer
->
plugin
->
configure
(
mixer
->
data
,
param
);
mixer
->
plugin
->
configure
(
mixer
->
data
,
param
);
...
...
src/mixer_api.h
View file @
4d472c26
...
@@ -28,7 +28,7 @@ struct mixer_plugin {
...
@@ -28,7 +28,7 @@ struct mixer_plugin {
/**
/**
* Setup and configure mixer
* Setup and configure mixer
*/
*/
void
(
*
configure
)(
struct
mixer_data
*
data
,
ConfigP
aram
*
param
);
void
(
*
configure
)(
struct
mixer_data
*
data
,
struct
config_p
aram
*
param
);
/**
/**
* Open mixer device
* Open mixer device
...
@@ -53,7 +53,7 @@ struct mixer {
...
@@ -53,7 +53,7 @@ struct mixer {
void
mixer_init
(
struct
mixer
*
mixer
,
struct
mixer_plugin
*
plugin
);
void
mixer_init
(
struct
mixer
*
mixer
,
struct
mixer_plugin
*
plugin
);
void
mixer_finish
(
struct
mixer
*
mixer
);
void
mixer_finish
(
struct
mixer
*
mixer
);
void
mixer_configure
(
struct
mixer
*
mixer
,
ConfigP
aram
*
param
);
void
mixer_configure
(
struct
mixer
*
mixer
,
struct
config_p
aram
*
param
);
bool
mixer_open
(
struct
mixer
*
mixer
);
bool
mixer_open
(
struct
mixer
*
mixer
);
bool
mixer_control
(
struct
mixer
*
mixer
,
int
cmd
,
void
*
arg
);
bool
mixer_control
(
struct
mixer
*
mixer
,
int
cmd
,
void
*
arg
);
void
mixer_close
(
struct
mixer
*
mixer
);
void
mixer_close
(
struct
mixer
*
mixer
);
...
...
src/output/alsa_plugin.c
View file @
4d472c26
...
@@ -88,9 +88,9 @@ static void freeAlsaData(AlsaData * ad)
...
@@ -88,9 +88,9 @@ static void freeAlsaData(AlsaData * ad)
}
}
static
void
static
void
alsa_configure
(
AlsaData
*
ad
,
ConfigP
aram
*
param
)
alsa_configure
(
AlsaData
*
ad
,
struct
config_p
aram
*
param
)
{
{
BlockP
aram
*
bp
;
struct
block_p
aram
*
bp
;
if
((
bp
=
getBlockParam
(
param
,
"device"
)))
if
((
bp
=
getBlockParam
(
param
,
"device"
)))
ad
->
device
=
g_strdup
(
bp
->
value
);
ad
->
device
=
g_strdup
(
bp
->
value
);
...
@@ -119,9 +119,10 @@ alsa_configure(AlsaData *ad, ConfigParam *param)
...
@@ -119,9 +119,10 @@ alsa_configure(AlsaData *ad, ConfigParam *param)
#endif
#endif
}
}
static
void
*
alsa_initDriver
(
G_GNUC_UNUSED
struct
audio_output
*
ao
,
static
void
*
alsa_initDriver
(
G_GNUC_UNUSED
struct
audio_output
*
ao
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
ConfigParam
*
param
)
struct
config_param
*
param
)
{
{
/* no need for pthread_once thread-safety when reading config */
/* no need for pthread_once thread-safety when reading config */
static
int
free_global_registered
;
static
int
free_global_registered
;
...
...
src/output/ao_plugin.c
View file @
4d472c26
...
@@ -74,14 +74,15 @@ static void audioOutputAo_error(const char *msg)
...
@@ -74,14 +74,15 @@ static void audioOutputAo_error(const char *msg)
g_warning
(
"%s: %s
\n
"
,
msg
,
error
);
g_warning
(
"%s: %s
\n
"
,
msg
,
error
);
}
}
static
void
*
audioOutputAo_initDriver
(
struct
audio_output
*
ao
,
static
void
*
audioOutputAo_initDriver
(
struct
audio_output
*
ao
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
ConfigParam
*
param
)
struct
config_param
*
param
)
{
{
ao_info
*
ai
;
ao_info
*
ai
;
char
*
test
;
char
*
test
;
AoData
*
ad
=
newAoData
();
AoData
*
ad
=
newAoData
();
BlockP
aram
*
blockParam
;
struct
block_p
aram
*
blockParam
;
if
((
blockParam
=
getBlockParam
(
param
,
"write_size"
)))
{
if
((
blockParam
=
getBlockParam
(
param
,
"write_size"
)))
{
ad
->
writeSize
=
strtol
(
blockParam
->
value
,
&
test
,
10
);
ad
->
writeSize
=
strtol
(
blockParam
->
value
,
&
test
,
10
);
...
...
src/output/fifo_plugin.c
View file @
4d472c26
...
@@ -161,10 +161,10 @@ static bool openFifo(FifoData *fd)
...
@@ -161,10 +161,10 @@ static bool openFifo(FifoData *fd)
static
void
*
fifo_initDriver
(
G_GNUC_UNUSED
struct
audio_output
*
ao
,
static
void
*
fifo_initDriver
(
G_GNUC_UNUSED
struct
audio_output
*
ao
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
ConfigP
aram
*
param
)
struct
config_p
aram
*
param
)
{
{
FifoData
*
fd
;
FifoData
*
fd
;
BlockP
aram
*
blockParam
;
struct
block_p
aram
*
blockParam
;
char
*
path
;
char
*
path
;
blockParam
=
getBlockParam
(
param
,
"path"
);
blockParam
=
getBlockParam
(
param
,
"path"
);
...
...
src/output/jack_plugin.c
View file @
4d472c26
...
@@ -186,10 +186,10 @@ mpd_jack_error(const char *msg)
...
@@ -186,10 +186,10 @@ mpd_jack_error(const char *msg)
static
void
*
static
void
*
mpd_jack_init
(
struct
audio_output
*
ao
,
mpd_jack_init
(
struct
audio_output
*
ao
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
ConfigP
aram
*
param
)
struct
config_p
aram
*
param
)
{
{
struct
jack_data
*
jd
;
struct
jack_data
*
jd
;
BlockP
aram
*
bp
;
struct
block_p
aram
*
bp
;
char
*
endptr
;
char
*
endptr
;
int
val
;
int
val
;
char
*
cp
=
NULL
;
char
*
cp
=
NULL
;
...
...
src/output/mvp_plugin.c
View file @
4d472c26
...
@@ -112,7 +112,7 @@ static bool mvp_testDefault(void)
...
@@ -112,7 +112,7 @@ static bool mvp_testDefault(void)
static
void
*
mvp_initDriver
(
G_GNUC_UNUSED
struct
audio_output
*
audio_output
,
static
void
*
mvp_initDriver
(
G_GNUC_UNUSED
struct
audio_output
*
audio_output
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
G_GNUC_UNUSED
ConfigP
aram
*
param
)
G_GNUC_UNUSED
struct
config_p
aram
*
param
)
{
{
MvpData
*
md
=
g_new
(
MvpData
,
1
);
MvpData
*
md
=
g_new
(
MvpData
,
1
);
md
->
audio_output
=
audio_output
;
md
->
audio_output
=
audio_output
;
...
...
src/output/null_plugin.c
View file @
4d472c26
...
@@ -28,7 +28,7 @@ struct null_data {
...
@@ -28,7 +28,7 @@ struct null_data {
static
void
*
static
void
*
null_initDriver
(
G_GNUC_UNUSED
struct
audio_output
*
audioOutput
,
null_initDriver
(
G_GNUC_UNUSED
struct
audio_output
*
audioOutput
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
G_GNUC_UNUSED
ConfigP
aram
*
param
)
G_GNUC_UNUSED
struct
config_p
aram
*
param
)
{
{
struct
null_data
*
nd
=
g_new
(
struct
null_data
,
1
);
struct
null_data
*
nd
=
g_new
(
struct
null_data
,
1
);
nd
->
timer
=
NULL
;
nd
->
timer
=
NULL
;
...
...
src/output/oss_plugin.c
View file @
4d472c26
...
@@ -344,7 +344,7 @@ static bool oss_testDefault(void)
...
@@ -344,7 +344,7 @@ static bool oss_testDefault(void)
return
false
;
return
false
;
}
}
static
void
*
oss_open_default
(
ConfigP
aram
*
param
)
static
void
*
oss_open_default
(
struct
config_p
aram
*
param
)
{
{
int
i
;
int
i
;
int
err
[
G_N_ELEMENTS
(
default_devices
)];
int
err
[
G_N_ELEMENTS
(
default_devices
)];
...
@@ -387,12 +387,13 @@ static void *oss_open_default(ConfigParam *param)
...
@@ -387,12 +387,13 @@ static void *oss_open_default(ConfigParam *param)
return
NULL
;
/* some compilers can be dumb... */
return
NULL
;
/* some compilers can be dumb... */
}
}
static
void
*
oss_initDriver
(
G_GNUC_UNUSED
struct
audio_output
*
audioOutput
,
static
void
*
oss_initDriver
(
G_GNUC_UNUSED
struct
audio_output
*
audioOutput
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
ConfigParam
*
param
)
struct
config_param
*
param
)
{
{
if
(
param
)
{
if
(
param
)
{
BlockP
aram
*
bp
=
getBlockParam
(
param
,
"device"
);
struct
block_p
aram
*
bp
=
getBlockParam
(
param
,
"device"
);
if
(
bp
)
{
if
(
bp
)
{
OssData
*
od
=
newOssData
();
OssData
*
od
=
newOssData
();
od
->
device
=
bp
->
value
;
od
->
device
=
bp
->
value
;
...
...
src/output/osx_plugin.c
View file @
4d472c26
...
@@ -83,7 +83,7 @@ static bool osx_testDefault(void)
...
@@ -83,7 +83,7 @@ static bool osx_testDefault(void)
static
void
*
static
void
*
osx_initDriver
(
G_GNUC_UNUSED
struct
audio_output
*
audioOutput
,
osx_initDriver
(
G_GNUC_UNUSED
struct
audio_output
*
audioOutput
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
G_GNUC_UNUSED
ConfigParam
*
param
)
G_GNUC_UNUSED
struct
config_param
*
param
)
{
{
return
newOsxData
();
return
newOsxData
();
}
}
...
...
src/output/pulse_plugin.c
View file @
4d472c26
...
@@ -55,10 +55,10 @@ static void pulse_free_data(struct pulse_data *pd)
...
@@ -55,10 +55,10 @@ static void pulse_free_data(struct pulse_data *pd)
static
void
*
static
void
*
pulse_init
(
struct
audio_output
*
ao
,
pulse_init
(
struct
audio_output
*
ao
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
G_GNUC_UNUSED
const
struct
audio_format
*
audio_format
,
ConfigP
aram
*
param
)
struct
config_p
aram
*
param
)
{
{
BlockP
aram
*
server
=
NULL
;
struct
block_p
aram
*
server
=
NULL
;
BlockP
aram
*
sink
=
NULL
;
struct
block_p
aram
*
sink
=
NULL
;
struct
pulse_data
*
pd
;
struct
pulse_data
*
pd
;
if
(
param
)
{
if
(
param
)
{
...
...
src/output/shout_plugin.c
View file @
4d472c26
...
@@ -94,7 +94,7 @@ static void free_shout_data(struct shout_data *sd)
...
@@ -94,7 +94,7 @@ static void free_shout_data(struct shout_data *sd)
static
void
*
my_shout_init_driver
(
struct
audio_output
*
audio_output
,
static
void
*
my_shout_init_driver
(
struct
audio_output
*
audio_output
,
const
struct
audio_format
*
audio_format
,
const
struct
audio_format
*
audio_format
,
ConfigP
aram
*
param
)
struct
config_p
aram
*
param
)
{
{
struct
shout_data
*
sd
;
struct
shout_data
*
sd
;
char
*
test
;
char
*
test
;
...
@@ -106,7 +106,7 @@ static void *my_shout_init_driver(struct audio_output *audio_output,
...
@@ -106,7 +106,7 @@ static void *my_shout_init_driver(struct audio_output *audio_output,
unsigned
protocol
;
unsigned
protocol
;
const
char
*
user
;
const
char
*
user
;
char
*
name
;
char
*
name
;
BlockP
aram
*
block_param
;
struct
block_p
aram
*
block_param
;
int
public
;
int
public
;
sd
=
new_shout_data
();
sd
=
new_shout_data
();
...
...
src/output_api.h
View file @
4d472c26
...
@@ -60,7 +60,7 @@ struct audio_output_plugin {
...
@@ -60,7 +60,7 @@ struct audio_output_plugin {
*/
*/
void
*
(
*
init
)(
struct
audio_output
*
ao
,
void
*
(
*
init
)(
struct
audio_output
*
ao
,
const
struct
audio_format
*
audio_format
,
const
struct
audio_format
*
audio_format
,
ConfigP
aram
*
param
);
struct
config_p
aram
*
param
);
/**
/**
* Free resources allocated by this device.
* Free resources allocated by this device.
...
...
src/output_control.h
View file @
4d472c26
...
@@ -29,7 +29,8 @@ struct audio_output_plugin;
...
@@ -29,7 +29,8 @@ struct audio_output_plugin;
struct
audio_format
;
struct
audio_format
;
struct
tag
;
struct
tag
;
int
audio_output_init
(
struct
audio_output
*
,
ConfigParam
*
param
);
int
audio_output_init
(
struct
audio_output
*
,
struct
config_param
*
param
);
bool
bool
audio_output_open
(
struct
audio_output
*
audioOutput
,
audio_output_open
(
struct
audio_output
*
audioOutput
,
...
...
src/output_init.c
View file @
4d472c26
...
@@ -38,11 +38,12 @@
...
@@ -38,11 +38,12 @@
if(bp) str = bp->value; \
if(bp) str = bp->value; \
}
}
int
audio_output_init
(
struct
audio_output
*
ao
,
ConfigParam
*
param
)
int
audio_output_init
(
struct
audio_output
*
ao
,
struct
config_param
*
param
)
{
{
const
char
*
name
=
NULL
;
const
char
*
name
=
NULL
;
char
*
format
=
NULL
;
char
*
format
=
NULL
;
BlockP
aram
*
bp
=
NULL
;
struct
block_p
aram
*
bp
=
NULL
;
const
struct
audio_output_plugin
*
plugin
=
NULL
;
const
struct
audio_output_plugin
*
plugin
=
NULL
;
if
(
param
)
{
if
(
param
)
{
...
...
src/path.c
View file @
4d472c26
...
@@ -66,7 +66,8 @@ const char *path_get_fs_charset(void)
...
@@ -66,7 +66,8 @@ const char *path_get_fs_charset(void)
void
path_global_init
(
void
)
void
path_global_init
(
void
)
{
{
ConfigParam
*
fs_charset_param
=
getConfigParam
(
CONF_FS_CHARSET
);
struct
config_param
*
fs_charset_param
=
config_get_param
(
CONF_FS_CHARSET
);
const
char
*
charset
=
NULL
;
const
char
*
charset
=
NULL
;
if
(
fs_charset_param
)
{
if
(
fs_charset_param
)
{
...
...
src/permission.c
View file @
4d472c26
...
@@ -71,7 +71,7 @@ void initPermissions(void)
...
@@ -71,7 +71,7 @@ void initPermissions(void)
{
{
char
*
password
;
char
*
password
;
unsigned
permission
;
unsigned
permission
;
ConfigP
aram
*
param
;
struct
config_p
aram
*
param
;
permission_passwords
=
g_hash_table_new_full
(
g_str_hash
,
g_str_equal
,
permission_passwords
=
g_hash_table_new_full
(
g_str_hash
,
g_str_equal
,
g_free
,
NULL
);
g_free
,
NULL
);
...
@@ -79,7 +79,7 @@ void initPermissions(void)
...
@@ -79,7 +79,7 @@ void initPermissions(void)
permission_default
=
PERMISSION_READ
|
PERMISSION_ADD
|
permission_default
=
PERMISSION_READ
|
PERMISSION_ADD
|
PERMISSION_CONTROL
|
PERMISSION_ADMIN
;
PERMISSION_CONTROL
|
PERMISSION_ADMIN
;
param
=
getNextConfigP
aram
(
CONF_PASSWORD
,
NULL
);
param
=
config_get_next_p
aram
(
CONF_PASSWORD
,
NULL
);
if
(
param
)
{
if
(
param
)
{
permission_default
=
0
;
permission_default
=
0
;
...
@@ -102,10 +102,10 @@ void initPermissions(void)
...
@@ -102,10 +102,10 @@ void initPermissions(void)
g_hash_table_replace
(
permission_passwords
,
g_hash_table_replace
(
permission_passwords
,
password
,
password
,
GINT_TO_POINTER
(
permission
));
GINT_TO_POINTER
(
permission
));
}
while
((
param
=
getNextConfigP
aram
(
CONF_PASSWORD
,
param
)));
}
while
((
param
=
config_get_next_p
aram
(
CONF_PASSWORD
,
param
)));
}
}
param
=
getConfigP
aram
(
CONF_DEFAULT_PERMS
);
param
=
config_get_p
aram
(
CONF_DEFAULT_PERMS
);
if
(
param
)
if
(
param
)
permission_default
=
parsePermissions
(
param
->
value
);
permission_default
=
parsePermissions
(
param
->
value
);
...
...
src/playerData.c
View file @
4d472c26
...
@@ -34,9 +34,9 @@ void initPlayerData(void)
...
@@ -34,9 +34,9 @@ void initPlayerData(void)
float
perc
=
DEFAULT_BUFFER_BEFORE_PLAY
;
float
perc
=
DEFAULT_BUFFER_BEFORE_PLAY
;
char
*
test
;
char
*
test
;
size_t
bufferSize
=
DEFAULT_BUFFER_SIZE
;
size_t
bufferSize
=
DEFAULT_BUFFER_SIZE
;
ConfigP
aram
*
param
;
struct
config_p
aram
*
param
;
param
=
getConfigP
aram
(
CONF_AUDIO_BUFFER_SIZE
);
param
=
config_get_p
aram
(
CONF_AUDIO_BUFFER_SIZE
);
if
(
param
)
{
if
(
param
)
{
bufferSize
=
strtol
(
param
->
value
,
&
test
,
10
);
bufferSize
=
strtol
(
param
->
value
,
&
test
,
10
);
...
@@ -54,7 +54,7 @@ void initPlayerData(void)
...
@@ -54,7 +54,7 @@ void initPlayerData(void)
FATAL
(
"buffer size
\"
%li
\"
is too big
\n
"
,
(
long
)
bufferSize
);
FATAL
(
"buffer size
\"
%li
\"
is too big
\n
"
,
(
long
)
bufferSize
);
}
}
param
=
getConfigP
aram
(
CONF_BUFFER_BEFORE_PLAY
);
param
=
config_get_p
aram
(
CONF_BUFFER_BEFORE_PLAY
);
if
(
param
)
{
if
(
param
)
{
perc
=
strtod
(
param
->
value
,
&
test
);
perc
=
strtod
(
param
->
value
,
&
test
);
...
...
src/playlist.c
View file @
4d472c26
...
@@ -120,7 +120,7 @@ static void incrPlaylistCurrent(void)
...
@@ -120,7 +120,7 @@ static void incrPlaylistCurrent(void)
void
initPlaylist
(
void
)
void
initPlaylist
(
void
)
{
{
char
*
test
;
char
*
test
;
ConfigP
aram
*
param
;
struct
config_p
aram
*
param
;
int
value
;
int
value
;
g_rand
=
g_rand_new
();
g_rand
=
g_rand_new
();
...
@@ -132,7 +132,7 @@ void initPlaylist(void)
...
@@ -132,7 +132,7 @@ void initPlaylist(void)
playlist
.
queued
=
-
1
;
playlist
.
queued
=
-
1
;
playlist
.
current
=
-
1
;
playlist
.
current
=
-
1
;
param
=
getConfigP
aram
(
CONF_MAX_PLAYLIST_LENGTH
);
param
=
config_get_p
aram
(
CONF_MAX_PLAYLIST_LENGTH
);
if
(
param
)
{
if
(
param
)
{
playlist_max_length
=
strtol
(
param
->
value
,
&
test
,
10
);
playlist_max_length
=
strtol
(
param
->
value
,
&
test
,
10
);
...
...
src/replay_gain.c
View file @
4d472c26
...
@@ -38,7 +38,7 @@ static float replay_gain_preamp = 1.0;
...
@@ -38,7 +38,7 @@ static float replay_gain_preamp = 1.0;
void
replay_gain_global_init
(
void
)
void
replay_gain_global_init
(
void
)
{
{
ConfigParam
*
param
=
getConfigP
aram
(
CONF_REPLAYGAIN
);
struct
config_param
*
param
=
config_get_p
aram
(
CONF_REPLAYGAIN
);
if
(
!
param
)
if
(
!
param
)
return
;
return
;
...
@@ -52,7 +52,7 @@ void replay_gain_global_init(void)
...
@@ -52,7 +52,7 @@ void replay_gain_global_init(void)
param
->
value
,
param
->
line
);
param
->
value
,
param
->
line
);
}
}
param
=
getConfigP
aram
(
CONF_REPLAYGAIN_PREAMP
);
param
=
config_get_p
aram
(
CONF_REPLAYGAIN_PREAMP
);
if
(
param
)
{
if
(
param
)
{
char
*
test
;
char
*
test
;
...
...
src/state_file.c
View file @
4d472c26
...
@@ -43,7 +43,7 @@ static const char *sfpath;
...
@@ -43,7 +43,7 @@ static const char *sfpath;
static
void
get_state_file_path
(
void
)
static
void
get_state_file_path
(
void
)
{
{
ConfigP
aram
*
param
;
struct
config_p
aram
*
param
;
if
(
sfpath
)
if
(
sfpath
)
return
;
return
;
param
=
parseConfigFilePath
(
CONF_STATE_FILE
,
0
);
param
=
parseConfigFilePath
(
CONF_STATE_FILE
,
0
);
...
...
src/tag.c
View file @
4d472c26
...
@@ -69,7 +69,7 @@ void tag_lib_init(void)
...
@@ -69,7 +69,7 @@ void tag_lib_init(void)
char
*
temp
;
char
*
temp
;
char
*
s
;
char
*
s
;
char
*
c
;
char
*
c
;
ConfigP
aram
*
param
;
struct
config_p
aram
*
param
;
int
i
;
int
i
;
/* parse the "metadata_to_use" config parameter below */
/* parse the "metadata_to_use" config parameter below */
...
@@ -77,7 +77,7 @@ void tag_lib_init(void)
...
@@ -77,7 +77,7 @@ void tag_lib_init(void)
memset
(
ignoreTagItems
,
0
,
TAG_NUM_OF_ITEM_TYPES
);
memset
(
ignoreTagItems
,
0
,
TAG_NUM_OF_ITEM_TYPES
);
ignoreTagItems
[
TAG_ITEM_COMMENT
]
=
1
;
/* ignore comments by default */
ignoreTagItems
[
TAG_ITEM_COMMENT
]
=
1
;
/* ignore comments by default */
param
=
getConfigP
aram
(
CONF_METADATA_TO_USE
);
param
=
config_get_p
aram
(
CONF_METADATA_TO_USE
);
if
(
!
param
)
if
(
!
param
)
return
;
return
;
...
...
src/utils.c
View file @
4d472c26
...
@@ -65,7 +65,7 @@ char *parsePath(char *path)
...
@@ -65,7 +65,7 @@ char *parsePath(char *path)
const
char
*
home
;
const
char
*
home
;
if
(
path
[
1
]
==
'/'
||
path
[
1
]
==
'\0'
)
{
if
(
path
[
1
]
==
'/'
||
path
[
1
]
==
'\0'
)
{
ConfigParam
*
param
=
getConfigP
aram
(
CONF_USER
);
struct
config_param
*
param
=
config_get_p
aram
(
CONF_USER
);
if
(
param
&&
param
->
value
)
{
if
(
param
&&
param
->
value
)
{
struct
passwd
*
passwd
=
getpwnam
(
param
->
value
);
struct
passwd
*
passwd
=
getpwnam
(
param
->
value
);
if
(
!
passwd
)
{
if
(
!
passwd
)
{
...
...
src/volume.c
View file @
4d472c26
...
@@ -50,22 +50,22 @@ void volume_finish(void)
...
@@ -50,22 +50,22 @@ void volume_finish(void)
static
void
static
void
mixer_reconfigure
(
char
*
driver
)
mixer_reconfigure
(
char
*
driver
)
{
{
ConfigP
aram
*
newparam
,
*
param
;
struct
config_p
aram
*
newparam
,
*
param
;
//create parameter list
//create parameter list
newparam
=
newConfigParam
(
NULL
,
-
1
);
newparam
=
newConfigParam
(
NULL
,
-
1
);
param
=
getConfigP
aram
(
CONF_MIXER_DEVICE
);
param
=
config_get_p
aram
(
CONF_MIXER_DEVICE
);
if
(
param
)
{
if
(
param
)
{
g_warning
(
"deprecated option mixer_device found, translating to %s config section
\n
"
,
driver
);
g_warning
(
"deprecated option mixer_device found, translating to %s config section
\n
"
,
driver
);
addBlockParam
(
newparam
,
"mixer_device"
,
param
->
value
,
-
1
);
addBlockParam
(
newparam
,
"mixer_device"
,
param
->
value
,
-
1
);
}
}
param
=
getConfigP
aram
(
CONF_MIXER_CONTROL
);
param
=
config_get_p
aram
(
CONF_MIXER_CONTROL
);
if
(
param
)
{
if
(
param
)
{
g_warning
(
"deprecated option mixer_control found, translating to %s config section
\n
"
,
driver
);
g_warning
(
"deprecated option mixer_control found, translating to %s config section
\n
"
,
driver
);
addBlockParam
(
newparam
,
"mixer_control"
,
param
->
value
,
-
1
);
addBlockParam
(
newparam
,
"mixer_control"
,
param
->
value
,
-
1
);
}
}
if
(
newparam
->
num
berOfBlockP
arams
>
0
)
{
if
(
newparam
->
num
_block_p
arams
>
0
)
{
//call configure method of corrensponding mixer
//call configure method of corrensponding mixer
if
(
!
mixer_configure_legacy
(
driver
,
newparam
))
{
if
(
!
mixer_configure_legacy
(
driver
,
newparam
))
{
g_error
(
"Using mixer_type '%s' with not enabled %s output"
,
driver
,
driver
);
g_error
(
"Using mixer_type '%s' with not enabled %s output"
,
driver
,
driver
);
...
@@ -77,7 +77,7 @@ mixer_reconfigure(char *driver)
...
@@ -77,7 +77,7 @@ mixer_reconfigure(char *driver)
void
volume_init
(
void
)
void
volume_init
(
void
)
{
{
ConfigParam
*
param
=
getConfigP
aram
(
CONF_MIXER_TYPE
);
struct
config_param
*
param
=
config_get_p
aram
(
CONF_MIXER_TYPE
);
//hw mixing is by default
//hw mixing is by default
if
(
param
)
{
if
(
param
)
{
if
(
strcmp
(
param
->
value
,
VOLUME_MIXER_SOFTWARE
)
==
0
)
{
if
(
strcmp
(
param
->
value
,
VOLUME_MIXER_SOFTWARE
)
==
0
)
{
...
...
src/zeroconf.c
View file @
4d472c26
...
@@ -35,7 +35,7 @@ static int zeroconfEnabled;
...
@@ -35,7 +35,7 @@ static int zeroconfEnabled;
void
initZeroconf
(
void
)
void
initZeroconf
(
void
)
{
{
const
char
*
serviceName
=
SERVICE_NAME
;
const
char
*
serviceName
=
SERVICE_NAME
;
ConfigP
aram
*
param
;
struct
config_p
aram
*
param
;
zeroconfEnabled
=
getBoolConfigParam
(
CONF_ZEROCONF_ENABLED
,
1
);
zeroconfEnabled
=
getBoolConfigParam
(
CONF_ZEROCONF_ENABLED
,
1
);
if
(
zeroconfEnabled
==
CONF_BOOL_UNSET
)
if
(
zeroconfEnabled
==
CONF_BOOL_UNSET
)
...
@@ -44,7 +44,7 @@ void initZeroconf(void)
...
@@ -44,7 +44,7 @@ void initZeroconf(void)
if
(
!
zeroconfEnabled
)
if
(
!
zeroconfEnabled
)
return
;
return
;
param
=
getConfigP
aram
(
CONF_ZEROCONF_NAME
);
param
=
config_get_p
aram
(
CONF_ZEROCONF_NAME
);
if
(
param
&&
*
param
->
value
!=
0
)
if
(
param
&&
*
param
->
value
!=
0
)
serviceName
=
param
->
value
;
serviceName
=
param
->
value
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment