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.

374 lines
15KB

  1. //------------------------------------------------------------------------
  2. // Project : VST SDK
  3. // Version : 3.6.7
  4. //
  5. // Category : Interfaces
  6. // Filename : pluginterfaces/vst/ivstrepresentation.h
  7. // Created by : Steinberg, 08/2010
  8. // Description : VST Representation Interface
  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 "pluginterfaces/vst/vsttypes.h"
  20. //------------------------------------------------------------------------
  21. #include "pluginterfaces/base/falignpush.h"
  22. //------------------------------------------------------------------------
  23. //------------------------------------------------------------------------
  24. namespace Steinberg {
  25. class IBStream;
  26. namespace Vst {
  27. //------------------------------------------------------------------------
  28. /** RepresentationInfo is the structure describing a representation
  29. This structure is used in the function \see IXmlRepresentationController::getXmlRepresentationStream.
  30. \see IXmlRepresentationController
  31. */
  32. struct RepresentationInfo
  33. {
  34. RepresentationInfo ()
  35. {
  36. memset (vendor, 0, kNameSize);
  37. memset (name, 0, kNameSize);
  38. memset (version, 0, kNameSize);
  39. memset (host, 0, kNameSize);
  40. }
  41. RepresentationInfo (char8* _vendor, char8* _name = 0, char8* _version = 0, char8* _host = 0)
  42. {
  43. memset (vendor, 0, kNameSize);
  44. if (_vendor)
  45. strcpy (vendor, _vendor);
  46. memset (name, 0, kNameSize);
  47. if (_name)
  48. strcpy (name, _name);
  49. memset (version, 0, kNameSize);
  50. if (_version)
  51. strcpy (version, _version);
  52. memset (host, 0, kNameSize);
  53. if (_host)
  54. strcpy (host, _host);
  55. }
  56. enum
  57. {
  58. kNameSize = 64
  59. };
  60. char8 vendor[kNameSize]; ///< Vendor name of the associated representation (remote) (eg. "Yamaha").
  61. char8 name[kNameSize]; ///< Representation (remote) Name (eg. "O2").
  62. char8 version[kNameSize]; ///< Version of this "Remote" (eg. "1.0").
  63. char8 host[kNameSize]; ///< Optional: used if the representation is for a given host only (eg. "Nuendo").
  64. };
  65. //------------------------------------------------------------------------
  66. //------------------------------------------------------------------------
  67. /** Extended Plug-in interface IEditController for a component.
  68. \ingroup vstIPlug vst350
  69. - [plug imp]
  70. - [extends IEditController]
  71. - [released: 3.5.0]
  72. - [optional]
  73. A Representation based on XML is a way to export and structure, group Plug-ins parameters for a specific remote (could be hardware or software rack (like quickcontrols)).
  74. \n
  75. It allows to describe more precisely each parameter (what is the best matching to a knob, different titles lengths matching limited remote display,...).\n See an \ref Example.
  76. \n\n
  77. - A Representation is composed of Pages (this means that to see all exported parameters the user has to navigate through the pages).
  78. - A Page is composed of Cells (for example 8 Cells per page).
  79. - A Cell is composed of Layers (for example a cell could have a knob, a display and a button which are 3 Layers).
  80. - A Layer is associated to a Plug-in parameter using the ParameterID as identifier:
  81. - it could be a knob with a display for Title and/or value, this display uses the same parameterId, but it could an another one.
  82. - Switch
  83. - link which allows to jump directly to a subpage (an another page)
  84. - more... See Vst::LayerType
  85. .
  86. \n
  87. This Representation is implemented as XML text following the Document Type Definition (DTD): http://dtd.steinberg.net/VST-Remote-1.1.dtd
  88. \section Example
  89. Here an example of what should be passed in the stream of getXmlRepresentationStream:
  90. \code
  91. <?xml version="1.0" encoding="utf-8"?>
  92. <!DOCTYPE vstXML PUBLIC "-//Steinberg//DTD VST Remote 1.1//EN" "http://dtd.steinberg.net/VST-Remote-1.1.dtd">
  93. <vstXML version="1.0">
  94. <plugin classID="341FC5898AAA46A7A506BC0799E882AE" name="Chorus" vendor="Steinberg Media Technologies" />
  95. <originator>My name</originator>
  96. <date>2010-12-31</date>
  97. <comment>This is an example for 4 Cells per Page for the Remote named ProductRemote
  98. from company HardwareCompany.</comment>
  99. <!-- ===================================== -->
  100. <representation name="ProductRemote" vendor="HardwareCompany" version="1.0">
  101. <page name="Root">
  102. <cell>
  103. <layer type="knob" parameterID="0">
  104. <titleDisplay>
  105. <name>Mix dry/wet</name>
  106. <name>Mix</name>
  107. </titleDisplay>
  108. </layer>
  109. </cell>
  110. <cell>
  111. <layer type="display"></layer>
  112. </cell>
  113. <cell>
  114. <layer type="knob" parameterID="3">
  115. <titleDisplay>
  116. <name>Delay</name>
  117. <name>Dly</name>
  118. </titleDisplay>
  119. </layer>
  120. </cell>
  121. <cell>
  122. <layer type="knob" parameterID="15">
  123. <titleDisplay>
  124. <name>Spatial</name>
  125. <name>Spat</name>
  126. </titleDisplay>
  127. </layer>
  128. </cell>
  129. </page>
  130. <page name="Page 2">
  131. <cell>
  132. <layer type="LED" ledStyle="spread" parameterID="2">
  133. <titleDisplay>
  134. <name>Width +</name>
  135. <name>Widt</name>
  136. </titleDisplay>
  137. </layer>
  138. <!--this is the switch for shape A/B-->
  139. <layer type="switch" switchStyle="pushIncLooped" parameterID="4"></layer>
  140. </cell>
  141. <cell>
  142. <layer type="display"></layer>
  143. </cell>
  144. <cell>
  145. <layer type="LED" ledStyle="singleDot" parameterID="17">
  146. <titleDisplay>
  147. <name>Sync Note +</name>
  148. <name>Note</name>
  149. </titleDisplay>
  150. </layer>
  151. <!--this is the switch for sync to tempo on /off-->
  152. <layer type="switch" switchStyle="pushIncLooped" parameterID="16"></layer>
  153. </cell>
  154. <cell>
  155. <layer type="knob" parameterID="1">
  156. <titleDisplay>
  157. <name>Rate</name>
  158. </titleDisplay>
  159. </layer>
  160. </cell>
  161. </page>
  162. </representation>
  163. </vstXML>
  164. \endcode
  165. */
  166. //------------------------------------------------------------------------
  167. class IXmlRepresentationController: public FUnknown
  168. {
  169. public:
  170. /** Retrieves a stream containing a XmlRepresentation for a wanted representation info */
  171. virtual tresult PLUGIN_API getXmlRepresentationStream (RepresentationInfo& info /*in*/, IBStream* stream /*out*/) = 0;
  172. //------------------------------------------------------------------------
  173. static const FUID iid;
  174. };
  175. DECLARE_CLASS_IID (IXmlRepresentationController, 0xA81A0471, 0x48C34DC4, 0xAC30C9E1, 0x3C8393D5)
  176. //------------------------------------------------------------------------
  177. /** Defines for XML representation Tags and Attributes */
  178. #define ROOTXML_TAG "vstXML"
  179. #define COMMENT_TAG "comment"
  180. #define CELL_TAG "cell"
  181. #define CELLGROUP_TAG "cellGroup"
  182. #define CELLGROUPTEMPLATE_TAG "cellGroupTemplate"
  183. #define CURVE_TAG "curve"
  184. #define CURVETEMPLATE_TAG "curveTemplate"
  185. #define DATE_TAG "date"
  186. #define LAYER_TAG "layer"
  187. #define NAME_TAG "name"
  188. #define ORIGINATOR_TAG "originator"
  189. #define PAGE_TAG "page"
  190. #define PAGETEMPLATE_TAG "pageTemplate"
  191. #define PLUGIN_TAG "plugin"
  192. #define VALUE_TAG "value"
  193. #define VALUEDISPLAY_TAG "valueDisplay"
  194. #define VALUELIST_TAG "valueList"
  195. #define REPRESENTATION_TAG "representation"
  196. #define SEGMENT_TAG "segment"
  197. #define SEGMENTLIST_TAG "segmentList"
  198. #define TITLEDISPLAY_TAG "titleDisplay"
  199. #define ATTR_CATEGORY "category"
  200. #define ATTR_CLASSID "classID"
  201. #define ATTR_ENDPOINT "endPoint"
  202. #define ATTR_INDEX "index"
  203. #define ATTR_FLAGS "flags"
  204. #define ATTR_FUNCTION "function"
  205. #define ATTR_HOST "host"
  206. #define ATTR_LEDSTYLE "ledStyle"
  207. #define ATTR_LENGTH "length"
  208. #define ATTR_LINKEDTO "linkedTo"
  209. #define ATTR_NAME "name"
  210. #define ATTR_ORDER "order"
  211. #define ATTR_PAGE "page"
  212. #define ATTR_PARAMID "parameterID"
  213. #define ATTR_STARTPOINT "startPoint"
  214. #define ATTR_STYLE "style"
  215. #define ATTR_SWITCHSTYLE "switchStyle"
  216. #define ATTR_TEMPLATE "template"
  217. #define ATTR_TURNSPERFULLRANGE "turnsPerFullRange"
  218. #define ATTR_TYPE "type"
  219. #define ATTR_UNITID "unitID"
  220. #define ATTR_VARIABLES "variables"
  221. #define ATTR_VENDOR "vendor"
  222. #define ATTR_VERSION "version"
  223. //------------------------------------------------------------------------
  224. /** Defines some predefined Representation Remote Names */
  225. #define GENERIC "Generic"
  226. #define GENERIC_4_CELLS "Generic 4 Cells"
  227. #define GENERIC_8_CELLS "Generic 8 Cells"
  228. #define GENERIC_12_CELLS "Generic 12 Cells"
  229. #define GENERIC_24_CELLS "Generic 24 Cells"
  230. #define GENERIC_N_CELLS "Generic %d Cells"
  231. #define QUICK_CONTROL_8_CELLS "Quick Controls 8 Cells"
  232. //------------------------------------------------------------------------
  233. /** Layer Types used in a VST XML Representation */
  234. //------------------------------------------------------------------------
  235. namespace LayerType
  236. {
  237. enum
  238. {
  239. kKnob = 0, ///< a knob (encoder or not)
  240. kPressedKnob, ///< a knob which is used by pressing and turning
  241. kSwitchKnob, ///< knob could be pressed to simulate a switch
  242. kSwitch, ///< a "on/off" button
  243. kLED, ///< LED like VU-meter or display around a knob
  244. kLink, ///< indicates that this layer is a folder linked to an another INode (page)
  245. kDisplay, ///< only for text display (not really a control)
  246. kFader, ///< a fader
  247. kEndOfLayerType
  248. };
  249. /** FIDString variant of the LayerType */
  250. static const FIDString layerTypeFIDString[] = {
  251. "knob"
  252. ,"pressedKnob"
  253. ,"switchKnob"
  254. ,"switch"
  255. ,"LED"
  256. ,"link"
  257. ,"display"
  258. ,"fader"
  259. ,0
  260. };
  261. };
  262. //------------------------------------------------------------------------
  263. /** Curve Types used in a VST XML Representation */
  264. //------------------------------------------------------------------------
  265. namespace CurveType
  266. {
  267. const CString kSegment = "segment"; ///<
  268. const CString kValueList = "valueList"; ///<
  269. };
  270. //------------------------------------------------------------------------
  271. /** Attributes used to defined a Layer in a VST XML Representation */
  272. //------------------------------------------------------------------------
  273. namespace Attributes
  274. {
  275. const CString kStyle = ATTR_STYLE; ///< string attribute : See AttributesStyle for available string value
  276. const CString kLEDStyle = ATTR_LEDSTYLE; ///< string attribute : See AttributesStyle for available string value
  277. const CString kSwitchStyle = ATTR_SWITCHSTYLE; ///< string attribute : See AttributesStyle for available string value
  278. const CString kKnobTurnsPerFullRange = ATTR_TURNSPERFULLRANGE; ///< float attribute
  279. const CString kFunction = ATTR_FUNCTION; ///< string attribute : See AttributesFunction for available string value
  280. const CString kFlags = ATTR_FLAGS; ///< string attribute : See AttributesFlags for available string value
  281. };
  282. //------------------------------------------------------------------------
  283. /** Attributes Function used to defined the function of a Layer in a VST XML Representation */
  284. //------------------------------------------------------------------------
  285. namespace AttributesFunction
  286. {
  287. /// Global Style
  288. const CString kPanPosCenterXFunc = "PanPosCenterX"; ///< Gravity point X-axis (L-R) (for stereo: middle between left and right)
  289. const CString kPanPosCenterYFunc = "PanPosCenterY"; ///< Gravity point Y-axis (Front-Rear)
  290. const CString kPanPosFrontLeftXFunc = "PanPosFrontLeftX"; ///< Left channel Position in X-axis
  291. const CString kPanPosFrontLeftYFunc = "PanPosFrontLeftY"; ///< Left channel Position in Y-axis
  292. const CString kPanPosFrontRightXFunc = "PanPosFrontRightX"; ///< Right channel Position in X-axis
  293. const CString kPanPosFrontRightYFunc = "PanPosFrontRightY"; ///< Right channel Position in Y-axis
  294. const CString kPanRotationFunc = "PanRotation"; ///< Rotation around the Center (gravity point)
  295. const CString kPanLawFunc = "PanLaw"; ///< Panning Law
  296. const CString kPanMirrorModeFunc = "PanMirrorMode"; ///< Panning Mirror Mode
  297. const CString kPanLfeGainFunc = "PanLfeGain"; ///< Panning LFE Gain
  298. const CString kGainReductionFunc = "GainReduction"; ///< Gain Reduction for compressor
  299. const CString kSoloFunc = "Solo"; ///< Solo
  300. const CString kMuteFunc = "Mute"; ///< Mute
  301. const CString kVolumeFunc = "Volume"; ///< Volume
  302. };
  303. //------------------------------------------------------------------------
  304. /** Attributes Style associated a specific Layer Type in a VST XML Representation */
  305. //------------------------------------------------------------------------
  306. namespace AttributesStyle
  307. {
  308. /// Global Style
  309. const CString kInverseStyle = "inverse"; ///< the associated layer should use the inverse value of parameter (1 - x).
  310. /// LED Style
  311. const CString kLEDWrapLeftStyle = "wrapLeft"; ///< |======>----- (the default one if not specified)
  312. const CString kLEDWrapRightStyle = "wrapRight"; ///< -------<====|
  313. const CString kLEDSpreadStyle = "spread"; ///< ---<==|==>---
  314. const CString kLEDBoostCutStyle = "boostCut"; ///< ------|===>--
  315. const CString kLEDSingleDotStyle = "singleDot"; ///< --------|----
  316. /// Switch Style
  317. const CString kSwitchPushStyle = "push"; ///< Apply only when pressed, unpressed will reset the value to min.
  318. const CString kSwitchPushIncLoopedStyle = "pushIncLooped"; ///< Push will increment the value. When the max is reached it will restart with min.
  319. ///< The default one if not specified (with 2 states values it is a OnOff switch).
  320. const CString kSwitchPushDecLoopedStyle = "pushDecLooped"; ///< Push will decrement the value. When the min is reached it will restart with max.
  321. const CString kSwitchPushIncStyle = "pushInc"; ///< Increment after each press (delta depends of the curve).
  322. const CString kSwitchPushDecStyle = "pushDec"; ///< Decrement after each press (delta depends of the curve).
  323. const CString kSwitchLatchStyle = "latch"; ///< Each push-release will change the value between min and max.
  324. ///< A timeout between push and release could be used to simulate a push style (if timeout is reached).
  325. };
  326. //------------------------------------------------------------------------
  327. /** Attributes Flags defining a Layer in a VST XML Representation */
  328. //------------------------------------------------------------------------
  329. namespace AttributesFlags
  330. {
  331. const CString kHideableFlag = "hideable"; ///< the associated layer marked as hideable allows a remote to hide or make it not usable a parameter when the associated value is inactive
  332. };
  333. //------------------------------------------------------------------------
  334. } // namespace Vst
  335. } // namespace Steinberg
  336. //------------------------------------------------------------------------
  337. #include "pluginterfaces/base/falignpop.h"
  338. //------------------------------------------------------------------------