The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Thank you for your donation!


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


Receive is Webradio playing
#1
Hi all,

I have succesfully set up Apple remote to control moode. This remote has one button for play/stop. I use commad mpc toggle.
It works fine but for webradios is better stop then pause as GUI does. My approach is:
Code:
http=$(echo -e "currentsong\nclose" | nc localhost 6600 | grep file: | sed 's/file: //' | cut -c -4)
status=$(echo -e "status\nclose" | nc localhost 6600 | grep state: | sed 's/state: //')
if [ "$http" == 'http' ] && [ "$status" == 'play' ]; then # radio
    mpc stop
else
    mpc toggle
fi
If the filename of a playing track starts with 'http' it is webradio. I am affraid it can catch tidal. For tidal is pause better then stop.

Is any way how to execute GUI commands. Something like:
Code:
curl "http://127.0.0.1/commands.php/?cmd=play"
Reply


Messages In This Thread
Receive is Webradio playing - by mezcal - 07-22-2018, 06:12 AM
RE: Receive is Webradio playing - by Tim Curtis - 07-22-2018, 05:46 PM
RE: Receive is Webradio playing - by Tim Curtis - 07-22-2018, 07:06 PM
RE: Receive is Webradio playing - by mezcal - 07-22-2018, 08:26 PM

Forum Jump: