config.cfg = &config_file_stuff;
/* Get the Service Name. */
- if (config_lookup_string(config.cfg, "general.name", &str)) {
+ if (config_lookup_non_empty_string(config.cfg, "general.name", &str)) {
raw_service_name = (char *)str;
}
#ifdef CONFIG_LIBDAEMON
&daemonisewithout);
/* Get the directory path for the pid file created when the program is daemonised. */
- if (config_lookup_string(config.cfg, "sessioncontrol.daemon_pid_dir", &str))
+ if (config_lookup_non_empty_string(config.cfg, "sessioncontrol.daemon_pid_dir", &str))
config.piddir = (char *)str;
#endif
/* Get the mdns_backend setting. */
- if (config_lookup_string(config.cfg, "general.mdns_backend", &str))
+ if (config_lookup_non_empty_string(config.cfg, "general.mdns_backend", &str))
config.mdns_name = (char *)str;
/* Get the output_backend setting. */
- if (config_lookup_string(config.cfg, "general.output_backend", &str))
+ if (config_lookup_non_empty_string(config.cfg, "general.output_backend", &str))
config.output_name = (char *)str;
/* Get the port setting. */
}
/* Get the password setting. */
- if (config_lookup_string(config.cfg, "general.password", &str))
+ if (config_lookup_non_empty_string(config.cfg, "general.password", &str))
config.password = (char *)str;
if (config_lookup_string(config.cfg, "general.interpolation", &str)) {
}
}
- if (config_lookup_string(config.cfg, "general.run_this_when_volume_is_set", &str)) {
+ if (config_lookup_non_empty_string(config.cfg, "general.run_this_when_volume_is_set", &str)) {
config.cmd_set_volume = (char *)str;
}
/* Get the interface to listen on, if specified Default is all interfaces */
/* we keep the interface name and the index */
- if (config_lookup_string(config.cfg, "general.interface", &str))
- config.interface = strdup(str);
-
if (config_lookup_string(config.cfg, "general.interface", &str)) {
+ config.interface = strdup(str);
config.interface_index = if_nametoindex(config.interface);
if (config.interface_index == 0) {
/* Get the regtype -- the service type and protocol, separated by a dot. Default is
* "_raop._tcp" */
- if (config_lookup_string(config.cfg, "general.regtype", &str))
+ if (config_lookup_non_empty_string(config.cfg, "general.regtype", &str))
config.regtype = strdup(str);
/* Get the volume range, in dB, that should be used If not set, it means you just use the
str);
}
- if (config_lookup_string(config.cfg, "metadata.pipe_name", &str)) {
+ if (config_lookup_non_empty_string(config.cfg, "metadata.pipe_name", &str)) {
config.metadata_pipename = (char *)str;
}
config.metadata_progress_interval = dvalue;
}
- if (config_lookup_string(config.cfg, "metadata.socket_address", &str)) {
+ if (config_lookup_non_empty_string(config.cfg, "metadata.socket_address", &str)) {
config.metadata_sockaddr = (char *)str;
}
if (config_lookup_int(config.cfg, "metadata.socket_port", &value)) {
#endif
#ifdef CONFIG_METADATA_HUB
- if (config_lookup_string(config.cfg, "metadata.cover_art_cache_directory", &str)) {
+ if (config_lookup_non_empty_string(config.cfg, "metadata.cover_art_cache_directory", &str)) {
config.cover_art_cache_dir = (char *)str;
}
}
#endif
- if (config_lookup_string(config.cfg, "sessioncontrol.run_this_before_play_begins", &str)) {
+ if (config_lookup_non_empty_string(config.cfg, "sessioncontrol.run_this_before_play_begins", &str)) {
config.cmd_start = (char *)str;
}
- if (config_lookup_string(config.cfg, "sessioncontrol.run_this_after_play_ends", &str)) {
+ if (config_lookup_non_empty_string(config.cfg, "sessioncontrol.run_this_after_play_ends", &str)) {
config.cmd_stop = (char *)str;
}
- if (config_lookup_string(config.cfg, "sessioncontrol.run_this_before_entering_active_state",
+ if (config_lookup_non_empty_string(config.cfg, "sessioncontrol.run_this_before_entering_active_state",
&str)) {
config.cmd_active_start = (char *)str;
}
- if (config_lookup_string(config.cfg, "sessioncontrol.run_this_after_exiting_active_state",
+ if (config_lookup_non_empty_string(config.cfg, "sessioncontrol.run_this_after_exiting_active_state",
&str)) {
config.cmd_active_stop = (char *)str;
}
config.active_state_timeout = dvalue;
}
- if (config_lookup_string(config.cfg,
+ if (config_lookup_non_empty_string(config.cfg,
"sessioncontrol.run_this_if_an_unfixable_error_is_detected", &str)) {
config.cmd_unfixable = (char *)str;
}
die("dsp.convolution_max_length must be within 1 and 200000");
}
- if (config_lookup_string(config.cfg, "dsp.convolution_ir_file", &str)) {
+ if (config_lookup_non_empty_string(config.cfg, "dsp.convolution_ir_file", &str)) {
config.convolution_ir_file = strdup(str);
config.convolver_valid =
convolver_init(config.convolution_ir_file, config.convolution_max_length);
dvalue);
}
- if (config.loudness == 1 && config_lookup_string(config.cfg, "alsa.mixer_control_name", &str))
+ if (config.loudness == 1 && config_lookup_non_empty_string(config.cfg, "alsa.mixer_control_name", &str))
die("Loudness activated but hardware volume is active. You must remove "
"\"alsa.mixer_control_name\" to use the loudness filter.");
if (config.mqtt_enabled && !config.metadata_enabled) {
die("You need to have metadata enabled in order to use mqtt");
}
- if (config_lookup_string(config.cfg, "mqtt.hostname", &str)) {
+ if (config_lookup_non_empty_string(config.cfg, "mqtt.hostname", &str)) {
config.mqtt_hostname = (char *)str;
// TODO: Document that, if this is false, whole mqtt func is disabled
}
config.mqtt_port = value;
}
- if (config_lookup_string(config.cfg, "mqtt.username", &str)) {
+ if (config_lookup_non_empty_string(config.cfg, "mqtt.username", &str)) {
config.mqtt_username = (char *)str;
}
- if (config_lookup_string(config.cfg, "mqtt.password", &str)) {
+ if (config_lookup_non_empty_string(config.cfg, "mqtt.password", &str)) {
config.mqtt_password = (char *)str;
}
int capath = 0;
- if (config_lookup_string(config.cfg, "mqtt.capath", &str)) {
+ if (config_lookup_non_empty_string(config.cfg, "mqtt.capath", &str)) {
config.mqtt_capath = (char *)str;
capath = 1;
}
- if (config_lookup_string(config.cfg, "mqtt.cafile", &str)) {
+ if (config_lookup_non_empty_string(config.cfg, "mqtt.cafile", &str)) {
if (capath)
die("Supply either mqtt cafile or mqtt capath -- you have supplied both!");
config.mqtt_cafile = (char *)str;
}
int certkeynum = 0;
- if (config_lookup_string(config.cfg, "mqtt.certfile", &str)) {
+ if (config_lookup_non_empty_string(config.cfg, "mqtt.certfile", &str)) {
config.mqtt_certfile = (char *)str;
certkeynum++;
}
- if (config_lookup_string(config.cfg, "mqtt.keyfile", &str)) {
+ if (config_lookup_non_empty_string(config.cfg, "mqtt.keyfile", &str)) {
config.mqtt_keyfile = (char *)str;
certkeynum++;
}
"If you do not want to use TLS Client Authentication, leave both empty.");
}
- if (config_lookup_string(config.cfg, "mqtt.topic", &str)) {
+ if (config_lookup_non_empty_string(config.cfg, "mqtt.topic", &str)) {
config.mqtt_topic = (char *)str;
}
config_set_lookup_bool(config.cfg, "mqtt.publish_raw", &config.mqtt_publish_raw);
}
config_set_lookup_bool(config.cfg, "mqtt.enable_autodiscovery",
&config.mqtt_enable_autodiscovery);
- if (config_lookup_string(config.cfg, "mqtt.autodiscovery_prefix", &str)) {
+ if (config_lookup_non_empty_string(config.cfg, "mqtt.autodiscovery_prefix", &str)) {
config.mqtt_autodiscovery_prefix = (char *)str;
}
config_set_lookup_bool(config.cfg, "mqtt.enable_remote", &config.mqtt_enable_remote);
- if (config_lookup_string(config.cfg, "mqtt.empty_payload_substitute", &str)) {
+ if (config_lookup_non_empty_string(config.cfg, "mqtt.empty_payload_substitute", &str)) {
if (strlen(str) == 0)
config.mqtt_empty_payload_substitute = NULL;
else
}
}
- if ((config.cfg != NULL) && (config_lookup_string(config.cfg, "general.mixdown", &str))) {
+ if ((config.cfg != NULL) && (config_lookup_non_empty_string(config.cfg, "general.mixdown", &str))) {
if ((strcasecmp(str, "off") == 0) || (strcasecmp(str, "no") == 0)) {
config.mixdown_enable = 0; // 0 on initialisation
debug(1, "mixdown disabled.", str);
const char *str;
if ((config.cfg != NULL) &&
- (config_lookup_string(config.cfg, "general.eight_channel_mode", &str))) {
+ (config_lookup_non_empty_string(config.cfg, "general.eight_channel_mode", &str))) {
if ((strcasecmp(str, "off") == 0) || (strcasecmp(str, "no") == 0)) {
config.eight_channel_layout = 0; // 0 on initialisation
} else if ((strcasecmp(str, "on") == 0) || (strcasecmp(str, "yes") == 0)) {
}
if ((config.cfg != NULL) &&
- (config_lookup_string(config.cfg, "general.six_channel_mode", &str))) {
+ (config_lookup_non_empty_string(config.cfg, "general.six_channel_mode", &str))) {
if ((strcasecmp(str, "off") == 0) || (strcasecmp(str, "no") == 0)) {
config.six_channel_layout = 0; // 0 on initialisation
} else if ((strcasecmp(str, "on") == 0) || (strcasecmp(str, "yes") == 0)) {
}
}
- if ((config.cfg != NULL) && (config_lookup_string(config.cfg, "general.mixdown", &str))) {
+ if ((config.cfg != NULL) && (config_lookup_non_empty_string(config.cfg, "general.mixdown", &str))) {
if ((strcasecmp(str, "off") == 0) || (strcasecmp(str, "no") == 0)) {
config.mixdown_enable = 0; // 0 on initialisation
} else if (strcasecmp(str, "auto") == 0) {