Ever since I started using LMS, nearly seven years ago, I have wished for some form of automation. What I mean is that I want a way to add commands to the playlist, so that certain tasks can be performed. For instance:
Pause or stop playback for a specified time, then resume playing with the next track in the playlist. (sometimes useful when a sync group has drifted out of sync) Stop playback, clear the playlist, then load and begin playing a different playlist. Maybe this capability exists in plugins that I am not aware of. But since I'm not aware of those options, I decided to try coming up with something on my own. I am not a developer, so I do not have code to share, just a concept. So I'm not posting this in Third-party Software. And even though what I'm doing works only in Linux, I think the concept can be applied in other environments, so I think this fits best in the LMS forum. I have added a folder named Commands to the top level of my music library. In that folder there are several audio files containing 30 seconds of silence. The Title tags of those files all begin with "[Command]", followed by a description of the task to be done. For instance, the first example I mentioned above becomes "[Command] pause group all then play next". Next, some way of monitoring what's currently playing is needed. This can probably be achieved with the PlayLog or LMS Event Trigger plugins. I already have a shell script running that gets Now Playing updates through the Command Line Interface, so that is what I use. With a few lines added to that script, it now checks the title of every new track, and if it begins with "[Command]" it calls another script with the rest of the title as a parameter. My hope is that in time the second script will evolve into something more sophisticated, but right now it's just a chain of IF statements. If one of them matches the parameter used when calling a script, it sends a command or a sequence of commands through the CLI. Using the same example: Code: -------------------- sleep 2 echo "01%3A23%3A45%3A67%3A89%3Aab pause 1" > sqz_fifo_in sleep 15 echo "01%3A23%3A45%3A67%3A89%3Aab pause 0" > sqz_fifo_in sleep 1 echo "01%3A23%3A45%3A67%3A89%3Aab playlist index +1" > sqz_fifo_in -------------------- That pauses the group player, waits fifteen seconds, then unpauses and jumps to the next track. It's not elegant, but it works. I'm sure it would work much better as a plugin, but it's not likely that I will ever make that happen. So if anyone would like to take this crude concept and develop it into something powerful, be my guest. But even if that never happens, I hope someone will find the concept useful and modify it to fit their needs. Next problem: running commands based on time, rather than sequence in a playlist. I have tried doing something like that with alarms in the past, without much success. But maybe it would help to set up a dummy player, only for the purpose of running commands. I am not ready to go there yet, but if someone else is ready, do go ahead! If nothing else, I hope real developers will get a good laugh out of my fumbling attempts to make this work. :D LMS 8 nightly; 3 Squeezelite players connected by powerline ethernet; 5 wireless players connected via Airplay Bridge; 1 SqueezeAmp player no high-end or esoteric audio gear 1 Squeezebox Radio (upgraded UE Smart Radio) now mostly retired ------------------------------------------------------------------------ RobbH's Profile: http://forums.slimdevices.com/member.php?userid=67008 View this thread: http://forums.slimdevices.com/showthread.php?t=112979 _______________________________________________ Squeezecenter mailing list Squeezecenter@lists.slimdevices.com http://lists.slimdevices.com/mailman/listinfo/squeezecenter