MidiDeviceInfo
class MidiDeviceInfo : Parcelable
kotlin.Any | |
↳ | android.media.midi.MidiDeviceInfo |
This class contains information to describe a MIDI device. For now we only have information that can be retrieved easily for USB devices, but we will probably expand this in the future. This class is just an immutable object to encapsulate the MIDI device description. Use the MidiDevice class to actually communicate with devices.
Summary
Nested classes | |
---|---|
Contains information about an input or output port. |
Constants | |
---|---|
static String |
Bundle key for the device's corresponding Bluetooth device. |
static String |
Bundle key for the device's manufacturer name property. |
static String |
Bundle key for the device's user visible name property. |
static String |
Bundle key for the device's product name property. |
static String |
Bundle key for the device's serial number property. |
static String |
Bundle key for the device's corresponding USB device. |
static String |
Bundle key for the device's version property. |
static Int |
Constant representing a default protocol with Universal MIDI Packets (UMP). |
static Int |
Constant representing a default protocol with Universal MIDI Packets (UMP). |
static Int |
Constant representing a default protocol with Universal MIDI Packets (UMP). |
static Int |
Constant representing a default protocol with Universal MIDI Packets (UMP). |
static Int |
Constant representing a default protocol with Universal MIDI Packets (UMP). |
static Int |
Constant representing a default protocol with Universal MIDI Packets (UMP). |
static Int |
Constant representing a default protocol with Universal MIDI Packets (UMP). |
static Int |
Constant representing a device with an unknown default protocol. |
static Int |
Constant representing Bluetooth MIDI devices for |
static Int |
Constant representing USB MIDI devices for |
static Int |
Constant representing virtual (software based) MIDI devices for |
Inherited constants | |
---|---|
Public methods | |
---|---|
Int | |
Boolean | |
Int |
Returns the default protocol. |
Int |
getId() Returns the ID of the device. |
Int |
Returns the device's number of input ports. |
Int |
Returns the device's number of output ports. |
Array<MidiDeviceInfo.PortInfo!>! |
getPorts() Returns information about the device's ports. |
Bundle! |
Returns the |
Int |
getType() Returns the type of the device. |
Int |
hashCode() |
Boolean |
Returns true if the device is private. |
String |
toString() |
Unit |
writeToParcel(parcel: Parcel, flags: Int) |
Properties | |
---|---|
static Parcelable.Creator<MidiDeviceInfo!> |
Constants
PROPERTY_BLUETOOTH_DEVICE
static val PROPERTY_BLUETOOTH_DEVICE: String
Bundle key for the device's corresponding Bluetooth device. The value for this property is of type android.bluetooth.BluetoothDevice
. Only set for Bluetooth MIDI devices. Used with the android.os.Bundle
returned by getProperties
Value: "bluetooth_device"
PROPERTY_MANUFACTURER
static val PROPERTY_MANUFACTURER: String
Bundle key for the device's manufacturer name property. The value for this property is of type java.lang.String
. Used with the android.os.Bundle
returned by getProperties
. Matches the USB device manufacturer name string for USB MIDI devices.
Value: "manufacturer"
PROPERTY_NAME
static val PROPERTY_NAME: String
Bundle key for the device's user visible name property. The value for this property is of type java.lang.String
. Used with the android.os.Bundle
returned by getProperties
. For USB devices, this is a concatenation of the manufacturer and product names.
Value: "name"
PROPERTY_PRODUCT
static val PROPERTY_PRODUCT: String
Bundle key for the device's product name property. The value for this property is of type java.lang.String
. Used with the android.os.Bundle
returned by getProperties
Matches the USB device product name string for USB MIDI devices.
Value: "product"
PROPERTY_SERIAL_NUMBER
static val PROPERTY_SERIAL_NUMBER: String
Bundle key for the device's serial number property. The value for this property is of type java.lang.String
. Used with the android.os.Bundle
returned by getProperties
Matches the USB device serial number for USB MIDI devices.
Value: "serial_number"
PROPERTY_USB_DEVICE
static val PROPERTY_USB_DEVICE: String
Bundle key for the device's corresponding USB device. The value for this property is of type android.hardware.usb.UsbDevice
. Only set for USB MIDI devices. Used with the android.os.Bundle
returned by getProperties
Value: "usb_device"
PROPERTY_VERSION
static val PROPERTY_VERSION: String
Bundle key for the device's version property. The value for this property is of type java.lang.String
. Used with the android.os.Bundle
returned by getProperties
Matches the USB device version number for USB MIDI devices.
Value: "version"
PROTOCOL_UMP_MIDI_1_0_UP_TO_128_BITS
static val PROTOCOL_UMP_MIDI_1_0_UP_TO_128_BITS: Int
Constant representing a default protocol with Universal MIDI Packets (UMP). UMP is defined in "Universal MIDI Packet (UMP) Format and MIDI 2.0 Protocol" spec. All UMP data should be a multiple of 4 bytes. Use MIDI 1.0 through UMP with packet sizes up to 128 bits. Call MidiManager#getDevicesForTransport
with parameter MidiManager#TRANSPORT_UNIVERSAL_MIDI_PACKETS
to get devices with this transport.
Value: 3
PROTOCOL_UMP_MIDI_1_0_UP_TO_128_BITS_AND_JRTS
static val PROTOCOL_UMP_MIDI_1_0_UP_TO_128_BITS_AND_JRTS: Int
Constant representing a default protocol with Universal MIDI Packets (UMP). UMP is defined in "Universal MIDI Packet (UMP) Format and MIDI 2.0 Protocol" spec. All UMP data should be a multiple of 4 bytes. Use MIDI 1.0 through UMP with packet sizes up to 128 bits and jitter reduction timestamps. Call MidiManager#getDevicesForTransport
with parameter MidiManager#TRANSPORT_UNIVERSAL_MIDI_PACKETS
to get devices with this transport.
Value: 4
PROTOCOL_UMP_MIDI_1_0_UP_TO_64_BITS
static val PROTOCOL_UMP_MIDI_1_0_UP_TO_64_BITS: Int
Constant representing a default protocol with Universal MIDI Packets (UMP). UMP is defined in "Universal MIDI Packet (UMP) Format and MIDI 2.0 Protocol" spec. All UMP data should be a multiple of 4 bytes. Use MIDI 1.0 through UMP with packet sizes up to 64 bits. Call MidiManager#getDevicesForTransport
with parameter MidiManager#TRANSPORT_UNIVERSAL_MIDI_PACKETS
to get devices with this transport.
Value: 1
PROTOCOL_UMP_MIDI_1_0_UP_TO_64_BITS_AND_JRTS
static val PROTOCOL_UMP_MIDI_1_0_UP_TO_64_BITS_AND_JRTS: Int
Constant representing a default protocol with Universal MIDI Packets (UMP). UMP is defined in "Universal MIDI Packet (UMP) Format and MIDI 2.0 Protocol" spec. All UMP data should be a multiple of 4 bytes. Use MIDI 1.0 through UMP with packet sizes up to 64 bits and jitter reduction timestamps. Call MidiManager#getDevicesForTransport
with parameter MidiManager#TRANSPORT_UNIVERSAL_MIDI_PACKETS
to get devices with this transport.
Value: 2
PROTOCOL_UMP_MIDI_2_0
static val PROTOCOL_UMP_MIDI_2_0: Int
Constant representing a default protocol with Universal MIDI Packets (UMP). UMP is defined in "Universal MIDI Packet (UMP) Format and MIDI 2.0 Protocol" spec. All UMP data should be a multiple of 4 bytes. Use MIDI 2.0 through UMP. Call MidiManager#getDevicesForTransport
with parameter MidiManager#TRANSPORT_UNIVERSAL_MIDI_PACKETS
to get devices with this transport.
Value: 17
PROTOCOL_UMP_MIDI_2_0_AND_JRTS
static val PROTOCOL_UMP_MIDI_2_0_AND_JRTS: Int
Constant representing a default protocol with Universal MIDI Packets (UMP). UMP is defined in "Universal MIDI Packet (UMP) Format and MIDI 2.0 Protocol" spec. All UMP data should be a multiple of 4 bytes. Use MIDI 2.0 through UMP and jitter reduction timestamps. Call MidiManager#getDevicesForTransport
with parameter MidiManager#TRANSPORT_UNIVERSAL_MIDI_PACKETS
to get devices with this transport.
Value: 18
PROTOCOL_UMP_USE_MIDI_CI
static val PROTOCOL_UMP_USE_MIDI_CI: Int
Constant representing a default protocol with Universal MIDI Packets (UMP). UMP is defined in "Universal MIDI Packet (UMP) Format and MIDI 2.0 Protocol" spec. All UMP data should be a multiple of 4 bytes. Use UMP to negotiate with the device with MIDI-CI. MIDI-CI is defined in "MIDI Capability Inquiry (MIDI-CI)" spec. Call MidiManager#getDevicesForTransport
with parameter MidiManager#TRANSPORT_UNIVERSAL_MIDI_PACKETS
to get devices with this transport.
Value: 0
PROTOCOL_UNKNOWN
static val PROTOCOL_UNKNOWN: Int
Constant representing a device with an unknown default protocol. If Universal MIDI Packets (UMP) are needed, use MIDI-CI through MIDI 1.0. UMP is defined in "Universal MIDI Packet (UMP) Format and MIDI 2.0 Protocol" spec. MIDI-CI is defined in "MIDI Capability Inquiry (MIDI-CI)" spec.
Value: -1
TYPE_BLUETOOTH
static val TYPE_BLUETOOTH: Int
Constant representing Bluetooth MIDI devices for getType
Value: 3
TYPE_USB
static val TYPE_USB: Int
Constant representing USB MIDI devices for getType
Value: 1
TYPE_VIRTUAL
static val TYPE_VIRTUAL: Int
Constant representing virtual (software based) MIDI devices for getType
Value: 2
Public methods
describeContents
fun describeContents(): Int
Return | |
---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
equals
fun equals(other: Any?): Boolean
Parameters | |
---|---|
obj |
the reference object with which to compare. |
Return | |
---|---|
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getDefaultProtocol
fun getDefaultProtocol(): Int
Returns the default protocol. For most devices, this will be PROTOCOL_UNKNOWN
. Returning PROTOCOL_UNKNOWN
is not an error; the device just doesn't support Universal MIDI Packets by default.
getId
fun getId(): Int
Returns the ID of the device. This ID is generated by the MIDI service and is not persistent across device unplugs.
Return | |
---|---|
Int |
the device's ID |
getInputPortCount
fun getInputPortCount(): Int
Returns the device's number of input ports.
Return | |
---|---|
Int |
the number of input ports |
getOutputPortCount
fun getOutputPortCount(): Int
Returns the device's number of output ports.
Return | |
---|---|
Int |
the number of output ports |
getPorts
fun getPorts(): Array<MidiDeviceInfo.PortInfo!>!
Returns information about the device's ports. The ports are in unspecified order.
Return | |
---|---|
Array<MidiDeviceInfo.PortInfo!>! |
array of PortInfo |
getProperties
fun getProperties(): Bundle!
Returns the android.os.Bundle
containing the device's properties.
Return | |
---|---|
Bundle! |
the device's properties |
getType
fun getType(): Int
Returns the type of the device.
Return | |
---|---|
Int |
the device's type |
isPrivate
fun isPrivate(): Boolean
Returns true if the device is private. Private devices are only visible and accessible to clients with the same UID as the application that is hosting the device.
Return | |
---|---|
Boolean |
true if the device is private |
toString
fun toString(): String
Return | |
---|---|
String |
a string representation of the object. |
writeToParcel
fun writeToParcel(
parcel: Parcel,
flags: Int
): Unit
Parameters | |
---|---|
dest |
The Parcel in which the object should be written. This value cannot be null . |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE . Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |