Class AudioDemoPanel

java.lang.Object
ca.corbett.extras.demo.panels.PanelBuilder
ca.corbett.extras.demo.panels.AudioDemoPanel
All Implemented Interfaces:
AudioPanelListener

public final class AudioDemoPanel extends PanelBuilder implements AudioPanelListener
Provides a way to test out the AudioUtils, and more specifically, the AudioWaveformPanel. Apologies: this code predates swing-forms and is therefore a little ugly. One day I'll sit down and rewrite it to get rid of all the GridBagLayout stuff.
Since:
2018-01-04
Author:
scorbo2
  • Constructor Details

    • AudioDemoPanel

      public AudioDemoPanel()
  • Method Details

    • getTitle

      public String getTitle()
      Description copied from class: PanelBuilder
      Returns a name for this PanelBuilder.
      Specified by:
      getTitle in class PanelBuilder
      Returns:
      A hopefully descriptive name.
    • build

      public JPanel build()
      Description copied from class: PanelBuilder
      Builds and returns the FormPanel (or technically any JPanel) for this builder.
      Specified by:
      build in class PanelBuilder
      Returns:
      A populated JPanel (or FormPanel).
    • generateWaveform

      public void generateWaveform()
    • stateChanged

      public void stateChanged(AudioWaveformPanel sourcePanel, AudioWaveformPanel.PanelState state)
      Description copied from interface: AudioPanelListener
      Indicates a state change within the panel.
      • IDLE - the panel is neither playing nor recording.
      • PLAYING - the panel is playing audio.
      • RECORDING - the panel is recording audio.
      Specified by:
      stateChanged in interface AudioPanelListener
      Parameters:
      sourcePanel - The AudioWaveformPanel that triggered this event.
      state - The new state of the panel.
    • recordingComplete

      public void recordingComplete(AudioWaveformPanel sourcePanel)
      Description copied from interface: AudioPanelListener
      Indicates that a clip has been recorded within the panel and is available for playback or saving.
      Specified by:
      recordingComplete in interface AudioPanelListener
      Parameters:
      sourcePanel - The AudioWaveformPanel that triggered this event.
    • audioLoaded

      public void audioLoaded(AudioWaveformPanel sourcePanel)
      Description copied from interface: AudioPanelListener
      Indicates that an audio clip has been loaded into the panel. This event is also triggered after recording a clip, as the newly recorded clip is loaded into the panel.
      Specified by:
      audioLoaded in interface AudioPanelListener
      Parameters:
      sourcePanel - The AudioWaveformPanel that triggered this event.
    • audioStopped

      public void audioStopped(PlaybackThread.StopReason stopReason)
      Description copied from interface: AudioPanelListener
      In addition to stateChanged, this message will also be triggered when audio stops playing, to provide information about why the audio stopped.
      Specified by:
      audioStopped in interface AudioPanelListener
      Parameters:
      stopReason - Indicates whether the audio was interrupted, hit its limit, or exhausted itself.