Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

154 lines
6.6KB

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