-
Hi, When I look at dynamic sources, I see either request.dynamic or a way to dynamically create and destroy sources against different mount points (here) What I'm looking for is dynamically adding and removing sources from the fallback operator. For example, right now I could have [requests, playqueue, jukebox] to support on the fly requests (requests), a place to push one or more playlists as a flat list (playqueue) and a preconfigured playlist (jukebox) However, I was looking at not having playqueue flat but being able to dynamically add or remove playqueue1...n and have LS see those changes and respond accordingly. ie, jukebox plays by default, a new source playqueue is added so LS either swaps to it immediately or after the current jukebox song finishes depending on track sensitive and while the playqueue is playing if a request is made, it jumps from playqueue to requests to play then back to playqueue unless it was removed at which point it falls back to jukebox. This would allow easier management of the overall queue by simply adding and removing sources instead of x files/urls from one main queue. I know i could do this by having x statically defined queues but the idea is that I don't know how many I will need ahead of time. I tried manipulating the fallback array while it was being used but i suspect LS takes a snapshot of it at the time of output creation. .. unless there's a way to do this now that I'm missing. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I have just modified You can also have a look at the implementation of
|
Beta Was this translation helpful? Give feedback.
-
@smimram. I can't seem to get this to work using a function (it does however work if I'm using the set function per the book's example) Here's the sample:
When calling It doesn't matter if it's a file or a remote url. I don't see a resolve() function like on a request to force init/resolution.
docker.io/savonet/liquidsoap:rolling-release-v2.2.x I also tried this with a recent version and same issue: Liquidsoap 2.2.2+git@ff1a04c |
Beta Was this translation helpful? Give feedback.
I have just modified
native.fallback
(the alternative implementation offallback
usingsource.dynamic
so that it accepts getters for sources: you can now pass a reference for the list of source. The PR is #3398 and it shall be merged once the tests pass.You can also have a look at the implementation of
native.fallback
which is basically what you want here. Suppose that you havesources
, which is a reference to a list of sources (which you can thus modify dynamically). You can then create a sources
which will play the first available one by