Re: [mpg123-users] How to use a play list in remote mode?
Brought to you by:
sobukus
From: Thomas O. <tho...@or...> - 2025-04-03 18:04:13
|
Am Thu, 3 Apr 2025 01:19:09 -0500 schrieb Seamus de Mora <sea...@gm...>: > > So - is there no possibility to use the 'PAUSE/P: pause playback' command > from the remote? What is missing is the playlist handling in remote mode. Or the remote mode in the normal operation. But then … as you are not interested in responses, you can simply automate the normal terminal control using socat with pty. For example this command line (sleep 3; echo ' '; sleep 3; echo ' '; sleep 3) \ | socat - "EXEC:mpg123 -q --random -@ test.m3u",pty,ctty,stderr (without the leading tabs, of course) will open the playlist test.m3u and then play for 3 seconds, then pause for 3 seconds, then play for 3 seconds and quit because the input stream to socat ended. Your task would be to write the script before the | socat, reacting to your button event (however it arrives in your system) and printing out <space><endofline> each time, instead of printing to the fifo before. This is one option. Another option is a little wrapper over --continue mode that just kills mpg123 and remembers the position, then starts it again. This needs some shell/perl/python programming as glue, but is perfectly doable. > I don't know Thomas... after reading this "terminal mode work-around", I am > feeling a bit confused. If there's no way to simply add an option to the > 'remote-mode' that will play a designated playlist, There is a way, and I might be prompted to program it. But not today. I need to fight for my programming time with real life, like so many others … At least I fixed --random together with --continue in the development trunk now. The socat hack above doesn't need that, though. Some playing around with the Unix toolset should get you there! Alrighty then, Thomas |