|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Frame javax.swing.JFrame at.ofai.music.beatroot.GUI
public class GUI
The main window of BeatRoot's graphical user interface.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JFrame |
---|
javax.swing.JFrame.AccessibleJFrame |
Nested classes/interfaces inherited from class java.awt.Frame |
---|
java.awt.Frame.AccessibleAWTFrame |
Nested classes/interfaces inherited from class java.awt.Window |
---|
java.awt.Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
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 |
Field Summary | |
---|---|
static java.lang.String |
AUDIO_SCALE_FACTOR
|
protected AudioPlayer |
audioPlayer
The object which handles sound output |
protected AudioProcessor |
audioProcessor
The object which reads and processes audio |
static int |
BAR
Constants defining metrical levels (see at.ofai.music.worm.WormFile) |
static int |
BEAT
Constants defining metrical levels (see at.ofai.music.worm.WormFile) |
static java.lang.String |
BEAT_TRACK
|
protected at.ofai.music.util.EventList |
beats
The current list of beat times |
protected Chooser |
chooser
BeatRoot's file chooser object |
static java.lang.String |
CLEAR_BEATS
|
static java.lang.String |
CLEAR_METRICAL_LEVELS
|
static java.lang.String |
CLICK_VOLUME
|
protected ControlPanel |
controlPanel
The panel containing buttons and text fields, situated at the bottom of the window |
static boolean |
debug
Flag for enabling printing of debugging information |
static double |
DEFAULT_CLICK_VOLUME
|
static double |
DEFAULT_HIGH_THRESHOLD
|
static double |
DEFAULT_LOW_THRESHOLD
Default values of preferences |
static double |
DEFAULT_SCALE_FACTOR
|
protected BeatTrackDisplay |
displayPanel
The main data panel, which displays audio and beat data, and is a component of this window |
static java.lang.String |
EDIT_PERCUSSION
|
static java.lang.String |
EDIT_PREFERENCES
|
static java.lang.String |
EXIT
|
static java.lang.String |
HIGH_THRESHOLD
|
static java.lang.String |
LENGTH
|
static java.lang.String |
LEVEL
Strings displayed in metrical level window |
protected EventProcessor |
listener
The object which processes key, button and menu events |
static java.lang.String |
LOAD_AUDIO
Strings displayed on menus and buttons |
static java.lang.String |
LOAD_BEATS
|
static java.lang.String |
LOW_THRESHOLD
Strings displayed in preferences window |
static java.lang.String |
MARK_METRICAL_LEVEL
|
protected javax.swing.JMenuBar |
menuBar
BeatRoot's menu bar |
protected at.ofai.music.util.Parameters |
metricalLevels
Dialog for specifying metrical levels |
static java.lang.String[][] |
PERCUSSION_STRINGS
|
static int |
percussionCount
Constants and default file names for percussion sounds for each metrical levels |
protected at.ofai.music.util.Parameters |
percussionSounds
Dialog for setting the percussion sounds which are played on beats |
static java.lang.String |
PHASE
|
static java.lang.String |
PLAY
|
static java.lang.String |
PLAY_AUDIO
|
static java.lang.String |
PLAY_BEATS
|
protected at.ofai.music.util.Parameters |
preferences
Dialog for setting preferences |
static java.lang.String |
REDO
|
static java.lang.String |
SAVE_AUDIO
|
static java.lang.String |
SAVE_BEATS
|
protected javax.swing.JScrollBar |
scroller
The scroller for showing or changing the position of the viewport relative to the whole audio file |
protected javax.swing.JPanel |
scrollPane
An intermediate level panel containing the displayPanel and scroller |
static int |
SEG1
Constants defining metrical levels (see at.ofai.music.worm.WormFile) |
static int |
SEG2
Constants defining metrical levels (see at.ofai.music.worm.WormFile) |
static int |
SEG3
Constants defining metrical levels (see at.ofai.music.worm.WormFile) |
static int |
SEG4
Constants defining metrical levels (see at.ofai.music.worm.WormFile) |
(package private) static long |
serialVersionUID
Avoid compiler warning |
static java.lang.String |
SHOW_BEATS
|
static java.lang.String |
SHOW_IBIS
|
static java.lang.String |
SHOW_SPECTRO
|
static java.lang.String |
SHOW_WAVE
|
static java.lang.String |
STOP
|
static java.lang.String |
title
Name of program - displayed as part of window title |
static int |
TRACK
Constants defining metrical levels (see at.ofai.music.worm.WormFile) |
static java.lang.String |
UNDO
|
static java.lang.String |
version
Version number of program - displayed as part of window title. |
Fields inherited from class javax.swing.JFrame |
---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Frame |
---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
GUI(AudioPlayer ap,
AudioProcessor proc,
Chooser ch)
Constructor: creates the GUI for BeatRoot |
Method Summary | |
---|---|
void |
clearBeatData()
Clear all beats. |
void |
clearMetricalLevels()
Clears any metrical level annotations from the beats |
void |
editPercussionSounds()
Opens the percussion sound selection dialog and updates the sound buffers accordingly |
void |
editPreferences()
Opens preferences dialog and updates the display accordingly. |
at.ofai.music.util.EventList |
getBeatData()
Returns the list of beats |
java.lang.String |
getPercussionSound(int level)
Returns the file name of a percussion sound for playing at beat times. |
void |
loadAudioData()
Loads and processes an audio file chosen with a file open dialog. |
void |
loadAudioData(java.lang.String fileName)
Loads and processes a given audio file. |
void |
loadBeatData()
Loads beat data from a file chosen by a file open dialog. |
void |
loadBeatData(java.lang.String fileName)
Loads beat data from a given file. |
protected javax.swing.JMenu |
makeBeatTrackMenu()
Creates the beat tracking menu |
protected javax.swing.JMenu |
makeEditMenu()
Creates the edit menu |
protected javax.swing.JMenu |
makeFileMenu()
Creates the file menu |
protected javax.swing.JMenuItem |
makeMenuItem(java.lang.String text,
int menuKey,
int altKey,
boolean isCheckBox)
Creates a menu item with the given text and key codes. |
protected javax.swing.JMenu |
makePlayMenu()
Creates the play menu |
protected javax.swing.JMenu |
makeViewMenu()
Creates the view menu |
void |
markMetricalLevel()
Opens the metrical levels dialog and annotates the beat data correspondingly |
void |
saveBeatData()
Saves beat data to a file chosen by a file save dialog. |
void |
scroll(int dir)
Scroll the display by a given amount. |
void |
setAudioData(double[] onsets,
double[] envTimes,
int[] envMags)
NOT USED: Sets the data for the amplitude envelope and onsets on the display. |
void |
setBeatData(at.ofai.music.util.EventList b)
Set the list of beats displayed on this window. |
void |
setMetricalLevels()
Initialises the metrical levels dialog |
void |
setMidiData(double[] onsets,
double[] offsets,
int[] pitches)
NOT USED: Sets the data for a MIDI piano-roll display. |
void |
setMode(int mode,
boolean flag)
Changes the display mode (which elements are displayed on the data panel). |
void |
setPercussionSounds()
Initialises the percussion sound dialog and sound buffers |
void |
setPreferences()
Copies default values into preferences dialog. |
void |
setSpectroData(double[][] data,
int len,
double tInc,
double overlap)
NOT USED Sets the data for displaying the spectrogram of the audio signal. |
void |
skipTo(double time)
Send a request to the audio player to skip to a given time if it is not playing |
(package private) void |
updateDisplay(boolean resetSelection)
Redraws the data panel when new data is loaded or the mode or preferences are changed. |
Methods inherited from class javax.swing.JFrame |
---|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update |
Methods inherited from class java.awt.Frame |
---|
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.awt.Window |
---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Field Detail |
---|
protected EventProcessor listener
protected AudioPlayer audioPlayer
protected AudioProcessor audioProcessor
protected Chooser chooser
protected at.ofai.music.util.Parameters preferences
protected at.ofai.music.util.Parameters metricalLevels
protected at.ofai.music.util.Parameters percussionSounds
protected javax.swing.JMenuBar menuBar
protected BeatTrackDisplay displayPanel
protected javax.swing.JScrollBar scroller
protected javax.swing.JPanel scrollPane
protected ControlPanel controlPanel
protected at.ofai.music.util.EventList beats
static final long serialVersionUID
public static boolean debug
public static final java.lang.String title
public static final java.lang.String version
public static final java.lang.String LOAD_AUDIO
public static final java.lang.String LOAD_BEATS
public static final java.lang.String SAVE_AUDIO
public static final java.lang.String SAVE_BEATS
public static final java.lang.String EXIT
public static final java.lang.String UNDO
public static final java.lang.String REDO
public static final java.lang.String EDIT_PREFERENCES
public static final java.lang.String EDIT_PERCUSSION
public static final java.lang.String SHOW_WAVE
public static final java.lang.String SHOW_SPECTRO
public static final java.lang.String SHOW_IBIS
public static final java.lang.String SHOW_BEATS
public static final java.lang.String PLAY
public static final java.lang.String PLAY_AUDIO
public static final java.lang.String PLAY_BEATS
public static final java.lang.String STOP
public static final java.lang.String BEAT_TRACK
public static final java.lang.String CLEAR_BEATS
public static final java.lang.String MARK_METRICAL_LEVEL
public static final java.lang.String CLEAR_METRICAL_LEVELS
public static final java.lang.String LOW_THRESHOLD
public static final java.lang.String HIGH_THRESHOLD
public static final java.lang.String AUDIO_SCALE_FACTOR
public static final java.lang.String CLICK_VOLUME
public static double DEFAULT_LOW_THRESHOLD
public static double DEFAULT_HIGH_THRESHOLD
public static double DEFAULT_SCALE_FACTOR
public static double DEFAULT_CLICK_VOLUME
public static final java.lang.String LEVEL
public static final java.lang.String LENGTH
public static final java.lang.String PHASE
public static final int TRACK
public static final int BEAT
public static final int BAR
public static final int SEG1
public static final int SEG2
public static final int SEG3
public static final int SEG4
public static final int percussionCount
public static final java.lang.String[][] PERCUSSION_STRINGS
Constructor Detail |
---|
public GUI(AudioPlayer ap, AudioProcessor proc, Chooser ch)
ap
- Handle to the audio player objectproc
- Handle to the audio processor objectch
- Handle to the file chooser objectMethod Detail |
---|
protected javax.swing.JMenuItem makeMenuItem(java.lang.String text, int menuKey, int altKey, boolean isCheckBox)
text
- The text that appears on the menumenuKey
- The key to access the menu item when the menu is openaltKey
- The shortcut key to access the menu item using the ALT keyisCheckBox
- Flag indicating whether the menu item is a binary flag
protected javax.swing.JMenu makeFileMenu()
protected javax.swing.JMenu makeEditMenu()
protected javax.swing.JMenu makeViewMenu()
protected javax.swing.JMenu makePlayMenu()
protected javax.swing.JMenu makeBeatTrackMenu()
public void loadAudioData()
public void loadAudioData(java.lang.String fileName)
fileName
- The name of the audio file to openpublic void loadBeatData()
public void loadBeatData(java.lang.String fileName)
fileName
- The name of the file to openpublic void saveBeatData()
public at.ofai.music.util.EventList getBeatData()
public void setAudioData(double[] onsets, double[] envTimes, int[] envMags)
onsets
- The list of onset timesenvTimes
- The list of times corresponding to envelope values (envMag
)envMags
- The values of the signal magnitude at each of these timespublic void setMidiData(double[] onsets, double[] offsets, int[] pitches)
onsets
- The onset times of each noteoffsets
- The offset times of each notepitches
- The MIDI pitches of each notepublic void setBeatData(at.ofai.music.util.EventList b)
b
- The list of beatspublic void clearBeatData()
public void setSpectroData(double[][] data, int len, double tInc, double overlap)
data
- The spectrogram data, indexed by time and frequencylen
- The number of frames of spectrogram datatInc
- The time between successive frames (hop time)overlap
- The ratio of hop size to frame size; used for centering the frames in the displayvoid updateDisplay(boolean resetSelection)
resetSelection
- Indicates whether the selected region should be resetpublic void setMode(int mode, boolean flag)
mode
- A bit string indicating the elements that should be switched on or offflag
- Indicates whether the elements should be switched on (true) or off (false)public void skipTo(double time)
public void scroll(int dir)
dir
- The direction and number of units to scrollpublic void setPreferences()
public void editPreferences()
public void setMetricalLevels()
public void clearMetricalLevels()
public void markMetricalLevel()
public void setPercussionSounds()
public void editPercussionSounds()
public java.lang.String getPercussionSound(int level)
level
- The requested metrical level
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |