Package clipgenerator

Class ClipControl

All Implemented Interfaces:
ClipDisplayParent, PamSettings, SettingsNameProvider

public class ClipControl extends PamControlledUnit implements PamSettings, ClipDisplayParent
The clip generator is used to generate short sound clips around detections. In principle, it can be triggered by just about any dataunit which is a subclass of AcousticDataUnit, i.e. one having both a start time and a duration.

The clip generator configuration contains a budget of how many clips it can make for each possible trigger and will, based on usage, decide in a semi random way whether or not to make a clip on the arrival of each detection.

Trigger specific settings also include a pre and post sample time.

It would be good to add clips as annotations to other data units, but of course clips only get made a second or two after the data unit, which will already have been stored, so can only work if storage of data units is delayed somehow. Not yet !

Author:
Doug Gillespie
  • Constructor Details

    • ClipControl

      public ClipControl(String unitName)
  • Method Details

    • createDetectionMenu

      public JMenuItem createDetectionMenu(Frame parentFrame)
      Description copied from class: PamControlledUnit
      Create a JMenu object containing MenuItems associated with PamProcesses
      Overrides:
      createDetectionMenu in class PamControlledUnit
      Parameters:
      parentFrame - The owner frame of the menu
      Returns:
      reference to a JMenu which can be added to an existing menu or menu bar

      Note that if multiple views are to use the same menu, then they should each create a new menu (by setting Create to true) the first time they call this method.

    • createDisplayMenu

      public JMenuItem createDisplayMenu(Frame parentFrame)
      Description copied from class: PamControlledUnit
      Create a JMenu object containing MenuItems associated with the view
      Overrides:
      createDisplayMenu in class PamControlledUnit
      Returns:
      reference to a JMenu which can be added to an existing menu or menu bar

      Note that if multiple views are to use the same menu, then they should each create a new menu (by setting Create to true) the first time they call this method.

    • displayOptions

      public void displayOptions(Frame parentFrame)
    • getSettingsReference

      public Serializable getSettingsReference()
      Specified by:
      getSettingsReference in interface PamSettings
      Returns:
      The serialisable object that will be stored
    • getSettingsVersion

      public long getSettingsVersion()
      Specified by:
      getSettingsVersion in interface PamSettings
      Returns:
      An integer version number for the settings
    • restoreSettings

      public boolean restoreSettings(PamControlledUnitSettings pamControlledUnitSettings)
      Specified by:
      restoreSettings in interface PamSettings
      Returns:
      true if successful The object performs final checks (if needed) and then casts the settings data pamcontrolledunitSettings.settings into the correct type and uses as required
    • notifyModelChanged

      public void notifyModelChanged(int changeType)
      Description copied from class: PamControlledUnit
      General notification when the PAMGAURD model changes.
      Overrides:
      notifyModelChanged in class PamControlledUnit
      Parameters:
      changeType - type of change
    • getPotentialTriggers

      public ArrayList<PamDataBlock> getPotentialTriggers()
      Get a list of datablocks which might trigger a clip generation.
      Returns:
      list of triggering data blocks.
    • getClipProcess

      public ClipProcess getClipProcess()
      Returns:
      the clipProcess
    • generateNewPanel

      public ClipDisplayPanel generateNewPanel()
    • removeUnit

      public boolean removeUnit()
      Description copied from class: PamControlledUnit
      Called to remove a unit.
      Overrides:
      removeUnit in class PamControlledUnit
      Returns:
      try (not used)
    • getClipDataBlock

      public ClipDataBlock getClipDataBlock()
      Specified by:
      getClipDataBlock in interface ClipDisplayParent
      Returns:
      the data block who's clips are to be displayed
    • getDisplayName

      public String getDisplayName()
      Description copied from interface: ClipDisplayParent
      A name (though I don't think this ever gets used by current displays)
      Specified by:
      getDisplayName in interface ClipDisplayParent
      Returns:
      display name
    • getClipDecorations

      public ClipDisplayDecorations getClipDecorations(ClipDisplayUnit clipDisplayUnit)
      Description copied from interface: ClipDisplayParent
      Add additional functionality and controls to a clip display unit
      Specified by:
      getClipDecorations in interface ClipDisplayParent
      Parameters:
      clipDisplayUnit - display unit to decorate.
    • findClipGenSetting

      public ClipGenSetting findClipGenSetting(String clipDataName)
      Find the clip generator settings for a specific data stream.
      Parameters:
      dataName - data name for the data block.
      Returns:
      clip generator settings, or null if none active.
    • displaySettingChange

      public void displaySettingChange()
      Specified by:
      displaySettingChange in interface ClipDisplayParent
    • getClipSettings

      public ClipSettings getClipSettings()
    • findTriggerDataUnit

      public PamDataUnit findTriggerDataUnit(ClipDataUnit clipDataUnit)