How to use
----------

ASAP2WAV
~~~~~~~~

Enter the following command line to see the syntax:

---------------------------------------------------------------------------
java -jar asap2wav.jar
---------------------------------------------------------------------------

Unless you specify the `-o`/`--output` option, the output filename will be
constructed from the input filename with the extension changed to `wav`.


Java applet
~~~~~~~~~~~

To embed the applet in a web page, use the following HTML syntax:

---------------------------------------------------------------------------
<applet width="40" height="45" code="ASAPApplet" archive="asap_applet.jar">
    <param name="file" value="File.sap" />
</applet>
---------------------------------------------------------------------------

or the following XHTML:

---------------------------------------------------------------------------
<object width="40" height="45" type="application/x-java-applet" classid="java:ASAPApplet.class">
    <param name="archive" value="asap_applet.jar" />
    <param name="code" value="ASAPApplet" />
    <param name="file" value="File.sap" />
</object>
---------------------------------------------------------------------------

(tested with Internet Explorer 8, Firefox 3.5 and Chrome 3.0).

The applet will play the specified file and display POKEY channel volume
meters scaled to the applet area (you can specify a different size).
There are four volume meters for mono music and eight for stereo.

The applet understands the following parameters:

- `file` - URL of the file to play
- `song` - zero-based subsong number
- `defaultPlaybackTime` - playback time for songs with unspecified duration,
  in the `"mm:ss.xxx"` format
- `loopPlaybackTime` - playback time for songs marked as looping
  (use `"ONCE"` to stop playback when the loop starts)
- `background` - background color specified as six hexadecimal digits (`"rrggbb"`)
- `foreground` - volume bars color specified as six hexadecimal digits (`"rrggbb"`)
- `onPlaybackEnd` - JavaScript to be executed when playback ends
  (additionally, the `mayscript` attribute must be added to the `applet` element)

The applet contains the following methods that can be called from JavaScript:

- `void setPlaybackTime(String defaultPlaybackTime, String loopPlaybackTime)` - sets
  playback times (see above)
- `void play(String filename, int song)` - plays the specified song (-1 for default)
- `void stop()` - stops playback
- `boolean togglePause()` - toggles pause and returns `true` if pause has been enabled
- `String getAuthor()` - returns the AUTHOR tag of the playing song
- `String getName()` - returns the NAME tag of the playing song
- `String getDate()` - returns the DATE tag of the playing song


Java midlet
~~~~~~~~~~~

Midlet is an application for mobile phones.
The ASAP midlet requires CLDC 1.1 and MIDP 2.0
and thus will not work on old Java implementations.
The midlet has a file browser for selecting music files,
which should be stored in phone memory or on a memory card.
