SoundRecorder
Class RecorderTriggerData

java.lang.Object
  extended by SoundRecorder.RecorderTriggerData

public class RecorderTriggerData
extends java.lang.Object

Information for triggered recordings to tell each recorder how long a recording it should make.

If a recording is already running when a RecorderTrigger is sent, then the recording will continue, ending at the later of the existing stop time (if recoring on a timer or on a different trigger) or the time indicated in RecorderTriggerData. If a continuous recording is being made, then that recording will simply continue.

If no recording is being made, then the recorder will take data from the buffer for secondsBeforeTrigger seconds to add to the start of the recording. Note that recordings NEVER overlap, so if secondsBeforeTrigger were set to say, 30s, and the previous recoridng had only ended 10 seconds earlier, then only 10s of data will be taken from the buffer.

Each recorder will ensure that adequate raw audio data is stored in the source data block to satisfy secondsBeforeTrigger in every trigger. Therefore, if secondsBeforeTrigger is set to a large value, excessive amounts of memory may be required to store the data, particularly at high frequencies.

Information from RecorderTriggerData is read when the recording is made, so it is possible to update teh fields secondsBeforeTrigger and secondsAfterTrigger after the RecorderTrigger has been registered with the recorders, although time may be required for the buffer to fill if secondsBeforeTrigger is increased.

Author:
Doug Gillespie
See Also:
RecorderTrigger, RecorderControl

Field Summary
private  int secondsAfterTrigger
          Number of seconds of data to record after the trigger event.
private  int secondsBeforeTrigger
          Number of seconds of data to add to the start of the recording prior to the trigger event.
 
Constructor Summary
RecorderTriggerData(int secondsBeforeTrigger, int secondsAfterTrigger)
           
 
Method Summary
 int getSecondsAfterTrigger()
           
 int getSecondsBeforeTrigger()
           
 void setSecondsAfterTrigger(int secondsAfterTrigger)
           
 void setSecondsBeforeTrigger(int secondsBeforeTrigger)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

secondsBeforeTrigger

private int secondsBeforeTrigger
Number of seconds of data to add to the start of the recording prior to the trigger event.


secondsAfterTrigger

private int secondsAfterTrigger
Number of seconds of data to record after the trigger event.

Constructor Detail

RecorderTriggerData

public RecorderTriggerData(int secondsBeforeTrigger,
                           int secondsAfterTrigger)
Method Detail

getSecondsAfterTrigger

public int getSecondsAfterTrigger()

setSecondsAfterTrigger

public void setSecondsAfterTrigger(int secondsAfterTrigger)

getSecondsBeforeTrigger

public int getSecondsBeforeTrigger()

setSecondsBeforeTrigger

public void setSecondsBeforeTrigger(int secondsBeforeTrigger)