All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface guinea.player.Player

public interface Player
This interface is implemented by the sound players as well as virtual players.


Method Index

· addPlayerListener(PlayerListener)
Adds the specified player listener to receive events from this player.
· getParentPlayer()
Get the parent player of a virtual player.
· getPlayerDirectory()
Get the directory of the player.
· getPlayerID()
The player ID string of this player.
· getTempMessageID()
Get a temporary ID string for loading samples etc.
· getVirtualPlayerID()
The player ID string of this player.
· hasAudio()
Does this player support audio?
· hasVideo()
Does this player support video?
· isPlayerRunning()
Is the player running?
· isVirtualPlayer()
Is the player a 'virtual' player.
· registerPlayerObject(String, PlayerMessageListener)
Register a new player object for receiving messages.
· removePlayerListener(PlayerListener)
Removes the specified player listener so that it no longer receives events from this player.
· sendMessage(String)
Send a message to the player process.
· setPlayerDirectory(File)
Set the directory for the player.
· startPlayer()
Start the sound player.
· stopPlayer()
Stop the sound player process.
· unregisterPlayerObject(String)
Remove a player object from the player.

Methods

· hasAudio
 public abstract boolean hasAudio()
Does this player support audio?

Returns:
true if audio is supported.
· hasVideo
 public abstract boolean hasVideo()
Does this player support video?

Returns:
true if video is supported.
· sendMessage
 public abstract void sendMessage(String msg) throws IOException, PlayerException
Send a message to the player process.

Parameters:
msg - the message.
Throws: IOException
if some kind of IO exception occurs when talking to the player process.
Throws: PlayerException
an exception occurs with a player.
· isVirtualPlayer
 public abstract boolean isVirtualPlayer()
Is the player a 'virtual' player. A virtual player is a player which uses a parent player and uses only a subset of all output channels for output.

Returns:
true if player is a virtual player.
See Also:
getParentPlayer
· getParentPlayer
 public abstract Player getParentPlayer()
Get the parent player of a virtual player. A parent of a virtual player is usually the real player.

Returns:
the parent player of the virtual player. If the player is a real player, it returns itself. If a virtual player has no parent, null is returned.
See Also:
isVirtualPlayer
· getVirtualPlayerID
 public abstract String getVirtualPlayerID()
The player ID string of this player. It is used to specify which virtual player the command applies to.

Returns:
a player ID string.
· getPlayerID
 public abstract String getPlayerID()
The player ID string of this player.

Returns:
a player ID string.
· getTempMessageID
 public abstract String getTempMessageID()
Get a temporary ID string for loading samples etc.

Returns:
an unique temporary ID string that can be used with this player.
· addPlayerListener
 public abstract void addPlayerListener(PlayerListener listener)
Adds the specified player listener to receive events from this player.

Parameters:
listener - the player listener.
· removePlayerListener
 public abstract void removePlayerListener(PlayerListener listener)
Removes the specified player listener so that it no longer receives events from this player.

Parameters:
listener - the listener to be removed from the listeners list.
· registerPlayerObject
 public abstract void registerPlayerObject(String id,
                                           PlayerMessageListener sample)
Register a new player object for receiving messages. The player will then know where to send the message from the player.

Parameters:
id - a string ID used to identify this listener.
sample - the listener that wants to receive messages.
· unregisterPlayerObject
 public abstract Object unregisterPlayerObject(String id)
Remove a player object from the player.

Parameters:
id - the id of the object to be removed.
Returns:
the removed object or null if no object was found with the given id.
· startPlayer
 public abstract void startPlayer() throws Exception
Start the sound player. The parameters of the player must be set before starting the player.

Throws: Exception
if an error occurs when trying to start the player, an exception will be thrown.
· stopPlayer
 public abstract void stopPlayer()
Stop the sound player process.

· isPlayerRunning
 public abstract boolean isPlayerRunning()
Is the player running?

Returns:
true if player is running, false if not running.
· setPlayerDirectory
 public abstract void setPlayerDirectory(File dir)
Set the directory for the player. Player directory can be used to load files from sample directories with relative names.

Parameters:
dir - A directory.
· getPlayerDirectory
 public abstract File getPlayerDirectory()
Get the directory of the player. Player directory can be used to load files from sample directories with relative names.

Parameters:
return - Player directory.

All Packages  Class Hierarchy  This Package  Previous  Next  Index