Le Sunday 07 June 2009 20:11:29 Romeo, vous avez écrit :
> Hi, Savonet Team!

        Hi !

> is it possible to update stream metadata using input.harbor headers?
>
> i suggest i must do it this way, but it doesn't work. i get blank title
> instead.

Yes, the liquidsoap language is a functional language. Hence, it is not 
possible to change the value of a variable. This is done by redefining a new 
variable.

For that reason, 
  x = y
is a boolean, true if x = y and false otherwise.

In some cases, however, this is not possible to redefine the variable
You can use the string.ref operator. This operators returns two functions, one 
for reading the current registered value, and another one to register a new 
value. 

In your precise case, you can do even better, and avoid string.ref. This goes 
like this:

def liveStart(headers)
    log("[LIVE-START]: live source goes up! Switching from playlist...")
    title = headers["ice-name"]
    ignore(server.execute("liveMeta.insert title=\"#{title}\"))
end

liveInput = input.harbor(id="live",
                                "live.ogg",
                                buffer=10.,
                                password=livePasswd,
                                on_connect=liveStart)

liveInput = insert_metadata(id="liveMeta", liveInput) 

That way, a new metadata will be inserted each time the harbor input receives 
a new connection.


Romain


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to