public class CoreMidiDestination extends Object implements MidiDevice
CoreMidiSourceMidiDevice.Info| Modifier and Type | Field and Description |
|---|---|
private CoreMidiDeviceInfo |
info |
private AtomicBoolean |
isOpen |
private Set<CoreMidiReceiver> |
receivers |
private AtomicLong |
startTime |
| Constructor and Description |
|---|
CoreMidiDestination(CoreMidiDeviceInfo info)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the Core MIDI Device, which also closes all of its receivers
|
MidiDevice.Info |
getDeviceInfo()
Gets the MIDI Info object
|
int |
getMaxReceivers()
Gets the maximum number of receivers that can be attached to this device.
|
int |
getMaxTransmitters()
Gets the maximum number of transmitters that can be attached to this device.
|
long |
getMicrosecondPosition()
Obtains the time in microseconds that has elapsed since this MIDI Device was opened.
|
private long |
getMicroSecondTime()
Obtains the current system time in microseconds.
|
Receiver |
getReceiver()
Creates and returns a MIDI Receiver for use with this Device
|
List<Receiver> |
getReceivers()
Gets a list of receivers connected to the device
|
long |
getStartTime()
Obtains the time in microseconds at which this MIDI Device was opened.
|
Transmitter |
getTransmitter()
Gets a transmitter for this device (which is also added to the internal list
|
List<Transmitter> |
getTransmitters()
Gets the list of transmitters registered with this MIDI device
|
boolean |
isOpen()
Checks to see if the MIDI Device is open
|
void |
open()
Opens the Core MIDI Device
|
(package private) void |
receiverClosed(CoreMidiReceiver receiver)
Reacts to the closing of a receiver by removing it from the set of active receivers
|
(package private) void |
updateDeviceInfo(CoreMidiDeviceInfo info)
Changes the MIDI Info object; can only be done by this package as a result of a MIDI environment change event.
|
private CoreMidiDeviceInfo info
private final AtomicBoolean isOpen
private final AtomicLong startTime
private final Set<CoreMidiReceiver> receivers
CoreMidiDestination(CoreMidiDeviceInfo info)
info - CoreMidiDeviceInfo object providing details of the MIDI interfacepublic MidiDevice.Info getDeviceInfo()
getDeviceInfo in interface MidiDevicevoid updateDeviceInfo(CoreMidiDeviceInfo info)
info - CoreMidiDeviceInfo objectpublic void open() throws MidiUnavailableException
open in interface MidiDeviceMidiUnavailableException - if the MIDI system cannot be accessedpublic void close()
close in interface AutoCloseableclose in interface MidiDevicepublic boolean isOpen()
isOpen in interface MidiDeviceMidiDevice.isOpen()public long getMicrosecondPosition()
getMicrosecondPosition in interface MidiDeviceMidiDevice.getMicrosecondPosition()public long getStartTime()
public int getMaxReceivers()
getMaxReceivers in interface MidiDeviceMidiDevice.getMaxReceivers()public int getMaxTransmitters()
getMaxTransmitters in interface MidiDeviceMidiDevice.getMaxTransmitters()public Receiver getReceiver() throws MidiUnavailableException
getReceiver in interface MidiDeviceMidiUnavailableExceptionMidiDevice.getReceiver()public List<Receiver> getReceivers()
getReceivers in interface MidiDeviceMidiDevice.getReceivers()void receiverClosed(CoreMidiReceiver receiver)
receiver - the transmitter which is reporting itself as having closedpublic Transmitter getTransmitter() throws MidiUnavailableException
getTransmitter in interface MidiDeviceMidiUnavailableExceptionMidiDevice.getTransmitter()public List<Transmitter> getTransmitters()
getTransmitters in interface MidiDeviceMidiDevice.getTransmitters()private long getMicroSecondTime()
Copyright © 2017. All rights reserved.