Added in API level 23

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 getType

static Int

Constant representing USB MIDI devices for getType

static Int

Constant representing virtual (software based) MIDI devices for getType

Inherited constants
Public methods
Int

Boolean
equals(other: Any?)

Int

Returns the default protocol.

Int

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!>!

Returns information about the device's ports.

Bundle!

Returns the android.os.Bundle containing the device's properties.

Int

Returns the type of the device.

Int

Boolean

Returns true if the device is private.

String

Unit
writeToParcel(parcel: Parcel, flags: Int)

Properties
static Parcelable.Creator<MidiDeviceInfo!>

Constants

PROPERTY_BLUETOOTH_DEVICE

Added in API level 23
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

Added in API level 23
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

Added in API level 23
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

Added in API level 23
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

Added in API level 23
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

Added in API level 23
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

Added in API level 23
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

Added in API level 33
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

Added in API level 33
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

Added in API level 33
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

Added in API level 33
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

Added in API level 33
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

Added in API level 33
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

Added in API level 33
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

Added in API level 33
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

Added in API level 23
static val TYPE_BLUETOOTH: Int

Constant representing Bluetooth MIDI devices for getType

Value: 3

TYPE_USB

Added in API level 23
static val TYPE_USB: Int

Constant representing USB MIDI devices for getType

Value: 1

TYPE_VIRTUAL

Added in API level 23
static val TYPE_VIRTUAL: Int

Constant representing virtual (software based) MIDI devices for getType

Value: 2

Public methods

describeContents

Added in API level 23
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

Added in API level 23
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.

getId

Added in API level 23
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

Added in API level 23
fun getInputPortCount(): Int

Returns the device's number of input ports.

Return
Int the number of input ports

getOutputPortCount

Added in API level 23
fun getOutputPortCount(): Int

Returns the device's number of output ports.

Return
Int the number of output ports

getPorts

Added in API level 23
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

Added in API level 23
fun getProperties(): Bundle!

Returns the android.os.Bundle containing the device's properties.

Return
Bundle! the device's properties

getType

Added in API level 23
fun getType(): Int

Returns the type of the device.

Return
Int the device's type

hashCode

Added in API level 23
fun hashCode(): Int
Return
Int a hash code value for this object.

isPrivate

Added in API level 23
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

Added in API level 23
fun toString(): String
Return
String a string representation of the object.

writeToParcel

Added in API level 23
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

Properties

CREATOR

Added in API level 23
static val CREATOR: Parcelable.Creator<MidiDeviceInfo!>