2011/6/20 Martin Hamant <[email protected]>:
> Hi Romain; David and the list

 Hi Martin!

> I Tried the following non-working code,   but I am not sure how to "write
> the if-then-else inside the second definition, and not the other way
> around."
> Is there a parenthesis / indent trick ?
>
>        # initial def with some properties
>        out = output.icecast(...)
>
>        # new def
>        out =
>        if stream_format == "mp3"
>        then
>                out(%mp3)
>        else
>                # I will write something else when I get the existing to work
> :D
>                print ("not mp3")
>
>        end
>
>        # out should now expect the source

The problem here is that each branch of the if-then-else must return a
variable of the same type, here a source..
Thus, if the format is not mp3, you should use a default format, so
something like:

        out =
        if stream_format == "mp3"
        then
                out(%mp3)
        else
               print("no recognized format, using %wav")
               out(%wav)
         end

> Now... Even if it works and if I have a "new" out with format inside
> expecting the source,  what becomes by first partial out def properties  ?

What do you mean exactly?

Romain

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to