return TRUE;
}
- debug(1, ">> setting volume to %6.3f.", iv);
+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(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);