Moode Forum
[PROBLEM] Execute python on Play,Stop,ffw,... - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7)
+--- Thread: [PROBLEM] Execute python on Play,Stop,ffw,... (/showthread.php?tid=2407)



Execute python on Play,Stop,ffw,... - angus1071 - 04-22-2020

I build a small chest with with Raspberry, amplifer with speakers and LEDs. If I use a remote control or a GPIO-button to start PLAY or any other command so I can start a python-script additionally - so my LEDs blink or are enlightened in a special way to the command. 
But if I use just the website this is not possible to add any additional command.  Where or in which file could I enable or add the commands?


RE: Execute python on Play,Stop,ffw,... - Tim Curtis - 04-22-2020

Do you just want to trap play/pause/next/previous?


RE: Execute python on Play,Stop,ffw,... - angus1071 - 04-22-2020

play/pause/next/previous/stop and vol up/down

example 

http://landing.a-chor.de/2020-04-22_15_43_36.gif

http://landing.a-chor.de/2020-04-22_16_03_14.gif


RE: Execute python on Play,Stop,ffw,... - Tim Curtis - 04-22-2020

For play/pause/next/previous/stop
/var/www/command/index.php

For volume
/var/www/command/moode.php

Note that the UI only sends the new volume level to the back-end. It does not also send the UI event the changed the volume for example +/- or tap the volume slider.


RE: Execute python on Play,Stop,ffw,... - angus1071 - 04-22-2020

got the command, but I don't know how to integrate......

echo(exec('python /home/pi/stop.py 2>&1'));
echo(exec('python /home/pi/play.py 2>&1'));