Class OutputDevice
Assembly: Melanchall.DryWetMidi.dll
public sealed class OutputDevice : MidiDevice, IOutputDevice, IDisposable
Properties
Gets the name of the current MIDI device.
Declaration
public override string Name { get; }
Property Value
Overrides
Methods
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
| Type |
Name |
Description |
| object |
obj |
The object to compare with the current object. |
Returns
| Type |
Description |
| bool |
true if the specified object is equal to the current object; otherwise, false. |
Overrides
Retrieves all output MIDI devices presented in the system.
Declaration
public static ICollection<OutputDevice> GetAll()
Returns
Retrieves an output MIDI device by the specified index.
Declaration
public static OutputDevice GetByIndex(int index)
Parameters
| Type |
Name |
Description |
| int |
index |
Index of an output device to retrieve. |
Returns
| Type |
Description |
| OutputDevice |
Output MIDI device at the specified index. |
Exceptions
Retrieves a first output MIDI device with the specified name.
Declaration
public static OutputDevice GetByName(string name)
Parameters
| Type |
Name |
Description |
| string |
name |
The name of an output MIDI device to retrieve. |
Returns
| Type |
Description |
| OutputDevice |
Output MIDI device with the specified name. |
Exceptions
| Type |
Condition |
| ArgumentException |
One of the following errors occurred:
-
name is null or contains white-spaces only. -
name specifies an output MIDI device which is not presented in the system.
|
| MidiDeviceException |
An error occurred on the device. |
Retrieves the number of output MIDI devices presented in the system.
Declaration
public static int GetDevicesCount()
Returns
| Type |
Description |
| int |
Number of output MIDI devices presented in the system. |
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
| Type |
Description |
| int |
A hash code for the current object. |
Overrides
Returns current value of the specified property attached to the current output device.
Declaration
public object GetProperty(OutputDeviceProperty property)
Parameters
Returns
| Type |
Description |
| object |
The current value of the property. |
Exceptions
Returns the list of the properties supported by output devices on the current
operating system.
Declaration
public static OutputDeviceProperty[] GetSupportedProperties()
Returns
| Type |
Description |
| OutputDeviceProperty[] |
The list of the properties supported by output devices on the current
operating system. |
Prepares output MIDI device for sending events to it allocating necessary
resources.
Declaration
public void PrepareForEventsSending()
Exceptions
Sends a MIDI event to the current output device.
Declaration
public void SendEvent(MidiEvent midiEvent)
Parameters
| Type |
Name |
Description |
| MidiEvent |
midiEvent |
MIDI event to send. |
Exceptions
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type |
Description |
| string |
A string that represents the current object. |
Overrides
Turns off all notes that were turned on by sending Note On events, and which haven't
yet been turned off by respective Note Off events.
Declaration
public void TurnAllNotesOff()
Exceptions
Events
Occurs when a MIDI event is sent.
Declaration
public event EventHandler<MidiEventSentEventArgs> EventSent
Event Type
Operators
Declaration
public static bool operator ==(OutputDevice outputDevice1, OutputDevice outputDevice2)
Parameters
Returns
| Type |
Description |
| bool |
true if the devices are equal, false otherwise. |
Declaration
public static bool operator !=(OutputDevice outputDevice1, OutputDevice outputDevice2)
Parameters
Returns
| Type |
Description |
| bool |
false if the devices are equal, true otherwise. |
Implements