Stay organized with collections
Save and categorize content based on your preferences.
MidiOutputPort
class MidiOutputPort : MidiSender, Closeable
This class is used for receiving data from a port on a MIDI device
Summary
Public methods
close
fun close(): Unit
Exceptions |
java.lang.Exception |
if this resource cannot be closed |
java.io.IOException |
if an I/O error occurs |
getPortNumber
fun getPortNumber(): Int
Returns the port number of this port
Return |
Int |
the port's port number |
Protected methods
finalize
protected fun finalize(): Unit
Exceptions |
java.lang.Throwable |
the Exception raised by this method |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# MidiOutputPort\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nMidiOutputPort\n==============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/midi/MidiOutputPort \"View this page in Java\") \n\n```\nclass MidiOutputPort : MidiSender, Closeable\n```\n\n|---|---|----------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||\n| ↳ | [android.media.midi.MidiSender](/reference/kotlin/android/media/midi/MidiSender) ||\n| | ↳ | [android.media.midi.MidiOutputPort](#) |\n\nThis class is used for receiving data from a port on a MIDI device\n\nSummary\n-------\n\n| Public methods ||\n|------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [close](#close())`()` \u003cbr /\u003e |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getPortNumber](#getPortNumber())`()` Returns the port number of this port |\n| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onConnect](#onConnect(android.media.midi.MidiReceiver))`(`receiver:` `[MidiReceiver](/reference/kotlin/android/media/midi/MidiReceiver)!`)` \u003cbr /\u003e |\n| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onDisconnect](#onDisconnect(android.media.midi.MidiReceiver))`(`receiver:` `[MidiReceiver](/reference/kotlin/android/media/midi/MidiReceiver)!`)` \u003cbr /\u003e |\n\n| Protected methods ||\n|------------------------------------------------------------------------------|------------------------------------|\n| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [finalize](#finalize())`()` \u003cbr /\u003e |\n\n| Inherited functions ||\n|---|---|\n| From class [MidiSender](/reference/kotlin/android/media/midi/MidiSender) |------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [connect](/reference/kotlin/android/media/midi/MidiSender#connect(android.media.midi.MidiReceiver))`(`receiver:` `[MidiReceiver](/reference/kotlin/android/media/midi/MidiReceiver)!`)` Connects a [MidiReceiver](/reference/kotlin/android/media/midi/MidiReceiver) to the sender \u003cbr /\u003e | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [disconnect](/reference/kotlin/android/media/midi/MidiSender#disconnect(android.media.midi.MidiReceiver))`(`receiver:` `[MidiReceiver](/reference/kotlin/android/media/midi/MidiReceiver)!`)` Disconnects a [MidiReceiver](/reference/kotlin/android/media/midi/MidiReceiver) from the sender \u003cbr /\u003e | ||\n\nPublic methods\n--------------\n\n### close\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun close(): Unit\n```\n\n| Exceptions ||\n|-----------------------|-----------------------------------|\n| `java.lang.Exception` | if this resource cannot be closed |\n| `java.io.IOException` | if an I/O error occurs |\n\n### getPortNumber\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getPortNumber(): Int\n```\n\nReturns the port number of this port\n\n| Return ||\n|----------------------------------------------------------------------------|------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | the port's port number |\n\n### onConnect\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun onConnect(receiver: MidiReceiver!): Unit\n```\n\n| Parameters ||\n|------------|---------------------------------------------------------------------------------------------|\n| `receiver` | [MidiReceiver](/reference/kotlin/android/media/midi/MidiReceiver)!: the receiver to connect |\n\n### onDisconnect\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun onDisconnect(receiver: MidiReceiver!): Unit\n```\n\n| Parameters ||\n|------------|------------------------------------------------------------------------------------------------|\n| `receiver` | [MidiReceiver](/reference/kotlin/android/media/midi/MidiReceiver)!: the receiver to disconnect |\n\nProtected methods\n-----------------\n\n### finalize\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nprotected fun finalize(): Unit\n```\n\n| Exceptions ||\n|-----------------------|---------------------------------------|\n| `java.lang.Throwable` | the `Exception` raised by this method |"]]