Xeno-rat
Loading...
Searching...
No Matches
NAudio.Midi.MidiOut Class Reference

Represents a MIDI out device. More...

Inheritance diagram for NAudio.Midi.MidiOut:
Collaboration diagram for NAudio.Midi.MidiOut:

Public Member Functions

 MidiOut (int deviceNo)
 Opens a specified MIDI out device.
 
void Close ()
 Closes the current resource.
 
void Dispose ()
 Releases the unmanaged resources used by the T:YourClassName and optionally releases the managed resources.
 
void Reset ()
 Resets the MIDI output device.
 
void SendDriverMessage (int message, int param1, int param2)
 Sends a driver message to the MIDI output device.
 
void Send (int message)
 Sends a MIDI message using the specified handle.
 
void SendBuffer (byte[] byteBuffer)
 Sends the specified byte buffer to the MIDI output device.
 

Static Public Member Functions

static MidiOutCapabilities DeviceInfo (int midiOutDeviceNumber)
 Retrieves the capabilities of the specified MIDI output device.
 

Protected Member Functions

virtual void Dispose (bool disposing)
 Closes the MIDI out device.
 

Properties

static int NumberOfDevices [get]
 Gets the number of MIDI devices available in the system.
 
int Volume [get, set]
 Gets or sets the volume for this MIDI out device.
 

Private Member Functions

void Callback (IntPtr midiInHandle, MidiInterop.MidiOutMessage message, IntPtr userData, IntPtr messageParameter1, IntPtr messageParameter2)
 Callback function for MIDI input messages.
 
 ~MidiOut ()
 Cleanup.
 

Private Attributes

IntPtr hMidiOut = IntPtr.Zero
 
bool disposed = false
 
MidiInterop.MidiOutCallback callback
 

Detailed Description

Represents a MIDI out device.

Constructor & Destructor Documentation

◆ MidiOut()

NAudio.Midi.MidiOut.MidiOut ( int deviceNo)
inline

Opens a specified MIDI out device.

Parameters
deviceNoThe device number
Here is the call graph for this function:

◆ ~MidiOut()

NAudio.Midi.MidiOut.~MidiOut ( )
inlineprivate

Cleanup.

Here is the call graph for this function:

Member Function Documentation

◆ Callback()

void NAudio.Midi.MidiOut.Callback ( IntPtr midiInHandle,
MidiInterop::MidiOutMessage message,
IntPtr userData,
IntPtr messageParameter1,
IntPtr messageParameter2 )
inlineprivate

Callback function for MIDI input messages.

Parameters
midiInHandleHandle to the MIDI input device.
messageThe MIDI output message.
userDataUser-defined data.
messageParameter1First message parameter.
messageParameter2Second message parameter.
Here is the caller graph for this function:

◆ Close()

void NAudio.Midi.MidiOut.Close ( )
inline

Closes the current resource.

This method calls the Dispose method to release resources used by the current instance.

Here is the call graph for this function:

◆ DeviceInfo()

static MidiOutCapabilities NAudio.Midi.MidiOut.DeviceInfo ( int midiOutDeviceNumber)
inlinestatic

Retrieves the capabilities of the specified MIDI output device.

Parameters
midiOutDeviceNumberThe number of the MIDI output device for which to retrieve the capabilities.
Returns
The capabilities of the specified MIDI output device as a MidiOutCapabilities object.
Exceptions
MmExceptionThrown when an error occurs while retrieving the device capabilities using the function midiOutGetDevCaps.
Here is the call graph for this function:

◆ Dispose() [1/2]

void NAudio.Midi.MidiOut.Dispose ( )
inline

Releases the unmanaged resources used by the T:YourClassName and optionally releases the managed resources.

Parameters
disposingtrue to release both managed and unmanaged resources; false to release only unmanaged resources.

This method disposes of the unmanaged resources used by the T:YourClassName. If disposing is true, it also disposes of the managed resources. This method should be called when the object is no longer needed, to release the resources it holds.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dispose() [2/2]

virtual void NAudio.Midi.MidiOut.Dispose ( bool disposing)
inlineprotectedvirtual

Closes the MIDI out device.

Parameters
disposingTrue if called from Dispose

◆ Reset()

void NAudio.Midi.MidiOut.Reset ( )
inline

Resets the MIDI output device.

Exceptions
MmExceptionThrown when an error occurs while resetting the MIDI output device.

This method resets the MIDI output device represented by the handle hMidiOut .

Here is the call graph for this function:

◆ Send()

void NAudio.Midi.MidiOut.Send ( int message)
inline

Sends a MIDI message using the specified handle.

Parameters
messageThe MIDI message to be sent.
Exceptions
MmExceptionThrown when an error occurs while sending the MIDI message.
Here is the call graph for this function:

◆ SendBuffer()

void NAudio.Midi.MidiOut.SendBuffer ( byte[] byteBuffer)
inline

Sends the specified byte buffer to the MIDI output device.

Parameters
byteBufferThe byte array to be sent to the MIDI output device.

This method prepares the header for the byte buffer, copies the byte buffer to unmanaged memory, and sends it to the MIDI output device. If an error occurs during the sending process, the method unprepares the header and frees the allocated memory.

◆ SendDriverMessage()

void NAudio.Midi.MidiOut.SendDriverMessage ( int message,
int param1,
int param2 )
inline

Sends a driver message to the MIDI output device.

Parameters
messageThe message to be sent to the MIDI output device.
param1The first parameter for the driver message.
param2The second parameter for the driver message.
Exceptions
MmExceptionThrown when an error occurs while sending the driver message.
Here is the call graph for this function:

Member Data Documentation

◆ callback

MidiInterop.MidiOutCallback NAudio.Midi.MidiOut.callback
private

◆ disposed

bool NAudio.Midi.MidiOut.disposed = false
private

◆ hMidiOut

IntPtr NAudio.Midi.MidiOut.hMidiOut = IntPtr.Zero
private

Property Documentation

◆ NumberOfDevices

int NAudio.Midi.MidiOut.NumberOfDevices
staticget

Gets the number of MIDI devices available in the system.

◆ Volume

int NAudio.Midi.MidiOut.Volume
getset

Gets or sets the volume for this MIDI out device.


The documentation for this class was generated from the following file: