Package nidaqdev

Class NIFilePlayback

java.lang.Object
nidaqdev.NIFilePlayback
All Implemented Interfaces:
PamSettings, SettingsNameProvider, FilePlaybackDevice

public class NIFilePlayback extends Object implements FilePlaybackDevice, PamSettings
PArt of the system for playback from wav files. The wav file playback system has a number of subsystems, currently including sound card and NI card outputs.
This is NOT the class used to play back data actually acquired using NI cards.
Author:
Doug Gillespie
  • Constructor Details

    • NIFilePlayback

      public NIFilePlayback(FilePlayback filePlayback)
  • Method Details

    • getDeviceNames

      public String[] getDeviceNames()
      Specified by:
      getDeviceNames in interface FilePlaybackDevice
      Returns:
      a list of device names
    • getName

      public String getName()
      Specified by:
      getName in interface FilePlaybackDevice
      Returns:
      a name for this type of playback device
    • getNumPlaybackChannels

      public int getNumPlaybackChannels(int devNum)
      Description copied from interface: FilePlaybackDevice
      Get's the number of playback channels for a given device.
      Specified by:
      getNumPlaybackChannels in interface FilePlaybackDevice
      Parameters:
      devNum - device number
      Returns:
      number of channels
    • playData

      public boolean playData(RawDataUnit[] data)
      Description copied from interface: FilePlaybackDevice
      Play some data. The length of the data array must correspond to the number of channels.
      Specified by:
      playData in interface FilePlaybackDevice
      Parameters:
      data - array of raw audio data units.
      Returns:
      true if played OK.
    • preparePlayback

      public boolean preparePlayback(PlaybackParameters playbackParameters)
      Description copied from interface: FilePlaybackDevice
      Prepare playback
      Specified by:
      preparePlayback in interface FilePlaybackDevice
      Parameters:
      playbackParameters - parameters
      Returns:
      true if all Ok. S
    • stopPlayback

      public boolean stopPlayback()
      Description copied from interface: FilePlaybackDevice
      Stop playback, clean up buffers, etc.
      Specified by:
      stopPlayback in interface FilePlaybackDevice
      Returns:
      true if all cleaned up Ok.
    • getDeviceState

      public PlayDeviceState getDeviceState()
      Description copied from interface: FilePlaybackDevice
      Get device status information.
      Specified by:
      getDeviceState in interface FilePlaybackDevice
      Returns:
    • getDeviceName

      public String getDeviceName()
      Specified by:
      getDeviceName in interface FilePlaybackDevice
    • getSettingsPanel

      public PamDialogPanel getSettingsPanel()
      Description copied from interface: FilePlaybackDevice
      Get a settings panel for additional options. Can be null.
      Specified by:
      getSettingsPanel in interface FilePlaybackDevice
      Returns:
      settings panel or null for additional options.
    • getNiFilePlaybackParams

      public NIFilePlaybackParams getNiFilePlaybackParams()
      Returns:
      the niFilePlaybackParams
    • setNiFilePlaybackParams

      public void setNiFilePlaybackParams(NIFilePlaybackParams niFilePlaybackParams)
      Parameters:
      niFilePlaybackParams - the niFilePlaybackParams to set
    • getUnitName

      public String getUnitName()
      Specified by:
      getUnitName in interface SettingsNameProvider
      Returns:
      A Name specific to this instance of the particular class, e.g. Sperm whale detector, Beaked whale detector, etc.
    • getUnitType

      public String getUnitType()
      Specified by:
      getUnitType in interface PamSettings
      Returns:
      A Name specific to the type, e.g. Click detector
    • 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
    • getCurrentDeviceInfo

      public NIDeviceInfo getCurrentDeviceInfo()
      Returns:
      the currentDeviceInfo