Add initial bits for Qt6 support
[carla.git] / source / includes / vst3sdk / pluginterfaces / vst / ivstprocesscontext.h
blob0a61e46b5d7095787f9b6fb5f66d21c8ccf1c944
1 //------------------------------------------------------------------------
2 // Project : VST SDK
3 //
4 // Category : Interfaces
5 // Filename : pluginterfaces/vst/ivstprocesscontext.h
6 // Created by : Steinberg, 10/2005
7 // Description : VST Processing Context 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/base/funknown.h"
20 #include "pluginterfaces/vst/vsttypes.h"
22 //------------------------------------------------------------------------
23 #include "pluginterfaces/base/falignpush.h"
24 //------------------------------------------------------------------------
26 //------------------------------------------------------------------------
27 namespace Steinberg {
28 namespace Vst {
29 //------------------------------------------------------------------------
30 /** Frame Rate
31 A frame rate describes the number of image (frame) displayed per second.
32 Some examples:
33 - 23.976 fps is framesPerSecond: 24 and flags: kPullDownRate
34 - 24 fps is framesPerSecond: 24 and flags: 0
35 - 25 fps is framesPerSecond: 25 and flags: 0
36 - 29.97 drop fps is framesPerSecond: 30 and flags: kDropRate|kPullDownRate
37 - 29.97 fps is framesPerSecond: 30 and flags: kPullDownRate
38 - 30 fps is framesPerSecond: 30 and flags: 0
39 - 30 drop fps is framesPerSecond: 30 and flags: kDropRate
40 - 50 fps is framesPerSecond: 50 and flags: 0
41 - 59.94 fps is framesPerSecond: 60 and flags: kPullDownRate
42 - 60 fps is framesPerSecond: 60 and flags: 0
44 struct FrameRate
46 //------------------------------------------------------------------------
47 enum FrameRateFlags
49 kPullDownRate = 1 << 0,
50 kDropRate = 1 << 1
53 uint32 framesPerSecond; ///< frame rate
54 uint32 flags; ///< flags #FrameRateFlags
55 //------------------------------------------------------------------------
58 //------------------------------------------------------------------------
59 /** Description of a chord.
60 A chord is described with a key note, a root note and the
61 \copydoc chordMask
62 \see ProcessContext
64 struct Chord
66 //------------------------------------------------------------------------
67 uint8 keyNote; ///< key note in chord
68 uint8 rootNote; ///< lowest note in chord
70 /** Bitmask of a chord. \n
71 1st bit set: minor second; 2nd bit set: major second, and so on. \n
72 There is \b no bit for the keynote (root of the chord) because it is inherently always present. \n
73 Examples:
74 - XXXX 0000 0100 1000 (= 0x0048) -> major chord
75 - XXXX 0000 0100 0100 (= 0x0044) -> minor chord
76 - XXXX 0010 0100 0100 (= 0x0244) -> minor chord with minor seventh */
77 int16 chordMask;
79 enum Masks {
80 kChordMask = 0x0FFF, ///< mask for chordMask
81 kReservedMask = 0xF000 ///< reserved for future use
83 //------------------------------------------------------------------------
86 //------------------------------------------------------------------------
87 /** Audio processing context.
88 For each processing block the host provides timing information and musical parameters that can
89 change over time. For a host that supports jumps (like cycle) it is possible to split up a
90 processing block into multiple parts in order to provide a correct project time inside of every
91 block, but this behavior is not mandatory. Since the timing will be correct at the beginning of the
92 next block again, a host that is dependent on a fixed processing block size can choose to neglect
93 this problem.
94 \see IAudioProcessor, ProcessData
96 struct ProcessContext
98 //------------------------------------------------------------------------
99 /** Transport state & other flags */
100 enum StatesAndFlags
102 kPlaying = 1 << 1, ///< currently playing
103 kCycleActive = 1 << 2, ///< cycle is active
104 kRecording = 1 << 3, ///< currently recording
106 kSystemTimeValid = 1 << 8, ///< systemTime contains valid information
107 kContTimeValid = 1 << 17, ///< continousTimeSamples contains valid information
109 kProjectTimeMusicValid = 1 << 9,///< projectTimeMusic contains valid information
110 kBarPositionValid = 1 << 11, ///< barPositionMusic contains valid information
111 kCycleValid = 1 << 12, ///< cycleStartMusic and barPositionMusic contain valid information
113 kTempoValid = 1 << 10, ///< tempo contains valid information
114 kTimeSigValid = 1 << 13, ///< timeSigNumerator and timeSigDenominator contain valid information
115 kChordValid = 1 << 18, ///< chord contains valid information
117 kSmpteValid = 1 << 14, ///< smpteOffset and frameRate contain valid information
118 kClockValid = 1 << 15 ///< samplesToNextClock valid
121 uint32 state; ///< a combination of the values from \ref StatesAndFlags
123 double sampleRate; ///< current sample rate (always valid)
124 TSamples projectTimeSamples; ///< project time in samples (always valid)
126 int64 systemTime; ///< system time in nanoseconds (optional)
127 TSamples continousTimeSamples; ///< project time, without loop (optional)
129 TQuarterNotes projectTimeMusic; ///< musical position in quarter notes (1.0 equals 1 quarter note) (optional)
130 TQuarterNotes barPositionMusic; ///< last bar start position, in quarter notes (optional)
131 TQuarterNotes cycleStartMusic; ///< cycle start in quarter notes (optional)
132 TQuarterNotes cycleEndMusic; ///< cycle end in quarter notes (optional)
134 double tempo; ///< tempo in BPM (Beats Per Minute) (optional)
135 int32 timeSigNumerator; ///< time signature numerator (e.g. 3 for 3/4) (optional)
136 int32 timeSigDenominator; ///< time signature denominator (e.g. 4 for 3/4) (optional)
138 Chord chord; ///< musical info (optional)
140 int32 smpteOffsetSubframes; ///< SMPTE (sync) offset in subframes (1/80 of frame) (optional)
141 FrameRate frameRate; ///< frame rate (optional)
143 int32 samplesToNextClock; ///< MIDI Clock Resolution (24 Per Quarter Note), can be negative (nearest) (optional)
144 //------------------------------------------------------------------------
147 //------------------------------------------------------------------------
148 } // namespace Vst
149 } // namespace Steinberg
151 //------------------------------------------------------------------------
152 #include "pluginterfaces/base/falignpop.h"
153 //------------------------------------------------------------------------