A MIDI Library for .NET

InputDevice.StartReceiving Method

Starts this input device receiving messages.

public void StartReceiving(
   Clock clock
);

Parameters

clock
If non-null, the clock's Time property will be used to assign a timestamp to each incoming message. If null, timestamps will be in seconds since StartReceiving() was called.

Remarks

This method launches a background thread to listen for input events, and as events are received, the event handlers are invoked on that background thread. Event handlers should be written to work from a background thread. (For example, if they want to update the GUI, they may need to BeginInvoke to arrange for GUI updates to happen on the correct thread.)

The background thread which is created by this method is joined (shut down) in StopReceiving.

Exceptions

Exception Type Condition
InvalidOperationException The device is not open or is already receiving.
DeviceException The device cannot start receiving.

See Also

InputDevice Class | Midi Namespace