Lib-Ray Template System
The Lib-Ray authoring wizard will include generation of menus from theme templates. I've been working the last couple of days on the internal side of this. The following is of interest to people considering writing their own themes. I plan to include at least two themes with the release (at minimum there will be themes based on the layout for the Blender and Sita releases).
So, if this is too technical, do not fear -- you won't need to know this just to use the Wizard to create a Lib-Ray volume, this is internal stuff.
Happily, I found that my old friend "SimpleTAL" is still readily available. This, combined with the "zipfile" and "ConfigParser" modules from the Python standard library covers everything we need for creating templates.
So template files will be ZIP files with SimpleTAL page templates and some control data, like this:
(Not shown: the template will typically contain additional static resources like image files or fonts. I also have not gotten into the full-blown internationalization system that I described earlier. For now, we just have a "setup" page as on a DVD. This will get expanded).
The template files will be expanded into a Lib-Ray structure based on user input and the configuration file included with the template. For example, the program will negotiate the number of chapters that appear on each chapter page and how they are laid out. The logic available in TAL templates is sufficient to handle this kind of layout problem, so the template can set upper and lower limits on this parameter and allow the user to choose.
As a result, the Lib-Ray volume image generated from the template will look something like this:
This also shows the internal object names for the page templates inside the Wizard script.
This layout includes all of the Lib-Ray specific HTML requirements, with stubs provided for the special feature hooks (volume special features, title special features, and "extras" -- where the "extras" are eqiuvalent to "DVD-ROM" content and do not have to conform to the security limitations on Lib-Ray menus, such as no external links or scripting). Once you get into authoring special features pages, you're designing HTML, and it will be more sensible to use existing HTML design tools for that (including a plain text editor).
One special case that's worth considering is the "title_in_index" option. For volumes with a single video title, it's kind of inconvenient to make the user hop through two menus, so we provide an option to condense the "title page" onto the volume "index page", like so:
(I haven't quite decided whether to only provide this option for template designers, or to require templates to allow for either case).
Lib-Ray Title Generation (Testing)
The code to generate Lib-Ray title video conversion scripts appears to work fine. I need to do some more to have it work from PNG streams correctly, and I need to do some testing on the audio and subtitle stream generators. The script actually writes a conversion script and then runs that, which allows for a lot of flexibility. I also need to actually have the script launch this new script into a background process, as it may potentially need to run for hours (vpxenc, in particular, tends to need quite awhile to work).
I'm not quite following the proper "test driven development" process, which dissatisfies me a little. I really should be creating unit tests and coding to meet them.
As it is, though, I have some doctests which work and some which don't, because they are interactive. I'll either have to drop the interactive ones out of the testing system or come up with some clever way to run the tests on them. I'm leaning towards just leaving them out and testing the interactive stuff manually, at least until I think of something clever.
"And that's the news from Lake Wobegon..." -- I'll be back with more later. :-)