|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectopenpiano.control.Controller
public class Controller
A class managing the main application
| Constructor Summary | |
|---|---|
Controller(OpenPiano openPiano)
Constructs a new controller class which constructs all other parts of the application |
|
| Method Summary | |
|---|---|
void |
createSettingsDialog(Boolean refresh)
Creates and shows the settings dialog |
Camera |
getCamera()
Returns the camera |
MidiSettings |
getCurrentMidiSettings()
Returns the settings of the current MIDI file |
javax.media.opengl.GL |
getGL()
Returns the current GL context |
GLCore |
getGLCore()
Returns the GL core |
MidiLoader |
getMidiLoader()
Returns the file loader for MIDI files |
LinkedList<MidiTrack> |
getMidiTracks()
Returns the list of MIDI tracks |
Notes |
getNotes()
Returns the notes |
OpenPiano |
getOpenPiano()
Returns the main application |
Piano |
getPiano()
Returns the piano |
Settings |
getSettings()
Returns the settings |
JDialog |
getSettingsDialog()
Returns the settings dialog |
int |
glToSlider(float glPos)
Calculates a GL position to a slider position |
long |
glToTick(float glPos)
Calculates a GL position to a MIDI tick |
void |
handleMidiLoader()
Handles the appearance of the MidiLoader dialog |
void |
handleSettings()
Handles the appearance of the settings dialog |
void |
initPiano(javax.media.opengl.GL gl)
Creates the piano |
Boolean |
isAudioOn(int track)
Returns true if the audio function is selected for a specified track |
Boolean |
isBpmStopped()
Returns true if the clock is stopped |
Boolean |
isMidiLoaderOn()
Returns true if the MidiLoader dialog is visible |
Boolean |
isPlayModeSet()
Returns true if the play button is activated |
Boolean |
isRepeatOn()
Returns true if the repeat button is activated |
Boolean |
isSettingsOn()
Returns true if the settings dialog is visible |
Boolean |
isSliding()
Returns true if the slider is currently in use |
Boolean |
isVisualOn(int track)
Returns true if the visual function is selected for a specified track |
void |
loadNotes(MidiLoader newMidiLoader)
Loads new notes according to a MidiLoader object |
void |
pauseNotes()
Stops or advances notes |
void |
playNotes()
Plays notes, starts from the beginning if end reached |
void |
registerControlPanel(ControlPanel controlPanel)
Sets the control panel |
void |
registerSlidePanel(SlidePanel slidePanel)
Registers the slider panel |
void |
resetControlMessages()
Resets the control messages of a MIDI file to the current tick |
void |
resetMidiLoaderDialog()
Resets the MidiLoader Dialog to rearrange items |
void |
resetMidiMessages()
Resets the all relevant MIDI messages of a MIDI file to the current tick |
void |
resumePlaying()
Resumes playing if the play button is active |
void |
send(ShortMessage midiMessage)
Handles and interprets a MIDI command |
void |
setAudio(int track,
Boolean audio)
Sets the status of the audio function for specified track |
void |
setAwaitNote(Boolean awaitNotes)
Sets the status of the await notes function |
void |
setFastForward(Boolean fastForward)
Sets the status of fast forward |
void |
setInstrument(int track)
Sets a previously selected instrument for a specified track |
void |
setInstrument(int track,
int channel,
int instrument)
Sets an instrument for a specified track and its channel |
void |
setInstruments()
Sets all previously selected instruments |
void |
setMarkKey(Boolean markKey)
Sets the status of the mark keys function |
void |
setMidiKeyboard(int channel)
Sets the channel the MIDI keyboard will play on |
void |
setRepeatOn(Boolean repeat)
Sets the status of the repeat button |
void |
setRewind(Boolean rewind)
Sets the status of rewind |
void |
setRewind(Boolean rewind,
Boolean oldPlayMode)
Sets the status of rewind |
void |
setTempo(int value)
Sets the tempo of a MIDI file |
void |
setVisual(int track,
Boolean visual)
Sets the status of the visual function for specified track |
void |
setVisual(int track,
Boolean visual,
int color)
Sets the status of the visual function for specified track |
void |
setVolume()
Sets the previously set volume of all tracks |
void |
setVolume(int track)
Sets a previously set volume to a track |
void |
setVolume(int track,
int volume)
Sets the volume of a track |
float |
sliderToGL(int sliderPos)
Calculates a slider position to a GL position |
long |
sliderToTick(int sliderPos)
Calculates a slider position to a MIDI tick |
void |
slideTo(int sliderPos)
Slide to a position in the MIDI file |
void |
slideTo(JSlider slider)
Slide to a position in the MIDI file |
void |
startBpm()
Starts the clock with the current beats per minute settings |
void |
stopBpm()
Stops the clock |
void |
stopNotes()
Stops the notes |
float |
tickToGL(long tick)
Calculates a MIDI tick to a GL position |
int |
tickToSlider(long tick)
Calculates a MIDI tick to a slider position |
void |
updateControlMessages(long tick)
Updates MIDI control messages to a specified tick |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Controller(OpenPiano openPiano)
openPiano - the reference to the main application| Method Detail |
|---|
public void createSettingsDialog(Boolean refresh)
refresh - true if settings dialog should only be refreshedpublic Camera getCamera()
public MidiSettings getCurrentMidiSettings()
public javax.media.opengl.GL getGL()
public GLCore getGLCore()
public MidiLoader getMidiLoader()
public LinkedList<MidiTrack> getMidiTracks()
public Notes getNotes()
public Piano getPiano()
public OpenPiano getOpenPiano()
public Settings getSettings()
public JDialog getSettingsDialog()
public int glToSlider(float glPos)
glPos - the GL position to calculate
public long glToTick(float glPos)
glPos - the GL position to calculate
public void handleMidiLoader()
public void handleSettings()
public void initPiano(javax.media.opengl.GL gl)
gl - the relevant GL contextpublic Boolean isAudioOn(int track)
track - the relevant track
public Boolean isBpmStopped()
public Boolean isMidiLoaderOn()
public Boolean isPlayModeSet()
public Boolean isRepeatOn()
public Boolean isSettingsOn()
public Boolean isSliding()
public Boolean isVisualOn(int track)
track - the relevant track
public void loadNotes(MidiLoader newMidiLoader)
newMidiLoader - the MidiLoader objectpublic void pauseNotes()
public void playNotes()
public void resetControlMessages()
public void resetMidiLoaderDialog()
public void resetMidiMessages()
public void resumePlaying()
public void send(ShortMessage midiMessage)
midiMessage - the MIDI command to handle
public void setAudio(int track,
Boolean audio)
track - the relevant trackaudio - true if the audio function should be enabledpublic void setAwaitNote(Boolean awaitNotes)
awaitNotes - true if the await notes function should be enabledpublic void registerControlPanel(ControlPanel controlPanel)
controlPanel - the control panelpublic void registerSlidePanel(SlidePanel slidePanel)
slidePanel - the slider panelpublic void setFastForward(Boolean fastForward)
fastForward - true if fast forward should be enabledpublic void setInstrument(int track)
track - the relevant track
public void setInstrument(int track,
int channel,
int instrument)
track - the relevant trackchannel - the corresponding channelinstrument - the instrument to setpublic void setInstruments()
public void setMarkKey(Boolean markKey)
markKey - true if the mark keys function should be enabledpublic void setMidiKeyboard(int channel)
channel - the channel to play onpublic void setRepeatOn(Boolean repeat)
repeat - true if repeat button is activepublic void setRewind(Boolean rewind)
rewind - true if rewind should be enabled
public void setRewind(Boolean rewind,
Boolean oldPlayMode)
rewind - true if rewind should be enabledoldPlayMode - true if the play button had been activated previouslypublic void setTempo(int value)
value - the tempo to set
public void setVisual(int track,
Boolean visual)
track - the relevant trackvisual - true if the visual function should be enabled
public void setVisual(int track,
Boolean visual,
int color)
track - the relevant trackvisual - true if the visual function should be enabledcolor - the color of the notespublic void setVolume()
public void setVolume(int track)
track - the corresponding track
public void setVolume(int track,
int volume)
track - the corresponding trackvolume - the volume to setpublic float sliderToGL(int sliderPos)
sliderPos - the slider position to calculate
public long sliderToTick(int sliderPos)
sliderPos - the slider position to calculate
public void slideTo(int sliderPos)
sliderPos - the position on the slider to slide topublic void slideTo(JSlider slider)
slider - the slider that holds the value to slide topublic void startBpm()
public void stopBpm()
public void stopNotes()
public float tickToGL(long tick)
tick - the tick to calculate
public int tickToSlider(long tick)
tick - the tick to calculate
public void updateControlMessages(long tick)
tick - the tick to update control messages to
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||