Adding new PCast menus for the LinkTheatre

From NAS-Central Buffalo - The Linkstation Wiki
Revision as of 09:05, 12 April 2007 by 66.150.105.20 (Talk)

Jump to: navigation, search
Originally by Mike Smith from linkstationwiki.org

Contents

Introduction

This investigation was inspired by Articles/GeneralFunWithPCast. It looked like it would be possible to change the PCast html files stored on the LinkStation to extend the menus and functionality of the LinkTheatre. I had the idea of checking for new emails in the lounge/kitchen/wherever, but the possibilities are probably endless. In fact this intrigue even caused me to buy a LinkTheatre to satisfy my curiosity - I didn't have one already!!

The current set of files held in /etc/pcast/theme/pcast from this project are available here: pcast themes


Side note on the LinkTheatre

The LinkTheatre works well on my 802.11g network - streaming Photos, Music and Video from the LinkStation. I was concerned about the bandwidth requirements for video, but this appears to be largely unfounded, and I use a variety of video formats including mpeg, DivX, XviD, mp4 and VOBs. The user interface is browser based, taking content from the media server (the LinkStation in this case) so displaying menus is not instantaneous. On the LinkTheatre there's a 'go back' function akin to a go back in a web browser, but there is no easy way to navigate up a level when browsing directories. The HTML code indicates that the Red button on a remote performs this function, but the LinkTheatre remote doesn't have the equivalent of the red button (it does have the equivalent of the other three, but they are not actually coloured - they have the video, music and picture icons on them).


Prerequisites

I had already replaced the original LinkStation firmware on a MIPSel device with an Projects/OpenLink firmware downloaded from LinkStationWiki. This enables command-line access using ssh (I use the PuTTY client). I have made various changes, and installed some additional packages, but these are not relevent to the PCast functionality.

You may also need a graphics editor such as Photoshop, Paint Shop Pro, The Gimp or even Microsoft Paint.


PCast updates

PCast HTML Setup

PCast holds it's HTML templates in a directory structure. The skin_root entry in the /etc/pcast/pcast.conf file points to that directory. The default is /etc/pcast/theme/pcast. When experimenting with a theme/skin it makes sense to copy an existing theme to a new diectory, changing the skin_root entry in the /etc/pcast/pcast.conf file to point to thart new directory and restart PCast. Should something go wrong it is easy to revert the settings in /etc/pcast/pcast.conf and continue with the original theme.

For this article, however, all work was performed in the /etc/pcast/theme/pcast directory on the LinkStation.

As noted in Articles/GeneralFunWithPCast, the html is prepocessed by the PCast executable /usr/sbin/pcastd as part of a templating system. This replaces variables embedded in the html files, and also builds pages using multiple files from the /etc/pcast/theme/pcast directory.

head_xxx.html is used for the menu functions

line_xxx.html is used for content

tail.html is a common trailer


There is a set of these files for each type of media, where xxx = image, movie and music. There are also some additional 'line' templates to create a content line (on the right hand side of the screen) containing a subdirectory (line_dir.html), blank line (line_space.html), and for when the file type is unknown (line_unknown.html).


WARNING

The recommended first step is to take a backup of all files under /etc/pcast/theme/pcast! Alternatively, place a copy of /etc/pcast/theme/pcast in a new subdirectory and change the skin_root in /etc/pcast/pcast.conf to point to that new directory and restart PCast

The LinkTheatre provides support for standard and HD TV resolution menus. There is a checkbox in the LinkTheatre 'setup' menu to select the higher resolution menus. The effect is to use a different set of html files, suffexed by '_high.html' (and similarly for image files). I have ignored the 'high' files in the article, but changes to standard menus could equally apply to the high def set.

Adding a main menu entry

The first step I took in extending the functionality available to the LinkTheatre was to add a fifth entry to the main menu. The standard four are 'home' and buttons to select the video, image and music content. Each of these three buttons invoke the same (unknown, because of the templating system) PCast function with a filter parameter to list the appropriate type of media.

This was a simple task - editting top.html; repeating the html code of one of the previous menu entries and changing the A tag to simply load a new html file instead of using the PCast macro. This is what I included (it's just another row in the left hand side table)

<TR>