This stuff sounds promising.  I think that the mixed xml layout/python
code is promising.  Now, I am going to throw out an idea.  What does
everyone think about borrowing the ruby on rails style?  

For those that are not familiar, rails separates the application logic
(control/model) from the view.  There is a set of files responsible for
the data (database), and another that is responsible for the html. I
believe that the freevo model can be static.  The html would be replaced
with the kaa.canvas xml.  The database stuff fits in quite well with the
new sqlite backend.  This is getting complicated; time for some
examples.

In the logic section, there could be a file named music.py.  It would
look something like:

class SomeThemeMusicPlayer(DefaultMusicPlayer):
        def init(self, ...):
                DefaultMusicPlayer.init(...)
                # do initialization...

        def view(self):
                music_library = get_list_of_songs()

This does two things.  It allows the developers/themes to handle events
in a generic manner.

Next, a "view" is defined in a file "music_view.pyxml."  This would be
the tricky implementation part...
         
<canvas style="video menu">
  <image name="background" width="100%" height="100%"/>    
  <container x="overscan_x1" y="overscan_y1" width="complete width 
        overscan_x1 - overscan_x2" height="...">
        <% for item in music_library: %>        // Python code...
        <text> <% item.name %> </text>  
        ...

I will try to write some code that implements some of this later today.
The wife wants to go to the mall now...

The different events get different layout files.  Perhaps another python
file could be used to define the event transitions/animations...

The system would fall back to defaults if a theme does not implement a
particular file.  It would need some way to define common things such as
backgrounds across all files.  I think that rails uses a 'layout'
concept to achieve this goal.

Again, this is just a zany idea that I had.  Ruby on rails is a cool
system.  What do people think?

Tell me if I am crazy.

~dan

On Thu, 2006-01-05 at 14:22 +0100, Dirk Meyer wrote:
> Hi,
> 
> I better start a new thread for this and don't put it below the
> animation thread. The current situation is that I don't think it will
> be possible to define the whole gui in xml. The animations and how to
> handle them is the main problem. How could I define that the selection
> bar moves and not the items? When is it time to show a new set of
> items? So I think we will have a xml file defining some basic stuff
> and also defining an engine to use. This engine has some stuff
> hardcoded. If someone whats some cool animation stuff, just code a new
> engine :)
> 
> For beginners, let us start with the screen itself. We have some
> resolution we don't care about. It should not matter if we use 720x480
> for NTSC or 720x576 for PAL, _both_ is 4:3 on your tv, no matter what
> the resolution is. Or even worse, 4:3 is the resolution minus the
> overscan. But the background should fill the whole screen without
> caring about overscan.
> 
> So some sort of code could look like this:
> 
> | <canvas style="video menu">
> |   <image name="background" width="100%" height="100%"/>
> 
> so now we have a background filling the whole screen, now we define
> the "visible" area.
> 
> |   <container x="overscan_x1" y="overscan_y1" width="complete width -
> |     overscan_x1 - overscan_x2" height="...">
> 
> Everything in this container is visible and _this_ is 4:3, independed
> of the real resolution left. So when defining
> 
> |     <rectangle x="25%" y="25%" width="50%" height="50%"/>
> 
> I will get a rectangle in the visible area. 100% in this container are
> 100% of the visible area (Tack: is that correct?)
> 
> Now take a look at the current audio menu. I want that transparent
> area at the left outside of the screen. So how to define it? We can't
> define it inside the container because 0% is still visible? So I need
> to define it outside with x="0" and width="overscan_x1 +
> 50%_of_visible_area". How to do that?
> 
> Now I want to print some text defined in the items, e.g. the length of
> the item.
> 
> | <text>Length: @length@ minutes</text>
> 
> Kaa.canvas needs a way to ask external code like Freevo what @length@
> is. Even worse, maybe the item has no length. So it would be
> 
> | <text condition="length">Length: @length@ minutes</text>
> 
> meaning this tag is only to be proccessed if condition is True. And
> again, kaa.canvas needs a way to check the condition using Freevo. The
> current Freevo code checks the expressions based on the items
> attributes. 
> 
> Now, to make it worse. Many texts may depend on the type of the
> item. To avoid adding the condition again and again, it could be
> 
> | <block condition="type == playlist>
> |   ...
> | </block>
> | <block condition="type == video>
> |   ...
> | </block>
> 
> So they whole block is only "there" if the condition is true. And when
> you select a new item, all this needs to be checked again and stuff
> can change.
> 
> To make it more complicated I need tags of my own, like <listing> and
> also <cover> (cover is a little bit different than a normal
> image). And maybe put some stuff outside this definition. You could
> not use a full filename in the <image> tag put a placeholder instead
> and use <image tag="background" filename="/where/to/find"> later. So
> just redefining this image will change the look very easy. And maybe
> filename would not be a complete path, only a filename and kaa.canvas
> will get a list of dirs where to search for it. When writing the xml
> file, I don't know where images will be in the installed system.
> 
> That is my basic idea. Now I need to know if it would be possible with
> kaa.canvas in general and if the kaa.canvas xml stuff should support
> all this. And how to move stuff defined there later? E.g. the listing
> could move to the left and a new one could come in from the right when
> selecting a new dir. 
> 
> 
> Comments please, I want a good design before starting coding on this
> one. 
> 
> 
> Dischi

-- 
Daniel C. Casimiro <[EMAIL PROTECTED]>



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Freevo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to