Class BaseTextEvent
Represents a text meta event.
Inheritance
BaseTextEvent
Inherited Members
Namespace: Melanchall.DryWetMidi.Core
Assembly: Melanchall.DryWetMidi.dll
Syntax
public abstract class BaseTextEvent : MetaEvent
Remarks
There are several meta events that have text content and the same structure. All these
events are derived from BaseTextEvent.
Constructors
BaseTextEvent(MidiEventType)
Initializes a new instance of the BaseTextEvent.
Declaration
protected BaseTextEvent(MidiEventType eventType)
Parameters
Type | Name | Description |
---|---|---|
MidiEventType | eventType |
BaseTextEvent(MidiEventType, string)
Initializes a new instance of the BaseTextEvent with the specified text.
Declaration
protected BaseTextEvent(MidiEventType eventType, string text)
Parameters
Type | Name | Description |
---|---|---|
MidiEventType | eventType | The type of event. |
string | text | Text contained in the event. |
Exceptions
Type | Condition |
---|---|
InvalidEnumArgumentException | eventType specified an invalid value. |
Properties
Text
Gets or sets text contained in the event.
Declaration
public string Text { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
GetContentSize(WritingSettings)
Gets the size of the content of a MIDI meta event.
Declaration
protected override sealed int GetContentSize(WritingSettings settings)
Parameters
Type | Name | Description |
---|---|---|
WritingSettings | settings | Settings according to which the event's content must be written. |
Returns
Type | Description |
---|---|
int | Size of the event's content. |
Overrides
ReadContent(MidiReader, ReadingSettings, int)
Reads content of a MIDI meta event.
Declaration
protected override sealed void ReadContent(MidiReader reader, ReadingSettings settings, int size)
Parameters
Type | Name | Description |
---|---|---|
MidiReader | reader | Reader to read the content with. |
ReadingSettings | settings | Settings according to which the event's content must be read. |
int | size | Size of the event's content. |
Overrides
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Text event cannot be read since the size is negative number. |
WriteContent(MidiWriter, WritingSettings)
Writes content of a MIDI meta event.
Declaration
protected override sealed void WriteContent(MidiWriter writer, WritingSettings settings)
Parameters
Type | Name | Description |
---|---|---|
MidiWriter | writer | Writer to write the content with. |
WritingSettings | settings | Settings according to which the event's content must be written. |