at.ofai.music.beatroot
Class GUI

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by at.ofai.music.beatroot.GUI
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class GUI
extends javax.swing.JFrame

The main window of BeatRoot's graphical user interface.

See Also:
Serialized Form

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

listener

protected EventProcessor listener
The object which processes key, button and menu events


audioPlayer

protected AudioPlayer audioPlayer
The object which handles sound output


audioProcessor

protected AudioProcessor audioProcessor
The object which reads and processes audio


chooser

protected Chooser chooser
BeatRoot's file chooser object


preferences

protected at.ofai.music.util.Parameters preferences
Dialog for setting preferences


metricalLevels

protected at.ofai.music.util.Parameters metricalLevels
Dialog for specifying metrical levels


percussionSounds

protected at.ofai.music.util.Parameters percussionSounds
Dialog for setting the percussion sounds which are played on beats


menuBar

protected javax.swing.JMenuBar menuBar
BeatRoot's menu bar


displayPanel

protected BeatTrackDisplay displayPanel
The main data panel, which displays audio and beat data, and is a component of this window


scroller

protected javax.swing.JScrollBar scroller
The scroller for showing or changing the position of the viewport relative to the whole audio file


scrollPane

protected javax.swing.JPanel scrollPane
An intermediate level panel containing the displayPanel and scroller


controlPanel

protected ControlPanel controlPanel
The panel containing buttons and text fields, situated at the bottom of the window


beats

protected at.ofai.music.util.EventList beats
The current list of beat times


serialVersionUID

static final long serialVersionUID
Avoid compiler warning

See Also:
Constant Field Values

debug

public static boolean debug
Flag for enabling printing of debugging information


title

public static final java.lang.String title
Name of program - displayed as part of window title

See Also:
Constant Field Values

version

public static final java.lang.String version
Version number of program - displayed as part of window title. DO NOT EDIT: This line is also used in creating the file name of the jar file.

See Also:
Constant Field Values

LOAD_AUDIO

public static final java.lang.String LOAD_AUDIO
Strings displayed on menus and buttons

See Also:
Constant Field Values

LOAD_BEATS

public static final java.lang.String LOAD_BEATS
See Also:
Constant Field Values

SAVE_AUDIO

public static final java.lang.String SAVE_AUDIO
See Also:
Constant Field Values

SAVE_BEATS

public static final java.lang.String SAVE_BEATS
See Also:
Constant Field Values

EXIT

public static final java.lang.String EXIT
See Also:
Constant Field Values

UNDO

public static final java.lang.String UNDO
See Also:
Constant Field Values

REDO

public static final java.lang.String REDO
See Also:
Constant Field Values

EDIT_PREFERENCES

public static final java.lang.String EDIT_PREFERENCES
See Also:
Constant Field Values

EDIT_PERCUSSION

public static final java.lang.String EDIT_PERCUSSION
See Also:
Constant Field Values

SHOW_WAVE

public static final java.lang.String SHOW_WAVE
See Also:
Constant Field Values

SHOW_SPECTRO

public static final java.lang.String SHOW_SPECTRO
See Also:
Constant Field Values

SHOW_IBIS

public static final java.lang.String SHOW_IBIS
See Also:
Constant Field Values

SHOW_BEATS

public static final java.lang.String SHOW_BEATS
See Also:
Constant Field Values

PLAY

public static final java.lang.String PLAY
See Also:
Constant Field Values

PLAY_AUDIO

public static final java.lang.String PLAY_AUDIO
See Also:
Constant Field Values

PLAY_BEATS

public static final java.lang.String PLAY_BEATS
See Also:
Constant Field Values

STOP

public static final java.lang.String STOP
See Also:
Constant Field Values

BEAT_TRACK

public static final java.lang.String BEAT_TRACK
See Also:
Constant Field Values

CLEAR_BEATS

public static final java.lang.String CLEAR_BEATS
See Also:
Constant Field Values

MARK_METRICAL_LEVEL

public static final java.lang.String MARK_METRICAL_LEVEL
See Also:
Constant Field Values

CLEAR_METRICAL_LEVELS

public static final java.lang.String CLEAR_METRICAL_LEVELS
See Also:
Constant Field Values

LOW_THRESHOLD

public static final java.lang.String LOW_THRESHOLD
Strings displayed in preferences window

See Also:
Constant Field Values

HIGH_THRESHOLD

public static final java.lang.String HIGH_THRESHOLD
See Also:
Constant Field Values

AUDIO_SCALE_FACTOR

public static final java.lang.String AUDIO_SCALE_FACTOR
See Also:
Constant Field Values

CLICK_VOLUME

public static final java.lang.String CLICK_VOLUME
See Also:
Constant Field Values

DEFAULT_LOW_THRESHOLD

public static double DEFAULT_LOW_THRESHOLD
Default values of preferences


DEFAULT_HIGH_THRESHOLD

public static double DEFAULT_HIGH_THRESHOLD

DEFAULT_SCALE_FACTOR

public static double DEFAULT_SCALE_FACTOR

DEFAULT_CLICK_VOLUME

public static double DEFAULT_CLICK_VOLUME

LEVEL

public static final java.lang.String LEVEL
Strings displayed in metrical level window

See Also:
Constant Field Values

LENGTH

public static final java.lang.String LENGTH
See Also:
Constant Field Values

PHASE

public static final java.lang.String PHASE
See Also:
Constant Field Values

TRACK

public static final int TRACK
Constants defining metrical levels (see at.ofai.music.worm.WormFile)

See Also:
Constant Field Values

BEAT

public static final int BEAT
Constants defining metrical levels (see at.ofai.music.worm.WormFile)

See Also:
Constant Field Values

BAR

public static final int BAR
Constants defining metrical levels (see at.ofai.music.worm.WormFile)

See Also:
Constant Field Values

SEG1

public static final int SEG1
Constants defining metrical levels (see at.ofai.music.worm.WormFile)

See Also:
Constant Field Values

SEG2

public static final int SEG2
Constants defining metrical levels (see at.ofai.music.worm.WormFile)

See Also:
Constant Field Values

SEG3

public static final int SEG3
Constants defining metrical levels (see at.ofai.music.worm.WormFile)

See Also:
Constant Field Values

SEG4

public static final int SEG4
Constants defining metrical levels (see at.ofai.music.worm.WormFile)

See Also:
Constant Field Values

percussionCount

public static final int percussionCount
Constants and default file names for percussion sounds for each metrical levels

See Also:
Constant Field Values

PERCUSSION_STRINGS

public static final java.lang.String[][] PERCUSSION_STRINGS
Constructor Detail

GUI

public GUI(AudioPlayer ap,
           AudioProcessor proc,
           Chooser ch)
Constructor: creates the GUI for BeatRoot

Parameters:
ap - Handle to the audio player object
proc - Handle to the audio processor object
ch - Handle to the file chooser object
Method Detail

makeMenuItem

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.

Parameters:
text - The text that appears on the menu
menuKey - The key to access the menu item when the menu is open
altKey - The shortcut key to access the menu item using the ALT key
isCheckBox - Flag indicating whether the menu item is a binary flag
Returns:
The menu item

makeFileMenu

protected javax.swing.JMenu makeFileMenu()
Creates the file menu


makeEditMenu

protected javax.swing.JMenu makeEditMenu()
Creates the edit menu


makeViewMenu

protected javax.swing.JMenu makeViewMenu()
Creates the view menu


makePlayMenu

protected javax.swing.JMenu makePlayMenu()
Creates the play menu


makeBeatTrackMenu

protected javax.swing.JMenu makeBeatTrackMenu()
Creates the beat tracking menu


loadAudioData

public void loadAudioData()
Loads and processes an audio file chosen with a file open dialog.


loadAudioData

public void loadAudioData(java.lang.String fileName)
Loads and processes a given audio file.

Parameters:
fileName - The name of the audio file to open

loadBeatData

public void loadBeatData()
Loads beat data from a file chosen by a file open dialog.


loadBeatData

public void loadBeatData(java.lang.String fileName)
Loads beat data from a given file.

Parameters:
fileName - The name of the file to open

saveBeatData

public void saveBeatData()
Saves beat data to a file chosen by a file save dialog.


getBeatData

public at.ofai.music.util.EventList getBeatData()
Returns the list of beats


setAudioData

public void setAudioData(double[] onsets,
                         double[] envTimes,
                         int[] envMags)
NOT USED: Sets the data for the amplitude envelope and onsets on the display.

Parameters:
onsets - The list of onset times
envTimes - The list of times corresponding to envelope values (envMag)
envMags - The values of the signal magnitude at each of these times

setMidiData

public void setMidiData(double[] onsets,
                        double[] offsets,
                        int[] pitches)
NOT USED: Sets the data for a MIDI piano-roll display.

Parameters:
onsets - The onset times of each note
offsets - The offset times of each note
pitches - The MIDI pitches of each note

setBeatData

public void setBeatData(at.ofai.music.util.EventList b)
Set the list of beats displayed on this window.

Parameters:
b - The list of beats

clearBeatData

public void clearBeatData()
Clear all beats. Note that this action can't be undone.


setSpectroData

public void setSpectroData(double[][] data,
                           int len,
                           double tInc,
                           double overlap)
NOT USED Sets the data for displaying the spectrogram of the audio signal.

Parameters:
data - The spectrogram data, indexed by time and frequency
len - The number of frames of spectrogram data
tInc - The time between successive frames (hop time)
overlap - The ratio of hop size to frame size; used for centering the frames in the display

updateDisplay

void updateDisplay(boolean resetSelection)
Redraws the data panel when new data is loaded or the mode or preferences are changed.

Parameters:
resetSelection - Indicates whether the selected region should be reset

setMode

public void setMode(int mode,
                    boolean flag)
Changes the display mode (which elements are displayed on the data panel). Constant values (SHOW_BEATS, etc.) are defined in BeatTrackDisplay.java

Parameters:
mode - A bit string indicating the elements that should be switched on or off
flag - Indicates whether the elements should be switched on (true) or off (false)

skipTo

public void skipTo(double time)
Send a request to the audio player to skip to a given time if it is not playing


scroll

public void scroll(int dir)
Scroll the display by a given amount. Used in dragging a selection beyond the left or right edge of the display.

Parameters:
dir - The direction and number of units to scroll

setPreferences

public void setPreferences()
Copies default values into preferences dialog.


editPreferences

public void editPreferences()
Opens preferences dialog and updates the display accordingly.


setMetricalLevels

public void setMetricalLevels()
Initialises the metrical levels dialog


clearMetricalLevels

public void clearMetricalLevels()
Clears any metrical level annotations from the beats


markMetricalLevel

public void markMetricalLevel()
Opens the metrical levels dialog and annotates the beat data correspondingly


setPercussionSounds

public void setPercussionSounds()
Initialises the percussion sound dialog and sound buffers


editPercussionSounds

public void editPercussionSounds()
Opens the percussion sound selection dialog and updates the sound buffers accordingly


getPercussionSound

public java.lang.String getPercussionSound(int level)
Returns the file name of a percussion sound for playing at beat times.

Parameters:
level - The requested metrical level
Returns:
The file name of the percussion sound for the requested metrical level