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.

143 lines
6.2KB

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