Thank you for your donation!


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


How to attach MOCP player, instead of MPD?
#2
If you turn on the metadata file in System config it will be updated after at most 3 seconds whenever current song metadata, volume, play state etc changes.

Example contents:
Code:
pi@rp3:~ $ cat /var/local/www/currentsong.txt
file=http://aac-64.streamthejazzgroove.com:80/stream
artist=Radio station
album=The Jazz Groove
title=Antonio Carlos Jobim - O Morro Nao Tem Vez
coverurl=images/radio-logos/The Jazz Groove.jpg
track=
date=
composer=
encoded=VBR
bitrate=59 kbps
outrate=16 bit, 44.1 kHz, Stereo, 1.411 mbps
volume=20
mute=0
state=play

You could also turn on the LCD updater engine and enter the path to a user-written script that parses currentsong.txt and does things based on the contents. The script doesn't have to update an LCD, it could for example send commands to another program.

The advantage of using the LCD updater engine to fire the script rather than having a stand-alone script with its own polling loop for detecting changes in currentsong.txt is that the LCD updater uses a very efficient inotifywait event mechanism and thus no polling loop :-) It only fires the script when currentsong.txt has been changed.

If you turn it on and don't specify a script it will by default create and update a file named /home/pi/lcd.txt

-Tim
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Messages In This Thread
RE: How to attach MOCP player, instead of MPD? - by Tim Curtis - 10-04-2018, 06:05 PM

Forum Jump: