Class InputDevice
Assembly: Melanchall.DryWetMidi.dll
public sealed class InputDevice : MidiDevice, IInputDevice, IDisposable
Properties
Gets a value that indicates whether
InputDevice is currently listening for
incoming MIDI events.
Declaration
public bool IsListeningForEvents { get; }
Property Value
Gets the name of the current MIDI device.
Declaration
public override string Name { get; }
Property Value
Overrides
Gets or sets a value indicating if
MidiTimeCodeReceived event should be raised or not.
Default value is
true
.
Declaration
public bool RaiseMidiTimeCodeReceived { get; set; }
Property Value
Gets or sets reaction of the input device on
Note On
events with velocity of zero.
The default is
NoteOn.
Declaration
public SilentNoteOnPolicy SilentNoteOnPolicy { get; set; }
Property Value
Exceptions
Gets or sets a value indicating whether system exclusive event is treated as received only
when it's completed or not. Default value is true
.
Declaration
public bool WaitForCompleteSysExEvent { get; set; }
Property Value
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 input MIDI devices presented in the system.
Declaration
public static ICollection<InputDevice> GetAll()
Returns
Retrieves an input MIDI device by the specified index.
Declaration
public static InputDevice GetByIndex(int index)
Parameters
Type |
Name |
Description |
int |
index |
Index of an input device to retrieve. |
Returns
Type |
Description |
InputDevice |
Input MIDI device at the specified index. |
Exceptions
Retrieves a first input MIDI device with the specified name.
Declaration
public static InputDevice GetByName(string name)
Parameters
Type |
Name |
Description |
string |
name |
The name of an input MIDI device to retrieve. |
Returns
Type |
Description |
InputDevice |
Input 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 input MIDI device which is not presented in the system.
|
MidiDeviceException |
An error occurred on the device. |
Retrieves the number of input MIDI devices presented in the system.
Declaration
public static int GetDevicesCount()
Returns
Type |
Description |
int |
Number of input 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 input device.
Declaration
public object GetProperty(InputDeviceProperty property)
Parameters
Returns
Type |
Description |
object |
The current value of the property . |
Exceptions
Returns the list of the properties supported by input devices on the current
operating system.
Declaration
public static InputDeviceProperty[] GetSupportedProperties()
Returns
Type |
Description |
InputDeviceProperty[] |
The list of the properties supported by input devices on the current
operating system. |
Starts listening for incoming MIDI events on the current input device.
Declaration
public void StartEventsListening()
Exceptions
Stops listening for incoming MIDI events on the current input device.
Declaration
public void StopEventsListening()
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
Events
Occurs when a MIDI event is received.
Declaration
public event EventHandler<MidiEventReceivedEventArgs> EventReceived
Event Type
Occurs when MIDI time code received, i.e. all MIDI events to complete MIDI time code are received.
Declaration
public event EventHandler<MidiTimeCodeReceivedEventArgs> MidiTimeCodeReceived
Event Type
Operators
Declaration
public static bool operator ==(InputDevice inputDevice1, InputDevice inputDevice2)
Parameters
Returns
Type |
Description |
bool |
true if the devices are equal, false otherwise. |
Declaration
public static bool operator !=(InputDevice inputDevice1, InputDevice inputDevice2)
Parameters
Returns
Type |
Description |
bool |
false if the devices are equal, true otherwise. |
Implements
Extension Methods