|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--org.mmbase.module.builders.vwms.EncodeHandler
When an audiopart has to be ripped or when ripped audio has to be encoded, an EncodeHandler is created to control this process. Each EncodeHandler has a task describing what it must do. The node field contains a reference to nodes (audiopart or rawaudio) used when controlling the services. After initializing the service, the EncodeHandler starts the service by putting it in a certain state, and then waits for it to finish. When the service finishes the EncodeHandler checks the result value stored in info field which is equal to the proces exitvalue. If this is equal to 0, the RawAudio representing the data created by service (eg. wav or realaudio) is set in a state ready for usage and the service will be reset. Otherwise the EncodeHandler quits and removes itself from list of running EncodeHandlers and leaves the service in current state. Also there are EncodeHandlers used to recover for when the mmbase is reset when service is still busy or just finished.
| Field Summary | |
MMObjectNode |
node
|
static java.lang.String |
RAWAUDIO_URL_HOST1
|
| Constructor Summary | |
EncodeHandler(EncodeCop parent,
java.lang.String task,
MMObjectNode node)
Constructor initializes EncodeHandler task and related node. |
|
| Method Summary | |
MMObjectNode |
addRawAudio(int id,
int status,
int format,
int speed,
int channels)
Creates a RawAudio node for an audiopart. |
void |
doCDRip()
Handles the audio file cdripping. |
void |
doG2Encode()
Handles the Real G2 Encoding of an audiopart. |
void |
doRecoverBusyCDRip(int cdplayernumber)
When mmbase has been reset during cd ripping we wait again for the cdplayer to finish. |
void |
doRecoverBusyG2Encoder(int g2encnumber)
When mmbase has been reset during encoding we wait again for the encoder to finish. |
void |
doRecoverFinishedCDRip(int cdplayernumber)
This is for the case when mmbase was reset just when an cdplayer finishes. |
void |
doRecoverFinishedG2Encoder(int g2encnumber)
This is for the case when mmbase was reset just when an encoder finishes. |
void |
init()
|
void |
run()
Checks EncoderHandlers task variable to decide what to do. |
void |
start()
Starts the admin Thread. |
void |
stop()
Stops the admin Thread. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public MMObjectNode node
public static final java.lang.String RAWAUDIO_URL_HOST1
| Constructor Detail |
public EncodeHandler(EncodeCop parent,
java.lang.String task,
MMObjectNode node)
parent - EncodeCop reference.task - name of the task.node - is a reference to either a audioparts or rawaudio node (type is encoded audio eg. g2).| Method Detail |
public void init()
public void start()
public void stop()
public void run()
run in interface java.lang.Runnablepublic void doCDRip()
public void doG2Encode()
public MMObjectNode addRawAudio(int id,
int status,
int format,
int speed,
int channels)
id - the idnumber = audiopartobjectnumberstatus - current stateformat - file formatspeed - bitratechannels - amount of audio channelspublic void doRecoverBusyG2Encoder(int g2encnumber)
g2encnumber - object number of the g2encoder we're recovering for.public void doRecoverBusyCDRip(int cdplayernumber)
cdplayernumber - object number of the cdplayer we're recovering for.public void doRecoverFinishedG2Encoder(int g2encnumber)
g2encnumber - object number of the g2encoder we're recovering for.public void doRecoverFinishedCDRip(int cdplayernumber)
cdplayernumber - object number of the cdplayer we're recovering for.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||