example.mmademo
Class SimplePlayer

java.lang.Object
  extended by javax.microedition.midlet.MIDlet
      extended by example.mmademo.BaseListMidlet
          extended by example.mmademo.SimplePlayer
All Implemented Interfaces:
Utils.BreadCrumbTrail, Utils.QueryListener, javax.microedition.lcdui.CommandListener

public class SimplePlayer
extends BaseListMidlet
implements Utils.BreadCrumbTrail, Utils.QueryListener

An example MIDlet for a generic Player for audio, MIDI media The top-level URLs are configured in the jad file:
PlayerURL-n defines the n'th URL
PlayerTitle-n defines the n'th title

Special URL "protocols" can be used:
resource: for media data from the jar
rms: for media data from RMS memory

Examples:
PlayerURL-1: http://server.com/
PlayerTitle-1: Browse server.com
PlayerURL-2: resource:/audio/hello.wav
PlayerTitle-2: hello.wav from jar
PlayerURL-3: http://localhost/movie.mpg
PlayerTitle-3: Funny movie
PlayerURL-4: rms:/
PlayerTitle-4: Browse Record Stores
PlayerURL-5: capture://audio
PlayerTitle-5: Capture Audio from default device


Field Summary
 
Fields inherited from class example.mmademo.BaseListMidlet
backCommand, exitCommand, playCommand, selectCommand
 
Constructor Summary
SimplePlayer()
           
 
Method Summary
 void destroyApp(boolean unconditional)
          Called when this MIDlet is destroyed.
protected  void fillList(javax.microedition.lcdui.List list)
          Child classes must implement this to insert the displayed list items and commands.
 void handle(java.lang.String title, java.lang.String url)
          Main function that decides which class to display dependent on the url.
protected static boolean isSupported(java.lang.String url)
           
 void queryCancelled()
           
 void queryOK(java.lang.String text)
           
protected  void selectCommand(int index)
          Child classes must implement this in response to a selection in the list
 java.lang.String toString()
           
 
Methods inherited from class example.mmademo.BaseListMidlet
commandAction, exit, getCurrentDisplayable, getDisplay, getList, go, goBack, pauseApp, replaceCurrent, startApp
 
Methods inherited from class javax.microedition.midlet.MIDlet
checkPermission, getAppProperty, notifyDestroyed, notifyPaused, platformRequest, resumeRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface example.mmademo.Utils.BreadCrumbTrail
getCurrentDisplayable, go, goBack, replaceCurrent
 

Constructor Detail

SimplePlayer

public SimplePlayer()
Method Detail

isSupported

protected static final boolean isSupported(java.lang.String url)

fillList

protected void fillList(javax.microedition.lcdui.List list)
Description copied from class: BaseListMidlet
Child classes must implement this to insert the displayed list items and commands.

Specified by:
fillList in class BaseListMidlet

handle

public void handle(java.lang.String title,
                   java.lang.String url)
Main function that decides which class to display dependent on the url.

Specified by:
handle in interface Utils.BreadCrumbTrail

selectCommand

protected void selectCommand(int index)
Description copied from class: BaseListMidlet
Child classes must implement this in response to a selection in the list

Specified by:
selectCommand in class BaseListMidlet

queryOK

public void queryOK(java.lang.String text)
Specified by:
queryOK in interface Utils.QueryListener

queryCancelled

public void queryCancelled()
Specified by:
queryCancelled in interface Utils.QueryListener

destroyApp

public void destroyApp(boolean unconditional)
Description copied from class: BaseListMidlet
Called when this MIDlet is destroyed. Subclasses should implement this for clean-up.

Overrides:
destroyApp in class BaseListMidlet

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object