2011/11/8 Вовчик <[email protected]>:
>
>
> 08.11.2011, 14:41, "Romain Beauxis" <[email protected]>:
>> Hi,
>>
>> 2011/11/7 Вовчик <[email protected]>:
>>
>>>  Hi Romain!
>>>
>>>  07.11.2011, 14:19, "Romain Beauxis" <[email protected]>:
>>>>  Hi!
>>>>
>>>>  2011/11/4 Вовчик <[email protected]>:
>>>>>   Hi savonet from Russia!
>>>>>   liquidsoap greatest streaming tool,
>>>>>   but i have one task:
>>>>>   i have a script on php that output's mp3 files in this format:
>>>>>   /path/to/file1.mp3
>>>>>   /path/to/file2.mp3
>>>>>   /path/to/file3.mp3
>>>>>   /path/to/file4.mp3
>>>>>   .... etc
>>>>>
>>>>>   but i dont know how to put this output to liquidsoap
>>>>>   i need that liquidsoap read script's output and play files from 
>>>>> generated
>>>>>   playlist
>>>>>   and when playlist is done, liquidsoap execute script again and play 
>>>>> files
>>>>>   from output
>>>>>   again again and again
>>>>>
>>>>>   i'm read manuals about playlist.reloadeble
>>>>>   request.dunamic
>>>>  request.dynamic is your friends :-)
>>>>
>>>>  def next() =
>>>>    file = list.hd(get_process_lines("/path/to/script arguments"))
>>>>    request.create(file)
>>>>  end
>>>>
>>>>  s = request.dynamic(next)
>>>  Romain please help, how to rewrite this example for playing playlist of 
>>> more than one file at a time
>>
>> I didnt get that :-)
>>
>> If your script returns multiple lines and you want to add all those
>> requests I am not sure how to do it. The file all have the same
>> duration? Can you describe with more details what you intent to do?
> Off course. I try to describe what i want:
> step1 : LIQUIDSOAP -> get_files_from_script: /home/music/1.mp3     --
>                                                                   
> /home/music/2.mp3       |
>                                                                   
> /home/music/3.mp3       |   playlist
>                                                                   
> /home/music/4.mp3       |
>                                                                   
> /home/music/5.mp3      --
>
> step 2: LIQUIDSOAP -> stream playlist: streaming --> /home/music/1.mp3 ... 
> ended
>                                                            streaming --> 
> /home/music/2.mp3 ... ended
>                                                            streaming --> 
> /home/music/3.mp3 .. ended
>                                                            ...
> step 3: when all files from playlist are played, GO TO step 1
> infinite loop
> only filenames changes
>
> i'm dont want to call script for each new file
> its possible? if not i will rewrite my script.php for outputing one file at a 
> time

I see..

You have a simple solution then: use a reference to the latest list of
requests and update the reference when the list of over. Something
like this:

requests = ref []
def next () =
  # Reload if empty
  if list.length(!requests) then
    requests := get_process_lines("/call/to/script foo bar")
  end

  # Grab first track
  r = request.create(list.hd(!requests))

  # Keep tail
  requests := list.tl(!requests)

  # Return
  r
end
s = request.dynamic(next)

Romain

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to