system
Class SystemAccess

java.lang.Object
  extended by java.lang.Thread
      extended by system.SystemAccess
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
SystemLinuxAccess

public class SystemAccess
extends Thread

This class is the base class for the system access functionalities, all operating system related classes inherit from this one.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SystemAccess(PoddyFrame mainWin)
          The standard constructor for this class, here the main window object is handed over from the application when creating this object
 
Method Summary
 void encodeToUSB(String srcPath, CDInfo cdInfo, TrackInfo trackInfo, String mountpoint, BufferedImage coverImage)
           
 String getCDDiscID()
          This method retrieves CD ROM information and fetches a disc identifier string that can be used from CDDB to identify this disc
 long getDVDDiscID()
          This method retrieves DVD ROM information and fetches a disc identifier string that can be used from DVD databases to identify this disc
 String getMainDirectory()
          This method has not to be overwritten!
 String getTempDirectory()
          This method can be overwritten but doesn't have to Returns the temporary directory that can be used for any temp data
 String getVideoDirectory()
          This method has not to be overwritten!
 void grabCDTracks()
          This method has not to be overwritten as long as the workCmd is handled in the overwritten run()-method!
 void grabDVD(String mypath)
          This method has not to be overwritten as long as the workCmd is handled in the overwritten run()-method!
 RecordInfo isRecording()
           
 boolean isWorking()
          This method can be used to find out if there is currently an operation in progress: as long as a workCmd is active and handled by the run() method here true is returned
 boolean mountUSB(String mountpoint)
           
 void playDVD(String isoPath)
          Starts replaying of a DVD, here the external player has to be called with the given path
 void playDVDDirect()
          Starts direct replaying of a DVD in the local drive
 void playVideo(String videoPath)
          Starts replaying of a video file, here the external player has to be called with the given path
 void powerOff()
           
 void record(RecordInfo info, String channel, String recpath)
           
 StationsList scanTV()
           
 boolean setCDTrack(int track, String path, int totalTracks)
          This method has not to be overwritten!
 void stopRecording()
           
 void stopVideo()
          Externally stop all running videos by killing the related processes.
 void switchTVChannel(StationInfo info)
           
 void turnOffTV()
           
 void turnOnTV()
           
 void unmountUSB(String mountpoint)
           
 
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, run, 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
 

Constructor Detail

SystemAccess

public SystemAccess(PoddyFrame mainWin)
The standard constructor for this class, here the main window object is handed over from the application when creating this object

Parameters:
mainWin - the main window of the application
Method Detail

getCDDiscID

public String getCDDiscID()
This method retrieves CD ROM information and fetches a disc identifier string that can be used from CDDB to identify this disc

Returns:
the disc ID in format "DDDDDDDD t1 t2 t3 .. tn" where DDDDDDDD is the ID of the whole disc and the t1..tn contain position information of the different tracks

getDVDDiscID

public long getDVDDiscID()
This method retrieves DVD ROM information and fetches a disc identifier string that can be used from DVD databases to identify this disc

Returns:
the disc ID in format "DDDDDDDD"

isWorking

public boolean isWorking()
This method can be used to find out if there is currently an operation in progress: as long as a workCmd is active and handled by the run() method here true is returned

Returns:
true when a working command is processed by the run() method, false otherwise

setCDTrack

public boolean setCDTrack(int track,
                          String path,
                          int totalTracks)
This method has not to be overwritten! Adds CD track information that have to be collected and used when the method grabCDTracks() is called

Parameters:
track - the 1-based number of the track
path - the path where the track data have to be stored at
totalTracks - the total number of tracks
Returns:
true in case the track information could be added to the list successfully, false otherwise

grabCDTracks

public void grabCDTracks()
This method has not to be overwritten as long as the workCmd is handled in the overwritten run()-method! Starts asynchronous grabbing and FLAC-compression of CD-tracks that have been defined with setCDTrack() before


grabDVD

public void grabDVD(String mypath)
This method has not to be overwritten as long as the workCmd is handled in the overwritten run()-method! Starts asynchronous grabbing and FLAC-compression of CD-tracks that have been defined with setCDTrack() before


getMainDirectory

public String getMainDirectory()
This method has not to be overwritten! Returns the main directory as read from the settings file

Returns:
path to the main directory

getTempDirectory

public String getTempDirectory()
This method can be overwritten but doesn't have to Returns the temporary directory that can be used for any temp data

Returns:
path to the main directory

getVideoDirectory

public String getVideoDirectory()
This method has not to be overwritten! Returns the path to the video directory as defined in the settings file

Returns:
path to the video directory

playDVD

public void playDVD(String isoPath)
Starts replaying of a DVD, here the external player has to be called with the given path

Parameters:
isoPath - the path to the ISO image that has to be used for replaying

playDVDDirect

public void playDVDDirect()
Starts direct replaying of a DVD in the local drive


playVideo

public void playVideo(String videoPath)
Starts replaying of a video file, here the external player has to be called with the given path

Parameters:
videoPath - the path to the video file that has to be used for replaying

stopVideo

public void stopVideo()
Externally stop all running videos by killing the related processes. This method is mainly a workaround for video players that do not exit cleanly some times.


scanTV

public StationsList scanTV()

turnOnTV

public void turnOnTV()

turnOffTV

public void turnOffTV()

switchTVChannel

public void switchTVChannel(StationInfo info)

record

public void record(RecordInfo info,
                   String channel,
                   String recpath)

isRecording

public RecordInfo isRecording()

stopRecording

public void stopRecording()

powerOff

public void powerOff()

mountUSB

public boolean mountUSB(String mountpoint)

unmountUSB

public void unmountUSB(String mountpoint)

encodeToUSB

public void encodeToUSB(String srcPath,
                        CDInfo cdInfo,
                        TrackInfo trackInfo,
                        String mountpoint,
                        BufferedImage coverImage)