[raop] Add option to exclude particular devices from speaker list

This commit is contained in:
ejurgensen 2017-03-12 22:11:56 +01:00
parent ef13abe2cf
commit fce68ebd1a
3 changed files with 13 additions and 0 deletions

View File

@ -202,6 +202,10 @@ audio {
# you can set a lower value here
# max_volume = 11
# Enable this option to exclude a particular AirPlay device from the
# speaker list
# exclude = false
# AirPlay password
# password = "s1kr3t"
#}

View File

@ -109,6 +109,7 @@ static cfg_opt_t sec_audio[] =
static cfg_opt_t sec_airplay[] =
{
CFG_INT("max_volume", 11, CFGF_NONE),
CFG_BOOL("exclude", cfg_false, CFGF_NONE),
CFG_STR("password", NULL, CFGF_NONE),
CFG_END()
};

View File

@ -4009,6 +4009,14 @@ raop_device_cb(const char *name, const char *type, const char *domain, const cha
DPRINTF(E_DBG, L_RAOP, "Event for AirPlay device %s (port %d, id %" PRIx64 ")\n", at_name, port, id);
airplay = cfg_gettsec(cfg, "airplay", at_name);
if (airplay && cfg_getbool(airplay, "exclude"))
{
DPRINTF(E_LOG, L_RAOP, "Excluding AirPlay device '%s' as set in config\n", at_name);
return;
}
rd = calloc(1, sizeof(struct output_device));
if (!rd)
{