Romeo wrote:
> then i  must write such code:
> ===================================================
> def relaxLiveStart()
>     log("got relax live source, starting relays..")
>     ignore(server.execute("vko_relay.start"))
> end
> [...]
> out_vko_relay = output.shoutcast.mp3( id="vko_relay",
> 
> but if we have a possibility to predefine out_vko_relay in the begining
> of the script then it will be more convenient to write script and easy
> to understand how an interraction will be done, isn't it?

Your code is correct, and I don't find it too confusing. True, at the 
beginning you don't know what vko_relay is and what controls it accepts.
But the server interaction is alien to the scripting language, so it's
normal that it feels a bit weird.

If you like it better, you can avoid writing twice "vko_relay" (with a risk
of typo) by putting it in a variable at the beginning of your script.

I don't think that I want to introduce new constructions in the language
for that kind of example. As I said earlier, doing them naively would lead
to problems, and it doesn't fit well in the current simple model.

However, I would like at some point to avoid string-based interaction with the
server when done from within liquidsoap scripts. But it's quite complex (we
would have to put the list of accepted commands in the type of sources) and
your example just makes me realize that it's even more complex than I
thought :) Identifier-based control will probably stay for long.

> p.s. and why i must use server.execute in pair with ignore?
>      it produces an error when used alone.

I explained that recently on the list, have a look at:
http://www.mail-archive.com/[email protected]/msg00933.html

Cheers,

David

------------------------------------------------------------------------------
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to