org.xnap.util.launcher
Class DefaultPlayer

java.lang.Object
  extended by org.xnap.util.launcher.DefaultLauncher
      extended by org.xnap.util.launcher.DefaultPlayer
All Implemented Interfaces:
Launcher, Player
Direct Known Subclasses:
ITunesPlayer, JMFPlayer, NoatunPlayer, XMMSPlayer

public class DefaultPlayer
extends DefaultLauncher
implements Player

Provides the default implements for the Player interface.


Field Summary
protected  java.lang.Process player
          The player process.
 
Constructor Summary
DefaultPlayer(java.lang.String key, java.lang.String name, java.lang.String command)
           
 
Method Summary
 boolean canPlay(java.io.File file)
          Returns true for mp3 files.
 void enqueue(java.io.File file)
          Executes DefaultLauncher.getCommand(), passing file as an argument.
 void open(java.io.File file)
          Calls stop() and enqueue(File).
 void open(java.net.URL url)
          Opens the given URL.
 void start()
          Executes DefaultLauncher.getCommand().
 void stop()
          Calls destory() on the player process, if running.
 
Methods inherited from class org.xnap.util.launcher.DefaultLauncher
getCommand, getKey, getName, isEditable, isEnabled, setCommand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xnap.util.launcher.Launcher
getCommand, getKey, getName, isEditable, isEnabled, setCommand
 

Field Detail

player

protected java.lang.Process player
The player process.

Constructor Detail

DefaultPlayer

public DefaultPlayer(java.lang.String key,
                     java.lang.String name,
                     java.lang.String command)
Method Detail

canPlay

public boolean canPlay(java.io.File file)
Returns true for mp3 files.

Specified by:
canPlay in interface Player

enqueue

public void enqueue(java.io.File file)
             throws java.io.IOException
Executes DefaultLauncher.getCommand(), passing file as an argument.

Specified by:
enqueue in interface Player
Throws:
java.io.IOException

open

public void open(java.io.File file)
          throws java.io.IOException
Calls stop() and enqueue(File).

Specified by:
open in interface Launcher
Overrides:
open in class DefaultLauncher
Throws:
java.io.IOException

start

public void start()
           throws java.io.IOException
Executes DefaultLauncher.getCommand().

Specified by:
start in interface Player
Throws:
java.io.IOException

stop

public void stop()
Calls destory() on the player process, if running.

Specified by:
stop in interface Player

open

public void open(java.net.URL url)
          throws java.io.IOException
Description copied from interface: Launcher
Opens the given URL.

Specified by:
open in interface Launcher
Overrides:
open in class DefaultLauncher
Throws:
java.io.IOException


Copyright © 2001-2005 XNap Team. All Rights Reserved.