Package ipsk.audio.arr.clip.ui
Class BasicAudioClipUI
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- ipsk.audio.arr.clip.ui.BasicAudioClipUI
-
- All Implemented Interfaces:
AudioClipListener
,AudioClipUI
,ActionProvider
,java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,java.util.EventListener
,javax.accessibility.Accessible
- Direct Known Subclasses:
AudioSignalClipView
,AudioSignalUI
,EnergyAudioClipUI
,FourierUI
,FragmentActionBarUI
,PitchAudioClipUI
public class BasicAudioClipUI extends javax.swing.JPanel implements AudioClipUI
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
BasicAudioClipUI.ViewSelection
-
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
-
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.sound.sampled.AudioFormat
audioFormat
protected AudioClip
audioSample
protected AudioSource
audioSource
protected int
channels
java.awt.Color
DEFAULT_TIME_GRID_COLOR
protected int
frameSize
protected double
framesPerPixel
protected long
length
protected double
lengthInSeconds
protected java.util.Vector<java.awt.event.ActionListener>
listenerList
protected MediaLengthUnit
mediaLengthUnit
protected double
pixelsPerFrame
protected float
sampleRate
protected Selection
selection
protected boolean
showTimeScaleGrid
protected java.text.Format
timeFormat
protected TickProvider<java.lang.Long>
timeScaleTickProvider
protected BasicAudioClipUI.ViewSelection
viewSelection
-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor Description BasicAudioClipUI()
BasicAudioClipUI(AudioClip audioSample)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addActionListener(java.awt.event.ActionListener acl)
Add an actionlistener to the plugin.java.awt.Component
asComponent()
void
audioClipChanged(AudioClipChangedEvent event)
void
close()
void
doLayout()
protected void
fireActionEvent(java.awt.event.ActionEvent ae)
protected java.lang.String
formatPosition(long framePosition)
protected double
framesToTimeInSeconds(long framePosition)
ActionTreeRoot
getActionTreeRoot()
AudioClip
getAudioSample()
javax.swing.JMenu[]
getJMenus()
double
getLengthInSeconds()
LocalizableMessage
getLocalizableName()
Get localized name.java.text.Format
getTimeFormat()
javax.swing.JComponent[]
getYScales()
boolean
hasControlDialog()
boolean
isPreferredFixedHeight()
boolean
isShowTimeScaleGrid()
protected int
mapFrameToPixel(long framePosition)
protected long
mapPixelToFrame(int pixelPosition)
void
removeActionListener(java.awt.event.ActionListener acl)
Remove an action listener.void
setAudioSample(AudioClip audioSample)
Set the audio sample.protected void
setAudioSource(AudioSource audioSource)
void
setMediaLengthUnit(MediaLengthUnit mediaLengthUnit)
Set media length units.void
setProcessedFrameLength(long frameLength)
protected void
setSelection()
void
setShowTimeScaleGrid(boolean showTimeScaleGrid)
void
setTimeFormat(java.text.Format timeFormat)
Set the time format to use.void
setTimeScaleTickProvider(TickProvider<java.lang.Long> timeScaleTickProvider)
Set the provider for time scale ticks.void
setVisible(boolean visible)
void
showJControlDialog(java.awt.Component parentComponent)
Show a dialog component for plugin controls.-
Methods inherited from interface ipsk.audio.arr.clip.ui.AudioClipUI
getName
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
-
-
-
-
Field Detail
-
DEFAULT_TIME_GRID_COLOR
public final java.awt.Color DEFAULT_TIME_GRID_COLOR
-
audioSource
protected AudioSource audioSource
-
audioSample
protected AudioClip audioSample
-
channels
protected int channels
-
lengthInSeconds
protected double lengthInSeconds
-
length
protected long length
-
audioFormat
protected javax.sound.sampled.AudioFormat audioFormat
-
frameSize
protected int frameSize
-
framesPerPixel
protected double framesPerPixel
-
pixelsPerFrame
protected double pixelsPerFrame
-
selection
protected Selection selection
-
viewSelection
protected BasicAudioClipUI.ViewSelection viewSelection
-
listenerList
protected java.util.Vector<java.awt.event.ActionListener> listenerList
-
sampleRate
protected float sampleRate
-
mediaLengthUnit
protected MediaLengthUnit mediaLengthUnit
-
timeFormat
protected java.text.Format timeFormat
-
timeScaleTickProvider
protected TickProvider<java.lang.Long> timeScaleTickProvider
-
showTimeScaleGrid
protected boolean showTimeScaleGrid
-
-
Constructor Detail
-
BasicAudioClipUI
public BasicAudioClipUI()
-
BasicAudioClipUI
public BasicAudioClipUI(AudioClip audioSample) throws AudioFormatNotSupportedException, AudioSourceException
-
-
Method Detail
-
isShowTimeScaleGrid
public boolean isShowTimeScaleGrid()
-
setShowTimeScaleGrid
public void setShowTimeScaleGrid(boolean showTimeScaleGrid)
-
mapPixelToFrame
protected long mapPixelToFrame(int pixelPosition)
-
mapFrameToPixel
protected int mapFrameToPixel(long framePosition)
-
framesToTimeInSeconds
protected double framesToTimeInSeconds(long framePosition)
-
getLocalizableName
public LocalizableMessage getLocalizableName()
Description copied from interface:AudioClipUI
Get localized name.- Specified by:
getLocalizableName
in interfaceAudioClipUI
- Returns:
- localized name
-
setAudioSample
public void setAudioSample(AudioClip audioSample)
Description copied from interface:AudioClipUI
Set the audio sample.- Specified by:
setAudioSample
in interfaceAudioClipUI
- Parameters:
audioSample
- the audiosample or null to clear
-
setAudioSource
protected void setAudioSource(AudioSource audioSource) throws AudioSourceException
- Throws:
AudioSourceException
-
setVisible
public void setVisible(boolean visible)
- Overrides:
setVisible
in classjavax.swing.JComponent
-
doLayout
public void doLayout()
- Overrides:
doLayout
in classjava.awt.Container
-
setProcessedFrameLength
public void setProcessedFrameLength(long frameLength)
-
getAudioSample
public AudioClip getAudioSample()
-
getLengthInSeconds
public double getLengthInSeconds()
-
audioClipChanged
public void audioClipChanged(AudioClipChangedEvent event)
- Specified by:
audioClipChanged
in interfaceAudioClipListener
-
setSelection
protected void setSelection()
-
addActionListener
public void addActionListener(java.awt.event.ActionListener acl)
Description copied from interface:AudioClipUI
Add an actionlistener to the plugin.- Specified by:
addActionListener
in interfaceAudioClipUI
-
removeActionListener
public void removeActionListener(java.awt.event.ActionListener acl)
Description copied from interface:AudioClipUI
Remove an action listener.- Specified by:
removeActionListener
in interfaceAudioClipUI
-
fireActionEvent
protected void fireActionEvent(java.awt.event.ActionEvent ae)
-
getTimeFormat
public java.text.Format getTimeFormat()
-
setTimeFormat
public void setTimeFormat(java.text.Format timeFormat)
Description copied from interface:AudioClipUI
Set the time format to use. For example framecount or media timne format ("00:00:00.000")- Specified by:
setTimeFormat
in interfaceAudioClipUI
-
formatPosition
protected java.lang.String formatPosition(long framePosition)
-
setTimeScaleTickProvider
public void setTimeScaleTickProvider(TickProvider<java.lang.Long> timeScaleTickProvider)
Description copied from interface:AudioClipUI
Set the provider for time scale ticks. If there is a time scale in the audio sample GUI, it can provide the time ticks for the other plugins to display vertical time scale lines.- Specified by:
setTimeScaleTickProvider
in interfaceAudioClipUI
-
getJMenus
public javax.swing.JMenu[] getJMenus()
-
close
public void close()
- Specified by:
close
in interfaceAudioClipUI
-
getYScales
public javax.swing.JComponent[] getYScales()
- Specified by:
getYScales
in interfaceAudioClipUI
-
setMediaLengthUnit
public void setMediaLengthUnit(MediaLengthUnit mediaLengthUnit)
Description copied from interface:AudioClipUI
Set media length units. (time or frames)- Specified by:
setMediaLengthUnit
in interfaceAudioClipUI
-
getActionTreeRoot
public ActionTreeRoot getActionTreeRoot()
- Specified by:
getActionTreeRoot
in interfaceActionProvider
-
showJControlDialog
public void showJControlDialog(java.awt.Component parentComponent)
Description copied from interface:AudioClipUI
Show a dialog component for plugin controls.- Specified by:
showJControlDialog
in interfaceAudioClipUI
-
hasControlDialog
public boolean hasControlDialog()
- Specified by:
hasControlDialog
in interfaceAudioClipUI
-
isPreferredFixedHeight
public boolean isPreferredFixedHeight()
- Specified by:
isPreferredFixedHeight
in interfaceAudioClipUI
-
asComponent
public java.awt.Component asComponent()
- Specified by:
asComponent
in interfaceAudioClipUI
-
-