public abstract class Device extends Object
Subclass must define two constructor, with no argument and with one argument,
Preferences
. Here is an example;
import java.util.prefs.Preferences; ... // Constructor for DeviceListWriter. public KawaiK4Device() { super("Kawai", "K4/K4R", "F07E..0602400000040000000000f7", INFO_TEXT, "Brian Klock & Gerrit Gehnen"); } // Constructor for for actual work. public KawaiK4Device(Preferences prefs) { this(); this.prefs = prefs; addDriver(new KawaiK4BulkConverter()); ... }Compatibility Note: The following fields are now
private
. Use
setter/getter method to access them.
manufacturerName, modelName, inquiryID, infoText, authors, synthName, channel, inPort, portCreated on 5. Oktober 2001, 21:59
IDriver
Modifier and Type | Field and Description |
---|---|
protected Preferences |
prefs
Preferences node for storing configuration options.
|
Constructor and Description |
---|
Device(String manufacturerName,
String modelName,
String inquiryID,
String infoText,
String authors)
Creates a new
Device instance. |
Modifier and Type | Method and Description |
---|---|
void |
addDriver(IDriver driver)
Add Driver.
|
JPanel |
config()
Create a configration panel.
|
int |
driverCount()
Size query for driverList.
|
String |
getAuthors()
Getter for property authors.
|
int |
getChannel()
Getter for property channel.
|
int |
getDeviceID()
Getter for property deviceID.
|
String |
getDeviceName()
Getter for DeviceName.
|
int |
getDeviceNum()
getter for device number.
|
IDriver |
getDriver(int i)
Indexed getter for driverList elements.
|
protected List<IDriver> |
getDriverList() |
String |
getInfoText()
Getter for property infoText.
|
int |
getInPort()
Getter for property inPort.
|
String |
getInquiryID()
Getter for property inquiryID.
|
String |
getManufacturerName()
Getter for property getManufacturerName.
|
String |
getModelName()
Getter for property modelName.
|
String |
getOutPortName()
Getter for property port (MIDI output port).
|
Preferences |
getPreferences() |
String |
getSynthName()
Getter for property synthName.
|
void |
send(MidiMessage message)
send MidiMessage to MIDI output.
|
void |
setChannel(int channel)
Setter for property channel which is used for playPatch, etc.
|
void |
setDeviceID(int deviceID)
Setter for property deviceID.
|
void |
setDeviceManager(DeviceManager deviceManager) |
void |
setInPort(int inPort)
Setter for property inPort, the MIDI input port number, where the cable
to the device is connected.
|
protected void |
setMidiBufSize(int bufSize,
int delay)
If the target MIDI device cannot handle a whole Sysex message and
requires to divide the Sysex Message into several small messages, use
this method.
|
void |
setMidiService(MidiService midiService) |
void |
setMidiSettings(MidiSettings midiSettings) |
void |
setOutPortName(String outPortName)
Setter for property port, the MIDI output port number, where the cable
to the device is connected.
|
void |
setSynthName(String synthName)
Setter for property synthName.
|
void |
setup(Preferences preferences)
Called after Device(Preferences prefs) is called.
|
void |
showDetails(Frame owner)
Show a dialog for the details of the device.
|
String |
toString()
Same as
getDeviceName() . |
protected Preferences prefs
public Device(String manufacturerName, String modelName, String inquiryID, String infoText, String authors)
Device
instance.manufacturerName
- The company which made the Synthesizer.modelName
- The fixed name of the model supported by this driver, as
stated on the type plate of the engine. eg TG33/SY22inquiryID
- The response to the Universal Inquiry Message. It can have
wildcards (*). It can be up to 16 bytes. Ex.
"F07E**0602413F01000000020000f7"
infoText
- Information about Device.authors
- Authors of the device driver.public void setup(Preferences preferences)
preferences
- TODOpublic final Preferences getPreferences()
public JPanel config()
public final String getManufacturerName()
public final String getModelName()
public final String getInquiryID()
public final String getInfoText()
public final String getAuthors()
public String getSynthName()
public final void setSynthName(String synthName)
synthName
- New value of property synthName.public final int getChannel()
public final void setChannel(int channel)
Some old drivers use this for device ID. Use setDeviceID method to set device ID.
channel
- The value must be 1 or greater than 1, and 16 or less than 16.public final int getDeviceID()
public final void setDeviceID(int deviceID)
For backward compatibility if this has the initial value (-1), The value
of channel
is used as device ID.
deviceID
- The value must be 1 or greater than 1, and 256 or less than
256.public final String getOutPortName()
public final void setOutPortName(String outPortName)
outPortName
- New value of property port.protected final void setMidiBufSize(int bufSize, int delay)
bufSize
- MIDI message size. If zero, whole MIDI message is passed to
lower MIDI driver.delay
- delay (msec) after every MIDI message transfer.public final void send(MidiMessage message)
public final int getInPort()
public final void setInPort(int inPort)
inPort
- New value of property inPort.public final void addDriver(IDriver driver)
Device
calls this. Bulk converters must be added before simple drivers!driver
- IDriver to be added.IConverter
public final int driverCount()
public final IDriver getDriver(int i)
public final int getDeviceNum()
public String getDeviceName()
public String toString()
getDeviceName()
. See #getDeviceNamepublic void showDetails(Frame owner)
@Inject public void setMidiService(MidiService midiService)
@Inject public void setMidiSettings(MidiSettings midiSettings)
@Inject public void setDeviceManager(DeviceManager deviceManager)
Copyright © 2014. All Rights Reserved.