DocumentationPage/FxdFiles |
UserPreferences |
Freevo Wiki | FrontPage | RecentChanges | TitleIndex | WordIndex | SiteNavigation | HelpContents |
Index
FXD files are special XML files that Freevo uses to define links to "external" media and to define the appearance of directories and files. An external source can be elsewhere in your filesystem, on cdrom, or even a DVD or (S)VCD. A DTD is provided in the Freevo installation in "Docs/freevo_XML_data.dtd," but at the time of this writing, the DTD file was outdated and no longer valid.
The root elementin FXD files is <freevo>.
Movie related FXD files contain a <movie>...</movie> tree directly under the top level <freevo> tag. The movie tag can include information about a cover image, a video source, variants (for instance, different language audio tracks), and other information.
Here is an example FXD:
<?xml version="1.0" ?> <freevo> <copyright> Copyright notice for this FXD. This is used by "Search IMDB" plugin to store IMDB copyright, but you may use it also. <source url="http://url/to/your/source/that/provides/you/info"/> </copyright> <movie title="My Movie Title"> <cover-img source="http://url/to/cover/provider">MyMovie.jpg</cover-img> <video> <file id="f1">MyMovie.avi</file> </video> <info> <genre>Genre</genre> <runtime>123 minutes</runtime> <rating>8/10</rating> <tagline>The best movie ever!</tagline> <plot>Some long description</plot> </info> </movie> </freevo>
The cover-img tag defines the image to use for this movie--typically a movie poster or DVD box art. A simple example:
<freevo> <movie title="My Movie"> <cover-img source="movieposter.jpg"/> [...] </movie> </freevo>
The video tag defines all of the parts that make up a movie. For instance, a movie that spans multiple VCDs or that has been broken up into multiple AVI files. Each video definition needs to have a unique id (which may be referred to in the variants section below).
Valid child tags for <video> are <dvd>, <vcd>, and <file>. See the DTD for additional details.
A simple example:
<freevo> <movie title="My Video"> <video> <file id="part1" name="My Video, Part 1">file1.avi</file> <file id="part2" name="My Video, Part 2">file2.avi</file> </video> [...] </movie> </freevo>
Sometimes movies contain several soundtracks or subtitles. On DVDs this will work automagically, but for plain files it is sometimes easier to specify it explicitly. You can use the <variants>-tags in this case. A simple example will look like this:
<freevo> <movie> [...] <video> <file id="p1">file1.avi</file> </video> [...] <variants> <variant name="Soundtrack German"> <part ref="p1"> <audio>audiofile.mp3</audio> </part> </variant> </variants> [...] </movie> </freevo>This will link in an extra external audio-file to be played back. The ref-Parameter in part references the corresponding file in <video>. You can then use "Show Variants" in the play-menu to select this track. However in most cases extra soundtracks are encoded into the same file. You can then try to use following structure:
<freevo> <movie> [...] <variants> <variant name="Soundtrack German" mplayer-options="-aid 0"> <part ref="p1"></part> </variant> </variants> [...] </movie> </freevo>Notice the mplayer-options parameter. With -aid <number> a soundtrack is specified. There a different tags for audio and subtitles. For a complete reference, see DocumentationPage/FxdFiles or use the DTD file in Docs/freevo_XML_data.dtd.
The info tag contains various tags with movie metadata. This includes copyright, a URL (PleaseUpdate: to the movie's homepage?), genre, year, runtime, tagline, plot, and rating. See the DTD for more info.
A disc-set contains a set of related discs--for example, all CD-ROMs containing files of a given TV show.
PleaseUpdate: This needs to be researched and documented more.
The whole directory can be handled as a single playitem. This is usefull when directory contains only one movie but several files (e.g. cd1.mpg, cd2.mpg, movie.nfo, movie.jpg, movie.sub). Placing fxd file in the directory with the same name as a directory (movie_name/movie_name.fxd) makes freevo to handle directory as a playitem and not as a directory.
FXD files can define an external music source, such as a net radio station.
The only real requirement here is a name and URL, but several metadata fields are provided to describe the stream.
A simple example:
<freevo> <title>RadioIO 80's</title> <logo source="/opt/freevo/testfiles/netradio/">mos.jpg</logo> <audio> <mplayer_options></mplayer_options> <url>http://radioio.sc.llnwd.net:8220/</url> </audio> <info> <genre>Alternative</genre> <desc>More choices, more music. Independent. Original. Digital. RadioIO 80's.</desc> </info> </freevo>
PleaseUpdate: Should the code be adjusted so that this is not all part of the <freevo> element, but instead wrapped pushed down a level such as <freevo><music>...title, logo, audio, etc...</music></freevo>?
PleaseUpdate (needs research): Does this support local audio files?
FXD files can be used to override the appearance of an individual directory. Please see DocumentationPage/SkinInfo for details.
This is to support commands run directly in freevo. I.E. run your favortie web browser, email application, or other application. In order to run XBased apps you must have an X based setup. This command does not allow framebuffer setups to run X applications. Likewise if your application is framebuffer based, it won't allow it to run in X11. ALso the command tag is only supported in freevo version 1.5 and greater.
a simple example:
<?xml version="1.0" ?> <freevo> <command title="Mozilla"> <cmd>/usr/bin/MozillaFirebird</cmd> <stoposd /> <spawnwm /> <info> <content>It is just a test</content> </info> </command> </freevo>
The title attribute of the command element is what shows in the Main Menu if using A Command Main Menu Item or it is the name of the entry if you have the fxd in your COMMANDS_DIR.
THe cmd element is the actual command to run in full, including arguments if there are any. Please do not use '&' to background a task, and should you need a '&' as a character in an argument then you should escape it as & because this is required for xml to work properly. If you want this to fork something into the background then i reccomend a shell script that starts a subshell and puts that command into the background.
The stoposd element is optional and tells freevo to the stop the freevo environment and let the application take over the whole screen. Typically you want this only for apps that are UI based like a web browser or email app.
The spawnwm element is optional and tells freevo start a window manager for the duration of this command. It uses the COMMAND_SPAWN_WM and COMMAND_KILL_WM to start and stop the window manager. The best window manager i have found that fits with freevo for this limited purpose is ratpoison.
To run a command in the commands dir, just simply put the FXD file in the directory. You can then select it by its title in the menu.
To run a command as a mainmenu item. then do the following in your local_conf.py:
plugin.activate('command.CommandMainMenuItem', args=('/usr/local/freevo_data/Commands/Mozilla.fxd', ), level=45)
where level influences the ordering of the menu. and you give the full path to the fxd file as the first arg. You may have as many of these lines in your local_conf.py as you like but it will enlarge your main menu. I have two myself, one for the web browser and another for displaying nasatv in real player.