Re: [mpg123-users] How to use a play list in remote mode?
Brought to you by:
sobukus
From: Thomas O. <tho...@or...> - 2025-04-01 10:04:11
|
Am Mon, 31 Mar 2025 20:12:40 -0500 schrieb Seamus de Mora <sea...@gm...>: > Is is accurate to summarize what you've said as follows?: > > - As of today, loop-playing a playlist using the remote mode is not > possible; only the terminal mode can accommodate this. > - Loop-playing via remote mode might be added at some point in the > future. Yes. But also, looping applies to tracks, not whole playlists. So you'd need to apply the overall loop on the outside. What we have is endless random play (--random). Maybe you mean that? > If this is an accurate synopsis, can you give me a clue or two on what a > 'terminal-mode' command to loop-play a list would look like? Your case seems to me like it could be covered by running mpg123 --continue --listentry $track --skip $position plist.m3u and just killing (SIGINT) mpg123 when the button is pressed, remembering the info printed for CONTINUE, like cont=$(mpg123 --continue --listentry "$track" --skip "$frames" -@ /dev/shm/plist.m3u ) then parse $cont value, which looks like [CONTINUE] track 27 frame 376 Those two numbers give the position to resume playback on the next button press, which just starts mpg123 anew. You need some scripting around that, but not too much. > tell me if the aforementioned "loop-play-via-terminal-mode" could be paused > via the 'remote-mode` command for 'PAUSE/P'?? > i.e. 'echo "pause" > /tmp/mpg123_fifo' pkill -INT mpg123 would be the simple approach (more sophistication: Remember the PID of the process and specifically kill that). Then start mpg123 again on un-pause. I realize that the --random mode doesn't interact nicely with --continue right now. The latter was coded for someone playing folders of audiobook pieces, where everything needs to be in order. I need to fix it so that --listentry is honoured properly also with random and shuffled play. For now, if you do want random playback, you could randomize your playlist beforehand and let mpg123 play it in order. If the CONTINUE info tells you that the list ended (track > number of tracks in list), you reset it to 1 and start again with the same or a newly shuffled list. This is suboptimal regarding perceived randomness, but should serve until next minor mpg123 release fixes things. Before adding playlists to remote control mode, it needs to be decided, if and how --random and --shuffle command-line switches would apply there, or if there are commands to enable/disable these modes. Alrighty then, Thomas |