Class RecorderTrigger
- Direct Known Subclasses:
ClickRecorderTrigger
,WMRecorderTrigger
A part of the PamGuard system that is to trigger recordings should first create a class that implements the RecorderTriggers interface. This class must then be registered with the PamGuard recorders using the static function void RecorderControl.addRecorderTrigger(RecorderTrigger recorderTrigger). The trigger will then be listed on the tab panel of each instance of the PamGuard recorder from where it can be enabled or disabled for each recorder independently.
When an event occurs which should start a recording, call the static function void RecorderControl.actionRecorderTrigger(RecorderTrigger recorderTrigger). Each instance of the recorder will then be notified and will start recording depending on the state of check box on each recorder tab on the GUI.
Note that the RecorderTrigger passed to RecorderControl.actionRecorderTrigger must be exactly the same instance as was passed to RecorderControl.addRecorderTrigger
- Author:
- Doug Gillespie
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract RecorderTriggerData
Get default data for this trigger.final String
getName()
boolean
This trigger has additional options available.boolean
showOptionsDialog
(Window frame, RecorderTriggerData triggerData) Show a dialog of additional options for the recorder trigger.boolean
triggerDataUnit
(PamDataUnit dataUnit, RecorderTriggerData rtData) Called as each data unit is considered for triggering.
-
Constructor Details
-
RecorderTrigger
-
-
Method Details
-
getDefaultTriggerData
Get default data for this trigger. This will be cloned and used locally in each individual recorder from where it can be modified from the recorders control panel.- Returns:
- default settings for a recorder.
-
triggerDataUnit
Called as each data unit is considered for triggering. Individual modules should override this in order to provide additional functionality, e.g. the click detector may give options to only trigger on certain click types, the whistle detector only on whsitles in a given frequency band or of a minimum length, etc.- Parameters:
dataUnit
- data unit to consider for recording triggering- Returns:
- true if unit should be used.
-
hasOptions
public boolean hasOptions()This trigger has additional options available.- Returns:
- true if additional options are available.
-
getDataSelectorName
-
showOptionsDialog
Show a dialog of additional options for the recorder trigger.Developers should probably put parameters controlling any options into a class extending the defaultTriggerData, so that these get stored on a recorder by recorder basis.
- Parameters:
frame
-triggerData
-- Returns:
-
getName
- Returns:
- the name used to identify the trigger.
-