public class PlayerView
extends javax.swing.JDialog
This class provides the player window.
It uses the PlayerController
as EventListener
for all interactions.
javax.swing.JDialog.AccessibleJDialog
java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
Modifier and Type | Field and Description |
---|---|
static javax.swing.ImageIcon |
AC_ICON_ACTIVE |
static javax.swing.ImageIcon |
AC_ICON_INACTIVE |
private MidicaButton |
btnFastForw |
private MidicaButton |
btnFastRew |
private MidicaButton |
btnForw |
private MidicaButton |
btnInfo |
private MidicaButton |
btnJump |
private MidicaButton |
btnMemorize |
private MidicaButton |
btnPlayPause |
private MidicaButton |
btnReparse |
private MidicaButton |
btnRew |
private MidicaButton |
btnSoundcheck |
private MidicaButton |
btnStop |
private javax.swing.JCheckBox |
cbxLyrics |
static int |
CH_VOL_MAJOR |
static int |
CH_VOL_MAX |
static int |
CH_VOL_MAX_VAL |
static int |
CH_VOL_MIN |
static int |
CH_VOL_MIN_VAL |
static int |
CH_VOL_MINOR |
static int |
CH_VOL_SCROLL |
static int |
CH_VOL_SKIP |
private static int |
CHANNEL_DETAIL_VOL_FLD_WIDTH |
private java.util.ArrayList<javax.swing.JLabel> |
channelActivityLEDs |
private java.util.ArrayList<MidicaButton> |
channelApplyToAllBtn |
private java.awt.Container |
channelArea |
private java.util.ArrayList<javax.swing.JLabel> |
channelBankNumbers |
private java.util.ArrayList<MidicaButton> |
channelButtons |
private java.util.ArrayList<FixedLabel> |
channelComments |
private java.util.ArrayList<java.awt.Container> |
channelDetails |
private java.util.ArrayList<FixedLabel> |
channelInstruments |
private java.awt.Container |
channelLyricsArea |
private java.util.ArrayList<javax.swing.JLabel> |
channelProgramNumbers |
private java.util.ArrayList<javax.swing.JTextField> |
channelVolumeFields |
private java.util.ArrayList<MidicaSlider> |
channelVolumeSliders |
static java.lang.String |
CMD_APPLY_TO_ALL |
static java.lang.String |
CMD_FAST_FWD |
static java.lang.String |
CMD_FAST_REW |
static java.lang.String |
CMD_FWD |
static java.lang.String |
CMD_INFO |
static java.lang.String |
CMD_JUMP |
static java.lang.String |
CMD_MEMORIZE |
static java.lang.String |
CMD_PAUSE |
static java.lang.String |
CMD_PLAY |
static java.lang.String |
CMD_REPARSE |
static java.lang.String |
CMD_REW |
static java.lang.String |
CMD_SHOW_HIDE |
static java.lang.String |
CMD_SOUNDCHECK |
static java.lang.String |
CMD_STOP |
private java.awt.Container |
content |
private PlayerController |
controller |
private java.io.File |
currentFile |
private javax.swing.JTextField |
fldJump |
private javax.swing.JTextField |
fldTempo |
private javax.swing.JTextField |
fldTranspose |
private javax.swing.JTextField |
fldVol |
static java.lang.String |
KAR_FONT_SIZE |
static int |
KAR_MAX_CHARS_PER_LINE |
static int |
KAR_PAST_LINES |
static int |
KAR_TOTAL_LINES |
static int |
KAR_WIDTH |
private KeyBindingManager |
keyBindingManager |
private javax.swing.JLabel |
lblCurrentTicks |
private javax.swing.JLabel |
lblCurrentTime |
private javax.swing.JLabel |
lblLyrics |
private javax.swing.JLabel |
lblParseStatus |
private javax.swing.JLabel |
lblTotalTicks |
private javax.swing.JLabel |
lblTotalTime |
private java.awt.Container |
lyricsArea |
static int |
MASTER_VOL_LABEL |
static int |
MASTER_VOL_MAJOR |
static int |
MASTER_VOL_MAX |
static int |
MASTER_VOL_MIN |
static int |
MASTER_VOL_MINOR |
static int |
MASTER_VOL_SCROLL |
private MidicaSlider |
masterVolumeSlider |
static java.awt.Dimension |
MIN_PROGRESS_DIM |
private java.util.ArrayList<javax.swing.JCheckBox> |
muteCbx |
static java.lang.String |
NAME_CH_VOL |
static java.lang.String |
NAME_JUMP |
static java.lang.String |
NAME_MASTER_VOL |
static java.lang.String |
NAME_MUTE |
static java.lang.String |
NAME_PROGRESS |
static java.lang.String |
NAME_SHOW_LYRICS |
static java.lang.String |
NAME_SOLO |
static java.lang.String |
NAME_TEMPO |
static java.lang.String |
NAME_TRANSPOSE |
private static int |
NOTE_HISTORY_COL_WIDTH_NAME |
private static int |
NOTE_HISTORY_COL_WIDTH_NUMBER |
private static int |
NOTE_HISTORY_COL_WIDTH_TICK |
private static int |
NOTE_HISTORY_COL_WIDTH_VELOCITY |
private static int |
NOTE_HISTORY_HEIGHT |
private static int |
NOTE_HISTORY_WIDTH |
static javax.swing.ImageIcon |
PARSE_FAILURE_ICON |
static javax.swing.ImageIcon |
PARSE_SUCCESS_ICON |
static int |
PROGRESS_SCROLL |
private MidicaSlider |
progressSlider |
private static long |
serialVersionUID |
private java.util.ArrayList<javax.swing.JCheckBox> |
soloCbx |
static int |
TEMPO_DEFAULT |
static int |
TEMPO_FRACT |
static int |
TEMPO_LABEL |
static int |
TEMPO_MAJOR |
static int |
TEMPO_MAX |
static int |
TEMPO_MIN |
static int |
TEMPO_MINOR |
static int |
TEMPO_SCROLL |
private MidicaSlider |
tempoSlider |
static int |
TRANSPOSE_DEFAULT |
static int |
TRANSPOSE_LABEL |
static int |
TRANSPOSE_MAJOR |
static int |
TRANSPOSE_MAX |
static int |
TRANSPOSE_MIN |
static int |
TRANSPOSE_MINOR |
static int |
TRANSPOSE_SCROLL |
private MidicaSlider |
transposeSlider |
accessibleContext, rootPane, rootPaneCheckingEnabled
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Constructor and Description |
---|
PlayerView(UiView view,
SequenceParser parser,
java.io.File currentFile)
Creates the player window.
|
Modifier and Type | Method and Description |
---|---|
private void |
addKeyBindings()
Adds key bindings to the player window using the
KeyBindingManager . |
void |
addKeyBindingsToSetProgressSliderToEnd()
Adds the key bindings to set the progress slider to the end of the sequence.
|
private java.awt.Container |
createChannelArea()
Creates the channel area at the left side containing the channel widgets.
|
private java.awt.Container |
createChannelDetailArea(byte channel)
Creates the channel details area for the given channel that is hidden by default.
|
private MidicaSlider |
createChannelVolumeSlider(byte channel)
Creates a volume slider for the specified channel.
|
private java.awt.Container |
createControlArea()
Creates the area containing the control buttons like play/pause, stop, rewind, forward etc.
|
private java.awt.Container |
createGlobalSliderAndButtonsArea()
Creates the right area containing the sliders for volume, tempo and transpose level and the buttons below the sliders.
|
private java.awt.Container |
createGlobalSliderArea()
Creates the area with the sliders for volume, tempo and the transpose level.
|
private java.awt.Container |
createJumpArea()
Creates the top area containing the buttons for memorize and jump, the show-lyrics checkbox and the tick/time display.
|
private java.awt.Container |
createLyricsArea()
Creates the lyrics area (not visible by default).
|
private MidicaSlider |
createMasterVolumeSlider()
Creates the global volume slider at the right side.
|
private java.awt.Component |
createNoteHistoryTable(byte channel)
Creates the note history table for the given channel.
|
private MidicaSlider |
createProgressSlider()
Creates the process slider for the current MIDI stream.
|
private MidicaSlider |
createTempoSlider()
Creates the tempo slider at the right side.
|
private java.awt.Container |
createTimeArea()
Creates the top right area containing the current and total ticks and time.
|
private MidicaSlider |
createTransposeSlider()
Creates the transpose slider at the right side.
|
byte |
getChannelVolumeFromField(byte channel)
Returns the content of the channel volume text field in the channel details area.
|
java.lang.String |
getMemory()
Returns the content of the memory text field.
|
float |
getTempoFromField()
Returns the content of the tempo text field under the global tempo slider.
|
byte |
getTransposeFromField()
Returns the content of the transpose text field under the global transpose slider.
|
byte |
getVolumeFromField()
Returns the content of the volume text field under the global volume slider.
|
private void |
init()
Composes the content of the player window.
|
void |
initProgressSlider()
Calculates and sets the major and minor ticks to be displayed in the progress slider.
|
boolean |
isChVolSliderAdjusting(byte channel)
Shows if the volume slider of the given channel is being changed via mouse click in the moment.
|
boolean |
isMasterVolumeSliderAdjusting()
Shows if the master volume slider is being changed via mouse click in the moment.
|
boolean |
isProgressSliderAdjusting()
Shows if the progress slider is being changed via mouse click in the moment.
|
boolean |
isTempoSliderAdjusting()
Shows if the tempo slider is being changed via mouse click in the moment.
|
boolean |
isTransposeSliderAdjusting()
Shows if the transpose slider is being changed via mouse click in the moment.
|
void |
pressEnterOnChannelVolumeTextField(int channel)
Fakes pressing ENTER in the channel volume text field.
|
void |
pressJumpButton()
Clicks the jump button.
|
void |
refreshProgressBar(long midiTicks,
java.lang.String time)
Refreshes the progress slider state and the labels for the current tickstamp and current time - called indirectly by the
RefresherThread . |
void |
setActivityLED(int channel,
boolean active)
Sets the given channel’s activity icon and the according tooltip to show an active or inactive state.
|
void |
setChannelVolumeField(byte channel,
byte volume)
Sets the channel volume text field in the channel details area.
|
void |
setChannelVolumeSlider(byte channel,
byte volume)
Sets the given channel volume slider to the given volume value.
|
void |
setGlobalSlidersAndFields(byte volume,
float tempo,
byte level)
Sets the global sliders on the right side to the given values.
|
void |
setInstrumentInfo(int channel,
java.lang.String bankNumShort,
java.lang.String bankNumLong,
java.lang.String program,
java.lang.String instrName,
java.lang.String comment)
Sets the Channel information.
|
void |
setLyrics(java.lang.String text)
Writes the given lyrics string into the lyrics area.
|
void |
setMasterVolumeField(byte volume)
Sets the master volume text field under the master volume slider to the given value.
|
void |
setMasterVolumeSlider(byte volume)
Sets the master volume slider to the given value.
|
void |
setMemory(long pos)
Fills the memory text field with the given value (current tick).
|
void |
setMute(int channel,
boolean mute)
Check or uncheck the given channel’s mute checkbox according to the mute state in the MIDI device.
|
void |
setProgressSlider(int ticks)
Sets the progress slider to the given value.
|
void |
setSolo(int channel,
boolean solo)
Check or uncheck the given channel’s solo checkbox according to the solo state in the MIDI device.
|
void |
setTempoField(float tempoFactor)
Sets the tempo text field under the global tempo slider to the given value.
|
void |
setTempoSlider(float tempoFactor)
Sets the tempo slider to the given value.
|
void |
setTextFieldColor(java.lang.String name,
java.awt.Color color)
Sets the text field with the given name to the given background color.
|
void |
setTickAndTimeLength(long tickLength,
java.lang.String timeLength)
Sets the tick and time maximum values in the top right corner and the maximum value of the progress slider.
|
void |
setTransposeField(byte level)
Sets the transpose text field under the global transpose slider to the given value.
|
void |
setTransposeSlider(byte level)
Sets the transpose slider to the given value.
|
void |
toggleChannelDetails(int channel)
Shows and/or hides a channel’s detail area after a click on the channel number.
|
void |
toggleLyrics()
Shows or hides the channel or lyrics area according to the show-lyrics checkbox.
|
void |
togglePlayPauseButton(java.lang.String oldCmd)
Toggles command and symbol of the play/pause button.
|
void |
updateParseStatusIcon()
Sets the image and tooltip of the parse status label.
|
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBack
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
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, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
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, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, 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, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
private static final long serialVersionUID
public static final int KAR_WIDTH
public static final int KAR_PAST_LINES
public static final int KAR_TOTAL_LINES
public static final int KAR_MAX_CHARS_PER_LINE
public static final java.lang.String KAR_FONT_SIZE
public static final java.lang.String NAME_PROGRESS
public static final int PROGRESS_SCROLL
public static final java.awt.Dimension MIN_PROGRESS_DIM
public static final int TEMPO_DEFAULT
public static final int TEMPO_MIN
public static final int TEMPO_MAX
public static final int TEMPO_LABEL
public static final int TEMPO_MAJOR
public static final int TEMPO_MINOR
public static final int TEMPO_FRACT
public static final int TEMPO_SCROLL
public static final int MASTER_VOL_MIN
public static final int MASTER_VOL_MAX
public static final int MASTER_VOL_LABEL
public static final int MASTER_VOL_MAJOR
public static final int MASTER_VOL_MINOR
public static final int MASTER_VOL_SCROLL
public static final int TRANSPOSE_DEFAULT
public static final int TRANSPOSE_MIN
public static final int TRANSPOSE_MAX
public static final int TRANSPOSE_LABEL
public static final int TRANSPOSE_MAJOR
public static final int TRANSPOSE_MINOR
public static final int TRANSPOSE_SCROLL
public static final int CH_VOL_MIN
public static final int CH_VOL_MAX
public static final int CH_VOL_MIN_VAL
public static final int CH_VOL_MAX_VAL
public static final int CH_VOL_SKIP
public static final int CH_VOL_MAJOR
public static final int CH_VOL_MINOR
public static final int CH_VOL_SCROLL
public static final java.lang.String NAME_JUMP
public static final java.lang.String NAME_SHOW_LYRICS
public static final java.lang.String NAME_MASTER_VOL
public static final java.lang.String NAME_TEMPO
public static final java.lang.String NAME_TRANSPOSE
public static final java.lang.String NAME_CH_VOL
public static final java.lang.String NAME_MUTE
public static final java.lang.String NAME_SOLO
public static final java.lang.String CMD_REPARSE
public static final java.lang.String CMD_SOUNDCHECK
public static final java.lang.String CMD_INFO
public static final java.lang.String CMD_JUMP
public static final java.lang.String CMD_MEMORIZE
public static final java.lang.String CMD_SHOW_HIDE
public static final java.lang.String CMD_APPLY_TO_ALL
public static final java.lang.String CMD_STOP
public static final java.lang.String CMD_PLAY
public static final java.lang.String CMD_PAUSE
public static final java.lang.String CMD_REW
public static final java.lang.String CMD_FAST_REW
public static final java.lang.String CMD_FWD
public static final java.lang.String CMD_FAST_FWD
public static final javax.swing.ImageIcon AC_ICON_INACTIVE
public static final javax.swing.ImageIcon AC_ICON_ACTIVE
public static final javax.swing.ImageIcon PARSE_SUCCESS_ICON
public static final javax.swing.ImageIcon PARSE_FAILURE_ICON
private static final int NOTE_HISTORY_COL_WIDTH_NUMBER
private static final int NOTE_HISTORY_COL_WIDTH_NAME
private static final int NOTE_HISTORY_COL_WIDTH_VELOCITY
private static final int NOTE_HISTORY_COL_WIDTH_TICK
private static final int CHANNEL_DETAIL_VOL_FLD_WIDTH
private static int NOTE_HISTORY_WIDTH
private static final int NOTE_HISTORY_HEIGHT
private PlayerController controller
private java.io.File currentFile
private KeyBindingManager keyBindingManager
private java.awt.Container content
private java.awt.Container channelLyricsArea
private java.awt.Container channelArea
private java.awt.Container lyricsArea
private javax.swing.JCheckBox cbxLyrics
private javax.swing.JLabel lblLyrics
private javax.swing.JLabel lblParseStatus
private MidicaSlider progressSlider
private MidicaSlider masterVolumeSlider
private MidicaSlider tempoSlider
private MidicaSlider transposeSlider
private MidicaButton btnPlayPause
private MidicaButton btnReparse
private MidicaButton btnSoundcheck
private MidicaButton btnInfo
private MidicaButton btnForw
private MidicaButton btnFastForw
private MidicaButton btnRew
private MidicaButton btnFastRew
private MidicaButton btnStop
private MidicaButton btnMemorize
private MidicaButton btnJump
private javax.swing.JTextField fldJump
private javax.swing.JTextField fldTempo
private javax.swing.JTextField fldTranspose
private javax.swing.JTextField fldVol
private javax.swing.JLabel lblCurrentTicks
private javax.swing.JLabel lblCurrentTime
private javax.swing.JLabel lblTotalTicks
private javax.swing.JLabel lblTotalTime
private java.util.ArrayList<MidicaButton> channelButtons
private java.util.ArrayList<javax.swing.JCheckBox> muteCbx
private java.util.ArrayList<javax.swing.JCheckBox> soloCbx
private java.util.ArrayList<java.awt.Container> channelDetails
private java.util.ArrayList<javax.swing.JLabel> channelActivityLEDs
private java.util.ArrayList<FixedLabel> channelInstruments
private java.util.ArrayList<javax.swing.JLabel> channelProgramNumbers
private java.util.ArrayList<javax.swing.JLabel> channelBankNumbers
private java.util.ArrayList<FixedLabel> channelComments
private java.util.ArrayList<MidicaSlider> channelVolumeSliders
private java.util.ArrayList<javax.swing.JTextField> channelVolumeFields
private java.util.ArrayList<MidicaButton> channelApplyToAllBtn
public PlayerView(UiView view, SequenceParser parser, java.io.File currentFile)
Creates the player window. Fills the content via init()
.
view
- Main window object.parser
- Parser object that can be used for reparsing the current file.currentFile
- Currently loaded and parsed file.private void init()
Composes the content of the player window. Creates the different areas by calling the appropriate methods.
private java.awt.Container createJumpArea()
Creates the top area containing the buttons for memorize and jump, the show-lyrics checkbox and the tick/time display.
public void updateParseStatusIcon()
Sets the image and tooltip of the parse status label. If a file could be parsed, the image is different.
private java.awt.Container createTimeArea()
Creates the top right area containing the current and total ticks and time.
private java.awt.Container createGlobalSliderAndButtonsArea()
Creates the right area containing the sliders for volume, tempo and transpose level and the buttons below the sliders.
private java.awt.Container createGlobalSliderArea()
Creates the area with the sliders for volume, tempo and the transpose level.
private MidicaSlider createProgressSlider()
Creates the process slider for the current MIDI stream.
private MidicaSlider createMasterVolumeSlider()
Creates the global volume slider at the right side.
private MidicaSlider createChannelVolumeSlider(byte channel)
Creates a volume slider for the specified channel.
channel
- The MIDI channel.private MidicaSlider createTempoSlider()
Creates the tempo slider at the right side.
private MidicaSlider createTransposeSlider()
Creates the transpose slider at the right side.
private java.awt.Container createControlArea()
Creates the area containing the control buttons like play/pause, stop, rewind, forward etc.
private java.awt.Container createChannelArea()
Creates the channel area at the left side containing the channel widgets.
private java.awt.Container createLyricsArea()
Creates the lyrics area (not visible by default).
private java.awt.Container createChannelDetailArea(byte channel)
Creates the channel details area for the given channel that is hidden by default. It contains channel volume control widgets and the channel based note history table.
channel
- MIDI channel number.private java.awt.Component createNoteHistoryTable(byte channel)
Creates the note history table for the given channel.
channel
- MIDI channel number.public void initProgressSlider()
Calculates and sets the major and minor ticks to be displayed in the progress slider. This is based on the maximum ticks.
public void togglePlayPauseButton(java.lang.String oldCmd)
Toggles command and symbol of the play/pause button.
The given command is regarded as the command to be switched away from.
oldCmd
- Old command which is to be left.public void pressJumpButton()
Clicks the jump button. This is called if ENTER is pressed while the jump text field is focused.
public void setMemory(long pos)
Fills the memory text field with the given value (current tick). Also changes the background color of the text field to normal.
This is called if the current tickstamp in the MIDI stream is memorized.
pos
- Current tickstamp in the MIDI stream.public java.lang.String getMemory()
Returns the content of the memory text field.
This is called if the jump button is pressed.
public void setMasterVolumeField(byte volume)
Sets the master volume text field under the master volume slider to the given value.
volume
- Value to set.public byte getVolumeFromField() throws java.lang.NumberFormatException
Returns the content of the volume text field under the global volume slider.
java.lang.NumberFormatException
- if the text cannot be parsed to a byte value.public void setTempoField(float tempoFactor)
Sets the tempo text field under the global tempo slider to the given value.
tempoFactor
- Value to be set.public float getTempoFromField() throws java.lang.NumberFormatException
Returns the content of the tempo text field under the global tempo slider.
java.lang.NumberFormatException
- if the text cannot be parsed to a float value.public void setTransposeField(byte level)
Sets the transpose text field under the global transpose slider to the given value.
level
- Value to be set.public byte getTransposeFromField() throws java.lang.NumberFormatException
Returns the content of the transpose text field under the global transpose slider.
java.lang.NumberFormatException
- if the text cannot be parsed to a byte value.public byte getChannelVolumeFromField(byte channel) throws java.lang.NumberFormatException
Returns the content of the channel volume text field in the channel details area.
channel
- MIDI channel.java.lang.NumberFormatException
- if the text cannot be parsed to a byte value.public void setChannelVolumeField(byte channel, byte volume)
Sets the channel volume text field in the channel details area.
channel
- MIDI channel.volume
- Value to be set.public void pressEnterOnChannelVolumeTextField(int channel)
Fakes pressing ENTER in the channel volume text field. Used between pressing the “apply to all” button and reading the volume of the current channel. So the user doesn’t need to press ENTER himself.
channel
- MIDI channel.public void setTickAndTimeLength(long tickLength, java.lang.String timeLength)
Sets the tick and time maximum values in the top right corner and the maximum value of the progress slider.
tickLength
- Length of the MIDI stream in ticks.timeLength
- Length of the MIDI stream as a time string.public void refreshProgressBar(long midiTicks, java.lang.String time)
Refreshes the progress slider state and the labels for the current tickstamp and current time - called indirectly by the RefresherThread
.
midiTicks
- Current tickstamp.time
- Current timestamp.public void setProgressSlider(int ticks)
Sets the progress slider to the given value.
This is called after scrolling with the mouse over the slider.
ticks
- Value to be set.public void setMasterVolumeSlider(byte volume)
Sets the master volume slider to the given value.
This is called: - after scrolling with the mouse over the slider; - after typing a value in the global volume text field; and - after opening the player window.
volume
- Value to be set.public void setTempoSlider(float tempoFactor)
Sets the tempo slider to the given value.
This is called: - after scrolling with the mouse over the slider; - after typing a value in the tempo text field; and - after opening the player window.
tempoFactor
- Value to be set.public void setTransposeSlider(byte level)
Sets the transpose slider to the given value.
This is called: - after scrolling with the mouse over the slider; - after typing a value in the transpose text field; and - after opening the player window.
level
- Value to be set.public void setChannelVolumeSlider(byte channel, byte volume)
Sets the given channel volume slider to the given volume value.
This is called: - after scrolling with the mouse over the slider; - after typing a value in the channel volume text field; and - after opening the player window.
channel
- MIDI channel.volume
- Value to be set.public boolean isProgressSliderAdjusting()
Shows if the progress slider is being changed via mouse click in the moment.
Returns true, if a mouse click on the slider has been started (mouse down) but is not yet finished (mouse up).
public boolean isMasterVolumeSliderAdjusting()
Shows if the master volume slider is being changed via mouse click in the moment.
Returns true, if a mouse click on the slider has been started (mouse down) but is not yet finished (mouse up).
public boolean isTempoSliderAdjusting()
Shows if the tempo slider is being changed via mouse click in the moment.
Returns true, if a mouse click on the slider has been started (mouse down) but is not yet finished (mouse up).
public boolean isTransposeSliderAdjusting()
Shows if the transpose slider is being changed via mouse click in the moment.
Returns true, if a mouse click on the slider has been started (mouse down) but is not yet finished (mouse up).
public boolean isChVolSliderAdjusting(byte channel)
Shows if the volume slider of the given channel is being changed via mouse click in the moment.
Returns true, if a mouse click on the slider has been started (mouse down) but is not yet finished (mouse up).
channel
- MIDI channelpublic void setMute(int channel, boolean mute)
Check or uncheck the given channel’s mute checkbox according to the mute state in the MIDI device.
Called when the player window is opened.
channel
- MIDI channel number.mute
- true to check the checkbox, false to uncheck it.public void setSolo(int channel, boolean solo)
Check or uncheck the given channel’s solo checkbox according to the solo state in the MIDI device.
Called when the player window is opened.
channel
- MIDI channel number.solo
- true to check the checkbox, false to uncheck it.public void setGlobalSlidersAndFields(byte volume, float tempo, byte level)
Sets the global sliders on the right side to the given values.
This is called when the player window is opened.
volume
- Value for the volume slider.tempo
- Value for the tempo slider.level
- Value for the transpose slider.public void setLyrics(java.lang.String text)
Writes the given lyrics string into the lyrics area.
text
- HTML-formatted lyrics text.public void setInstrumentInfo(int channel, java.lang.String bankNumShort, java.lang.String bankNumLong, java.lang.String program, java.lang.String instrName, java.lang.String comment)
Sets the Channel information. This consists of bank number, program number, instrument name and channel comment.
channel
- MIDI channel number.bankNumShort
- bank number syntax – MSB, if LSB is null; otherwise: MSB and LSB, separated by the currently configured separatorbankNumLong
- full bank number, MSB and LSB in a human-readable formprogram
- program (instrument) numberinstrName
- instrument namecomment
- channel comment (META event INSTRUMENT NAME)public void setActivityLED(int channel, boolean active)
Sets the given channel’s activity icon and the according tooltip to show an active or inactive state.
channel
- MIDI channel number.active
- true to show an active state, false to show an inactive state.public void setTextFieldColor(java.lang.String name, java.awt.Color color)
Sets the text field with the given name to the given background color.
This shows if the content of the text field is valid.
name
- The text field’s name.color
- The designated background color.public void toggleLyrics()
Shows or hides the channel or lyrics area according to the show-lyrics checkbox.
If the checkbox is checked: shows the lyrics area and hides the channel area. Otherwise: shows the channel area and hides the lyrics area.
public void toggleChannelDetails(int channel)
Shows and/or hides a channel’s detail area after a click on the channel number.
Hides the clicked channel if is visible. Otherwise shows it and hides all other channels’ detail areas.
channel
- number of the MIDI channel that has been clicked.private void addKeyBindings()
Adds key bindings to the player window using the KeyBindingManager
.
Called when opening the player.
public void addKeyBindingsToSetProgressSliderToEnd()
Adds the key bindings to set the progress slider to the end of the sequence. This must be available as a public method because the sequence length (and so the end tick) may have changed after reparsing the sequence.
Called when the player is opened and after reparsing the sequence.