com.tuneology.avm.player
Class WinampPlayer

java.lang.Object
  |
  +--com.tuneology.avm.player.Player
        |
        +--com.tuneology.avm.player.LocalPlayer
              |
              +--com.tuneology.avm.player.WinampPlayer
All Implemented Interfaces:
AudioPlayer, MediaPlayer

public class WinampPlayer
extends LocalPlayer
implements AudioPlayer

An interface to Winamp, a Windows media player.

Version:
$Id: WinampPlayer.java,v 1.12 2003/07/10 19:52:12 xnarf Exp $
Author:
Fran Taylor

Fields inherited from class com.tuneology.avm.player.LocalPlayer
mixer, mixerChannel, paused
 
Fields inherited from class com.tuneology.avm.player.Player
dev, listeners, looping
 
Constructor Summary
WinampPlayer(java.lang.String dev, java.lang.String name)
           
 
Method Summary
 void addFile(java.lang.String path)
           
 void clearPlaylist()
           
 void close()
          Close the player and release its resources.
 void cueFile(MediaData f)
          Loads a file, sets the current position to the beginning, and pauses.
static java.lang.String getDescription()
           
 long getEQValue(long eq_index)
          Retrieves the EQ slider value for the slider specified by EQ_Index.
 java.lang.String getName()
           
 long getPreAmpValue()
           
 int getSize()
          Returns the maximum size of the current file.
 java.lang.String getStatus()
          Retrieves the status of WinAMP: PLAYING, PAUSED or STOPPED
 long getTrackLength()
           
 long getTrackPosition()
          Retrieves the position of the current track in secs.
static java.lang.String getVersionString()
           
 Volume getVolume()
          Gets the audio output volume.
 VolumeRange getVolumeRange()
           
 void jumpTo(int pos)
          Moves the current position.
 void pause()
          Temporarily stops playing at the current position.
 void play()
          Starts playing after calling stop or cuefile.
 boolean playFile(java.lang.String path)
          Play the file, blocking until it's done.
 void playNextTrack()
           
 void playPrevTrack()
           
 void playStream(java.io.InputStream str)
           
 void seekToPosition(long pos)
           
 void sendCommandMessage(long msg)
           
 void setEQValue(long eq_index, long eq_value)
          Sets the EQ slider value for the slider specified by eq_index.
 void setPreAmpValue(long preamp_value)
           
 void setVolume(Volume vol)
          Sets the audio output volume.
static void setWinampCmd(java.lang.String s)
           
 void shutdown()
           
 void stop()
          Stops playing and resets the current position to the beginning.
 void unpause()
          Starts playing after calling pause.
 
Methods inherited from class com.tuneology.avm.player.LocalPlayer
canEject, eject, getCanvas, getMixerChannel, getPcmChannel, initInstance, setArtist, setTime, setTitle, setTotal, setTrack
 
Methods inherited from class com.tuneology.avm.player.Player
addStatusListener, findPlayerClass, findVideoPlayerClass, formatSeconds, getAudioDevices, getAudioPlayers, getDescription, getDevice, getDeviceDescription, getLoop, getVersions, getVideoPlayers, newMediaPlayer, removeStatusListener, setDevice, setLoop, shutdownPlayers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.tuneology.avm.player.MediaPlayer
addStatusListener, getCanvas, getDevice, getLoop, removeStatusListener, setArtist, setDevice, setLoop, setTitle, setTotal, setTrack
 

Constructor Detail

WinampPlayer

public WinampPlayer(java.lang.String dev,
                    java.lang.String name)
             throws java.lang.Exception
Parameters:
dev -  
name -  
Throws:
java.lang.Exception -  
Method Detail

playFile

public boolean playFile(java.lang.String path)
                 throws java.lang.Exception
Description copied from interface: MediaPlayer
Play the file, blocking until it's done.
Specified by:
playFile in interface MediaPlayer
Parameters:
path -  
Throws:
java.lang.Exception -  

playStream

public void playStream(java.io.InputStream str)
                throws java.lang.Exception
Specified by:
playStream in interface MediaPlayer
Parameters:
str -  
Throws:
java.lang.Exception -  

cueFile

public void cueFile(MediaData f)
             throws java.lang.Exception
Description copied from interface: MediaPlayer
Loads a file, sets the current position to the beginning, and pauses. Call unpause() to begin playing.
Specified by:
cueFile in interface MediaPlayer
Parameters:
f -  
Throws:
java.lang.Exception -  

getSize

public int getSize()
            throws java.lang.Exception
Description copied from interface: MediaPlayer
Returns the maximum size of the current file.
Specified by:
getSize in interface MediaPlayer
Returns:
the size of the current file.
Throws:
java.lang.Exception -  

jumpTo

public void jumpTo(int pos)
            throws java.lang.Exception
Description copied from interface: MediaPlayer
Moves the current position. Valid values are 0 - getSize(). If the player was playing, it will continue playing at the new position. If the player was paused, it will remain paused at the new position.
Specified by:
jumpTo in interface MediaPlayer
Overrides:
jumpTo in class LocalPlayer
Parameters:
f -  
Throws:
java.lang.Exception -  

play

public void play()
          throws java.lang.Exception
Description copied from interface: MediaPlayer
Starts playing after calling stop or cuefile.
Specified by:
play in interface MediaPlayer
Overrides:
play in class LocalPlayer
Throws:
java.lang.Exception -  

playNextTrack

public void playNextTrack()
                   throws java.lang.Exception
Specified by:
playNextTrack in interface MediaPlayer
Overrides:
playNextTrack in class LocalPlayer
Throws:
java.lang.Exception -  

playPrevTrack

public void playPrevTrack()
                   throws java.lang.Exception
Specified by:
playPrevTrack in interface MediaPlayer
Overrides:
playPrevTrack in class LocalPlayer
Throws:
java.lang.Exception -  

pause

public void pause()
           throws java.lang.Exception
Description copied from interface: MediaPlayer
Temporarily stops playing at the current position.
Specified by:
pause in interface MediaPlayer
Overrides:
pause in class LocalPlayer
Throws:
java.lang.Exception -  

unpause

public void unpause()
             throws java.lang.Exception
Description copied from interface: MediaPlayer
Starts playing after calling pause.
Specified by:
unpause in interface MediaPlayer
Overrides:
unpause in class LocalPlayer
Throws:
java.lang.Exception -  

stop

public void stop()
          throws java.lang.Exception
Description copied from interface: MediaPlayer
Stops playing and resets the current position to the beginning.
Specified by:
stop in interface MediaPlayer
Overrides:
stop in class LocalPlayer
Throws:
java.lang.Exception -  

shutdown

public void shutdown()
Overrides:
shutdown in class Player

getName

public java.lang.String getName()
Specified by:
getName in interface MediaPlayer
Overrides:
getName in class Player

setEQValue

public void setEQValue(long eq_index,
                       long eq_value)
Sets the EQ slider value for the slider specified by eq_index.

setPreAmpValue

public void setPreAmpValue(long preamp_value)

clearPlaylist

public void clearPlaylist()

getStatus

public java.lang.String getStatus()
Retrieves the status of WinAMP: PLAYING, PAUSED or STOPPED

getTrackPosition

public long getTrackPosition()
Retrieves the position of the current track in secs.

getEQValue

public long getEQValue(long eq_index)
Retrieves the EQ slider value for the slider specified by EQ_Index.

getPreAmpValue

public long getPreAmpValue()

seekToPosition

public void seekToPosition(long pos)

getVolumeRange

public VolumeRange getVolumeRange()
Specified by:
getVolumeRange in interface MediaPlayer
Overrides:
getVolumeRange in class LocalPlayer
Following copied from class: com.tuneology.avm.player.LocalPlayer
Throws:
java.lang.Exception -  

getVolume

public Volume getVolume()
                 throws java.io.IOException
Gets the audio output volume.
Specified by:
getVolume in interface MediaPlayer
Overrides:
getVolume in class LocalPlayer
Returns:
volume level.
Throws:
java.io.IOException -  

setVolume

public void setVolume(Volume vol)
               throws java.io.IOException
Sets the audio output volume.
Specified by:
setVolume in interface MediaPlayer
Overrides:
setVolume in class LocalPlayer
Parameters:
vol -  
Throws:
java.io.IOException -  

getTrackLength

public long getTrackLength()

addFile

public void addFile(java.lang.String path)

close

public void close()
           throws java.io.IOException
Description copied from interface: MediaPlayer
Close the player and release its resources.
Specified by:
close in interface MediaPlayer
Following copied from interface: com.tuneology.avm.player.MediaPlayer
Throws:
java.lang.Exception -  

sendCommandMessage

public void sendCommandMessage(long msg)

getVersionString

public static java.lang.String getVersionString()
Returns:
the version string.

setWinampCmd

public static void setWinampCmd(java.lang.String s)
                         throws java.lang.Exception
Parameters:
s -  

getDescription

public static java.lang.String getDescription()