java.lang.Runnable
public class MidiRouter extends java.lang.Object implements java.lang.Runnable
Does MidiSystem.getMidiDevice always return the same object given the same MidiDevice.Info - The answer is no when the MIDI device is a software synthesizer or sequencer.
FlowLayout
,
GridLayout
,
GridBagLayout
,
BoxLayout
Modifier and Type | Class | Description |
---|---|---|
protected class |
MidiRouter.Connection |
Represents connection between MIDI devices.
|
protected class |
MidiRouter.DestListing |
Creates a panel that contains information on a potential destination.
|
protected class |
MidiRouter.DisplayFrame |
Create a widow displaying text and optionally save the text to a file.
|
protected class |
MidiRouter.Left |
Creates the panel at the lower left corner of the window which
contains the list of possible sources.
|
protected class |
MidiRouter.Listing |
This represents a cell in the source or destinations column.
|
protected class |
MidiRouter.LogReceiver |
Displays MIDI information in a Java Swing window.
|
protected class |
MidiRouter.MidiMenuBar |
Constructs the menu bar.
|
protected class |
MidiRouter.Outer |
Opens the main window for the application.
|
protected class |
MidiRouter.Right |
Creates the panel at the lower right hand corner of the
window which contains information for destination devices.
|
protected class |
MidiRouter.SourceListing |
Creates a panel that contains information on a potential
source.
|
protected static class |
MidiRouter.specType |
Specifies the way in which an endpoint is specified.
|
protected class |
MidiRouter.TestMidiMessage |
Subclass of MidiMessage used for testing.
|
protected class |
MidiRouter.Top |
Creates top panel of display.
|
Modifier and Type | Field | Description |
---|---|---|
protected javax.sound.midi.MidiDevice.Info[] |
allDevices |
|
protected java.util.GregorianCalendar |
calendar |
|
protected MidiRouter.Connection |
connection |
|
protected int |
debugFlag |
A value of zero means no diagnostic output, while
higher values create more output.
|
protected java.util.ArrayList<javax.sound.midi.MidiDevice.Info> |
destDevices |
|
protected java.io.File |
destFile |
MIDI file to be used as destination of MIDI
information (e.g.:
Sequencer and
Synthesizer ) |
protected java.util.ArrayList<MidiRouter.Listing> |
destItems |
|
protected java.util.ArrayList<javax.sound.midi.MidiDevice> |
destMidiDevices |
|
protected javax.swing.JFrame |
frame |
Swing
JFrame attached to the main window. |
protected java.io.File |
inputFile |
|
protected javax.swing.JPanel |
left |
Pane containing a list of potential MIDI
sources.
|
protected MidiRouter.Connection |
logConnection |
This Connection object will send information from the
source object to the log window.
|
protected java.io.File |
logFile |
|
protected MidiRouter.LogReceiver |
logReceiver |
This acts as a of MIDI
information and displays the data in a window.
|
protected javax.swing.JMenuBar |
menuBar |
Menu bar for the main window.
|
protected MidiRouter.MidiMenuBar |
midiMenuBar |
|
protected long |
musicStart |
Time MIDI connection was opened.
|
protected javax.swing.JPanel |
outer |
Outermost panel for the main window.
|
protected java.io.File |
outputFile |
|
protected javax.swing.JPanel |
right |
Pane containing a list of potential MIDI
destinations.
|
protected MidiRouter.Listing |
selectedDest |
|
protected MidiRouter.Listing |
selectedSource |
|
(package private) boolean |
selectionLocked |
If true, no changes are allowed to the selections in the
source and destination columns.
|
protected java.util.ArrayList<javax.sound.midi.MidiDevice.Info> |
sourceDevices |
|
protected java.io.File |
sourceFile |
MIDI file to be used as source of MIDI information
(e.g.:
Sequencer ). |
protected java.util.ArrayList<MidiRouter.Listing> |
sourceItems |
|
protected java.util.ArrayList<javax.sound.midi.MidiDevice> |
sourceMidiDevices |
|
protected java.lang.String |
title |
|
protected javax.swing.JPanel |
top |
Pane at the top of the main window that
contains general information.
|
(package private) boolean |
useLogWindow |
If true, MIDI messages from the source will be echoed to a
Java Swing window.
|
Constructor | Description |
---|---|
MidiRouter() |
Modifier and Type | Method | Description |
---|---|---|
protected void |
buildLists() |
Constructs the lists of potential source and destination devices.
|
protected byte[] |
buildMessage(int[] data) |
Convenience method for tests of log software.
|
protected byte[] |
buildMessage2(int... values) |
Convenience method for tests of log software.
|
static void |
main(java.lang.String[] args) |
Test driver.
|
void |
run() |
Starts the Swing graphics operations.
|
protected void |
showPopup(java.lang.String message) |
Display a message in a popup window.
|
protected void |
showPopup(java.lang.String title,
java.lang.String message) |
Display a message in a popup window.
|
protected void |
testDisplayFrame() |
This is a test of the
MidiRouter.DisplayFrame class. |
protected void |
testLogReceiver() |
This is a test of the
MidiRouter.LogReceiver class. |
protected int debugFlag
protected javax.swing.JPanel outer
protected javax.swing.JPanel top
protected javax.swing.JPanel left
protected javax.swing.JPanel right
protected javax.swing.JFrame frame
JFrame
attached to the main window.protected javax.swing.JMenuBar menuBar
protected java.lang.String title
protected java.io.File sourceFile
Sequencer
).protected java.io.File destFile
Sequencer
and
Synthesizer
)protected javax.sound.midi.MidiDevice.Info[] allDevices
protected java.util.ArrayList<javax.sound.midi.MidiDevice> sourceMidiDevices
protected java.util.ArrayList<javax.sound.midi.MidiDevice> destMidiDevices
protected java.util.ArrayList<javax.sound.midi.MidiDevice.Info> sourceDevices
protected java.util.ArrayList<javax.sound.midi.MidiDevice.Info> destDevices
protected java.util.ArrayList<MidiRouter.Listing> sourceItems
protected java.util.ArrayList<MidiRouter.Listing> destItems
protected MidiRouter.MidiMenuBar midiMenuBar
protected java.io.File inputFile
protected java.io.File outputFile
protected java.io.File logFile
protected MidiRouter.Listing selectedSource
protected MidiRouter.Listing selectedDest
protected MidiRouter.Connection connection
protected MidiRouter.LogReceiver logReceiver
protected java.util.GregorianCalendar calendar
protected long musicStart
protected MidiRouter.Connection logConnection
boolean selectionLocked
boolean useLogWindow
public MidiRouter()
protected void showPopup(java.lang.String message) throws java.awt.HeadlessException
message
- message to appear in popup windowjava.awt.HeadlessException
protected void showPopup(java.lang.String title, java.lang.String message) throws java.awt.HeadlessException
title
- text to be displayed on title of popup windowmessage
- message to appear in popup windowjava.awt.HeadlessException
protected void buildLists()
public void run()
run
in interface java.lang.Runnable
protected void testDisplayFrame()
MidiRouter.DisplayFrame
class.protected byte[] buildMessage2(int... values)
values
- items used to build Midi messageprotected byte[] buildMessage(int[] data)
data
- items used to build Midi messageprotected void testLogReceiver()
MidiRouter.LogReceiver
class.
Must use subclass of MidiMessage.
public static void main(java.lang.String[] args)
args
- first argument can optionally run test casesCopyright © 2017. All rights reserved.