Thank you for your donation!


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


Run Script with play button (yet another...)
#5
Hello again,

the good thing first: The script is now getting started, when I choose a radio station, great!
So thanks again for your patience and help.


But I haven't thought about a few things:
- When I have chosen a radio station and change it to another, the script of course gets started again because of the "clearplay" command.

That's why I created my own php script and included it in the index.php as well as in the moode.php.
The problem is that I don't have a variable, where I can store the "playing" state so that changing the radio station doesn't trigger the startup script of the amplifier again.

I've tried it with the global super variable in php as well as with a static local variable inside my php switch function (which calls the actual python script).
None of my attempts worked :-(. I've to also admit that I'm in no way experienced in php. Confused

My ultimate goal is to achieve the following:
When choosing a radio station or hitting the play button, start up the amplifier via script. Do not run the script again, when a radio station is already playing.
When hitting the pause/stop button, start a timer (for example 20 seconds). If the 20 seconds are over, call a shutdown script for the amplifier.
If another play request within the 20 seconds occurs, do not shut down the amplifier.


I was thinking about a thread in php for the timer part but I'm worried that it might end in the same way as it does for the "playing" state - that this state/variable is not visible or readable when another event (play/stop) occurs. Huh

I hope someone can understand what I'm trying to do/build. Also I'd be very very happy, if someone could help me partly out!

Thanks everyone - especially Tim! :-)

Regards
Matthias
Reply


Messages In This Thread
RE: Run Script with play button (yet another...) - by MattOff491 - 10-19-2019, 08:13 PM

Forum Jump: