[Ambulant-users] Auto smil feed

Jack Jansen Jack.Jansen at cwi.nl
Tue Aug 5 14:23:04 CEST 2008

On 1 aug 2008, at 03:18, CK Ho wrote:

> Hi Jack,
>> What about Ambulant supporting auto smil files feed format to a  
>> certain folder and Ambulant will play FIFO?
> What do you mean by "Auto smil files feed"? Do you want Ambulant to  
> watch a specified directory and play all files that show up in that  
> directory?
> YES. Exactly. May i know Ambulant able to support that or I need to  
> do some modification.
Ambulant does not do this out-of-the-box.

There are three ways you could go about implementing this functionality:
- Do it in C++. Take the existing source code, and somewhere early  
during startup fire off a new thread that watches a folder. The thread  
will have to be notified when the current SMIL presentation ends  
(easy, there's a callback for that) and open the next file.
- Do it in Python, as a main program. This has the advantage that in  
Python it's probably easier (assuming you know Python, that is), but  
it has the disadvantage that you may have to recreate the whole main  
program logic. Hence, my personal preference would be
- Do it in Python, as a plugin. Even a plugin can "take over" the main  
program behaviour, we have experience with this and it works fine. All  
the Ambulant C++ APIs are accessible from Python. So, during plugin  
load time you fire up a thread (same as in first example), and  
whenever a document stops playing you start playing a new one.

Only problem with the last method is that you probably need the CVS  
Ambulant sources. Python support in the 1.8 release is not good enough.

The good news is that once the next Ambulant release comes out you  
won't even need to rebuild ambulant or anything: your plugin could be  
pure Python code only, and it would drop into any Ambulant player. So  
you could distribute it as an addon to Ambulant and become famous:-)
Jack Jansen, <Jack.Jansen at cwi.nl>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma  

More information about the Ambulant-users mailing list