On Thu, Nov 20, 2008 at 7:19 PM, David Baelde <[EMAIL PROTECTED]> wrote:


>>  - I don't want to rely on file length. I'm "almost a control
>> engineer" (doing my thesis), and  I'm aware of time integration
>> problems, so I like enforcing  time resets when they make sense.
>>
>> - I will need 3* kinds of prime sources (plus live, but that one I'll
>> handle later and looks pretty well documented); 2 of them are random
>> playlists, which don't have any special length (and thus need to be
>> stopped );  So when the time comes, I need to change between them (I
>> will have an external scheduler).
>
> Okay. Part of your needs involves switching from one playlist to the
> other at a precise time. I'll describe a naive way of obtaining this
> behavior. We shall use the switch operator. Usually it goes like:
> switch(track_sensitive=false,[
>  ({ 0h-12h }, listA),
>  ({12h-0h  }, listB)
> ])
>
> That's too static for you, no problem. The { .. } notation is nothing
> special, it just means fun () -> ... it's a function that's evaluated
> to know whether the source should be played or not. Inside the
> function you don't need to use time interval checking 0h-12h. That
> thing looks fancy but it's an expression like another. For example we
> can write instead { "ok"==get_process_output("myscript") }. This means
> that at every frame, liq will call your script to know whether it
> should switch to a source or not.
>
> This kind of thing works well, but is naive. A drawback is that it
> calls your script very often. A better solution would be passive. For
> example, use { ["ok"]==server.execute("var.get blah") } and change the
> content of the variable as needed using the server interface.
>
> It's not so bad, but a bit ugly. I think the example is well
> motivated, and if I don't find a better way to solve it, it'll be a
> good reason for adding real references (setq-able variables) inside
> our script language.
>

Good, good! that is just the solution I had found (using interactive
vars) :) I was afraid that it used all the CPU available afterall it's
a "busy-waiting" algorithm (the "ugly thing"), but it didn't.  I'll
work on the scheduler now (external app).


Gil

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to