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

    • serialVersionUID Link icon

      public static final long serialVersionUID
      See Also:
    • BITDEPTHS Link icon

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

      public String rawDataSource
      Name of the raw data source
    • enableBuffer Link icon

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

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

      public String outputFolder
      Output folder for recording files
    • fileInitials Link icon

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

      public int autoInterval
      Number of seconds between automatic recordings
    • autoDuration Link icon

      public int autoDuration
      Duration of automatic recordings in seconds
    • maxLengthSeconds Link icon

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

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

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

    • setOutputFolder Link icon

      public void setOutputFolder(String outputFolder)
    • isRoundFileStarts Link icon

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

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

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

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

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

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

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

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

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

      public void setFileType(AudioFileFormat.Type fileType)
    • replaceTriggerData Link icon

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

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

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

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

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

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

      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.