From: <ny...@us...> - 2006-07-29 05:19:09
|
Revision: 141 Author: nyaochi Date: 2006-07-28 22:18:48 -0700 (Fri, 28 Jul 2006) ViewCVS: http://svn.sourceforge.net/pmplib/?rev=141&view=rev Log Message: ----------- Added the source files for PMPlib web pages. We will scrap the current web pages powered by MODx and migrate to simple HTML pages. The source files consist of XML files describing the content, several image files, XSL files to generate HTML and RSS files (xsltproc is necessary), and Makefile that generate the necessary files for web pages by typing 'make'. Added Paths: ----------- trunk/webpage/ trunk/webpage/1024px.css trunk/webpage/HACKING trunk/webpage/Makefile trunk/webpage/about.xml trunk/webpage/document.xml trunk/webpage/document_easypmp_tutorial.xml trunk/webpage/document_jspl.xml trunk/webpage/download.xml trunk/webpage/faq.xml trunk/webpage/images/ trunk/webpage/images/background-800px.gif trunk/webpage/images/background.gif trunk/webpage/images/eac.png trunk/webpage/images/easypmp_win32gui_screenshot.png trunk/webpage/images/example.jpg trunk/webpage/images/fb2k-button.png trunk/webpage/images/fb2k_playlist.png trunk/webpage/images/music-folder.png trunk/webpage/index.xml trunk/webpage/links.xml trunk/webpage/news.xml trunk/webpage/newsrss.xsl trunk/webpage/pmplib.xsl Added: trunk/webpage/1024px.css =================================================================== --- trunk/webpage/1024px.css (rev 0) +++ trunk/webpage/1024px.css 2006-07-29 05:18:48 UTC (rev 141) @@ -0,0 +1,216 @@ +/* 1024px - An open source xhtml/css website template by Andreas Viklund - http://andreasviklund.com . Free to use in any way and for any purpose as long as the proper credits are given to the original designer. + +Version: 1.2, April 20, 2006 */ + +/******** General tags ********/ +body{ + font:76% Verdana,Tahoma,Arial,sans-serif; + background:#ffffff url(images/background.gif) top center repeat-y; + color:#404040; + line-height:1.2em; + margin:0 auto; + padding:0; +} + +a{ + text-decoration:none; + color:#4088b8; +} + +a img{ + border:0; +} + +p { + margin:0 0 10px 10px; +} + +img { + margin: 0 0 10px 10px; +} +ul,ol,dl { + margin: 2px 0 16px 16px; +} +ul ul,ol ol { + margin:4px 0 4px 16px; +} + +h1{ +font-size:4.2em; +letter-spacing:-5px; +margin:0 0 30px 25px; +color:#4088b8; +} + +h1 a{text-transform:none; color:#4088b8;} + +h2{ +font-size:1.4em; +color:#4088b8; +border-bottom:4px solid #dadada; +padding:0 2px 2px 5px; +margin:0 0 10px 0; +letter-spacing:-1px; +} + +h3{ +font-size:1.2em; +font-weight:bold; +color:#4088b8; +border-bottom:1px solid #dadada; +margin:10px 0 8px 0; +padding:1px 2px 2px 3px; +} + +blockquote{ +font-size:0.9em; +border:1px solid #dadada; +margin:20px 10px; +padding:8px; +} + +/******** Main wrap ********/ +#wrap{ +color:#404040; +width:970px; +margin:10px auto; +padding:0; +} + +#header{margin:0;} + +#toplinks{text-align:right; padding:5px 2px 2px 3px;} + +#slogan{ +font-size:1.5em; +color:#808080; +font-weight:bold; +letter-spacing:-1px; +margin:15px 0px 20px 35px; +line-height:1.2em; +} + +/******** sidebar ********/ +#sidebar{ +float:left; +width:195px; +margin:0 0 5px 0; +padding:1px 0 0 0; +} + +#sidebar ul{ +list-style:none; +font-size:0.9em; +margin:0; +padding:0 0 15px 10px; +} + +#sidebar li{ +list-style:none; +margin:0 0 4px 0; +padding:0; +} + +#sidebar li a{ +font-size:1.2em; +font-weight:bold; +padding:2px; +} + +#sidebar ul ul{ +margin:4px 0 3px 15px; +line-height:1.2em; +padding:0; +} + +#sidebar ul ul li a{font-weight:normal;} +#sidebar h2{margin:3px 0px 8px 0px;} + +/******** Content variations ********/ +#content{ +line-height:1.5em; +width:750px; +float:right; +text-align:left; +margin:0; +padding:0; +} + +#contentalt{ +line-height:1.5em; +width:750px; +float:left; +text-align:left; +padding:0; +margin-right:20px; +} + +#content h3, #contentalt h3{margin:10px 0 8px;} + +/******** Footer ********/ +#footer{ +clear:both; +text-align:right; +color:#808080; +font-size:0.9em; +border-top:4px solid #dadada; +margin:0 auto; +padding:8px 0; +line-height:1.6em; +} + +#footer p{margin:0; padding:0;} +#footer a{color:#808080;} + +/******** Various classes ********/ +.box{ +color:#ffffff; +font-size:0.9em; +background-color:#4088b8; +border:1px solid #c8c8c8; +line-height:1.3em; +padding:5px 5px 5px 8px; +} + +.box a{color:#f0f0f0;} +.left{float:left; margin:0 15px 4px 0;} +.right{float:right; margin:0 0 4px 15px;} +.textright{text-align:right;} +.readmore{text-align:right; margin:-10px 10px 12px 0;} + +.center{text-align:center;} +.blue{color:#4088b8;} +.big{font-size:1.3em;} +.small{font-size:0.8em;} +.bold{font-weight:bold;} + +.clear{clear:both;} +.hide{display:none;} +.fade{color:#c8c8c8;} +.gray{color:#808080;} + +.photo{ +border:1px solid #bababa; +padding:2px; +background-color:#ffffff; +margin:6px 18px 2px 5px; +} + +table { + margin: 8px; +} + +code { + font: 1em 'Courier New', Courier, monospace; + color: #444; + white-space: pre; + width: 640px; + height: auto; + overflow: auto; + display: block; + border: 1px solid #999; + border-width: 2px 0; + padding: 1em; + margin: 0 0 1em 48px; + background-color: #fafafa; +} Added: trunk/webpage/HACKING =================================================================== --- trunk/webpage/HACKING (rev 0) +++ trunk/webpage/HACKING 2006-07-29 05:18:48 UTC (rev 141) @@ -0,0 +1,15 @@ +1. How to write a Web content + +All Web pages are written in XML files. The specification was defined by me +(Nyaochi), and no documentation is available for the specification. However, +I think the specification is quite easy to guess from the existing XML files. + + +2. How to convert XML files into HTML files + +Just type +$ make +This will generate HTML files by applying an XSLT stylesheet (pmplib.xsl) +to updated XML file(s). You need xsltproc for XSLT processor. + + Added: trunk/webpage/Makefile =================================================================== --- trunk/webpage/Makefile (rev 0) +++ trunk/webpage/Makefile 2006-07-29 05:18:48 UTC (rev 141) @@ -0,0 +1,26 @@ + +TARGETS = \ + index.html \ + news.html \ + download.html \ + document.html \ + document_easypmp_tutorial.html \ + document_jspl.html \ + faq.html \ + about.html \ + links.html \ + index.rss \ + +all: $(TARGETS) + +.SUFFIXES: +.SUFFIXES: .html .xml + +index.html: index.xml news.xml + +.xml.html: pmplib.xsl + xsltproc pmplib.xsl $< > $@ + +index.rss: newsrss.xsl news.xml + xsltproc --stringparam date "`date -R`" newsrss.xsl news.xml > $@ + Added: trunk/webpage/about.xml =================================================================== --- trunk/webpage/about.xml (rev 0) +++ trunk/webpage/about.xml 2006-07-29 05:18:48 UTC (rev 141) @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<?xml-stylesheet href="./pmplib.xsl" type="application/xml"?> + +<page> +<head> +<title>About</title> +<last-update>$Date: 2005/10/10 09:28:51 $</last-update> +</head> + +<body> + +<section caption="What is PMPlib project?"> +<p> +Portable Media Player library (PMPlib) is an open source project for the development of management software/library for various portable media players. +The immediate objectives of this project: +</p> +<ul> +<li>to understand the specifications of media database and playlists used in various portable media players</li> +<li>to provide an alternative way to organize a player other than through bundled software or Windows Media Player</li> +<li>to provide libraries for other applications to manage a player</li> +<li>to make your player more accessible</li> +</ul> +</section> + +<section caption="Project members"> +<p> +<dl> +<dt>Nyaochi</dt> +<dd> +Project founder, admin, and core developer. +He owns iriver H320, H10 UMS [5GB], H10Jr UMS [1GB], U10 UMS [512MB], and E10 [6GB]. +<br/> +<img src="http://nyaochi.sakura.ne.jp/nyaochi-mail.png" /> +</dd> + +<dt>Martin Ellis</dt> +<dd> +Project admin and core developer. +</dd> + +</dl> +</p> +</section> + +<section caption="Acknowledgement"> +<p> +PMPlib uses the following libraries: +</p> +<ul> +<li><a href="http://www.vorbis.com">libogg, libvorbis, libvorbisfile</a> licensed under BSD.</li> +<li><a href="http://www.underbit.com/products/mad/">libid3tag</a> licensed under GPL.</li> +<li><a href="http://www.gzip.org/zlib/">zlib</a> licensed under zlib licence.</li> +<li><a href="http://www.mozilla.org/js/spidermonkey/">SpiderMonkey (JavaScript-C) Engine</a> licensed under MPL 1.1/GPL 2.0/LGPL 2.1</li> +</ul> + +<p> +PMPlib consults the following information (and source codes): +</p> +<ul> +<li><a href="http://www.netrino.com/Connecting/2000-01/">Easier Said Than Done (CRC-32 calculation)</a> by Michael Barr.</li> +</ul> + +</section> + +<section caption="Contact"> +<p> +If you find any problems or have any suggestions, don't hesitate to contact us. +</p> +</section> + +</body> +</page> Added: trunk/webpage/document.xml =================================================================== --- trunk/webpage/document.xml (rev 0) +++ trunk/webpage/document.xml 2006-07-29 05:18:48 UTC (rev 141) @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<?xml-stylesheet href="./pmplib.xsl" type="application/xml"?> + +<page> +<head> +<title>Manual</title> +<last-update>$Date: 2005/10/31 00:06:44 $</last-update> +</head> + +<body> + +<section caption="PMPlib Document"> + +<dl> + +<dt><a href="./document_easypmp_tutorial.html">EasyPMP Tutorial</a></dt> +<dd>This article presents a life with EasyPMP. I strongly suggest one to read this before using EasyPMP.</dd> + +<dt><a href="./document_jspl.html">JavaScript playlist (JSPL)</a></dt> +<dd>Specification of JavaScript playlist (JSPL)</dd> + +</dl> + +</section> + +</body> +</page> Added: trunk/webpage/document_easypmp_tutorial.xml =================================================================== --- trunk/webpage/document_easypmp_tutorial.xml (rev 0) +++ trunk/webpage/document_easypmp_tutorial.xml 2006-07-29 05:18:48 UTC (rev 141) @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<?xml-stylesheet href="./pmplib.xsl" type="application/xml"?> + +<page> +<head> +<title>Tutorial</title> +<last-update>$Date: 2005/10/31 00:06:44 $</last-update> +</head> + +<body> + +<section caption="EasyPMP Tutorial"> +<p> +Can you imagine what life with EasyPMP is like? +If not, check this tutorial before looking at the manuals. +This tutorial presents a brief introduction of EasyPMP [Win32 GUI] and EasyPMP [CUI] versions. +</p> + +<subsection caption="Prepare music files in your favorite way"> +<p> +EasyPMP does not have built-in components to prepare music files, e.g., to extract music files from audio CD, to encode music files to the format supported by the player, to edit media information (e.g., track title, artist, album) in music files, etc. +The absence of such components in EasyPMP is because we may prefer a number of useful and excellent software that has already been released for free. +Here is a list of links to the software to manage music files: +</p> + +<ul> +<li><a href="http://www.exactaudiocopy.de/">Exact Audio Copy</a> (king-of-quality CD ripper)</li> +<li><a href="http://cdexos.sourceforge.net/">CDex</a> (easy-to-use CD ripper of good quality)</li> +<li><a href="http://lame.sourceforge.net/">LAME</a> (king-of-quality MP3 encoder)</li> +<li><a href="http://www.vorbis.com/">Ogg Vorbis</a> (king-of-quality lossy audio codec)</li> +<li><a href="http://www.foobar2000.org/">foobar2000</a> (multifunctional music player with CD ripper and encoders integrated)</li> + +<li><a href="http://www.quinnware.com/">Quintessential Player</a> (multifunctional music player with CD ripper and encoders integrated)</li> +<li><a href="http://www.mp3tag.de/en/">MP3TAG</a> (tagging software)</li> +<li><a href="http://users.otenet.gr/~jtcliper/tgf/">The GodFather</a> (tagging software)</li> +</ul> + +<p> +<a href="http://www.exactaudiocopy.de/"><img src="http://www.exactaudiocopy.de/eacbanner.png" height="31" width="88" /></a> +<a href="http://www.foobar2000.org/"><img src="images/fb2k-button.png" height="31" width="88" /></a> +<a href="http://www.quinnware.com/downloads.php"><img src="http://www.quinnware.com/img/bug3.gif" width="88" height="31" border="0" /></a> + +</p> +<img src="images/eac.png" width="449" height="273" /> +</subsection> + +<subsection caption="Transfer the music files that you want to listen to"> +<p> +Refer to <a href="">the list of supported players</a> for the location where we should place them. +You can transfer the music files into your player by Explorer, or synchronization software (e.g. <a href="http://www.microsoft.com/windowsxp/using/digitalphotography/prophoto/synctoy.mspx">SyncToy for Windows XP</a>, <a href="http://samba.anu.edu.au/rsync/">rsync</a>, and <a href="http://www.cis.upenn.edu/~bcpierce/unison/">Unison</a>). +</p> +<img src="images/music-folder.png" width="386" height="285" /> +</subsection> + +<subsection caption="Transfer the playlist files that you want to use in your player"> +<p> +Refer to <a href="">the list of supported players</a> for the location where we should place them. +EasyPMP converts M3U/M3U8/PLS playlists into the native format recognized by your player. +Just as music files, you can prepare playlist files in your favorite software such as <a href="http://www.winamp.com">WinAmp</a>, <a href="http://www.foobar2000.org/">foobar2000</a>, etc. +EasyPMP can also generate dynamic playlists based on media information (e.g., all tracks by a specific artist, top 50 tracks played frequently, etc.) by describing JavaScript playlist (JSPL). +</p> +<img src="images/fb2k_playlist.png" width="385" height="277" /> +</subsection> + +<subsection caption="Run EasyPMP"> +<p> +Run EasyPMP and choose a player location and determine processing modes (<i>update</i> or <i>rebuild</i>) for media database construction and playlist conversion. +Press [OK] button in the previous dialog and wait for EasyPMP to complete the preparation. +EasyPMP enumerates all music files located under music folders and constructs the media database (if necessary). +It also converts M3U/M3U8/PLS/JSPL playlist files into respective playlist files (if necessary) that are recognized by your player. +</p> +<img src="images/easypmp_win32gui_screenshot.png" width="602" height="324" /> +<p> +Note that EasyPMP <b>never interferes your style of preparing music files and transferring them into your player</b>. +You don't have to stick with Windows Media Player 10 or cumbersome bundled software any more. +</p> +</subsection> +</section> + +</body> +</page> Added: trunk/webpage/document_jspl.xml =================================================================== --- trunk/webpage/document_jspl.xml (rev 0) +++ trunk/webpage/document_jspl.xml 2006-07-29 05:18:48 UTC (rev 141) @@ -0,0 +1,482 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<?xml-stylesheet href="./pmplib.xsl" type="application/xml"?> + +<page> +<head> +<title>JavaScript playlist (JSPL)</title> +<last-update>$Date: 2006/04/30 16:32:02 $</last-update> +</head> + +<body> + +<section caption="JavaScript playlist (JSPL)"> + +<subsection caption="Introduction"> +<p> +A <i>playlist</i> is a sequence (ordered list) of media tracks (i.e., songs and movies) to specify one's favorite tracks and their order. +In general, a playlist stores a sequence of file names (either in relative or absolute paths). +For example, an M3U playlist is mere a text file in which each line describes a reference (i.e., a file name in relative or absolute path) to a media track. +Therefore, playlists are <i>static</i> in the sense that the user must revise them to change the track list or sequence. +Although it is useful to represent one's best tracks in his or her collection, some might want to organize playlist automatically with some rules, for example, +</p> +<ul> +<li>All tracks in the player arranged in a random order;</li> +<li>All tracks performed by the Beatles;</li> +<li>All tracks with genre "Rock";</li> +<li>Top 100 tracks played frequently in the player.</li> +</ul> +<p> +We call such playlists described by the rules as <i>dynamic playlists</i>. +Dynamic playlists can be achieved by introducing a user interface (e.g., GUI form) to specify artist name, genre name, playback count, etc. +However, such approach lacks the versatility: a user might not be satisfied with a predefined GUI form if he or she wants a playlist with more complicated rules. +For this reason, we introduce a scripting language in which a user can access to the media information of all tracks, choose necessary tracks based on the media information, and arrange the tracks in an arbitrary order. +EasyPMP employs <i>JavaScript</i> as the scripting language for describing dynamic playlists. +</p> +<p> +JavaScript is best known as the scripting language for dynamic web contents and has a great number of users. +Some might presume that JavaScript is just for web contents, but it is also used as a scripting language embedded in other applications, e.g., Virtual Reality Modeling Language (VRML), Scalable Vector Graphics (SVG), etc. +Moreover, JavaScript has a powerful language specification for describing dynamic playlist, featuring: +</p> +<ul> +<li>Object Oriented Programing (OOP)</li> +<li>Useful built-in objects such as Array, Math, Object, String, etc.</li> +<li>Unicode support in String object.</li> +<li>Regular Expression (RegExp) object.</li> +</ul> +</subsection> + +<subsection caption="The function to be implemented: main"> +<p> +Any JavaScript playlist must implement function <i>main</i>. +This function chooses tracks to be included in the target playlist(s) from media information of all tracks in a portable player. +For generating a single playlist, the function should return a JavaScript Array instance that represents a sequence (ordered list) of tracks. +For generating multiple playlists, the function should return a JavaScript Object instance storing associations from playlist names to their corresponding track sequences. +The application such as EasyPMP sets the necessary arguments (e.g., media information) to the function, receives the JavaScript value from the <i>main</i> function, and generates the corresponding playlist(s). +</p> +<p> +The following describes a skeleton code implementing the minimum components for a valid JSPL, not including any tracks to the corresponding plylist. +</p> +<code><![CDATA[/** + * A skeleton code for JSPL. + * @param media The array of media information of all tracks. + * @param src The full-path name of this JSPL file. + * @return A JavaScript array (for singple playlist); + * a JavaScript object (for multiple playlists). + */ +function main(media, src) +{ +} +]]></code> +<p> +Content of a playlist is determined by the array returned by the function <i>main</i>. +For example, if an implementation collects tracks by a specific artist, the corresponding playlist will have the tracks by the artist. +The primary task of the <i>main</i> function is to choose a set of preferred tracks by implementing a conditional expression. +The following code extracts tracks performed by the Beatles. +</p> +<code><![CDATA[/* JSPL with all tracks by Beatles. */ + +function main(media, src) +{ + // Create a JavaScript array representing a playlist. + var pl = new Array(); + + for (var i = 0;i < media.length;++i) { + var track = media[i]; + + // Add the current track if the artist name is "Beatles". + if (track.artist == "Beatles") { + pl.push(track); + } + } + + // Return the playlist. + return pl; +} +]]></code> +<p> +In addition, the playback order of a playlist is determined by the order of tracks stored in the JavaScript Array object. +For example, if a returned array contains all tracks in a portable player in a random order, the corresponding playlist will be a random playlist with all tracks. +The function is responsible for sorting tracks in a preferred order, e.g., numerical order of track numbers, alphabetical order of track titles, etc. +The following code extracts all tracks in a player and arranges them in an alphabetical order of track titles. +The sorting implementation can be simplified by using Playlist class "playlist.js" (described later). +</p> +<code><![CDATA[/* JSPL with all tracks in an alphabetical order. */ + +function comp_title(x, y) +{ + return ((x.title)>(y.title))-((x.title)<(y.title)); +} + +function main(media, src) +{ + // Create a JavaScript array representing a playlist. + var pl = new Array(); + + // Add all tracks to the playlist. + for (var i = 0;i < media.length;++i) { + pl.push(media[i]); + } + + // Sort the playlist in an alphabetical order of track titles. + pl.sort(comp_title); + + // Return the playlist. + return pl; +} +]]></code> +<p> +A JavaScript playlist can generate multiple playlists, e.g., playlists each of which represents tracks by an artist. +The <i>main</i> function must return a JavaScript object storing mappings from playlist names and their playlist contents. +According to the JavaScript language specification, any JavaScript object incorporates an <i>associative array</i> that associates attribute names and their values. +In JavaScript playlist, an attribute name represents a playlist name, and its value corresponds to a JavaScript array storing the track list. +The following JSPL collects the tracks performed by the same artist into a playlist and generates such playlists for all artists. +</p> +<code><![CDATA[/* JSPL for organizing multiple playlists by artist names. */ + +function main(media, src) +{ + // Container storing multiple playlists. + var pls = new Object(); + + for (var i = 0;i < media.length;++i) { + var track = media[i]; + + // Access to the playlist named as the artist name. + var pl = pls[track.artist]; + + // Create a new playlist if such playlist does not exist. + if (pl == undefined) { + pl = pls[track.artist] = new Array(); + } + + // Add this track to the playlist. + pl.push(track); + } + + // Return the container of multiple playlists. + return pls; +} +]]></code> +</subsection> + +<subsection caption="Arguments to main function"> +<p> +Function <i>main</i> receives two arguments, <i>media</i> and <i>src</i>. +The first argument <i>media</i> is an array of JavaScript objects each of which represents media information of a track in a portable player. +Each element in the array has a set of attributes that represents the media information. +A JavaScript playlist makes use of the attributes to extract preferred tracks and to arrange them in a preferred order. +The following is the list of the attributes in each element. +</p> + +<table border="1"> +<tr><th>Field name</th><th>Type</th><th>Description</th><th>Example</th></tr> +<tr> +<td>id</td> +<td>Integer</td> +<td>Unique identifier</td> +<td>1</td> +</tr> + +<tr> +<td>filename</td> +<td>String</td> +<td>Full-path name of the media file</td> +<td>D:\Music\Beatles\YellowSubmarine\02.mp3</td> +</tr> +<tr> +<td>title</td> +<td>String</td> +<td>Title name</td> + +<td>Hey Bulldog</td> +</tr> +<tr> +<td>artist</td> +<td>String</td> +<td>Artist name</td> +<td>Beatles</td> +</tr> +<tr> +<td>composer</td> +<td>String</td> + +<td>Composer of this track typically used for classical music.</td> +<td>John Lennon & Paul McCartney</td> +</tr> +<tr> +<td>album</td> +<td>String</td> +<td>Album name</td> +<td>Yellow Submarine</td> +</tr> +<tr> + +<td>genre</td> +<td>String</td> +<td>Genre name</td> +<td>Rock</td> +</tr> +<tr> +<td>codec</td> +<td>Integer</td> +<td>Codec identifier</td> +<td>Codec.OggVorbis</td> + +</tr> +<tr> +<td>track_number</td> +<td>Integer</td> +<td>Track number</td> +<td>2</td> +</tr> +<tr> +<td>sample_rate</td> +<td>Integer</td> +<td>Sample rate in Hz</td> + +<td>44100</td> +</tr> +<tr> +<td>bitrate</td> +<td>Integer</td> +<td>Bitrate in bps</td> +<td>128000</td> +</tr> +<tr> +<td>duration</td> +<td>Integer</td> + +<td>Track length in seconds</td> +<td>193</td> +</tr> +<tr> +<td>rating</td> +<td>Integer</td> +<td>Rating value</td> +<td>5</td> +</tr> +<tr> +<td>play_count</td> + +<td>Integer</td> +<td>The number of playback times</td> +<td>3</td> +</tr> +<tr> +<td>update_timestamp</td> +<td>Integer</td> +<td>Timestamp of the last modified</td> +<td>193</td> +</tr> + +<tr> +<td>import_timestamp</td> +<td>Integer</td> +<td>Timestamp when this track was added to the database</td> +<td>193</td> +</tr> +<tr> +<td>playback_timestamp</td> +<td>Integer</td> +<td>Timestamp when this track was played in the player</td> + +<td>193</td> +</tr> +</table> + +<p> +The second argument <i>src</i> presents the full-path name of the current JavaScript playlist. +</p> +</subsection> + +<subsection caption="JSPL extension to ECMAScript"> +<p> +For debugging purpose, JSPL defines a global function <i>print</i> to display values. +The function takes multiple arguments and outputs the argument values. +The following code outputs artist, album, and title names of all tracks. +</p> +<code><![CDATA[/* JSPL displaying track artists, albums, and titles. */ + +function main(media, src) +{ + for (var i = 0;i < media.length;++i) { + var track = media[i]; + print(track.artist, track.album, track.title); + } +} +]]></code> +<p> +JSPL defines a global function <i>include</i> to evaluate an external JavaScript file. +This function is useful to modularize reusable components. +The following code import "playlist.js" located in JSPL include path (typically "jspl" directory under EasyPMP executable). +</p> +<code><![CDATA[include("playlist.js"); +]]></code> +</subsection> + +<subsection caption="Codec object (defined as a global object)"> +<p> +<i>Codec</i> object defines codec identifiers used by <i>codec</i> field in media information. +Following member variables are defined: +</p> + +<dl> +<dt>MP3</dt><dd>MPEG Audio Layer III</dd> +<dt>OggVorbis</dt><dd>Ogg Vorbis</dd> +<dt>WAV</dt><dd>Microsoft WAVE</dd> +<dt>WMA</dt><dd>Windows Media Audio</dd> +</dl> +</subsection> + +<subsection caption="Playlist object (playlist.js)"> +<p> +Playlist class is a specialization of JavaScript Array for the management of a playlist. +In addition to the member function in Array, Playlist class has two member functions, <i>order</i> and <i>shuffle</i>. +</p> + +<subsubsection caption="order function"> +<p> +Member function <i>order</i> is useful to arrange tracks in a playlist. +Although JavaScript Array class has member function <i>sort</i>, it is boring to implement a comparison function to arrange tracks in a preferred order. +The function arranges tracks by the field(s) specified by the argument(s). +Each argument represents the field name to predicate the order of two tracks. +Receiving "title" as an argument, for example, the function arranges tracks in a alphabetical (descending) order of title names. +If the function receives an argument beginning with character '-', tracks are arranged in an ascending order. +</p> +<p> +If the values of two tracks are identical by a comparison with the field specified by the first argument, the function tries the next field specified by the second argument (if any). +This process will be repeated while the values of two tracks are identical. +If two tracks are identical even after comparing with all fields, the order is left undefined. +</p> +<p> +The following snippet arranges tracks in an alphabetical order of artist names. +If artist names of two tracks are identical, the order is determined by the alphabetical order of album names. +If artist and album names of two tracks are the same, the order is determined by the numerical order of track numbers. +</p> +<code><![CDATA[include("playlist.js"); + +pl = new Playlist(); +... +/* Arrange tracks by artists, albums, and track numbers. */ +pl.order("artist", "album", "track_number"); +]]></code> +<p> +The following code arranges tracks in a <i>descending</i> order of play counts, i.e., in a popularity order. +</p> +<code><![CDATA[include("playlist.js"); + +pl = new Playlist(); +... +/* Arrange tracks in a descending order of play counts. */ +pl.order("-play_count"); +]]></code> +</subsubsection> + +<subsubsection caption="shuffle function"> +<p> +Member function <i>shuffle</i> randomizes the order of tracks in a playlist. +The function is useful to generate a shuffle playlist. +</p> +<code><![CDATA[include("playlist.js"); + +pl = new Playlist(); +... +/* Arrange tracks in a random order. */ +pl.shuffle(); +]]></code> +</subsubsection> +</subsection> + +<subsection caption="Examples"> + +<subsubsection caption="Artist.jspl"> +<code><![CDATA[/* + * Artist playlist + * + * This JSPL extracts tracks performed by the artist whose name is + * is specified by either variable 'artist_name' or filename of this JSPL. + * + */ + +// Change this to specify the artist name +var artist_name = ""; + +include("playlist.js"); + +function main(media, source) +{ + // Check artist_name. + if (!artist_name) { + // Retrieve an artist name from the filename. + var begin = 0, end = source.length; + for (var i = 0;i < source.length;++i) { + if (source[i] == '\' || source[i] == '/') + begin = i; + if (source[i] == '.') + end = i; + } + artist_name = source.slice(begin, end); + } + + // Convert the artist name to lower case. + artist_name = artist_name.toLowerCase(); + + var pl = new Playlist(); + for (var i = 0;i < media.length;++i) + if (media[i].artist.toLowerCase() == artist_name) + pl.push(media[i]); + pl.order("album", "track_number"); + + return pl; +} +]]></code> +</subsubsection> + +<subsubsection caption="Artists.jspl"> +<code><![CDATA[/* + * Artists playlist + * + * This JSPL generates multiple playlists each of which collects tracks + * performed by an artist. + * + */ + +include("playlist.js"); + +function main(media, playlist) +{ + var pls = new Object(); + + for (var i = 0;i < media.length;++i) { + var artist = media[i].artist.toLowerCase(); + var pl = pls[artist]; + if (pl == undefined) + pl = pls[artist] = new Playlist(); + pl.push(media[i]); + } + + for (var name in pls) { + var pl = pls[name]; + pl.order("album", "track_number"); + } + + return pls; +} +]]></code> +</subsubsection> +</subsection> + +<subsection caption="Reference"> +<ul> +<li> +<a href="http://developer.mozilla.org/en/docs/JavaScript">JavaScript - MDC</a>: Documentation of the JavaScript language used by Gecko-based browsers (e.g., FireFox) and also by EasyPMP (libplaylist). + +</li> +<li> +<a href="http://www.mozilla.org/js/spidermonkey/">SpiderMonkey</a>: The JavaScript engine used by EasyPMP (libplaylist). It is Gecko's JavaScript engine written in C. It is used in various Mozilla products, and is available under MPL/GPL/LGPL tri-license. +</li> +</ul> +</subsection> +</section> +</body> +</page> Added: trunk/webpage/download.xml =================================================================== --- trunk/webpage/download.xml (rev 0) +++ trunk/webpage/download.xml 2006-07-29 05:18:48 UTC (rev 141) @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<?xml-stylesheet href="./pmplib.xsl" type="application/xml"?> + +<page> +<head> +<title>Download</title> +<last-update>$Date: 2006/04/30 16:32:00 $</last-update> +</head> + +<body> + +<section caption="Download"> +<p> +Currently, EasyPMP is the only application we develop and release. +</p> + +<subsection caption="EasyPMP [Win32]"> +<p> +Download the <a href="http://sourceforge.net/project/showfiles.php?group_id=157298&package_id=175772">EasyPMP binary for Windows 2000/XP</a> at sourceforge.net. +</p> +</subsection> + +<subsection caption="EasyPMP [POSIX]"> +<p> +Download the <a href="http://sourceforge.net/project/showfiles.php?group_id=157298&package_id=175772">source code of pmplib</a> at sourceforge.net. +</p> +</subsection> +</section> + +<section caption="Accessing the source code through SVN"> +<p> +The source code is available at the <a href="http://sourceforge.net/svn/?group_id=157298">subversion repository</a>. +You can also <a href="http://svn.sourceforge.net/pmplib">browse the source code</a> through the web browsers. +</p> +</section> + +</body> +</page> Added: trunk/webpage/faq.xml =================================================================== --- trunk/webpage/faq.xml (rev 0) +++ trunk/webpage/faq.xml 2006-07-29 05:18:48 UTC (rev 141) @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<?xml-stylesheet href="./pmplib.xsl" type="application/xml"?> + +<page> +<head> +<title>Frequently Asked Questions (FAQ)</title> +<last-update>$Date: 2006/01/23 20:52:40 $</last-update> +</head> + +<body> +<makeindex caption="Table of Contents: PMPlib FAQ" /> + +<section caption="EasyH10 Frequently Asked Questions (FAQ)"> +<subsection caption="item #1"> +</subsection> +</section> + +</body> +</page> Added: trunk/webpage/images/background-800px.gif =================================================================== (Binary files differ) Property changes on: trunk/webpage/images/background-800px.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/webpage/images/background.gif =================================================================== (Binary files differ) Property changes on: trunk/webpage/images/background.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/webpage/images/eac.png =================================================================== (Binary files differ) Property changes on: trunk/webpage/images/eac.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/webpage/images/easypmp_win32gui_screenshot.png =================================================================== (Binary files differ) Property changes on: trunk/webpage/images/easypmp_win32gui_screenshot.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/webpage/images/example.jpg =================================================================== (Binary files differ) Property changes on: trunk/webpage/images/example.jpg ___________________________________________________________________ Name: svn:mime-type + image/jpeg Added: trunk/webpage/images/fb2k-button.png =================================================================== (Binary files differ) Property changes on: trunk/webpage/images/fb2k-button.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/webpage/images/fb2k_playlist.png =================================================================== (Binary files differ) Property changes on: trunk/webpage/images/fb2k_playlist.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/webpage/images/music-folder.png =================================================================== (Binary files differ) Property changes on: trunk/webpage/images/music-folder.png ___________________________________________________________________ Name: svn:mime-type + image/png Added: trunk/webpage/index.xml =================================================================== --- trunk/webpage/index.xml (rev 0) +++ trunk/webpage/index.xml 2006-07-29 05:18:48 UTC (rev 141) @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<?xml-stylesheet href="./pmplib.xsl" type="application/xml"?> + +<page> +<head> +<include-rss /> +<last-update>$Date: 2006/01/17 14:07:30 $</last-update> +</head> + +<body> + +<section caption="Welcome to PMPlib project!"> +<p> +Portable Media Player library (PMPlib) is an open source project for the development of management software/library for various portable media players. PMPlib project currently supports the following hardware: +</p> +<ul> +<li>iRiver H100 series</li> +<li>iRiver H300 series</li> +<li>iRiver H10 UMS</li> +<li>iRiver H10 MTP (with emergency connect mode)</li> +<li>iRiver H10Jr. UMS</li> +<li>iRiver U10 UMS</li> +<li>MEDION MDJuke220</li> +<li>MEDION MDJuke440</li> +<li>Samsung YH-820</li> +<li>Samsung YH-920</li> +<li>Samsung YH-925</li> +</ul> +</section> + +<section caption="News"> +<include-news /> +</section> + +</body> +</page> Added: trunk/webpage/links.xml =================================================================== --- trunk/webpage/links.xml (rev 0) +++ trunk/webpage/links.xml 2006-07-29 05:18:48 UTC (rev 141) @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<?xml-stylesheet href="./pmplib.xsl" type="application/xml"?> + +<page> +<head> +<title>Links</title> +<last-update>$Date: 2005/10/31 00:06:44 $</last-update> +</head> + +<body> + +<section caption="Links"> +<p> +If you know other useful sites or create a web site related to PMPlib, please let us know. +</p> +</section> + +</body> +</page> Added: trunk/webpage/news.xml =================================================================== --- trunk/webpage/news.xml (rev 0) +++ trunk/webpage/news.xml 2006-07-29 05:18:48 UTC (rev 141) @@ -0,0 +1,131 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<?xml-stylesheet href="./pmplib.xsl" type="application/xml"?> + +<page> +<head> +<include-rss /> +<title>News</title> +<last-update>$Date: 2006/04/30 16:32:02 $</last-update> +</head> + +<body> + +<news> + +<ni caption="EasyPMP version 0.11 released" date="2006-06-06"> +<p> +We are pleased to annouce that PMPlib 0.11 was released with the source-code distribution for POSIX environments. +</p> +<ul> +<li><b>The memorable release of PMPlib source code for POSIX environments.</b> Martin Ellis, who joined the PMPlib project as a developer, achieved this miracle with his brilliant skill of programming. We confirmed that the current source code worked fine on Debian GNU/Linux 3.1. Note that libid3tag, libz, libogg, libvorbis, SpiderMonkey are necessary for building EasyPMP. Please report the workability or problems on your environments because we are not sure about the portability with other Linux distributions and Mac OS.</li> + +<li>A serious bug-fix in playlist conversion for iRiver U10 and H10Jr. Playlist conversion did not work correctly if multiple files whose names begin with the same eight letters exist.</li> +<li>Implemented a function to strip preceding words such as 'the' in artist names.</li> +<li>Supported U10 UMS firmware 1.65.</li> +</ul> +</ni> + +<ni caption="EasyPMP version 0.10 released" date="2006-05-25"> +<p> +<b>Welcome to EasyPMP, iRiver U10 users worldwide!</b> +</p> +<p> +Following <a href="http://www.iriver.com/mtp/">iRiver's great decision</a> of releasing the UMS firmware for U10 shipped with the MTP firmware, we are pleased to release EasyPMP version 0.10 alpha to support the latest firmware, U10 UMS firmware version 1.64. +The difference between the previous version to the current is only that EasyPMP now recognizes U10 UMS 1.64 automatically. +Even though this is a minor change to the source code, we release a new version to celebrate the new firmware! +</p> +</ni> + +<ni caption="EasyPMP version 0.9 released" date="2006-05-05"> +<p> +EasyPMP version 0.9 was released. +</p> +<ul> +<li>Revised the specification of JavaScript playlist for better flexibility. The new specification is totally incompatible with the old one. Please refer to the <a href="jspl.html">JSPL documentation</a>.</li> +<li>Load the media database automatically when enabling JSPL.</li> +<li>Supported Samsung YH-820 player.</li> +<li>Supported Samsung YH-925 player (to be confirmed; maybe...)</li> +<li>Launched the official web site.</li> +</ul> +</ni> + +<ni caption="EasyPMP version 0.8 released" date="2006-02-13"> +<p> +EasyPMP version 0.8 was released. +</p> +<ul> +<li>Supported JavaScript Playlist (JSPL). Put artists.jspl into your playlist folder to experience how powerful it is.</li> +<li>Supported configurable sources of media information. EasyPMP can now make use of folder structure and file name for obtaining media information.</li> +<li>Bug-fix in playlist generation for PortalPlayer based players.</li> +</ul> +</ni> + +<ni caption="EasyPMP version 0.7 released" date="2006-02-11"> +<p> +EasyPMP version 0.7 was released. +</p> +<ul> +<li>Supported Medion MDJuke 440, MDJuke220.</li> +</ul> +</ni> + +<ni caption="EasyPMP version 0.6 released" date="2006-01-24"> +<p> +EasyPMP version 0.6 was released. +</p> +<ul> +<li>Bug fix in database construction for H10Jr/U10</li> +</ul> +</ni> + +<ni caption="EasyPMP version 0.5 released" date="2006-01-09"> +<p> +EasyPMP version 0.5 was the initial release of Win32 GUI version. +</p> +</ni> + +<ni caption="EasyPMP version 0.4 released" date="2006-01-03"> +<p> +EasyPMP version 0.4 was released. +</p> +<ul> +<li>Implemented the incremental update of media database and playlists.</li> +<li>Revised command-line switches.</li> +<li>Changed the license of some DLLs to LGPL.</li> +</ul> +</ni> + +<ni caption="EasyPMP version 0.3 released" date="2006-01-01"> +<p> +EasyPMP version 0.3 was released. +</p> +<ul> +<li>Changed the application name to EasyPMP.</li> +<li>Supported iRiver H10 players.</li> +<li>Implemented playlist conversion.</li> +<li>Fixed a bug in the database construction for iRiver H10Jr/U10.</li> +<li>Exported the internal libraries as dynamic link libraries (DLLs) for the future use.</li> +</ul> +</ni> + +<ni caption="DMPSync version 0.2 released" date="2005-12-24"> +<p> +DMPSync version 0.2 was released. +</p> +<ul> +<li>Supported iRiver H100/H300 database (iRivNavi.iDB)</li> +</ul> +</ni> + +<ni caption="DMPSync version 0.1 released" date="2005-12-23"> +<p> +This is the initial attemp to construct a media database for iriver H10Jr/U10 players. +Only Win32 CUI version was released. +No playlist conversion at this moment. +</p> +</ni> + +</news> + +</body> +</page> Added: trunk/webpage/newsrss.xsl =================================================================== --- trunk/webpage/newsrss.xsl (rev 0) +++ trunk/webpage/newsrss.xsl 2006-07-29 05:18:48 UTC (rev 141) @@ -0,0 +1,153 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + +<xsl:output + method="xml" + encoding="ISO-8859-1" + /> + +<xsl:template match="/"> + <rss version="2.0"> + <channel> + <title>PMPlib News</title> + <link>http://pmplib.sourceforge.net/</link> + <description>Portable Media Player library (PMPlib) is an open source project for the development of management software and library for various portable media players.</description> + <copyright><xsl:call-template name="copyright" /></copyright> + <lastBuildDate><xsl:value-of select="$date" /></lastBuildDate> + <generator>PMPlib News RSS generator</generator> + <xsl:apply-templates select="/page/body/news" /> + </channel> + </rss> +</xsl:template> + + +<xsl:template match="news"> +<xsl:apply-templates select="ni[1]" /> +<xsl:apply-templates select="ni[2]" /> +<xsl:apply-templates select="ni[3]" /> +<xsl:apply-templates select="ni[4]" /> +<xsl:apply-templates select="ni[5]" /> +<xsl:apply-templates select="ni[6]" /> +<xsl:apply-templates select="ni[7]" /> +<xsl:apply-templates select="ni[8]" /> +<xsl:apply-templates select="ni[9]" /> +<xsl:apply-templates select="ni[10]" /> +</xsl:template> + +<xsl:template match="ni"> +<item> +<title><xsl:value-of select="@caption" /> (<xsl:value-of select="@date" />)</title> +<description><xsl:apply-templates /></description> +<author>Nyaochi</author> +<link>http://easyh10.sourceforge.net/news.html#<xsl:value-of select="generate-id()" /></link> +<guid isPermaLink="true">http://easyh10.sourceforge.net/news.html#<xsl:value-of select="generate-id()" /></guid> +</item> +</xsl:template> + + + + + +<xsl:template match="a"> +<a> + <xsl:attribute name="href"><xsl:value-of select="@href" /></xsl:attribute> + <xsl:apply-templates /> +</a> +</xsl:template> + +<xsl:template match="p"><p><xsl:apply-templates /></p></xsl:template> +<xsl:template match="br"><br/></xsl:template> +<xsl:template match="i"><i><xsl:apply-templates /></i></xsl:template> +<xsl:template match="b"><b><xsl:apply-templates /></b></xsl:template><xsl:template match="u"><u><xsl:apply-templates /></u></xsl:template> +<xsl:template match="table"> +<div align="center"> +<xsl:if test="@caption"><br/><b><xsl:value-of select="@caption" /></b></xsl:if> +<table border="1"> +<xsl:if test="@border"><xsl:attribute name="border"><xsl:value-of select="@border" /></xsl:attribute></xsl:if> +<xsl:apply-templates /> +</table> +</div> +</xsl:template> +<xsl:template match="tr"><tr><xsl:apply-templates /></tr></xsl:template> +<xsl:template match="td"><td><xsl:if test="@colspan"><xsl:attribute name="colspan"><xsl:value-of select="@colspan" /></xsl:attribute></xsl:if><xsl:apply-templates /></td></xsl:template> +<xsl:template match="th"><th><xsl:if test="@width"><xsl:attribute name="width"><xsl:value-of select="@width" /></xsl:attribute></xsl:if><xsl:apply-templates /></th></xsl:template> + +<xsl:template match="shell"><pre class="shell"><xsl:apply-templates /></pre></xsl:template><xsl:template match="br"><br/></xsl:template> +<xsl:template match="pre"><pre><xsl:apply-templates /></pre></xsl:template> +<xsl:template match="source"><pre class="source"><xsl:apply-templates /></pre></xsl:template> +<xsl:template match="ul"><ul><xsl:apply-templates /></ul></xsl:template> +<xsl:template match="ol"><ol><xsl:apply-templates /></ol></xsl:template> +<xsl:template match="li"><li><xsl:apply-templates /></li></xsl:template> +<xsl:template match="dl"><dl><xsl:apply-templates /></dl></xsl:template> +<xsl:template match="dt"><dt><xsl:apply-templates /></dt></xsl:template> +<xsl:template match="dd"><dd><xsl:apply-templates /></dd></xsl:template> + +<xsl:template match="fig"><p align="center"> +<xsl:choose> +<xsl:when test="@detail-src"> +<a><xsl:attribute name="href">fig/<xsl:value-of select="@detail-src" /></xsl:attribute><img><xsl:attribute name="src">http://www.iriver.co.jp/images/supporter/670_52/<xsl:value-of select="@src" /></xsl:attribute></img></a> +</xsl:when> +<xsl:otherwise> +<img><xsl:attribute name="src">fig/<xsl:value-of select="@src" /></xsl:attribute></img> +</xsl:otherwise> +</xsl:choose> +<xsl:if test="@caption"><br/><b><xsl:value-of select="@caption" /></b></xsl:if></p></xsl:template> + +<xsl:template match="img"> +<img><xsl:attribute name="src"><xsl:value-of select="@src" /></xsl:attribute><xsl:attribute name="alt"><xsl:value-of select="@alt" /></xsl:attribute></img> +</xsl:template> + +<xsl:template match="jpg"><div align="center"> +<a><xsl:attribute name="href">fig/<xsl:value-of select="@src" />.jpg</xsl:attribute><img><xsl:attribute name="src">fig/<xsl:value-of select="@src" />-s.jpg</xsl:attribute></img></a> +<xsl:if test="@caption"><br/><b><xsl:value-of select="@caption" /></b></xsl:if> +</div> +</xsl:template> + +<xsl:template match="gif"><div align="center"> +<a><xsl:attribute name="href">fig/<xsl:value-of select="@src" />.gif</xsl:attribute><img><xsl:attribute name="src">fig/<xsl:value-of select="@src" />-s.gif</xsl:attribute></img></a> +<xsl:if test="@caption"><br/><b><xsl:value-of select="@caption" /></b></xsl:if> +</div> +</xsl:template> + +<xsl:template match="section-table"> +<table border="1"> +<xsl:apply-templates mode="section-table"/> +</table> +</xsl:template> + +<xsl:template match="ts" mode="section-table"> +<xsl:apply-templates mode="section-table"> + <xsl:with-param name="section_caption" select="@caption" /> + <xsl:with-param name="num_rowspan" select="count(tr)" /> +</xsl:apply-templates> +</xsl:template> + +<xsl:template match="tr" mode="section-table"> + <xsl:param name="section_caption"></xsl:param> + <xsl:param name="num_rowspan">1</xsl:param> + <tr> + <xsl:choose> + <xsl:when test="@superior='1'"><xsl:attribute name="bgcolor">#DDDDFF</xsl:attribute></xsl:when> + <xsl:when test="@superior='2'"><xsl:attribute name="bgcolor">#FFDDDD</xsl:attribute></xsl:when> + <xsl:otherwise></xsl:otherwise> + </xsl:choose> + <xsl:if test="position() = 2"> + <td align="middle" bgcolor="#DDDDDD"> + <xsl:attribute name="rowspan"><xsl:value-of select="$num_rowspan" /></xsl:attribute> + <xsl:value-of select="$section_caption" /> + </td> + </xsl:if> + <td><xsl:value-of select="@caption" /></td> + <xsl:apply-templates /> + </tr> +</xsl:template> + +<xsl:template match="thr" mode="section-table"> +<tr bgcolor="#AAAAAA"><xsl:apply-templates /></tr> +</xsl:template> + + +<!-- Named Template --> +<xsl:template name="copyright">Copyright (c) 2005-2006 PMPlib project.</xsl:template> + +</xsl:stylesheet> Added: trunk/webpage/pmplib.xsl =================================================================== --- trunk/webpage/pmplib.xsl (rev 0) +++ trunk/webpage/pmplib.xsl 2006-07-29 05:18:48 UTC (rev 141) @@ -0,0 +1,313 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + +<xsl:output + method="xml" + encoding="ISO-8859-1" + doctype-public="-//W3C//DTD XHTML 1.1//EN" + doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" + /> + +<xsl:template match="/"> + <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> + <head> + <meta http-equiv="Content-Type" content="text/html; charaset=ISO-8859-1" /> + <meta name="keywords" content="PMPlib,EasyPMP,Portable Media Player,database,playlist" /> + <meta name="description" content="Portable Media Player library (PMPlib) is an open source project for the development of management software/library for various portable media players." /> + <meta name="author" content="http://pmplib.sourceforge.net/" /> + <meta name="copyright" content="Copyright (c) 2005-2006 by PMPlib project" /> + + <link rel="stylesheet" href="./1024px.css" type="text/css" title="1024px style" media="screen,projection"/> + <xsl:if test="/page/head/include-rss"><link rel="alternate" type="application/rss+xml" title="RSS" href="./index.rss" /></xsl:if> + + <title><xsl:call-template name="title" /></title> + </head> + <body> + <div id="wrap"> + + <div id="header"> + <p id="toplinks">Skip to: <a href="#content">Content</a> | <a href="#sidebar">Navigation</a> | <a href="#footer">Footer</a></p> + <h1><a href="index.html">PMP<span class="fade">lib</span></a></h1> + <p id="slogan"></p> + </div> + + <div id="content"> + <xsl:apply-templates select="/page/body" /> + </div> + + <div id="sidebar"> + + <h2>Pages:</h2> + <xsl:call-template name="topmenu" /> + + <h2>Site news:</h2> + <xsl:call-template name="sitenews" /> + + <h2>About us</h2> + <p>Portable Media Player library (PMPlib) is an open source project for the development of management software and library for various portable media players.</p> + + <p><a href="http://sourceforge.net"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=157298&type=1" width="88" height="31" border="0" alt="SourceForge.net Logo" /></a></p> + + </div> + + <div id="footer"> + <xsl:call-template name="footer" /> + </div> + + </div> + </body> + </html> +</xsl:template> + +<xsl:template match="body"> +<xsl:apply-templates /> +</xsl:template> + +<xsl:template match="include-news"> +<xsl:apply-templates select="document('news.xml')/page/body/news/ni[1]" /> +<xsl:apply-templates select="document('news.xml')/page/body/news/ni[2]" /> +<xsl:apply-templates select="document('news.xml')/page/body/news/ni[3]" /> +</xsl:template> + +<xsl:template match="makeindex"> +<h2> +<xsl:choose> + <xsl:when test="@caption"><xsl:value-of select="@caption" /></xsl:when> + <xsl:otherwise>Table of Contents</xsl:otherwise> +</xsl:choose> +</h2> +<xsl:choose> + <xsl:when test="@ordered[.='yes']"> + <ol class="index"> + <xsl:apply-templates select="../section" mode="makeindex"> + <xsl:with-param name="list-element">ol</xsl:with-param> + </xsl:apply-templates> + </ol> + </xsl:when> + <xsl:otherwise> + <ul class="index"> + <xsl:apply-templates select="../section" mode="makeindex"> + <xsl:with-param name="list-element">ul</xsl:with-param> + </xsl:apply-templates> + </ul> + </xsl:otherwise> +</xsl:choose> +</xsl:template> + +<!-- + Implementation of <section> element +--> +<xsl:template match="section"> +<h2><a name="{generate-id()}"><xsl:value-of select="@caption" /></a></h2> +<xsl:apply-templates /> +</xsl:template> + +<xsl:template match="section" mode="makeindex"> + <xsl:param name="list-element">ul</xsl:param> + <li> + <a href="#{generate-id()}"><xsl:value-of select="@caption" /></a> + <xsl:element name="{$list-element}"> + <xsl:attribute name="class">index</xsl:attribute> + <xsl:apply-templates select="subsection" mode="makeindex"> + </xsl:apply-templates> + </xsl:element> + </li> +</xsl:template> + + + +<!-- + Implementation of <subsection> element +--> +<xsl:template match="subsection"> +<h3><a name="{generate-id()}"><xsl:value-of select="@caption" /></a></h3> +<xsl:apply-templates /> +</xsl:template> + +<xsl:template match="subsection" mode="makeindex"> + <xsl:param name="list-element">ul</xsl:param> + <li> + <a href="#{generate-id()}"><xsl:value-of select="@caption" /></a> + <xsl:element name="{$list-element}"> + <xsl:attribute name="class">index</xsl:attribute> + <xsl:apply-templates select="subsubsection" mode="makeindex"> + </xsl:apply-templates> + </xsl:element> + </li> +</xsl:template> + +<!-- + Implementation of <subsubsection> element +--> +<xsl:template match="subsubsection"> +<h4><a name="{generate-id()}"><xsl:value-of select="@caption" /></a></h4> +<xsl:apply-templates /> +</xsl:template> + +<xsl:template match="subsubsection" mode="makeindex"> + <xsl:param name="list-element">ul</xsl:param> + <li> + <a href="#{generate-id()}"><xsl:value-of select="@caption" /></a> + <xsl:element name="{$list-element}"> + <xsl:attribute name="class">index</xsl:attribute> + <xsl:apply-templates select="subsubsection" mode="makeindex"> + </xsl:apply-templates> + </xsl:element> + </li> +</xsl:template> + + +<xsl:template match="news"> +<h2>News</h2> +<xsl:apply-templates select="ni" /> +</xsl:template> + +<xsl:template match="ni"> +<h3><a name="{generate-id()}"><xsl:value-of select="@caption" /> (<xsl:value-of select="@date" />)</a></h3> +<xsl:apply-templates /> +</xsl:template> + +<xsl:template match="ni" mode="title"> +<p> +<strong><xsl:value-of select="@date" /></strong> +<br/> +<xsl:value-of select="@caption" /> +</p> +</xsl:template> + + +<xsl:template match="a"> +<a> + <xsl:attribute name="href"><xsl:value-of select="@href" /></xsl:attribute> + <xsl:apply-templates /> +</a> +</xsl:template> + +<xsl:template match="p"><p><xsl:apply-templates /></p></xsl:template> +<xsl:template match="br"><br/></xsl:template> +<xsl:template match="i"><i><xsl:apply-templates /></i></xsl:template> +<xsl:template match="s"><s><xsl:apply-templates /></s></xsl:template> +<xsl:template match="b"><b><xsl:apply-templates /></b></xsl:template><xsl:template match="u"><u><xsl:apply-templates /></u></xsl:template> +<xsl:template match="table"> +<div align="center"> +<xsl:if test="@caption"><br/><b><xsl:value-of select="@caption" /></b></xsl:if> +<table border="1"> +<xsl:if test="@border"><xsl:attribute name="border"><xsl:value-of select="@border" /></xsl:attribute></xsl:if> +<xsl:apply-templates /> +</table> +</div> +</xsl:template> +<xsl:template match="tr"><tr><xsl:apply-templates /></tr></xsl:template> +<xsl:template match="td"><td><xsl:if test="@colspan"><xsl:attribute name="colspan"><xsl:value-of select="@colspan" /></xsl:attribute></xsl:if><xsl:apply-templates /></td></xsl:template> +<xsl:template match="th"><th><xsl:if test="@width"><xsl:attribute name="width"><xsl:value-of select="@width" /></xsl:attribute></xsl:if><xsl:apply-templates /></th></xsl:template> + +<xsl:template match="shell"><pre class="shell"><xsl:apply-templates /></pre></xsl:template><xsl:template match="br"><br/></xsl:template> +<xsl:template match="pre"><pre><xsl:apply-templates /></pre></xsl:template> +<xsl:template match="code"><code><xsl:apply-templates /></code></xsl:template> +<xsl:template match="source"><pre class="source"><xsl:apply-templates /></pre></xsl:template> +<xsl:template match="ul"><ul><xsl:apply-templates /></ul></xsl:template> +<xsl:template match="ol"><ol><xsl:apply-templates /></ol></xsl:template> +<xsl:template match="li"><li><xsl:apply-templates /></li></xsl:template> +<xsl:template match="dl"><dl><xsl:apply-templates /></dl></xsl:template> +<xsl:template match="dt"><dt><xsl:apply-templates /></dt></xsl:template> +<xsl:template match="dd"><dd><xsl:apply-templates /></dd></xsl:template> + +<xsl:template match="fig"><p align="center"> +<xsl:choose> +<xsl:when test="@detail-src"> +<a><xsl:attribute name="href">fig/<xsl:value-of select="@detail-src" /></xsl:attribute><img><xsl:attribute name="src">http://www.iriver.co.jp/images/supporter/670_52/<xsl:value-of select="@src" /></xsl:attribute></img></a> +</xsl:when> +<xsl:otherwise> +<img><xsl:attribute name="src">fig/<xsl:value-of select="@src" /></xsl:attribute></img> +</xsl:otherwise> +</xsl:choose> +<xsl:if test="@caption"><br/><b><xsl:value-of select="@caption" /></b></xsl:if></p></xsl:template> + +<xsl:template match="img"> +<img><xsl:attribute name="src"><xsl:value-of select="@src" /></xsl:attribute><xsl:choose><xsl:when test="@caption"><xsl:attribute name="alt"><xsl:value-of select="@caption" /></xsl:attribute></xsl:when><xsl:otherwise><xsl:attribute name="alt"><xsl:value-of select="@alt" /></xsl:attribute></xsl:otherwise></xsl:choose></img> +</xsl:template> + +<xsl:template match="jpg"><div align="center"> +<a><xsl:attribute name="href">fig/<xsl:value-of select="@src" />.jpg</xsl:attribute><img><xsl:attribute name="src">fig/<xsl:value-of select="@src" />-s.jpg</xsl:attribute></img></a> +<xsl:if test="@caption"><br/><b><xsl:value-of select="@caption" /></b></xsl:if> +</div> +</xsl:template> + +<xsl:template match="gif"><div align="center"> +<a><xsl:attribute name="href">fig/<xsl:value-of select="@src" />.gif</xsl:attribute><img><xsl:attribute name="src">fig/<xsl:value-of select="@src" />-s.gif</xsl:attribute></img></a> +<xsl:if test="@caption"><br/><b><xsl:value-of select="@caption" /></b></xsl:if> +</div> +</xsl:template> + +<xsl:template match="section-table"> +<table border="1"> +<xsl:apply-templates mode="section-table"/> +</table> +</xsl:template> + +<xsl:template match="ts" mode="section-table"> +<xsl:apply-templates mode="section-table"> + <xsl:with-param name="section_caption" select="@caption" /> + <xsl:with-param name="num_rowspan" select="count(tr)" /> +</xsl:apply-templates> +</xsl:template> + +<xsl:template match="tr" mode="section-table"> + <xsl:param name="section_caption"></xsl:param> + <xsl:param name="num_rowspan">1</xsl:param> + <tr> + <xsl:choose> + <xsl:when test="@superior='1'"><xsl:attribute name="bgcolor">#DDDDFF</xsl:attribute></xsl:when> + <xsl:when test="@superior='2'"><xsl:attribute name="bgcolor">#FFDDDD</xsl:attribute></xsl:when> + <xsl:otherwise></xsl:otherwise> + </xsl:choose> + <xsl:if test="position() = 2"> + <td align="middle" bgcolor="#DDDDDD"> + <xsl:attribute name="rowspan"><xsl:value-of select="$num_rowspan" /></xsl:attribute> + <xsl:value-of select="$section_caption" /> + </td> + </xsl:if> + <td><xsl:value-of select="@caption" /></td> + <xsl:apply-templates /> + </tr> +</xsl:template> + +<xsl:template match="thr" mode="section-table"> +<tr bgcolor="#AAAAAA"><xsl:apply-templates /></tr> +</xsl:template> + + +<!-- Named Template --> +<xsl:template name="title">PMPlib project <xsl:value-of select="/page/head/title" /></xsl:template> + +<xsl:template name="sitenews"> +<xsl:apply-templates select="document('news.xml')/page/body/news/ni[1]" mode="title" /> +<xsl:apply-templates select="document('news.xml')/page/body/news/ni[2]" mode="title" /> +<xsl:apply-templates select="document('news.xml')/page/body/news/ni[3]" mode="title" /> +</xsl:template> + +<xsl:template name="topmenu"> +<ul> + <li><a href="index.html">Home</a></li> + <li><a href="news.html">News</a></li> ... [truncated message content] |