Skip to content

Commit 1273ece

Browse files
committed
Add a "volume_control_type" setting to the configuration file. Zero hides or disables the control in the player.
1 parent 454a26f commit 1273ece

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

scripts/shairport-sync.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ general =
6666
// If you build Shairport Sync with the flag --with-ffmpeg, the FFmpeg ALAC decoder will be chosen by default. This is recommended except where there is insufficient storage on the device. With this setting, the Hammerton decoder will not be built.
6767
// In AirPlay 2 operation, the FFmpeg ALAC decoder is always used.
6868
// ignore_volume_control = "no"; // set this to "yes" if you want the volume to be at 100% no matter what the source's volume control is set to.
69+
// volume_control_type = 3; // this experimental setting affects the volume control in unclear ways. Set it to 0 to hide or disable the volume control in the player. (AirPlay 2 only.)
6970
// volume_range_db = 60 ; // use this advanced setting to set the range, in dB, you want between the maximum volume and the minimum volume. Range is 30 to 150 dB. Leave it commented out to use mixer's native range.
7071
// volume_max_db = 0.0 ; // use this advanced setting, which must have a decimal point in it, to set the maximum volume, in dB, you wish to use.
7172
// The setting is for the hardware mixer, if chosen, or the software mixer otherwise. The value must be in the mixer's range (0.0 to -96.2 for the software mixer).

shairport.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,14 @@ int parse_options(int argc, char **argv) {
978978
warn("The default airplay volume setting must be between -30.0 and 0.0.");
979979
}
980980
}
981+
982+
#ifdef CONFIG_AIRPLAY_2
983+
/* Get the optional volume_control_type setting. */
984+
if (config_lookup_int(config.cfg, "general.volume_control_type", &value)) {
985+
// debug(1, "Max volume setting of %f dB", dvalue);
986+
config.volumeControlType = value;
987+
}
988+
#endif
981989

982990
if (config_lookup_non_empty_string(config.cfg, "general.run_this_when_volume_is_set", &str)) {
983991
config.cmd_set_volume = (char *)str;

0 commit comments

Comments
 (0)