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.

ivstprocesscontext.h 6.2KB

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