public class CoreMidiDeviceProvider extends MidiDeviceProvider implements CoreMidiNotification
| Modifier and Type | Class and Description |
|---|---|
private static class |
CoreMidiDeviceProvider.MidiProperties |
| Modifier and Type | Field and Description |
|---|---|
private static int |
DEVICE_MAP_SIZE |
private static CoreMidiDeviceProvider.MidiProperties |
midiProperties |
| Constructor and Description |
|---|
CoreMidiDeviceProvider()
Class constructor
|
| Modifier and Type | Method and Description |
|---|---|
static void |
addNotificationListener(CoreMidiNotification listener)
Adds a notification listener to the listener set maintained by this class.
|
private void |
buildDeviceMap()
Builds the device map
|
private int |
getDestination(int destinationIndex)
Gets the specified MIDI Destination EndPoint (JNI).
|
MidiDevice |
getDevice(MidiDevice.Info info)
Gets the MidiDevice specified by the supplied MidiDevice.Info structure
|
MidiDevice.Info[] |
getDeviceInfo()
Gets information on the installed Core MIDI Devices
|
static String |
getLibraryVersion()
Determine the version of the library which is being used.
|
(package private) static CoreMidiClient |
getMIDIClient()
Gets the CoreMidiClient object
|
static MidiDevice.Info[] |
getMidiDeviceInfo()
Obtains an array of information objects representing the set of all working MIDI devices available on the system.
|
private CoreMidiDeviceInfo |
getMidiDeviceInfo(int reference)
Gets a MidiDevice.Info class for the specified reference (JNI).
|
private int |
getNumberOfDestinations()
Gets the number of destinations supported by the system
|
private int |
getNumberOfSources()
Gets the number of sources supported by the system
|
(package private) static CoreMidiOutputPort |
getOutputPort()
Gets the output port
|
private int |
getSource(int sourceIndex)
Gets the specified MIDI Source EndPoint
|
private int |
getUniqueID(int reference)
Gets the unique ID for an object reference (JNI).
|
private void |
initialise()
Initialises the system
|
boolean |
isDeviceSupported(MidiDevice.Info info)
Checks to see if the required device is supported by this MidiDeviceProvider
|
static boolean |
isLibraryLoaded()
Check whether we have been able to load the native library.
|
void |
midiSystemUpdated()
Called when a change in the MIDI environment occurs
|
static void |
removeNotificationListener(CoreMidiNotification listener)
Removes a notification listener from the listener list maintained by this class
|
private static final int DEVICE_MAP_SIZE
private static final CoreMidiDeviceProvider.MidiProperties midiProperties
public CoreMidiDeviceProvider() throws CoreMidiException
CoreMidiException - if there is a problem initializing the providerprivate void initialise() throws CoreMidiException
CoreMidiException - if there is a problem communicating with CoreMIDIprivate void buildDeviceMap() throws CoreMidiException
CoreMidiException - if there is a problem communicating with CoreMIDIstatic CoreMidiClient getMIDIClient() throws CoreMidiException
CoreMidiException - if there is a problem communicating with CoreMIDIstatic CoreMidiOutputPort getOutputPort()
public MidiDevice.Info[] getDeviceInfo()
getDeviceInfo in class MidiDeviceProviderpublic MidiDevice getDevice(MidiDevice.Info info) throws IllegalArgumentException
getDevice in class MidiDeviceProviderinfo - The specifications of the device we wish to getIllegalArgumentException - if the device is not one that we providedMidiDeviceProvider.getDevice(javax.sound.midi.MidiDevice.Info)public boolean isDeviceSupported(MidiDevice.Info info)
isDeviceSupported in class MidiDeviceProviderinfo - The specifications of the device we wish to checkMidiDeviceProvider.isDeviceSupported(javax.sound.midi.MidiDevice.Info)public void midiSystemUpdated() throws CoreMidiException
midiSystemUpdated in interface CoreMidiNotificationCoreMidiException - if a problem occurs rebuilding the map of available MIDI devicespublic static void addNotificationListener(CoreMidiNotification listener) throws CoreMidiException
CoreMidiDeviceProvider, only keep the most recent one, since Java will create many,
and we only want to update the device map once when the MIDI environment changes.listener - The CoreMidiNotification listener to addCoreMidiException - if it is not possible to provide change notificationspublic static void removeNotificationListener(CoreMidiNotification listener) throws CoreMidiException
listener - The CoreMidiNotification listener to removeCoreMidiException - when we are unable to offer change notificationspublic static boolean isLibraryLoaded() throws CoreMidiException
CoreMidiException - if something unexpected happens trying to load the native library on a Mac OS X system.public static String getLibraryVersion()
public static MidiDevice.Info[] getMidiDeviceInfo()
private int getNumberOfSources()
private int getNumberOfDestinations()
private int getSource(int sourceIndex) throws CoreMidiException
sourceIndex - The index of the source to getCoreMidiException - if the source index is not validprivate int getDestination(int destinationIndex) throws CoreMidiException
destinationIndex - The index of the destination to getCoreMidiException - if the destination index is not validprivate int getUniqueID(int reference) throws CoreMidiException
reference - The reference to the object to get the UID forCoreMidiException - if there is a problem communicating with CoreMIDIprivate CoreMidiDeviceInfo getMidiDeviceInfo(int reference) throws CoreMidiException
reference - The Core MIDI endpoint reference to create a MidiDevice.Info class forCoreMidiException - if the reference is not validCopyright © 2017. All rights reserved.