com.tuneology.avm.ripper
Class ShellRipper

java.lang.Object
  |
  +--com.tuneology.avm.ripper.ShellRipper
Direct Known Subclasses:
Cdda2wavRipper, CdparanoiaRipper, ReadcdRipper

public abstract class ShellRipper
extends java.lang.Object

An abstract class used to control command-line CD ripping programs.

Version:
$Id: ShellRipper.java,v 1.6 2003/05/17 10:04:29 xnarf Exp $
Author:
Fran Taylor

Field Summary
protected  java.lang.String dev
          The path to the drive device.
protected  CDDrive drive
          The drive from which to rip the data.
protected  java.lang.String genericDev
          The path of the generic SCSI interface to the device.
protected  java.lang.String scsiId
          The SCSI ID of the drive.
 
Constructor Summary
protected ShellRipper(CDDrive drive)
           
 
Method Summary
protected abstract  java.lang.String[] getCmd(int trk, int startindex, int len, java.lang.String path)
          Returns a shell command, in the form of an array of strings, that will execute the command necessary to burn the specified track.
 java.lang.String getProcessOutput()
          Waits for the process to end, and returns a string containing the output from the process.
protected abstract  boolean processLine(java.lang.String str, RipStatus stat)
          Extract useful information from the lines of text produced by the program as it runs.
 java.io.InputStream ripTrack(int track, int startIndex, int len, int bufsiz, RipStatus stat)
          Rips the track from the CD, returns a stream containing the WAV data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

drive

protected CDDrive drive
The drive from which to rip the data.

scsiId

protected java.lang.String scsiId
The SCSI ID of the drive.

genericDev

protected java.lang.String genericDev
The path of the generic SCSI interface to the device.

dev

protected java.lang.String dev
The path to the drive device.
Constructor Detail

ShellRipper

protected ShellRipper(CDDrive drive)
Parameters:
drive -  
Method Detail

getCmd

protected abstract java.lang.String[] getCmd(int trk,
                                             int startindex,
                                             int len,
                                             java.lang.String path)
Returns a shell command, in the form of an array of strings, that will execute the command necessary to burn the specified track.
Parameters:
trk - the track to read.
startIndex - where to start reading in the track.
len - the number of blocks to read.
path - the path of the file where the track data is to be written.
Returns:
the command

processLine

protected abstract boolean processLine(java.lang.String str,
                                       RipStatus stat)
                                throws java.lang.Exception
Extract useful information from the lines of text produced by the program as it runs.
Parameters:
str -  
Returns:
true if the line is to be logged, false otherwise.
Throws:
java.lang.Exception -  

ripTrack

public java.io.InputStream ripTrack(int track,
                                    int startIndex,
                                    int len,
                                    int bufsiz,
                                    RipStatus stat)
                             throws java.lang.Exception
Rips the track from the CD, returns a stream containing the WAV data.
Parameters:
track - the track to rip
startIndex - the index within the track to start ripping
len - the number of sectors to rip (-1 means the length of the track)
bufsiz - the buffer size to use in the internal copy operation.
Returns:
the data stream.
Throws:
java.io.IOException -  

getProcessOutput

public java.lang.String getProcessOutput()
Waits for the process to end, and returns a string containing the output from the process.
Returns:
The process output.