It's not that simple Nicholas to use it with a switch, due to the type of
an interactive string technically being a function.

Here's how to do it:

------

use_playlist = ref false
server.register(namespace="vars", "use_playlist", fun (s) -> begin
use_playlist := (s == "true") string_of(!use_playlist) end)

src = switch([
    ({ !use_playlist }, playlist_source),
    ({ true }, normal_source)
])

-----

When connecting to the server via telnet or over socket, sending
"vars.use_playlist true" will work.

The ! is a dereference, not a "not". :)

uno: this should solve your problem, and you can use transitions and
track_sensitive=true settings on the switch to improve the listening
experience. (those are available to be read in the docs)

- Rob

On Sat, Jul 30, 2016 at 8:01 AM, Nicholas Vrtis <[email protected]>
wrote:

> Setting a variable from Telnet is pretty simple (you might need to look up
> the true/false definations.. can't test it at the moment.
>
>
>
> # Define an interactive Telnet boolean variable
> v = interactive.boolean("myswitch", false)
>
> If you enter 'help" in a telnet session it will tell you how to get/set
> interactive variables.
>
> Or, you can check out the example here:
> http://liquidsoap.fm/doc-1.2.1/server.html on how to set/get a boolean
> switch.
>
> Nick
>
>
>
>
> On Thu, Jul 28, 2016 at 5:27 AM, uno <[email protected]> wrote:
>
>> Robert McAuley:
>> > Have you thought about using a switch?
>>
>>
>> I see how switch is used in time-dependent playlist.
>> but I don't see (yet) who to use that for my need.
>> what I'd need it a sort of telnet cmd for a switch...
>>
>> one working solution is to just add (another) request queue,
>> and feed it one by one in a sequence, and which has precedence
>> over the regular stream.
>>
>> /u
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> >
>> > If you are using an external program, have you thought about coding
>> extra
>> > functionality into that program to play a playlist at a specific time?
>> > (which is what I've done)
>> >
>> > On Wed, Jul 27, 2016 at 12:10 AM, unosonic <[email protected]> wrote:
>> >
>> > >
>> > > I'm using dynamic requests along with the annotate protocol
>> > > quite heavily, but only for single requests / files.
>> > >
>> > > is there an easy way to use a playlist along with requests?
>> > > thx for ideas, u.
>> > >
>> > >
>> > >
>> ------------------------------------------------------------------------------
>> > > What NetFlow Analyzer can do for you? Monitors network bandwidth and
>> > > traffic
>> > > patterns at an interface-level. Reveals which users, apps, and
>> protocols
>> > > are
>> > > consuming the most bandwidth. Provides multi-vendor support for
>> NetFlow,
>> > > J-Flow, sFlow and other flows. Make informed decisions using capacity
>> > > planning
>> > > reports.http://sdm.link/zohodev2dev
>> > > _______________________________________________
>> > > Savonet-users mailing list
>> > > [email protected]
>> > > https://lists.sourceforge.net/lists/listinfo/savonet-users
>> > >
>>
>> >
>> ------------------------------------------------------------------------------
>> > What NetFlow Analyzer can do for you? Monitors network bandwidth and
>> traffic
>> > patterns at an interface-level. Reveals which users, apps, and
>> protocols are
>> > consuming the most bandwidth. Provides multi-vendor support for NetFlow,
>> > J-Flow, sFlow and other flows. Make informed decisions using capacity
>> planning
>> > reports.http://sdm.link/zohodev2dev
>>
>> > _______________________________________________
>> > Savonet-users mailing list
>> > [email protected]
>> > https://lists.sourceforge.net/lists/listinfo/savonet-users
>>
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Savonet-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/savonet-users
>>
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> Savonet-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/savonet-users
>
>
------------------------------------------------------------------------------
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to