Closed Hurricos closed 6 years ago
Wow that's nice! I've had a brief look at the code, and I'll test it ASAP
Not fully tested jet. But as of now, seems perfect. Could you just move out of the config file the "echo" command? it would be better if it was in the service script rather than on the configuration file :)
The idea behind inserting the echo
there was to allow the end-user to possibly further customize the way RDS is generated - for example, by echo
ing and then cut
ting the fields to fit, or using an awk script, or however. That being said, this may be better (possible?) to restrict to printf
(see man printf 1
), which itself has nice conventions for format strings (near-identical to C printf()
). I just haven't figured out the right escape sequence to be able to say rdsPattern='%.8s: %s (%.10s)' $ARTIST_NAME $SONG_NAME $ALBUM_NAME
... this would be easier if it weren't relying on shell evaluation. :(
I'm aware it's a bit overcomplicated of a solution, but the hope is to make it function elegantly for the end user.
Alright I get the cutting and stuff, but couldn't it work it simply was eval echo $PATTERN
in getTitle() or am I missing something?
Afterwards, an advanced user could always append cut
or any other filter to the pattern in configuration file, right?
Yes, that would work fine, but I was imagining to instead do printf $PATTERN
(or eval printf $PATTERN
?), because that is flexible enough, and just about anyone who has a Raspberry Pi should know the C / Python convention of 'format string' $ARG1 $ARG2 $ARG3 ...
Let's just not overcomplicate it for the moment, I like using echo and just sticking with the simple syntax which is more user friendly for the vast majority of standard users. Also, I plan to move the RDS service to a simple thread of the player process in the future, so let's not put too much effort in it. Please revert it back to echo and stuff (leaving echo out of the config file) , and we're done :)
As you wish. End-user can handle what they need (and when the RDS service is running on C++, it can be built with more in mind anyways).
Please test, as I have, at this second, no access to an RDS receiver.
Yup. As of now I'd rather focus on enabling mpradio to communicate with other processes via socket (just like PiFmRds does) which puts the basis for the companion app (server side) and few more nice things!
Tested and merged! thanks for your contribution!
That all makes much more sense now.
I am happy to contribute any way I can to such a useful piece of software.
This update accomplishes the following:
libid3-dev,
for parsing many forms of mp3-metadataps
ps.songName
defaults back tosongname
, so tagless files should behave identically to before.update_now_playing()
now writes what metadata it finds to now_playing in a Bash-readable formatmpradio-legacyRDS.sh
to print information about a song, using a formatting string defined inpirateradio.config