Thank you for your donation!


Problem: Rotary encoder ignores "Max MPD volume"
#2
I am able to repro. This is fixed for upcoming moOde 6.6.0 release.

You can also try adding the fixes manually by editing the file /usr/local/bin/rotenc. The adds are in red below

# Update MPD and UI volume
def update_volume(direction, step):
db_cursor.execute("SELECT value FROM cfg_system WHERE param='volknob' or param='volume_mpd_max'")
row = db_cursor.fetchone()
current_vol = int(row['value'])
row = db_cursor.fetchone()
volume_mpd_max = int(row['value'])

if direction == "+":
    new_volume = current_vol + step
else:
    new_volume = current_vol - step

if new_volume > volume_mpd_max:
    new_volume = volume_mpd_max

if new_volume > 100:
    new_volume = 100
elif new_volume < 0:
    new_volume = 0

db_cursor.execute("UPDATE cfg_system SET value='" + str(new_volume) + "' WHERE param='volknob'")
db.commit()

mpd_cli.connect()
mpd_cli.setvol(new_volume)
Reply


Messages In This Thread
RE: Rotary encoder ignores "Max MPD volume" - by Tim Curtis - 06-29-2020, 12:22 PM

Forum Jump: