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.

131 lines
5.1KB

  1. //------------------------------------------------------------------------
  2. // Project : VST SDK
  3. //
  4. // Category : Interfaces
  5. // Filename : pluginterfaces/vst/ivstphysicalui.h
  6. // Created by : Steinberg, 06/2018
  7. // Description : VST Physical User Interface support
  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/vst/ivstnoteexpression.h"
  18. //------------------------------------------------------------------------
  19. #include "pluginterfaces/base/falignpush.h"
  20. //------------------------------------------------------------------------
  21. //------------------------------------------------------------------------
  22. namespace Steinberg {
  23. namespace Vst {
  24. //------------------------------------------------------------------------
  25. typedef uint32 PhysicalUITypeID;
  26. //------------------------------------------------------------------------
  27. /** PhysicalUITypeIDs describes the type of Physical UI (PUI) which could be associated to a note
  28. expression. \see PhysicalUIMap
  29. */
  30. enum PhysicalUITypeIDs
  31. {
  32. /** absolute X position when touching keys of PUIs. Range [0=left, 0.5=middle, 1=right] */
  33. kPUIXMovement = 0,
  34. /** absolute Y position when touching keys of PUIs. Range [0=bottom/near, 0.5=center, 1=top/far] */
  35. kPUIYMovement,
  36. /** pressing a key down on keys of PUIs. Range [0=No Pressure, 1=Full Pressure] */
  37. kPUIPressure,
  38. kPUITypeCount, ///< count of current defined PUIs
  39. kInvalidPUITypeID = 0xFFFFFFFF ///< indicates an invalid or not initialized PUI type
  40. };
  41. //------------------------------------------------------------------------
  42. /** PhysicalUIMap describes a mapping of a noteExpression Type to a Physical UI Type.
  43. It is used in PhysicalUIMapList.
  44. \see PhysicalUIMapList */
  45. struct PhysicalUIMap
  46. {
  47. /** This represents the physical UI. /see PhysicalUITypeIDs, this is set by the caller of
  48. * getPhysicalUIMapping */
  49. PhysicalUITypeID physicalUITypeID;
  50. /** This represents the associated noteExpression TypeID to the given physicalUITypeID. This
  51. * will be filled by the plug-in in the call getPhysicalUIMapping, set it to kInvalidTypeID if
  52. * no Note Expression is associated to the given PUI. */
  53. NoteExpressionTypeID noteExpressionTypeID;
  54. };
  55. //------------------------------------------------------------------------
  56. /** PhysicalUIMapList describes a list of PhysicalUIMap
  57. \see INoteExpressionPhysicalUIMapping*/
  58. struct PhysicalUIMapList
  59. {
  60. /** Count of entries in the map array, set by the caller of getPhysicalUIMapping. */
  61. uint32 count;
  62. /** Pointer to a list of PhysicalUIMap containing count entries. */
  63. PhysicalUIMap* map;
  64. };
  65. //------------------------------------------------------------------------
  66. /** Extended Plug-in interface IEditController for note expression event support
  67. \ingroup vstIPlug vst3611
  68. - [plug imp]
  69. - [extends IEditController]
  70. - [released: 3.6.11]
  71. - [optional]
  72. With this Plug-in interface, the host can retrieve the preferred physical mapping associated to note
  73. expression supported by the Plug-in.
  74. When the mapping changes (for example when switching presets) the Plug-in needs
  75. to inform the host about it via \ref IComponentHandler::restartComponent (kNoteExpressionChanged).
  76. \section INoteExpressionPhysicalUIMappingExample Example
  77. \code
  78. tresult PLUGIN_API myPlug::::getPhysicalUIMapping (int32 busIndex, int16 channel, PhysicalUIMapList& list)
  79. {
  80. if (busIndex == 0 && channel == 0)
  81. {
  82. for (uint32 i = 0; i < list.count; ++i)
  83. {
  84. NoteExpressionTypeID type = kInvalidTypeID;
  85. if (kPUIXMovement == list.map[i].physicalUITypeID)
  86. list.map[i].noteExpressionTypeID = kCustomStart + 1;
  87. else if (kPUIYMovement == list.map[i].physicalUITypeID)
  88. list.map[i].noteExpressionTypeID = kCustomStart + 2;
  89. }
  90. return kResultTrue;
  91. }
  92. return kResultFalse;
  93. }
  94. \endcode */
  95. class INoteExpressionPhysicalUIMapping : public FUnknown
  96. {
  97. public:
  98. /** Fills the list of mapped [physical UI (in) - note expression (out)] for a given bus index
  99. * and channel. */
  100. virtual tresult PLUGIN_API getPhysicalUIMapping (int32 busIndex, int16 channel,
  101. PhysicalUIMapList& list) = 0;
  102. //------------------------------------------------------------------------
  103. static const FUID iid;
  104. };
  105. DECLARE_CLASS_IID (INoteExpressionPhysicalUIMapping, 0xB03078FF, 0x94D24AC8, 0x90CCD303, 0xD4133324)
  106. //------------------------------------------------------------------------
  107. } // namespace Vst
  108. } // namespace Steinberg
  109. //------------------------------------------------------------------------
  110. #include "pluginterfaces/base/falignpop.h"
  111. //------------------------------------------------------------------------