From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Tue, 9 Aug 2022 13:18:53 +0000 (+0100) Subject: Merge other enhancements. X-Git-Tag: 4.1-rc1~24^2~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05dfcdfd6aadc23a74545ad91a3ae247a11d9851;p=thirdparty%2Fshairport-sync.git Merge other enhancements. --- 05dfcdfd6aadc23a74545ad91a3ae247a11d9851 diff --cc dbus-service.c index e72e5a9c,05dd9726..c68aac9b --- a/dbus-service.c +++ b/dbus-service.c @@@ -571,25 -571,6 +571,25 @@@ gboolean notify_drift_tolerance_callbac return TRUE; } +gboolean notify_volume_callback(ShairportSync *skeleton, + __attribute__((unused)) gpointer user_data) { + gdouble iv = shairport_sync_get_volume(skeleton); + if (((iv >= -30.0) && (iv <= 0.0)) || (iv == -144.0)) { - debug(1, ">> setting volume to %6.3f.", iv); ++ debug(2, ">> setting volume to %7.4f.", iv); + + lock_player(); + config.airplay_volume = iv; + if (playing_conn != NULL) + player_volume(iv, playing_conn); + unlock_player(); + + } else { + debug(1, ">> invalid volume: %f. Ignored.", iv); + shairport_sync_set_volume(skeleton, config.airplay_volume); + } + return TRUE; +} + gboolean notify_disable_standby_mode_callback(ShairportSync *skeleton, __attribute__((unused)) gpointer user_data) { char *th = (char *)shairport_sync_get_disable_standby_mode(skeleton);