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

Represents a MIDI key signature event event. More...

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

Public Member Functions

 KeySignatureEvent (BinaryReader br, int length)
 Reads a new track sequence number event from a MIDI stream.
 
 KeySignatureEvent (int sharpsFlats, int majorMinor, long absoluteTime)
 Creates a new Key signature event with the specified data.
 
override MidiEvent Clone ()
 Creates a new instance of the KeySignatureEvent with the same property values as the current instance.
 
override string ToString ()
 Returns a formatted string representation of the object.
 
override void Export (ref long absoluteTime, BinaryWriter writer)
 Exports the object's data to a binary writer.
 
- Public Member Functions inherited from NAudio.Midi.MetaEvent
 MetaEvent (MetaEventType metaEventType, int metaDataLength, long absoluteTime)
 Custom constructor for use by derived types, who will manage the data themselves.
 
override MidiEvent Clone ()
 Clones the current MidiEvent and returns the cloned instance.
 
override string ToString ()
 Returns a string representation of the object, combining the AbsoluteTime and metaEvent properties.
 
override void Export (ref long absoluteTime, BinaryWriter writer)
 Exports the meta event and its associated data to a binary writer.
 
- Public Member Functions inherited from NAudio.Midi.MidiEvent
virtual int GetAsShortMessage ()
 Returns the short message value calculated based on the channel and command code.
 
 MidiEvent (long absoluteTime, int channel, MidiCommandCode commandCode)
 Creates a MIDI event with specified parameters.
 
override string ToString ()
 Returns a string representation of the current Midi event.
 

Properties

int SharpsFlats [get]
 Number of sharps or flats.
 
int MajorMinor [get]
 Major or Minor key.
 
- Properties inherited from NAudio.Midi.MetaEvent
MetaEventType MetaEventType [get]
 Gets the type of this meta event.
 
- 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

readonly byte sharpsFlats
 
readonly byte majorMinor
 

Additional Inherited Members

- Static Public Member Functions inherited from NAudio.Midi.MetaEvent
static MetaEvent ReadMetaEvent (BinaryReader br)
 Reads a meta event from the provided BinaryReader and returns the corresponding MetaEvent object.
 
- 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.MetaEvent
 MetaEvent ()
 Empty constructor.
 
- Protected Member Functions inherited from NAudio.Midi.MidiEvent
 MidiEvent ()
 Default constructor.
 

Detailed Description

Represents a MIDI key signature event event.

Constructor & Destructor Documentation

◆ KeySignatureEvent() [1/2]

NAudio.Midi.KeySignatureEvent.KeySignatureEvent ( BinaryReader br,
int length )
inline

Reads a new track sequence number event from a MIDI stream.

Parameters
brThe MIDI stream
lengththe data length

◆ KeySignatureEvent() [2/2]

NAudio.Midi.KeySignatureEvent.KeySignatureEvent ( int sharpsFlats,
int majorMinor,
long absoluteTime )
inline

Creates a new Key signature event with the specified data.

Member Function Documentation

◆ Clone()

override MidiEvent NAudio.Midi.KeySignatureEvent.Clone ( )
virtual

Creates a new instance of the KeySignatureEvent with the same property values as the current instance.

Returns
A new KeySignatureEvent that is a copy of the current instance.

Reimplemented from NAudio.Midi.MidiEvent.

◆ Export()

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

Exports the object's data to a binary writer.

Parameters
absoluteTimeThe absolute time value.
writerThe binary writer to which the data is exported.
Exceptions
ArgumentNullExceptionThrown when the binary writer is null.

This method exports the sharpsFlats and majorMinor properties to the specified binary writer.

Reimplemented from NAudio.Midi.MidiEvent.

◆ ToString()

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

Returns a formatted string representation of the object.

Returns
A string that represents the object, including the base string representation, sharps/flats, and major/minor information.

Member Data Documentation

◆ majorMinor

readonly byte NAudio.Midi.KeySignatureEvent.majorMinor
private

◆ sharpsFlats

readonly byte NAudio.Midi.KeySignatureEvent.sharpsFlats
private

Property Documentation

◆ MajorMinor

int NAudio.Midi.KeySignatureEvent.MajorMinor
get

Major or Minor key.

◆ SharpsFlats

int NAudio.Midi.KeySignatureEvent.SharpsFlats
get

Number of sharps or flats.


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