Package SoundRecorder

Class RecorderSettings

java.lang.Object
SoundRecorder.RecorderSettings
All Implemented Interfaces:
Serializable, Cloneable, ManagedParameters

public class RecorderSettings extends Object implements Serializable, Cloneable, ManagedParameters
Control parameters for sound recorders.
Author:
Doug Gillespie
See Also:
  • Field Details

    • serialVersionUID

      public static final long serialVersionUID
      See Also:
    • BITDEPTHS

      public static final int[] BITDEPTHS
      Allowable bit depths.
    • rawDataSource

      public String rawDataSource
      Name of the raw data source
    • enableBuffer

      public boolean enableBuffer
      Buffer data so that it can be added to the start of a file
    • bufferLength

      public int bufferLength
      Length of the buffered data to store
    • outputFolder

      public String outputFolder
      Output folder for recording files
    • fileInitials

      public String fileInitials
      Initials to add to the start of a file name, the rest of which is made up from the date.
    • autoInterval

      public int autoInterval
      Number of seconds between automatic recordings
    • autoDuration

      public int autoDuration
      Duration of automatic recordings in seconds
    • maxLengthSeconds

      public int maxLengthSeconds
      Maximum length of a single file in seconds
    • maxLengthMegaBytes

      public long maxLengthMegaBytes
      Maximum length of a single file in Mega bytes
    • startStatus

      public int startStatus
      New start status option to make it easier to automatically start recording.
      Tells PAMGuard whether or not to start the recorder when PAMGuard starts.
  • Method Details

    • setOutputFolder

      public void setOutputFolder(String outputFolder)
    • isRoundFileStarts

      public boolean isRoundFileStarts()
      Returns:
      if file start times should be rounded to 'nice' times.
    • setRoundFileStarts

      public void setRoundFileStarts(boolean roundFileStarts)
      Parameters:
      roundFileStarts - File start times will be rounded to 'nice' times.
    • createTriggerDataList

      protected void createTriggerDataList(ArrayList<RecorderTrigger> recorderTriggers)
      Check that everything in the recorderTriggers list is also represented in the triggerDataList.

      Each recorder trigger can provide a set of default data, which is basically what the programmer has put in to give an idea of suitable data budgets and trigger conditions. These default parameters then get modified by the user to suit their own requirements.

    • cleanTriggerDataList

      protected void cleanTriggerDataList(ArrayList<RecorderTrigger> recorderTriggers)
      Called before settings are saved to remove settings for any module no longer present.
      Parameters:
      recorderTriggers -
    • findTriggerData

      public RecorderTriggerData findTriggerData(RecorderTrigger recorderTrigger)
      Find the active trigger data for a trigger of a given name.

      If the trigger data cannot be found, add the default set.

      Parameters:
      recorderTrigger -
      Returns:
      Active trigger data (started as the default, then got modified by the user)
    • findTriggerData

      public RecorderTriggerData findTriggerData(String triggerName)
      find a set of trigger data by name.
      Parameters:
      triggerName - trigger name
      Returns:
      Active trigger data.
    • getLongestHistory

      public double getLongestHistory()
      Get the largest (enabled) pre trigger time
      Returns:
      longest time in seconds.
    • clone

      public RecorderSettings clone()
      Overrides:
      clone in class Object
    • getFileType

      public AudioFileFormat.Type getFileType()
      Since AudioFileFormat.Type is not serialized, fileType is stored as a sting. The getter therefore needs to search available file types and return the appropriate one.
      Returns:
      Format type for the audio file
      See Also:
    • setFileType

      public void setFileType(AudioFileFormat.Type fileType)
    • replaceTriggerData

      public void replaceTriggerData(RecorderTriggerData newData)
      Find a trigger data object with the same name and replace it.
      Parameters:
      newData -
    • getChannelBitmap

      public int getChannelBitmap(int availableChannels)
      get the channel map, but tell it what channels are available !
      Parameters:
      availableChannels - available cahnnels (channel map of parent process)
      Returns:
      channel bitmap
    • getNumChannels

      public int getNumChannels()
      Returns:
      The number of channels to be recorded.
    • setChannelBitmap

      public void setChannelBitmap(int channelBitmap)
      Parameters:
      channelBitmap - the channelBitmap to set
    • setChannelBitmap

      public int setChannelBitmap(int iChannel, boolean state)
      Set the bitmap for a given channel.
      Parameters:
      iChannel - channel number
      state - on or of (true or false)
      Returns:
      channel bitmap
    • getChannelBitmap

      public boolean getChannelBitmap(int availableChannels, int iChannel)
      Get the state of a single channel.
      Parameters:
      availableChannels - available channels
      iChannel - channel number
      Returns:
      true or false.
    • getParameterSet

      public PamParameterSet getParameterSet()
      Description copied from interface: ManagedParameters
      Get a set of data that describes all of the parameters in a class
      Specified by:
      getParameterSet in interface ManagedParameters
      Returns:
      description of the parameters in a class.