Class RecorderTrigger

java.lang.Object
SoundRecorder.trigger.RecorderTrigger
Direct Known Subclasses:
ClickRecorderTrigger, WMRecorderTrigger

public abstract class RecorderTrigger extends Object
RecorderTriggers are used to automatically make sound file recordings in response to detections, or any other PamGuard event.

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 Details Link icon

    • RecorderTrigger Link icon

      public RecorderTrigger(PamDataBlock dataBlock)
  • Method Details Link icon

    • getDefaultTriggerData Link icon

      public abstract RecorderTriggerData 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 Link icon

      public boolean triggerDataUnit(PamDataUnit dataUnit, RecorderTriggerData rtData)
      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 Link icon

      public boolean hasOptions()
      This trigger has additional options available.
      Returns:
      true if additional options are available.
    • getDataSelectorName Link icon

      public String getDataSelectorName()
    • showOptionsDialog Link icon

      public boolean showOptionsDialog(Window frame, RecorderTriggerData triggerData)
      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 Link icon

      public final String getName()
      Returns:
      the name used to identify the trigger.