MidiOutPort
MidiOutPort
MidiOutPort
MidiOutPort
Class
Definition
Represents a port used to send MIDI messages to a MIDI device.
public : sealed class MidiOutPort : IMidiOutPort, IClosablepublic sealed class MidiOutPort : IMidiOutPort, IDisposablePublic NotInheritable Class MidiOutPort Implements IMidiOutPort, IDisposable// You can use this class in JavaScript.
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Properties
DeviceId DeviceId DeviceId DeviceId
Gets the id of the device that was used to initialize the MidiOutPort.
public : PlatForm::String DeviceId { get; }public string DeviceId { get; }Public ReadOnly Property DeviceId As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
The ID of the device.
Methods
Close() Close() Close() Close()
Closes the MidiOutPort.
public : void Close()This member is not implemented in C#This member is not implemented in VB.Net// You can use this method in JavaScript.
Dispose() Dispose() Dispose() Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
This member is not implemented in C++void Dispose()Sub Disposevoid Dispose()
FromIdAsync(String) FromIdAsync(String) FromIdAsync(String) FromIdAsync(String)
Creates a MidiOutPort object for the specified device.
public : static IAsyncOperation<IMidiOutPort> FromIdAsync(PlatForm::String deviceId)public static IAsyncOperation<IMidiOutPort> FromIdAsync(String deviceId)Public Static Function FromIdAsync(deviceId As String) As IAsyncOperation( Of IMidiOutPort )// You can use this method in JavaScript.
- deviceId
- PlatForm::String String String String
The device ID, which can be obtained by enumerating the devices on the system Windows.Devices.Enumeration.DeviceInformation.FindAllAsync.
The asynchronous operation. Upon completion, IAsyncOperation.GetResults returns a MidiOutPort object.
Remarks
To enumerate the MidiOutPort 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.
GetDeviceSelector() GetDeviceSelector() GetDeviceSelector() GetDeviceSelector()
Gets a query string that can be used to enumerate all MidiOutPort objects on the system.
public : static PlatForm::String GetDeviceSelector()public static string GetDeviceSelector()Public Static Function GetDeviceSelector() As string// You can use this method in JavaScript.
The query string used to enumerate the MidiOutPort objects on the system.
Remarks
To enumerate the MidiOutPort objects on the system, pass the query string provided by this method to Windows.Devices.Enumeration.DeviceInformation.FindAllAsync.
SendBuffer(IBuffer) SendBuffer(IBuffer) SendBuffer(IBuffer) SendBuffer(IBuffer)
Send the specified data buffer to the device associated with this MidiOutPort.
public : void SendBuffer(IBuffer midiData)public void SendBuffer(IBuffer midiData)Public Function SendBuffer(midiData As IBuffer) As void// You can use this method in JavaScript.
Remarks
If this method fails with RO_E_CLOSED, it can be assumed that the MidiOutPort has been disconnected from the device.
See Obtaining pointers to data buffers (C++/CX) for more info.
SendMessage(IMidiMessage) SendMessage(IMidiMessage) SendMessage(IMidiMessage) SendMessage(IMidiMessage)
Send the data in the specified MIDI message to the device associated with this MidiOutPort.
public : void SendMessage(IMidiMessage midiMessage)public void SendMessage(IMidiMessage midiMessage)Public Function SendMessage(midiMessage As IMidiMessage) As void// You can use this method in JavaScript.
- midiMessage
- IMidiMessage IMidiMessage IMidiMessage IMidiMessage
The MIDI message to send to the device.