You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: amplipi/ctrl.py
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -850,14 +850,16 @@ def set_vol():
850
850
vol, vol_f, vol_f_delta, vol_min, or vol_max.
851
851
"""
852
852
# Field precedence: vol (db) > vol_delta > vol (float)
853
-
# vol (db) is first in precedence yet last in the stack to cover the default case of a None volume change, but when it does have a value it overrides the other options
853
+
# vol (db) is first in precedence yet last in the stack to cover the default case of no volume change
zone.vol_f_overflow=0ifmodels.MIN_VOL_F<expected_vol_totalandexpected_vol_total<models.MAX_VOL_Felseutils.clamp((expected_vol_total-vol_f_new), models.MIN_VOL_F_OVERFLOW, models.MAX_VOL_F_OVERFLOW) # Clamp the remaining delta to be between -1 and 1
# Clamp the remaining delta to be between -1 and 1
861
863
862
864
elifupdate.vol_fisnotNoneandupdate.volisNone:
863
865
clamp_vol_f=utils.clamp(vol_f, 0, 1)
@@ -874,8 +876,8 @@ def set_vol():
874
876
else:
875
877
raiseException('unable to update zone volume')
876
878
877
-
# If the change made vol f be between the min and max, delete the overflow
878
-
# This is useful so that you can click wherever you want on the volume bar and expect it to end up there without rubberbanding back to whatever vol_f + vol_f_overflow value you'd otherwise be at
879
+
# Reset the overflow when vol_f goes in bounds, there is no longer an overflow
0 commit comments