MidiInPort class

[This documentation is preliminary and is subject to change.]

Represents a port used to receive MIDI messages from a MIDI device.

Important  

The WindowsPreview.Devices.Midi API are preview API and are not included in the Windows Software Development Kit (SDK). The API are distributed as a NuGet package. See WindowsPreview.Devices.Midi for info on how to download and install the NuGet package in your project.

WindowsPreview.Devices.Midi API require Windows 8.1 Update and later.

Syntax

var midiInPort = WindowsPreview.Devices.Midi.MidiInPort;
public sealed class MidiInPort : IDisposable
Public NotInheritable Class MidiInPort
    Implements IDisposable
public ref class MidiInPort sealed : IClosable

Attributes

[MarshalingBehavior(Agile)]

[Threading(MTA)]

[Version(0x06030000)]

Members

The MidiInPort class has these types of members:

  • Events
  • Methods
  • Properties

Events

The MidiInPort class has these events.

Event Description
MessageReceived Occurs when the MidiInPort receives data.

 

Methods

The MidiInPort class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

Method Description
Close Closes the MidiInPort.
FromIdAsync Creates a MidiInPort object for the specified device.
GetDeviceSelector Gets a query string that can be used to enumerate all MidiInPort objects on the system.

 

Properties

The MidiInPort class has these properties.

Property Access type Description

DeviceId

Read-only Gets the id of the device that was used to initialize the MidiInPort.

 

Remarks

If the MidiInPort becomes disconnected for any reason, it should be disposed and a new one created to continue receiving messages.

Requirements

Minimum supported client

Windows 8.1 [Windows Store apps only]

Minimum supported server

Windows Server 2012 R2 [Windows Store apps only]

Namespace

WindowsPreview.Devices.Midi WindowsPreview::Devices::Midi [C++]

Metadata

WindowsPreview.winmd

See also

Object

IClosable

MIDI Windows Runtime sample