Le 05/11/2011 23:37, David Baelde a écrit :
> Hi Martin,
>
> I cannot propose any working solution,

Hi David,
I thought so and I understand !!

>   but it should be possible to do
> it as follows: you setup an insert_metadata() operator, and use
> add_timeout() to periodically get the metadata from the URL, using
> http.get(), and insert that metadata (after having parsed it) using
> the function given by insert_metadata.
>
> Here's a standalone minimal example doing this. Unfortunately I cannot
> test at all at the moment.
>
> url = "http://localhost/metadata";
> source = blank()
> insert_source = insert_metadata(source)
> insert = fst(insert_source)
> source = snd(insert_source)
> delay = 5.
> def update_meta() =
>    x_data = http.get(url)
>    insert([("title",snd(x_data))])
> end
> add_timeout(0., { update_meta() ; delay })
> output.dummy(on_metadata(fun(m)->print(m),source))
Yes, I already have an idea on how to implement each part but the 
question remain on how to assemble it  with dyn_sources and interface it 
with my app.

If you'd have like 5min of your time to devote, it would be for that 
question: instead of storing only sources (in dyn_sources[]),  how to 
store a reference to a string that hold "url", for each stream link.
Then I'd only had to read/write what resides at this reference.
note: Last time we talk about that you talked about this, you talked 
about "arbitrary tuples" , ie you can't do (x,y,z) but only (x,(y,z))

Inspired by the above, I thought about this:
   dyn_sources :=
       list.append( [((uri,s0), stream_metaurl),((uri,output), 
stream_metaurl)],
                     !dyn_sources )

But if I do this, then I have an error like:
At line 143, char 44-56:
   this value has type
     [((string*active_source(audio=2,video=0,midi=0))*_)] (infered at 
line 7, char 19-20)
   but it should be a subtype of
     [(?A*_)] where ?A is an orderable type

The code at line 143 is like follow:
   result = list.fold(parse_list, ([], []), !dyn_sources)

Maybe I'm close to something, but maybe i'm far !

Thanks again for your time.

Martin

------------------------------------------------------------------------------
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