#382: function to get a source by it's id
------------------------+---------------------------------------------------
 Reporter:  mccurly     |       Owner:  admin
     Type:  Feature     |      Status:  new  
 Priority:  1           |   Milestone:       
Component:  Liquidsoap  |     Version:       
 Keywords:              |         Mac:  1    
    Linux:  1           |      Netbsd:  1    
    Other:  1           |     Freebsd:  1    
------------------------+---------------------------------------------------

Comment(by mccurly):

 lo, mrpingouin!
 thanks for asking. let's continue the discussion. in my case the major
 need for that function was raised by the otput.file.x function. currently
 it is not possible do change filenames of the output during runtime. let
 me explain a little example:

 <snip>
 def start_recording =
 output.file.x(
         id = "whatever",
         ...
         "/path/" ^ some_generated_filename ^ ".ext",
         GET_SOURCE_BY_ID("liveinput")  # the source live, will not work
 here
 end
 live = input.harbor(id="liveinput", on_connect=start_recording,
 on_disconnect=stop_recording, "/mount" )
 <snap>

 a possible way to let the filename of the output function variate, is to
 create it at runtime, BUT you cannot take a source that is created later
 in the config file. in my example the source of the output function should
 be "live". this can't work out. as you have to define a
 on_connect/on_disconnect function of a harbor source before itself, you
 can't use the source itself. i think that is a nice example to explain,
 where's a need for the get_source_by_id() function. granted, but this is
 taken from real life. on the other hand i could imagine, this function
 would solve lots of chicken/egg problems, where you are bound on the
 notation of sources/functions.

 i must admit, that it's some kind of tricky, because it is not guaranteed
 that a source with that id exists. i can understand that, yes, *solution*
 but i could imagine that, if it was not possible to catch some source, a
 silent source, with the searched id, is created.*/solution*

 wow, i hope you understand my bad english.

 ps: i didn't try it, yet.

-- 
Ticket URL: <http://savonet.rastageeks.org/ticket/382#comment:2>
Savonet <http://savonet.rastageeks.org/>
Let's program our stream !
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Savonet-trac mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-trac

Reply via email to