Académique Documents
Professionnel Documents
Culture Documents
1. Introduction
Now Playing and Summary templates in Helium uses a technology called XSLT.
XSLT is a script language similar to XML which can be used to transform raw data (XML)
into different targets, HTML for example which is used in Helium.
Creating templates requires a good knowledge of HTML/CSS and some knowledge of XSLT
and XML (especially if you would like to create completely different structures to the default
structures).
A strong recommendation is that you start to study the XSL templates that are shipped with
Helium.
The templates can be found as follows:
• Now Playing Templates: <helium folder>\Templates\Now Playing
• Summary Templates: <helium folder>\Templates\Summary
When a file is replayed in Helium a XML document will be created. This XML document can
look like the example below:
1. <?xml version="1.0" encoding="ISO-8859-1"?>
2. <EARData>
3. <ExternalArtistPicture file=""/>
4. <ExternalAlbumPicture file=""/>
Lines 11-17 contains the XML structure used for the <favourite-tracks> node.
The item definition are the same as for <suggested-tracks> (described above) and can also
contain a maximum of 10 items.
Lines 18-22 contains the XML structure used to list the available albums from the current
artist. A maximum of ten albums can be displayed. Each album has the following attributes:
Lines 23-27 contains the XML structure used to describe the full tracklist for an album. The
current album XML will exist if you are playing a file from one of the available albums in the
<albums-by-artist> node.
Each track has the following attributes:
• id: Internal Database ID
• track-number: The number of this track
• title: The title of the track
• available: Set to zero if the file is not available and -1 otherwise.
• length: The length of this track, as a formatted string
• cd: which CD in a set this track comes from. -1 if not available.
• rating: The track’s rating .
Line 28 contains the XML structure for a track-data node. Track data is a combination of
internally used data and replaying information. The following attributes are available:
• first-played: A text string containing information when the track was first played.
• last-played: A text string containing information when the track was last played.
• playcount: Contains the number of times a track has been replayed.
• picture: A path to the picture for the album from which this track comes from. Empty
if not available.
• album-id: Internal ID
• artist-id: Internal ID
• detail-id: Internal ID
Lines 29-42 shows the file-data lines XML structure. This XML block exists for both Now
Playing templates and Summary (single file) templates.
The type attribute in line 29 can have one of the following values:
• MPEG – MPEG files
• MPC – MPEG Plus files
• OGG – Ogg Vorbis files
• FLAC – FLAC files
• WMA – WMA/ASF files
• APE – Monkey Audio’s files
• M4A – M4A, M4P and M4B files
• CDA – CD Audio tracks
2. 7 Tag Data
43. <tag type="ID32">
44. <TagField name="TIT2" content="Steam Machine"/>
45. <TagField name="TPE1" content="Daft Punk"/>
46. <TagField name="TALB" content="Human After All"/>
47. <TagField name="TXXX" description="#HELIUM2 RELEASETYPE" content="2"/>
48. <TagField name="TSOA" content="Human After All"/>
49. <TagField name="TDTG" content="2005-03-23T22:42:24"/>
51. <TagField name="TRCK" content="4/10"/>
52. <TagField name="TLAN" content="English"/>
53. <TagField name="TCON" content="General House"/>
54. <TagField name="TPUB" content="Virgin Records"/>
55. <TagField name="TDRL" content="2005"/>
56. <TagField name="TDRC" content="2005"/>
57. </tag>
Line 43 contains a tag rootnode. There can be several <tag> nodes in a Now
Playing/Summary document, depending on which tags the source file contains.
The type attribute can have one of the following values:
• ID32 – ID3v2.x tags
• ID31 – ID3v1.x tags
• Lyrics3 – Lyrics3v2.0 tags
• M4A – M4A/M4P/M4B file tags (QuickTime)
• APE2 – APE v2.0 tags
• Vorbis – Vorbis tags
• ASF – WMA/ASF tags
Lines 44-56 shows an example of the contents for a few basic tag types.
All constants (name attribute) are defined in tagconsthelper.xsl. In this file there is also a
generic helper function defined, GetTagString, which is used to extract the proper tag
contents. Please see the example templates for a usage description.
There are multiple summary files. All these files must exist and must be named:
• albumsummary.xsl – Document used when a album is selected
• noalbum.xsl – Document used when no album is selected
• nofiles.xsl – Document used when no files are selected
• summary.xsl – Document used when one file is selected
• summarymulti.xsl – Document used when multiple files are selected
They are quite similar to Now Playing templates except for a few things detailed in the
sections below.
Line 1 contains a XML processing instruction and line 2 contains the album root node,
containing two attributes: name – contains the name of the album and id which is an internal
database id.
3. <fields>
4. <field name="artist" content="Various Artists"/>
5. <field name="items" content="13"/>
6. <field name="size" content="82"/>
7. <field name="length" content="76:23"/>
8. <field name="picture"><![CDATA[D:\\1992\\Various Artists - Trancemaster Vol.
1\\cover.jpg]]></field>
9. <field name="rating" content="rating4"/>
10. <field name="release-type" content="rt8"/>
11. <field name="release-type-text" content="Compilation"/>
12. <field name="total-cds" content="1"/>
13. <field name="release-year" content="1992"/>
14. <field name="sort-order" content="Trancemaster 1"/>
15. <field name="subtitle" content="Ambient Dance II Trance Chill Out"/>
16. <field name="publisher" content="Vision Soundcarriers"/>
17. <field name="thumb-size" content="128"/>
18. <field name="part-of-series" content="Trancemaster"/>
19. <field name="album-picture-filename" content="C:\Temp\{08D65B73-B15A-4D5F-9985-
0F9C9E2200B2}.jpg"/>
20. <field name="lend-out-date" content="1899-12-30"/>
21. <field name="review"><![CDATA[]]></field>
22. </fields>
Line 3-22 defines all the available fields for an album item.
They are all equal and almost self explanatory. However, two fields require some further
explanation:
Line 8 contains the full path to an extracted album picture. Please note that this
data is enclosed in a CDATA structure so that the contents are preserved exactly
as entered.
Line 21 contains an album review (if available) which is also enclosed in a
CDATA structure to maintain exact preservation of the data as entered (Album
reviews generally contain HTML markup data).
23. </album>
This node is named <playing-history> and contains a list of date/timestamps when the
selected track has been replayed, sorted in descending order.
Please node that this root node is optional and will not exist if the track has never been
replayed.
The other available nodes and their data are described in the following sections:
• 2.6 – File Data
• 2.7 – Tag Data
The XML data document used for this summary type looks like this:
1. <?xml version="1.0" encoding="ISO-8859-1"?>
2. <fields>
3. <field name="NumberOfFiles" content="7"/>
4. <field name="TotalSize" content="78058133"/>
5. <field name="TotalLength" content="00:49:16"/>
6. <field name="AvgBitrate" content="210"/>
7. <field name="AvgSize" content="11151161"/>
8. <field name="AvgSize" content="11151161"/>
9. <field name="AvgLength" content="00:07:02"/>
10. <field name="AvgRating" content="0,64"/>
11. </fields>
Lines 3-10 defines the available data nodes. All sizes are expressed in bytes.
4. General Tips
• Use the available helper classes; they contain the necessary functions for extracting
data from the XML documents.
• Split visual & logic information by using a visual include file.