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

Represents a MIDI control change event. More...

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

Public Member Functions

 ControlChangeEvent (BinaryReader br)
 Reads a control change event from a MIDI stream.
 
 ControlChangeEvent (long absoluteTime, int channel, MidiController controller, int controllerValue)
 Creates a control change event.
 
override string ToString ()
 Returns a string representation of the object, including the controller and controller value.
 
override int GetAsShortMessage ()
 Gets the short message by combining the base short message with the controller and controller value.
 
override void Export (ref long absoluteTime, BinaryWriter writer)
 Exports the data to a binary writer, including the controller and its value.
 
- Public Member Functions inherited from NAudio.Midi.MidiEvent
 MidiEvent (long absoluteTime, int channel, MidiCommandCode commandCode)
 Creates a MIDI event with specified parameters.
 
virtual MidiEvent Clone ()
 Creates a new object that is a copy of the current instance.
 
override string ToString ()
 Returns a string representation of the current Midi event.
 

Properties

MidiController Controller [get, set]
 The controller number.
 
int ControllerValue [get, set]
 The controller value.
 
- Properties inherited from NAudio.Midi.MidiEvent
virtual int Channel [get, set]
 The MIDI Channel Number for this event (1-16)
 
int DeltaTime [get]
 The Delta time for this event.
 
long AbsoluteTime [get, set]
 The absolute time for this event.
 
MidiCommandCode CommandCode [get]
 The command code for this event.
 

Private Attributes

MidiController controller
 
byte controllerValue
 

Additional Inherited Members

- Static Public Member Functions inherited from NAudio.Midi.MidiEvent
static MidiEvent FromRawMessage (int rawMessage)
 Converts a raw MIDI message to a MidiEvent object.
 
static MidiEvent ReadNextEvent (BinaryReader br, MidiEvent previous)
 Reads the next MIDI event from the BinaryReader and returns the corresponding MidiEvent.
 
static bool IsNoteOff (MidiEvent midiEvent)
 Checks if the given MIDI event represents a Note Off message.
 
static bool IsNoteOn (MidiEvent midiEvent)
 Checks if the provided MIDI event is a Note On event and returns true if the velocity is greater than 0.
 
static bool IsEndTrack (MidiEvent midiEvent)
 Checks if the provided MIDI event is an end track event.
 
static int ReadVarInt (BinaryReader br)
 Reads a variable-length encoded integer from the provided BinaryReader and returns the result.
 
static void WriteVarInt (BinaryWriter writer, int value)
 Writes a variable-length encoded integer to the specified BinaryWriter.
 
- Protected Member Functions inherited from NAudio.Midi.MidiEvent
 MidiEvent ()
 Default constructor.
 

Detailed Description

Represents a MIDI control change event.

Constructor & Destructor Documentation

◆ ControlChangeEvent() [1/2]

NAudio.Midi.ControlChangeEvent.ControlChangeEvent ( BinaryReader br)
inline

Reads a control change event from a MIDI stream.

Parameters
brBinary reader on the MIDI stream

◆ ControlChangeEvent() [2/2]

NAudio.Midi.ControlChangeEvent.ControlChangeEvent ( long absoluteTime,
int channel,
MidiController controller,
int controllerValue )
inline

Creates a control change event.

Parameters
absoluteTimeTime
channelMIDI Channel Number
controllerThe MIDI Controller
controllerValueController value

Member Function Documentation

◆ Export()

override void NAudio.Midi.ControlChangeEvent.Export ( ref long absoluteTime,
BinaryWriter writer )
inlinevirtual

Exports the data to a binary writer, including the controller and its value.

Parameters
absoluteTimeThe absolute time reference for the export operation.
writerThe binary writer to which the data is exported.
Exceptions
ExceptionThrown when an error occurs during the export operation.

This method exports the controller and its corresponding value to the specified binary writer. It first calls the base class's Export method to handle any base class-specific export operations. The controller and its value are then written to the binary writer using the Write method.

Reimplemented from NAudio.Midi.MidiEvent.

◆ GetAsShortMessage()

override int NAudio.Midi.ControlChangeEvent.GetAsShortMessage ( )
inlinevirtual

Gets the short message by combining the base short message with the controller and controller value.

Returns
The combined short message.

Reimplemented from NAudio.Midi.MidiEvent.

◆ ToString()

override string NAudio.Midi.ControlChangeEvent.ToString ( )
inline

Returns a string representation of the object, including the controller and controller value.

Returns
A string containing the object's base string, controller, and controller value.

Member Data Documentation

◆ controller

MidiController NAudio.Midi.ControlChangeEvent.controller
private

◆ controllerValue

byte NAudio.Midi.ControlChangeEvent.controllerValue
private

Property Documentation

◆ Controller

MidiController NAudio.Midi.ControlChangeEvent.Controller
getset

The controller number.

◆ ControllerValue

int NAudio.Midi.ControlChangeEvent.ControllerValue
getset

The controller value.


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