Add initial bits for Qt6 support
[carla.git] / source / includes / vst3sdk / pluginterfaces / vst / ivstevents.h
blob62ff6a7875456ce2f5a56b8c1c2f5f57bd0624ce
1 //------------------------------------------------------------------------
2 // Project : VST SDK
3 //
4 // Category : Interfaces
5 // Filename : pluginterfaces/vst/ivstevents.h
6 // Created by : Steinberg, 11/2005
7 // Description : VST Events Interfaces
8 //
9 //-----------------------------------------------------------------------------
10 // This file is part of a Steinberg SDK. It is subject to the license terms
11 // in the LICENSE file found in the top-level directory of this distribution
12 // and at www.steinberg.net/sdklicenses.
13 // No part of the SDK, including this file, may be copied, modified, propagated,
14 // or distributed except according to the terms contained in the LICENSE file.
15 //-----------------------------------------------------------------------------
17 #pragma once
19 #include "pluginterfaces/vst/ivstprocesscontext.h"
20 #include "pluginterfaces/vst/ivstnoteexpression.h"
22 //------------------------------------------------------------------------
23 #include "pluginterfaces/base/falignpush.h"
24 //------------------------------------------------------------------------
26 //------------------------------------------------------------------------
27 namespace Steinberg {
28 namespace Vst {
30 //------------------------------------------------------------------------
31 /** Reserved note identifier (noteId) range for a plug-in. Guaranteed not used by the host. */
32 enum NoteIDUserRange
34 kNoteIDUserRangeLowerBound = -10000,
35 kNoteIDUserRangeUpperBound = -1000,
38 //------------------------------------------------------------------------
39 /** Note-on event specific data. Used in \ref Event (union)
40 \ingroup vstEventGrp
41 Pitch uses the twelve-tone equal temperament tuning (12-TET).
43 struct NoteOnEvent
45 int16 channel; ///< channel index in event bus
46 int16 pitch; ///< range [0, 127] = [C-2, G8] with A3=440Hz (12-TET: twelve-tone equal temperament)
47 float tuning; ///< 1.f = +1 cent, -1.f = -1 cent
48 float velocity; ///< range [0.0, 1.0]
49 int32 length; ///< in sample frames (optional, Note Off has to follow in any case!)
50 int32 noteId; ///< note identifier (if not available then -1)
53 //------------------------------------------------------------------------
54 /** Note-off event specific data. Used in \ref Event (union)
55 \ingroup vstEventGrp
57 struct NoteOffEvent
59 int16 channel; ///< channel index in event bus
60 int16 pitch; ///< range [0, 127] = [C-2, G8] with A3=440Hz (12-TET)
61 float velocity; ///< range [0.0, 1.0]
62 int32 noteId; ///< associated noteOn identifier (if not available then -1)
63 float tuning; ///< 1.f = +1 cent, -1.f = -1 cent
66 //------------------------------------------------------------------------
67 /** Data event specific data. Used in \ref Event (union)
68 \ingroup vstEventGrp
70 struct DataEvent
72 uint32 size; ///< size in bytes of the data block bytes
73 uint32 type; ///< type of this data block (see \ref DataTypes)
74 const uint8* bytes; ///< pointer to the data block
76 /** Value for DataEvent::type */
77 enum DataTypes
79 kMidiSysEx = 0 ///< for MIDI system exclusive message
83 //------------------------------------------------------------------------
84 /** PolyPressure event specific data. Used in \ref Event (union)
85 \ingroup vstEventGrp
87 struct PolyPressureEvent
89 int16 channel; ///< channel index in event bus
90 int16 pitch; ///< range [0, 127] = [C-2, G8] with A3=440Hz
91 float pressure; ///< range [0.0, 1.0]
92 int32 noteId; ///< event should be applied to the noteId (if not -1)
95 //------------------------------------------------------------------------
96 /** Chord event specific data. Used in \ref Event (union)
97 \ingroup vstEventGrp
99 struct ChordEvent
101 int16 root; ///< range [0, 127] = [C-2, G8] with A3=440Hz
102 int16 bassNote; ///< range [0, 127] = [C-2, G8] with A3=440Hz
103 int16 mask; ///< root is bit 0
104 uint16 textLen; ///< the number of characters (TChar) between the beginning of text and the terminating
105 ///< null character (without including the terminating null character itself)
106 const TChar* text; ///< UTF-16, null terminated Hosts Chord Name
109 //------------------------------------------------------------------------
110 /** Scale event specific data. Used in \ref Event (union)
111 \ingroup vstEventGrp
113 struct ScaleEvent
115 int16 root; ///< range [0, 127] = root Note/Transpose Factor
116 int16 mask; ///< Bit 0 = C, Bit 1 = C#, ... (0x5ab5 = Major Scale)
117 uint16 textLen; ///< the number of characters (TChar) between the beginning of text and the terminating
118 ///< null character (without including the terminating null character itself)
119 const TChar* text; ///< UTF-16, null terminated, Hosts Scale Name
122 //------------------------------------------------------------------------
123 /** Legacy MIDI CC Out event specific data. Used in \ref Event (union)
124 \ingroup vstEventGrp
125 - [released: 3.6.12]
127 This kind of event is reserved for generating MIDI CC as output event for kEvent Bus during the process call.
129 struct LegacyMIDICCOutEvent
131 uint8 controlNumber;///< see enum ControllerNumbers [0, 255]
132 int8 channel; ///< channel index in event bus [0, 15]
133 int8 value; ///< value of Controller [0, 127]
134 int8 value2; ///< [0, 127] used for pitch bend (kPitchBend) and polyPressure (kCtrlPolyPressure)
137 //------------------------------------------------------------------------
138 /** Event
139 \ingroup vstEventGrp
140 Structure representing a single Event of different types associated to a specific event (\ref kEvent) bus.
142 struct Event
144 int32 busIndex; ///< event bus index
145 int32 sampleOffset; ///< sample frames related to the current block start sample position
146 TQuarterNotes ppqPosition; ///< position in project
147 uint16 flags; ///< combination of \ref EventFlags
149 /** Event Flags - used for Event::flags */
150 enum EventFlags
152 kIsLive = 1 << 0, ///< indicates that the event is played live (directly from keyboard)
154 kUserReserved1 = 1 << 14, ///< reserved for user (for internal use)
155 kUserReserved2 = 1 << 15 ///< reserved for user (for internal use)
158 /** Event Types - used for Event::type */
159 enum EventTypes
161 kNoteOnEvent = 0, ///< is \ref NoteOnEvent
162 kNoteOffEvent = 1, ///< is \ref NoteOffEvent
163 kDataEvent = 2, ///< is \ref DataEvent
164 kPolyPressureEvent = 3, ///< is \ref PolyPressureEvent
165 kNoteExpressionValueEvent = 4, ///< is \ref NoteExpressionValueEvent
166 kNoteExpressionTextEvent = 5, ///< is \ref NoteExpressionTextEvent
167 kChordEvent = 6, ///< is \ref ChordEvent
168 kScaleEvent = 7, ///< is \ref ScaleEvent
169 kLegacyMIDICCOutEvent = 65535 ///< is \ref LegacyMIDICCOutEvent
172 uint16 type; ///< a value from \ref EventTypes
173 union
175 NoteOnEvent noteOn; ///< type == kNoteOnEvent
176 NoteOffEvent noteOff; ///< type == kNoteOffEvent
177 DataEvent data; ///< type == kDataEvent
178 PolyPressureEvent polyPressure; ///< type == kPolyPressureEvent
179 NoteExpressionValueEvent noteExpressionValue; ///< type == kNoteExpressionValueEvent
180 NoteExpressionTextEvent noteExpressionText; ///< type == kNoteExpressionTextEvent
181 ChordEvent chord; ///< type == kChordEvent
182 ScaleEvent scale; ///< type == kScaleEvent
183 LegacyMIDICCOutEvent midiCCOut; ///< type == kLegacyMIDICCOutEvent
187 //------------------------------------------------------------------------
188 /** List of events to process: Vst::IEventList
189 \ingroup vstIHost vst300
190 - [host imp]
191 - [released: 3.0.0]
192 - [mandatory]
194 \see ProcessData, Event
196 class IEventList : public FUnknown
198 public:
199 //------------------------------------------------------------------------
200 /** Returns the count of events. */
201 virtual int32 PLUGIN_API getEventCount () = 0;
203 /** Gets parameter by index. */
204 virtual tresult PLUGIN_API getEvent (int32 index, Event& e /*out*/) = 0;
206 /** Adds a new event. */
207 virtual tresult PLUGIN_API addEvent (Event& e /*in*/) = 0;
209 //------------------------------------------------------------------------
210 static const FUID iid;
213 DECLARE_CLASS_IID (IEventList, 0x3A2C4214, 0x346349FE, 0xB2C4F397, 0xB9695A44)
215 //------------------------------------------------------------------------
216 } // namespace Vst
217 } // namespace Steinberg
219 //------------------------------------------------------------------------
220 #include "pluginterfaces/base/falignpop.h"
221 //------------------------------------------------------------------------