Package ca.corbett.extras.demo.panels
Class AudioDemoPanel
java.lang.Object
ca.corbett.extras.demo.panels.PanelBuilder
ca.corbett.extras.demo.panels.AudioDemoPanel
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaudioLoaded(AudioWaveformPanel sourcePanel) Indicates that an audio clip has been loaded into the panel.voidaudioStopped(PlaybackThread.StopReason stopReason) In addition to stateChanged, this message will also be triggered when audio stops playing, to provide information about why the audio stopped.build()Builds and returns the FormPanel (or technically any JPanel) for this builder.voidgetTitle()Returns a name for this PanelBuilder.voidrecordingComplete(AudioWaveformPanel sourcePanel) Indicates that a clip has been recorded within the panel and is available for playback or saving.voidstateChanged(AudioWaveformPanel sourcePanel, AudioWaveformPanel.PanelState state) Indicates a state change within the panel.
-
Constructor Details
-
AudioDemoPanel
public AudioDemoPanel()
-
-
Method Details
-
getTitle
Description copied from class:PanelBuilderReturns a name for this PanelBuilder.- Specified by:
getTitlein classPanelBuilder- Returns:
- A hopefully descriptive name.
-
build
Description copied from class:PanelBuilderBuilds and returns the FormPanel (or technically any JPanel) for this builder.- Specified by:
buildin classPanelBuilder- Returns:
- A populated JPanel (or FormPanel).
-
generateWaveform
public void generateWaveform() -
stateChanged
Description copied from interface:AudioPanelListenerIndicates 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:
stateChangedin interfaceAudioPanelListener- Parameters:
sourcePanel- The AudioWaveformPanel that triggered this event.state- The new state of the panel.
-
recordingComplete
Description copied from interface:AudioPanelListenerIndicates that a clip has been recorded within the panel and is available for playback or saving.- Specified by:
recordingCompletein interfaceAudioPanelListener- Parameters:
sourcePanel- The AudioWaveformPanel that triggered this event.
-
audioLoaded
Description copied from interface:AudioPanelListenerIndicates 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:
audioLoadedin interfaceAudioPanelListener- Parameters:
sourcePanel- The AudioWaveformPanel that triggered this event.
-
audioStopped
Description copied from interface:AudioPanelListenerIn addition to stateChanged, this message will also be triggered when audio stops playing, to provide information about why the audio stopped.- Specified by:
audioStoppedin interfaceAudioPanelListener- Parameters:
stopReason- Indicates whether the audio was interrupted, hit its limit, or exhausted itself.
-