Add logarithmic volume_control_profile mode

This commit is contained in:
dasl-
2023-07-02 09:27:53 -04:00
parent c2abee35d0
commit baf51cf2a7
6 changed files with 47 additions and 2 deletions
+7
View File
@@ -765,6 +765,8 @@ gboolean notify_volume_control_profile_callback(ShairportSync *skeleton,
config.volume_control_profile = VCP_standard;
else if (strcasecmp(th, "flat") == 0)
config.volume_control_profile = VCP_flat;
else if (strcasecmp(th, "logarithmic") == 0)
config.volume_control_profile = VCP_logarithmic;
else {
warn("Unrecognised Volume Control Profile: \"%s\".", th);
switch (config.volume_control_profile) {
@@ -774,6 +776,9 @@ gboolean notify_volume_control_profile_callback(ShairportSync *skeleton,
case VCP_flat:
shairport_sync_set_volume_control_profile(skeleton, "flat");
break;
case VCP_logarithmic:
shairport_sync_set_volume_control_profile(skeleton, "logarithmic");
break;
default:
debug(1, "This should never happen!");
shairport_sync_set_volume_control_profile(skeleton, "standard");
@@ -1065,6 +1070,8 @@ static void on_dbus_name_acquired(GDBusConnection *connection, const gchar *name
if (config.volume_control_profile == VCP_standard)
shairport_sync_set_volume_control_profile(SHAIRPORT_SYNC(shairportSyncSkeleton), "standard");
else if (config.volume_control_profile == VCP_logarithmic)
shairport_sync_set_volume_control_profile(SHAIRPORT_SYNC(shairportSyncSkeleton), "logarithmic");
else
shairport_sync_set_volume_control_profile(SHAIRPORT_SYNC(shairportSyncSkeleton), "flat");