Le dimanche 9 janvier 2011 16:05:41, Vincent Cassé a écrit :
> hi !

        Hi !

> Today, I would like to change the content of a declared single, in a 
> fonction.
> 
> my single declaration is :
> 
>     background = single("./error.mp3")
> 
> And i would like change the mp3 file :
> 
>     def add_background(music)
>        background = single(music)
>     end
> 
> Do it possible ?

I do not think it is possible like this. You probably need to use a 
request.dynamic operator.. 

A simple example: 
Put in a /tmp/jingle.txt file the adress of a local file containing your jingle:
cat /tmp/jingle.txt
  /path/to/error.mp3

Then define the following source:
  s = request.dynamic(
             fun () -> request.create(
                             list.hd(
                               get_process_lines("cat /tmp/jingle.txt"))))

Now, when you want to change the file used for the jingle, just do:
echo /path/to/new_error.mp3 > /tmp/jingle.txt

Romain

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to