Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Rotary encoder guru ?
#5
You could also replace contents of /var/www/command/rotvol.sh with the streamlined moOde 4.3 version below for slightly better performance.

Code:
#!/bin/bash
# moOde audio player (C) 2014 Tim Curtis, GPLv3, moOde 4.3
VOLKNOB=$(sqlite3 /var/local/www/db/moode-sqlite3.db "select value from cfg_system where id='32'")
if [[ $1 = "up" ]]; then LEVEL=$(($VOLKNOB + $2)); elif [[ $1 = "dn" ]]; then LEVEL=$(($VOLKNOB - $2)); fi
if (( $LEVEL < 0 )); then LEVEL=0; elif (( $LEVEL > 100 )); then LEVEL=100; fi
sqlite3 /var/local/www/db/moode-sqlite3.db "update cfg_system set value=$LEVEL where id='32'"
mpc volume $LEVEL >/dev/null
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Messages In This Thread
Rotary encoder guru ? - by DRONE7 - 09-06-2018, 06:43 AM
RE: Rotary encoder guru ? - by AnnaBlume - 09-06-2018, 09:50 AM
RE: Rotary encoder guru ? - by AnnaBlume - 09-06-2018, 01:13 PM
RE: Rotary encoder guru ? - by Tim Curtis - 09-06-2018, 11:40 PM
RE: Rotary encoder guru ? - by Tim Curtis - 09-07-2018, 01:13 AM
RE: Rotary encoder guru ? - by DRONE7 - 09-07-2018, 03:18 AM
RE: Rotary encoder guru ? - by Tim Curtis - 09-07-2018, 03:42 AM
RE: Rotary encoder guru ? - by fedormil - 09-14-2018, 03:29 AM
RE: Rotary encoder guru ? - by Tim Curtis - 09-14-2018, 04:35 PM
RE: Rotary encoder guru ? - by fedormil - 09-14-2018, 07:01 PM
RE: Rotary encoder guru ? - by Zootalaws - 09-12-2020, 11:43 PM
RE: Rotary encoder guru ? - by Johnathan W. - 02-27-2024, 04:51 PM
RE: Rotary encoder guru ? - by v12nut - 03-03-2024, 12:06 PM
RE: Rotary encoder guru ? - by the_bertrum - 03-04-2024, 09:31 AM
RE: Rotary encoder guru ? - by Johnathan W. - 03-05-2024, 05:09 AM
RE: Rotary encoder guru ? - by the_bertrum - 03-05-2024, 07:51 AM
RE: Rotary encoder guru ? - by steve4star - 03-05-2024, 08:03 AM

Forum Jump: