MidiInPort.FromIdAsync(String) Method

Definition

Creates a MidiInPort object for the specified device.

public:
 static IAsyncOperation<MidiInPort ^> ^ FromIdAsync(Platform::String ^ deviceId);
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<MidiInPort> FromIdAsync(winrt::hstring const& deviceId);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<MidiInPort> FromIdAsync(string deviceId);
function fromIdAsync(deviceId)
Public Shared Function FromIdAsync (deviceId As String) As IAsyncOperation(Of MidiInPort)

Parameters

deviceId
String

The device ID, which can be obtained by enumerating the devices on the system Windows.Devices.Enumeration.DeviceInformation.FindAllAsync.

Returns

IAsyncOperation<MidiInPort>

The asynchronous operation. Upon completion, IAsyncOperation.GetResults returns a MidiInPort object.

Attributes

Remarks

To enumerate the MidiInPort objects on the system, pass the query string provided by GetDeviceSelector to Windows.Devices.Enumeration.DeviceInformation.FindAllAsync.

Suggested times to attempt to create a MidiInPort are on any sort of app activation or user interaction. If a function call on a MidiInPort fails, or if a message received from a MidiInPort is invalid, do not try to recreate the port immediately.

Applies to