base
Class CDPlayManager

java.lang.Object
  extended by java.lang.Thread
      extended by base.CDPlayManager
All Implemented Interfaces:
Runnable

public class CDPlayManager
extends Thread

This class manages the different replaying methods for CD data: single tracks, sequential and shuffle using albums/artists/all data.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
static int CMD_PLAY_ALBUM
          work command constant to randomly replay the tracks of an album
static int CMD_PLAY_ALBUM_FROM_TRACK
          work command constant to randomly replay all tracks of all albums of all artists
static int CMD_PLAY_ARTIST
          work command constant to replay the tracks of an album in correct order
static int CMD_PLAY_CDS
          work command constant to randomly replay all tracks of all album of an artist
static int CMD_SHUFFLE_ALBUM
           
static int CMD_SHUFFLE_ARTIST
          work command constant to replay all albums and all tracks of these albums in correct order
static int CMD_SHUFFLE_CDS
          work command constant to replay all audio tracks of all albums of all artists in their correct order
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
CDPlayManager(int workCmd, SQLLocalAccess SQL, BottomField BottomPanel, TopField TopPanel, Vector<MenuField> menuList, int itemNumSelected)
          The standard constructor for a play manager object.
 
Method Summary
 int getWorkCmd()
          Using this method the currently used working command can be retrieved.
 void nextTrack()
          When the user invokes jumping to the next track (what means the next track within an album for ordered replaing modes or jumping to an other track in random replaying modes) this method is invoked by the main application to let the player manager skip the current track and go to the next one
 void previousTrack()
          When the user invokes jumping to the previous track (what means the preceding track within an album for ordered replaing modes or jumping to an other track in random replaying modes) this method is invoked by the main application to let the player manager skip the current track and go to the previous one
 void run()
          This is the main loop of this object, here the working commands are handled.
 void stopPlay()
          This method is called by the main application when the user presses the stop button to stop replaying of the tracks completely.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CMD_SHUFFLE_ALBUM

public static final int CMD_SHUFFLE_ALBUM
See Also:
Constant Field Values

CMD_PLAY_ALBUM

public static final int CMD_PLAY_ALBUM
work command constant to randomly replay the tracks of an album

See Also:
Constant Field Values

CMD_PLAY_ARTIST

public static final int CMD_PLAY_ARTIST
work command constant to replay the tracks of an album in correct order

See Also:
Constant Field Values

CMD_SHUFFLE_ARTIST

public static final int CMD_SHUFFLE_ARTIST
work command constant to replay all albums and all tracks of these albums in correct order

See Also:
Constant Field Values

CMD_PLAY_CDS

public static final int CMD_PLAY_CDS
work command constant to randomly replay all tracks of all album of an artist

See Also:
Constant Field Values

CMD_SHUFFLE_CDS

public static final int CMD_SHUFFLE_CDS
work command constant to replay all audio tracks of all albums of all artists in their correct order

See Also:
Constant Field Values

CMD_PLAY_ALBUM_FROM_TRACK

public static final int CMD_PLAY_ALBUM_FROM_TRACK
work command constant to randomly replay all tracks of all albums of all artists

See Also:
Constant Field Values
Constructor Detail

CDPlayManager

public CDPlayManager(int workCmd,
                     SQLLocalAccess SQL,
                     BottomField BottomPanel,
                     TopField TopPanel,
                     Vector<MenuField> menuList,
                     int itemNumSelected)
The standard constructor for a play manager object.

Parameters:
workCmd - one of the CMD_xxx constants that define how the tracks have to be displayed
SQL - the SQL object, it is used by thsi class to store statistical data about tracks, artists and albums and how often they are replayed
BottomPanel - the bottom panel of the main window to display track/CD information
TopPanel - the top panel of the main window
menuList - the list of menu fields where this replay action was invoked from
itemNumSelected - the menu number out of this list that was selected by the user
Method Detail

stopPlay

public void stopPlay()
This method is called by the main application when the user presses the stop button to stop replaying of the tracks completely.


nextTrack

public void nextTrack()
When the user invokes jumping to the next track (what means the next track within an album for ordered replaing modes or jumping to an other track in random replaying modes) this method is invoked by the main application to let the player manager skip the current track and go to the next one


previousTrack

public void previousTrack()
When the user invokes jumping to the previous track (what means the preceding track within an album for ordered replaing modes or jumping to an other track in random replaying modes) this method is invoked by the main application to let the player manager skip the current track and go to the previous one


getWorkCmd

public int getWorkCmd()
Using this method the currently used working command can be retrieved.

Returns:
the working command constant CMD_xxx that is used by this object

run

public void run()
This is the main loop of this object, here the working commands are handled.

Specified by:
run in interface Runnable
Overrides:
run in class Thread