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 classBasicAudioClipUI.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.AudioFormataudioFormatprotected AudioClipaudioSampleprotected AudioSourceaudioSourceprotected intchannelsjava.awt.ColorDEFAULT_TIME_GRID_COLORprotected intframeSizeprotected doubleframesPerPixelprotected longlengthprotected doublelengthInSecondsprotected java.util.Vector<java.awt.event.ActionListener>listenerListprotected MediaLengthUnitmediaLengthUnitprotected doublepixelsPerFrameprotected floatsampleRateprotected Selectionselectionprotected booleanshowTimeScaleGridprotected java.text.FormattimeFormatprotected TickProvider<java.lang.Long>timeScaleTickProviderprotected BasicAudioClipUI.ViewSelectionviewSelection-
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 voidaddActionListener(java.awt.event.ActionListener acl)Add an actionlistener to the plugin.java.awt.ComponentasComponent()voidaudioClipChanged(AudioClipChangedEvent event)voidclose()voiddoLayout()protected voidfireActionEvent(java.awt.event.ActionEvent ae)protected java.lang.StringformatPosition(long framePosition)protected doubleframesToTimeInSeconds(long framePosition)ActionTreeRootgetActionTreeRoot()AudioClipgetAudioSample()javax.swing.JMenu[]getJMenus()doublegetLengthInSeconds()LocalizableMessagegetLocalizableName()Get localized name.java.text.FormatgetTimeFormat()javax.swing.JComponent[]getYScales()booleanhasControlDialog()booleanisPreferredFixedHeight()booleanisShowTimeScaleGrid()protected intmapFrameToPixel(long framePosition)protected longmapPixelToFrame(int pixelPosition)voidremoveActionListener(java.awt.event.ActionListener acl)Remove an action listener.voidsetAudioSample(AudioClip audioSample)Set the audio sample.protected voidsetAudioSource(AudioSource audioSource)voidsetMediaLengthUnit(MediaLengthUnit mediaLengthUnit)Set media length units.voidsetProcessedFrameLength(long frameLength)protected voidsetSelection()voidsetShowTimeScaleGrid(boolean showTimeScaleGrid)voidsetTimeFormat(java.text.Format timeFormat)Set the time format to use.voidsetTimeScaleTickProvider(TickProvider<java.lang.Long> timeScaleTickProvider)Set the provider for time scale ticks.voidsetVisible(boolean visible)voidshowJControlDialog(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:AudioClipUIGet localized name.- Specified by:
getLocalizableNamein interfaceAudioClipUI- Returns:
- localized name
-
setAudioSample
public void setAudioSample(AudioClip audioSample)
Description copied from interface:AudioClipUISet the audio sample.- Specified by:
setAudioSamplein 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:
setVisiblein classjavax.swing.JComponent
-
doLayout
public void doLayout()
- Overrides:
doLayoutin 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:
audioClipChangedin interfaceAudioClipListener
-
setSelection
protected void setSelection()
-
addActionListener
public void addActionListener(java.awt.event.ActionListener acl)
Description copied from interface:AudioClipUIAdd an actionlistener to the plugin.- Specified by:
addActionListenerin interfaceAudioClipUI
-
removeActionListener
public void removeActionListener(java.awt.event.ActionListener acl)
Description copied from interface:AudioClipUIRemove an action listener.- Specified by:
removeActionListenerin 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:AudioClipUISet the time format to use. For example framecount or media timne format ("00:00:00.000")- Specified by:
setTimeFormatin interfaceAudioClipUI
-
formatPosition
protected java.lang.String formatPosition(long framePosition)
-
setTimeScaleTickProvider
public void setTimeScaleTickProvider(TickProvider<java.lang.Long> timeScaleTickProvider)
Description copied from interface:AudioClipUISet 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:
setTimeScaleTickProviderin interfaceAudioClipUI
-
getJMenus
public javax.swing.JMenu[] getJMenus()
-
close
public void close()
- Specified by:
closein interfaceAudioClipUI
-
getYScales
public javax.swing.JComponent[] getYScales()
- Specified by:
getYScalesin interfaceAudioClipUI
-
setMediaLengthUnit
public void setMediaLengthUnit(MediaLengthUnit mediaLengthUnit)
Description copied from interface:AudioClipUISet media length units. (time or frames)- Specified by:
setMediaLengthUnitin interfaceAudioClipUI
-
getActionTreeRoot
public ActionTreeRoot getActionTreeRoot()
- Specified by:
getActionTreeRootin interfaceActionProvider
-
showJControlDialog
public void showJControlDialog(java.awt.Component parentComponent)
Description copied from interface:AudioClipUIShow a dialog component for plugin controls.- Specified by:
showJControlDialogin interfaceAudioClipUI
-
hasControlDialog
public boolean hasControlDialog()
- Specified by:
hasControlDialogin interfaceAudioClipUI
-
isPreferredFixedHeight
public boolean isPreferredFixedHeight()
- Specified by:
isPreferredFixedHeightin interfaceAudioClipUI
-
asComponent
public java.awt.Component asComponent()
- Specified by:
asComponentin interfaceAudioClipUI
-
-