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

    • ClipControl Link icon

      public ClipControl(String unitName)
  • Method Details Link icon

    • createDetectionMenu Link icon

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

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

      public void displayOptions(Frame parentFrame)
    • getSettingsReference Link icon

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

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

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

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

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

      public ClipProcess getClipProcess()
      Returns:
      the clipProcess
    • generateNewPanel Link icon

      public ClipDisplayPanel generateNewPanel()
    • removeUnit Link icon

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

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

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

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

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

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

      public ClipSettings getClipSettings()
    • findTriggerDataUnit Link icon

      public PamDataUnit findTriggerDataUnit(ClipDataUnit clipDataUnit)