Package SoundRecorder.trigger
Class TriggerDecisionMaker
java.lang.Object
SoundRecorder.trigger.TriggerDecisionMaker
Basic recorder trigger which can be re-implemented in many guises.
Contains basic code for
a) requiring a minimum number of detections in a set time b) can limit total length of a recording c) can force a minimum gap between recordings.
- Author:
- Doug Gillespie
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
canRecord
(RecorderTriggerData rtData, long timeNow, int nChan, float sampleRate, int nBytes) Work out whether or not a recording can be made.void
setMessage
(String message)
-
Constructor Details
-
TriggerDecisionMaker
-
-
Method Details
-
canRecord
public double canRecord(RecorderTriggerData rtData, long timeNow, int nChan, float sampleRate, int nBytes) Work out whether or not a recording can be made. If it can, the maximum length of the recording in seconds is returned, otherwise, 0 or a negative number.- Parameters:
timeNow
- current data time in millisecondsnChan
- number of channelssampleRate
- sample rate for the recording- Returns:
- +ve number of seconds to record, or invalid input: '<'=0 for no recording.
-
setMessage
- Parameters:
message
- the message to set
-
getMessage
- Returns:
- the message
-