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.

vstspeaker.h 46KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997
  1. //------------------------------------------------------------------------
  2. // Project : VST SDK
  3. //
  4. // Category : Interfaces
  5. // Filename : pluginterfaces/vst/vstspeaker.h
  6. // Created by : Steinberg, 01/2018
  7. // Description : common defines
  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/vsttypes.h"
  18. //------------------------------------------------------------------------
  19. namespace Steinberg {
  20. namespace Vst {
  21. //------------------------------------------------------------------------
  22. /** \defgroup speakerArrangements Speaker Arrangements
  23. \image html "vst3_speaker_types.jpg"
  24. \n
  25. A SpeakerArrangement is a bitset combination of speakers. For example:
  26. \code
  27. const SpeakerArrangement kStereo = kSpeakerL | kSpeakerR; // => hex: 0x03 / binary: 0011.
  28. \endcode
  29. \see IAudioProcessor::getBusArrangement () and IAudioProcessor::setBusArrangements ()
  30. */
  31. //------------------------------------------------------------------------
  32. //------------------------------------------------------------------------
  33. /** Speaker Definitions.
  34. \ingroup speakerArrangements */
  35. //------------------------------------------------------------------------
  36. /**@{*/
  37. const Speaker kSpeakerL = 1 << 0; ///< Left (L)
  38. const Speaker kSpeakerR = 1 << 1; ///< Right (R)
  39. const Speaker kSpeakerC = 1 << 2; ///< Center (C)
  40. const Speaker kSpeakerLfe = 1 << 3; ///< Subbass (Lfe)
  41. const Speaker kSpeakerLs = 1 << 4; ///< Left Surround (Ls)
  42. const Speaker kSpeakerRs = 1 << 5; ///< Right Surround (Rs)
  43. const Speaker kSpeakerLc = 1 << 6; ///< Left of Center (Lc) - Front Left Center
  44. const Speaker kSpeakerRc = 1 << 7; ///< Right of Center (Rc) - Front Right Center
  45. const Speaker kSpeakerS = 1 << 8; ///< Surround (S)
  46. const Speaker kSpeakerCs = kSpeakerS; ///< Center of Surround (Cs) - Back Center - Surround (S)
  47. const Speaker kSpeakerSl = 1 << 9; ///< Side Left (Sl)
  48. const Speaker kSpeakerSr = 1 << 10; ///< Side Right (Sr)
  49. const Speaker kSpeakerTc = 1 << 11; ///< Top Center Over-head, Top Middle (Tc)
  50. const Speaker kSpeakerTfl = 1 << 12; ///< Top Front Left (Tfl)
  51. const Speaker kSpeakerTfc = 1 << 13; ///< Top Front Center (Tfc)
  52. const Speaker kSpeakerTfr = 1 << 14; ///< Top Front Right (Tfr)
  53. const Speaker kSpeakerTrl = 1 << 15; ///< Top Rear/Back Left (Trl)
  54. const Speaker kSpeakerTrc = 1 << 16; ///< Top Rear/Back Center (Trc)
  55. const Speaker kSpeakerTrr = 1 << 17; ///< Top Rear/Back Right (Trr)
  56. const Speaker kSpeakerLfe2 = 1 << 18; ///< Subbass 2 (Lfe2)
  57. const Speaker kSpeakerM = 1 << 19; ///< Mono (M)
  58. const Speaker kSpeakerACN0 = (Speaker)1 << 20; ///< Ambisonic ACN 0
  59. const Speaker kSpeakerACN1 = (Speaker)1 << 21; ///< Ambisonic ACN 1
  60. const Speaker kSpeakerACN2 = (Speaker)1 << 22; ///< Ambisonic ACN 2
  61. const Speaker kSpeakerACN3 = (Speaker)1 << 23; ///< Ambisonic ACN 3
  62. const Speaker kSpeakerACN4 = (Speaker)1 << 38; ///< Ambisonic ACN 4
  63. const Speaker kSpeakerACN5 = (Speaker)1 << 39; ///< Ambisonic ACN 5
  64. const Speaker kSpeakerACN6 = (Speaker)1 << 40; ///< Ambisonic ACN 6
  65. const Speaker kSpeakerACN7 = (Speaker)1 << 41; ///< Ambisonic ACN 7
  66. const Speaker kSpeakerACN8 = (Speaker)1 << 42; ///< Ambisonic ACN 8
  67. const Speaker kSpeakerACN9 = (Speaker)1 << 43; ///< Ambisonic ACN 9
  68. const Speaker kSpeakerACN10 = (Speaker)1 << 44; ///< Ambisonic ACN 10
  69. const Speaker kSpeakerACN11 = (Speaker)1 << 45; ///< Ambisonic ACN 11
  70. const Speaker kSpeakerACN12 = (Speaker)1 << 46; ///< Ambisonic ACN 12
  71. const Speaker kSpeakerACN13 = (Speaker)1 << 47; ///< Ambisonic ACN 13
  72. const Speaker kSpeakerACN14 = (Speaker)1 << 48; ///< Ambisonic ACN 14
  73. const Speaker kSpeakerACN15 = (Speaker)1 << 49; ///< Ambisonic ACN 15
  74. const Speaker kSpeakerTsl = (Speaker)1 << 24; ///< Top Side Left (Tsl)
  75. const Speaker kSpeakerTsr = (Speaker)1 << 25; ///< Top Side Right (Tsr)
  76. const Speaker kSpeakerLcs = (Speaker)1 << 26; ///< Left of Center Surround (Lcs) - Back Left Center
  77. const Speaker kSpeakerRcs = (Speaker)1 << 27; ///< Right of Center Surround (Rcs) - Back Right Center
  78. const Speaker kSpeakerBfl = (Speaker)1 << 28; ///< Bottom Front Left (Bfl)
  79. const Speaker kSpeakerBfc = (Speaker)1 << 29; ///< Bottom Front Center (Bfc)
  80. const Speaker kSpeakerBfr = (Speaker)1 << 30; ///< Bottom Front Right (Bfr)
  81. const Speaker kSpeakerPl = (Speaker)1 << 31; ///< Proximity Left (Pl)
  82. const Speaker kSpeakerPr = (Speaker)1 << 32; ///< Proximity Right (Pr)
  83. const Speaker kSpeakerBsl = (Speaker)1 << 33; ///< Bottom Side Left (Bsl)
  84. const Speaker kSpeakerBsr = (Speaker)1 << 34; ///< Bottom Side Right (Bsr)
  85. const Speaker kSpeakerBrl = (Speaker)1 << 35; ///< Bottom Rear Left (Brl)
  86. const Speaker kSpeakerBrc = (Speaker)1 << 36; ///< Bottom Rear Center (Brc)
  87. const Speaker kSpeakerBrr = (Speaker)1 << 37; ///< Bottom Rear Right (Brr)
  88. //------------------------------------------------------------------------
  89. /** @}*/
  90. //------------------------------------------------------------------------
  91. /** Speaker Arrangement Definitions (SpeakerArrangement) */
  92. namespace SpeakerArr
  93. {
  94. //------------------------------------------------------------------------
  95. /** Speaker Arrangement Definitions.
  96. \ingroup speakerArrangements */
  97. /*@{*/
  98. const SpeakerArrangement kEmpty = 0; ///< empty arrangement
  99. const SpeakerArrangement kMono = kSpeakerM; ///< M
  100. const SpeakerArrangement kStereo = kSpeakerL | kSpeakerR; ///< L R
  101. const SpeakerArrangement kStereoSurround = kSpeakerLs | kSpeakerRs; ///< Ls Rs
  102. const SpeakerArrangement kStereoCenter = kSpeakerLc | kSpeakerRc; ///< Lc Rc
  103. const SpeakerArrangement kStereoSide = kSpeakerSl | kSpeakerSr; ///< Sl Sr
  104. const SpeakerArrangement kStereoCLfe = kSpeakerC | kSpeakerLfe; ///< C Lfe
  105. const SpeakerArrangement kStereoTF = kSpeakerTfl | kSpeakerTfr; ///< Tfl Tfr
  106. const SpeakerArrangement kStereoTS = kSpeakerTsl | kSpeakerTsr; ///< Tsl Tsr
  107. const SpeakerArrangement kStereoTR = kSpeakerTrl | kSpeakerTrr; ///< Trl Trr
  108. const SpeakerArrangement kStereoBF = kSpeakerBfl | kSpeakerBfr; ///< Bfl Bfr
  109. const SpeakerArrangement kCineFront = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLc | kSpeakerRc; ///< L R C Lc Rc
  110. /** L R C */
  111. const SpeakerArrangement k30Cine = kSpeakerL | kSpeakerR | kSpeakerC;
  112. /** L R C Lfe */
  113. const SpeakerArrangement k31Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe;
  114. /** L R S */
  115. const SpeakerArrangement k30Music = kSpeakerL | kSpeakerR | kSpeakerCs;
  116. /** L R Lfe S */
  117. const SpeakerArrangement k31Music = kSpeakerL | kSpeakerR | kSpeakerLfe | kSpeakerCs;
  118. /** L R C S (LCRS) */
  119. const SpeakerArrangement k40Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerCs;
  120. /** L R C Lfe S (LCRS+Lfe) */
  121. const SpeakerArrangement k41Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerCs;
  122. /** L R Ls Rs (Quadro) */
  123. const SpeakerArrangement k40Music = kSpeakerL | kSpeakerR | kSpeakerLs | kSpeakerRs;
  124. /** L R Lfe Ls Rs (Quadro+Lfe) */
  125. const SpeakerArrangement k41Music = kSpeakerL | kSpeakerR | kSpeakerLfe | kSpeakerLs | kSpeakerRs;
  126. /** L R C Ls Rs */
  127. const SpeakerArrangement k50 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs;
  128. /** L R C Lfe Ls Rs */
  129. const SpeakerArrangement k51 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs;
  130. /** L R C Ls Rs Cs */
  131. const SpeakerArrangement k60Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerCs;
  132. /** L R C Lfe Ls Rs Cs */
  133. const SpeakerArrangement k61Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs;
  134. /** L R Ls Rs Sl Sr */
  135. const SpeakerArrangement k60Music = kSpeakerL | kSpeakerR | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr;
  136. /** L R Lfe Ls Rs Sl Sr */
  137. const SpeakerArrangement k61Music = kSpeakerL | kSpeakerR | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr;
  138. /** L R C Ls Rs Lc Rc */
  139. const SpeakerArrangement k70Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc;
  140. /** L R C Lfe Ls Rs Lc Rc */
  141. const SpeakerArrangement k71Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc;
  142. const SpeakerArrangement k71CineFullFront = k71Cine;
  143. /** L R C Ls Rs Sl Sr */
  144. const SpeakerArrangement k70Music = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr;
  145. /** L R C Lfe Ls Rs Sl Sr */
  146. const SpeakerArrangement k71Music = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr;
  147. /** L R C Lfe Ls Rs Lcs Rcs */
  148. const SpeakerArrangement k71CineFullRear = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLcs | kSpeakerRcs;
  149. const SpeakerArrangement k71CineSideFill = k71Music;
  150. /** L R C Lfe Ls Rs Pl Pr */
  151. const SpeakerArrangement k71Proximity = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerPl | kSpeakerPr;
  152. /** L R C Ls Rs Lc Rc Cs */
  153. const SpeakerArrangement k80Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs;
  154. /** L R C Lfe Ls Rs Lc Rc Cs */
  155. const SpeakerArrangement k81Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs;
  156. /** L R C Ls Rs Cs Sl Sr */
  157. const SpeakerArrangement k80Music = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerCs | kSpeakerSl | kSpeakerSr;
  158. /** L R C Lfe Ls Rs Cs Sl Sr */
  159. const SpeakerArrangement k81Music = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs | kSpeakerSl | kSpeakerSr;
  160. /** L R C Ls Rs Lc Rc Sl Sr */
  161. const SpeakerArrangement k90Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc |
  162. kSpeakerSl | kSpeakerSr;
  163. /** L R C Lfe Ls Rs Lc Rc Sl Sr */
  164. const SpeakerArrangement k91Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc |
  165. kSpeakerSl | kSpeakerSr;
  166. /** L R C Ls Rs Lc Rc Cs Sl Sr */
  167. const SpeakerArrangement k100Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs |
  168. kSpeakerSl | kSpeakerSr;
  169. /** L R C Lfe Ls Rs Lc Rc Cs Sl Sr */
  170. const SpeakerArrangement k101Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs |
  171. kSpeakerSl | kSpeakerSr;
  172. /** First-Order with Ambisonic Channel Number (ACN) ordering and SN3D normalization */
  173. const SpeakerArrangement kAmbi1stOrderACN = kSpeakerACN0 | kSpeakerACN1 | kSpeakerACN2 | kSpeakerACN3;
  174. /** Second-Order with Ambisonic Channel Number (ACN) ordering and SN3D normalization */
  175. const SpeakerArrangement kAmbi2cdOrderACN = kAmbi1stOrderACN | kSpeakerACN4 | kSpeakerACN5 | kSpeakerACN6 | kSpeakerACN7 | kSpeakerACN8;
  176. /** Third-Order with Ambisonic Channel Number (ACN) ordering and SN3D normalization */
  177. const SpeakerArrangement kAmbi3rdOrderACN = kAmbi2cdOrderACN | kSpeakerACN9 | kSpeakerACN10 | kSpeakerACN11 | kSpeakerACN12 | kSpeakerACN13 | kSpeakerACN14 | kSpeakerACN15;
  178. /*-----------*/
  179. /* 3D formats */
  180. /*-----------*/
  181. /** L R Ls Rs Tfl Tfr Trl Trr */ // 4.0.4
  182. const SpeakerArrangement k80Cube = kSpeakerL | kSpeakerR | kSpeakerLs | kSpeakerRs | kSpeakerTfl| kSpeakerTfr| kSpeakerTrl | kSpeakerTrr;
  183. /** L R C Lfe Ls Rs Cs Tc */ // 6.1.1
  184. const SpeakerArrangement k71CineTopCenter = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs | kSpeakerTc;
  185. /** L R C Lfe Ls Rs Cs Tfc */ // 6.1.1
  186. const SpeakerArrangement k71CineCenterHigh = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs | kSpeakerTfc;
  187. /** L R C Lfe Ls Rs Tfl Tfr */ // 5.1.2
  188. const SpeakerArrangement k71CineFrontHigh = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerTfl | kSpeakerTfr;
  189. const SpeakerArrangement k71MPEG3D = k71CineFrontHigh;
  190. /** L R C Lfe Ls Rs Tsl Tsr */ // 5.1.2
  191. const SpeakerArrangement k71CineSideHigh = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerTsl | kSpeakerTsr;
  192. /** L R Lfe Ls Rs Tfl Tfc Tfr Bfc */ // 4.1.4
  193. const SpeakerArrangement k81MPEG3D = kSpeakerL | kSpeakerR | kSpeakerLfe | kSpeakerLs | kSpeakerRs |
  194. kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerBfc;
  195. /** L R C Ls Rs Tfl Tfr Trl Trr */ // 5.0.4
  196. const SpeakerArrangement k90 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs |
  197. kSpeakerTfl| kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
  198. const SpeakerArrangement k50_4 = k90;
  199. /** L R C Lfe Ls Rs Tfl Tfr Trl Trr */ // 5.1.4
  200. const SpeakerArrangement k91 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs |
  201. kSpeakerTfl| kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
  202. const SpeakerArrangement k51_4 = k91;
  203. /** L R C Ls Rs Sl Sr Tsl Tsr */ // 7.0.2
  204. const SpeakerArrangement k70_2 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs |
  205. kSpeakerSl | kSpeakerSr | kSpeakerTsl | kSpeakerTsr;
  206. /** L R C Lfe Ls Rs Sl Sr Tsl Tsr */ // 7.1.2
  207. const SpeakerArrangement k71_2 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs |
  208. kSpeakerSl | kSpeakerSr | kSpeakerTsl | kSpeakerTsr;
  209. const SpeakerArrangement k91Atmos = k71_2; // 9.1 Dolby Atmos (3D)
  210. /** L R C Ls Rs Sl Sr Tfl Tfr Trl Trr */ // 7.0.4
  211. const SpeakerArrangement k70_4 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr |
  212. kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
  213. /** L R C Lfe Ls Rs Sl Sr Tfl Tfr Trl Trr */ // 7.1.4
  214. const SpeakerArrangement k71_4 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr |
  215. kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
  216. const SpeakerArrangement k111MPEG3D = k71_4;
  217. /** L R C Ls Rs Sl Sr Tfl Tfr Trl Trr Tsl Tsr */ // 7.0.6
  218. const SpeakerArrangement k70_6 = kSpeakerL | kSpeakerR | kSpeakerC |
  219. kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr |
  220. kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerTsl | kSpeakerTsr;
  221. /** L R C Lfe Ls Rs Sl Sr Tfl Tfr Trl Trr Tsl Tsr */ // 7.1.6
  222. const SpeakerArrangement k71_6 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe |
  223. kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr |
  224. kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerTsl | kSpeakerTsr;
  225. /** L R C Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr */ // 9.0.4
  226. const SpeakerArrangement k90_4 = kSpeakerL | kSpeakerR | kSpeakerC |
  227. kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerSl | kSpeakerSr |
  228. kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
  229. /** L R C Lfe Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr */ // 9.1.4
  230. const SpeakerArrangement k91_4 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe |
  231. kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerSl | kSpeakerSr |
  232. kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
  233. /** L R C Lfe Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr Tsl Tsr */ // 9.0.6
  234. const SpeakerArrangement k90_6 = kSpeakerL | kSpeakerR | kSpeakerC |
  235. kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerSl | kSpeakerSr |
  236. kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerTsl | kSpeakerTsr;
  237. /** L R C Lfe Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr Tsl Tsr */ // 9.1.6
  238. const SpeakerArrangement k91_6 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe |
  239. kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerSl | kSpeakerSr |
  240. kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerTsl | kSpeakerTsr;
  241. /** L R C Ls Rs Tc Tfl Tfr Trl Trr */ // 5.0.5
  242. const SpeakerArrangement k100 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs |
  243. kSpeakerTc | kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
  244. /** L R C Lfe Ls Rs Tc Tfl Tfr Trl Trr */ // 5.1.5
  245. const SpeakerArrangement k101 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs |
  246. kSpeakerTc | kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
  247. const SpeakerArrangement k101MPEG3D = k101;
  248. /** L R C Lfe Ls Rs Tfl Tfc Tfr Trl Trr Lfe2 */ // 5.2.5
  249. const SpeakerArrangement k102 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs |
  250. kSpeakerTfl| kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerLfe2;
  251. /** L R C Ls Rs Tc Tfl Tfc Tfr Trl Trr */ // 5.0.6
  252. const SpeakerArrangement k110 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs |
  253. kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
  254. /** L R C Lfe Ls Rs Tc Tfl Tfc Tfr Trl Trr */ // 5.1.6
  255. const SpeakerArrangement k111 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs |
  256. kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
  257. /** L R C Lfe Ls Rs Lc Rc Tfl Tfc Tfr Trl Trr Lfe2 */ // 7.2.5
  258. const SpeakerArrangement k122 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc |
  259. kSpeakerTfl| kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerLfe2;
  260. /** L R C Ls Rs Sl Sr Tc Tfl Tfc Tfr Trl Trr */ // 7.0.6
  261. const SpeakerArrangement k130 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr |
  262. kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
  263. /** L R C Lfe Ls Rs Sl Sr Tc Tfl Tfc Tfr Trl Trr */ // 7.1.6
  264. const SpeakerArrangement k131 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr |
  265. kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
  266. /** L R Ls Rs Sl Sr Tfl Tfr Trl Trr Bfl Bfr Brl Brr */ // 6.0.4.4
  267. const SpeakerArrangement k140 = kSpeakerL | kSpeakerR | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr |
  268. kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr |
  269. kSpeakerBfl | kSpeakerBfr | kSpeakerBrl | kSpeakerBrr;
  270. /** L R C Ls Rs Lc Rc Cs Sl Sr Tc Tfl Tfc Tfr Trl Trc Trr Tsl Tsr Bfl Bfc Bfr */ // 10.0.9.3
  271. const SpeakerArrangement k220 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs | kSpeakerSl | kSpeakerSr |
  272. kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrc | kSpeakerTrr | kSpeakerTsl | kSpeakerTsr |
  273. kSpeakerBfl| kSpeakerBfc | kSpeakerBfr;
  274. /** L R C Lfe Ls Rs Lc Rc Cs Sl Sr Tc Tfl Tfc Tfr Trl Trc Trr Lfe2 Tsl Tsr Bfl Bfc Bfr */ // 10.2.9.3
  275. const SpeakerArrangement k222 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs | kSpeakerSl | kSpeakerSr |
  276. kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrc | kSpeakerTrr | kSpeakerLfe2 | kSpeakerTsl | kSpeakerTsr |
  277. kSpeakerBfl| kSpeakerBfc | kSpeakerBfr;
  278. //------------------------------------------------------------------------
  279. /** Speaker Arrangement String Representation.
  280. \ingroup speakerArrangements */
  281. /*@{*/
  282. const CString kStringEmpty = "";
  283. const CString kStringMono = "Mono";
  284. const CString kStringStereo = "Stereo";
  285. const CString kStringStereoR = "Stereo (Ls Rs)";
  286. const CString kStringStereoC = "Stereo (Lc Rc)";
  287. const CString kStringStereoSide = "Stereo (Sl Sr)";
  288. const CString kStringStereoCLfe = "Stereo (C LFE)";
  289. const CString kStringStereoTF = "Stereo (Tfl Tfr)";
  290. const CString kStringStereoTS = "Stereo (Tsl Tsr)";
  291. const CString kStringStereoTR = "Stereo (Trl Trr)";
  292. const CString kStringStereoBF = "Stereo (Bfl Bfr)";
  293. const CString kStringCineFront = "Cine Front";
  294. const CString kString30Cine = "LRC";
  295. const CString kString30Music = "LRS";
  296. const CString kString31Cine = "LRC+LFE";
  297. const CString kString31Music = "LRS+LFE";
  298. const CString kString40Cine = "LRCS";
  299. const CString kString40Music = "Quadro";
  300. const CString kString41Cine = "LRCS+LFE";
  301. const CString kString41Music = "Quadro+LFE";
  302. const CString kString50 = "5.0";
  303. const CString kString51 = "5.1";
  304. const CString kString60Cine = "6.0 Cine";
  305. const CString kString60Music = "6.0 Music";
  306. const CString kString61Cine = "6.1 Cine";
  307. const CString kString61Music = "6.1 Music";
  308. const CString kString70Cine = "7.0 SDDS";
  309. const CString kString70CineOld = "7.0 Cine (SDDS)";
  310. const CString kString70Music = "7.0";
  311. const CString kString70MusicOld = "7.0 Music (Dolby)";
  312. const CString kString71Cine = "7.1 SDDS";
  313. const CString kString71CineOld = "7.1 Cine (SDDS)";
  314. const CString kString71Music = "7.1";
  315. const CString kString71MusicOld = "7.1 Music (Dolby)";
  316. const CString kString71CineTopCenter = "7.1 Cine Top Center";
  317. const CString kString71CineCenterHigh = "7.1 Cine Center High";
  318. const CString kString71CineFrontHigh = "7.1 Cine Front High";
  319. const CString kString71CineSideHigh = "7.1 Cine Side High";
  320. const CString kString71CineFullRear = "7.1 Cine Full Rear";
  321. const CString kString71Proximity = "7.1 Proximity";
  322. const CString kString80Cine = "8.0 Cine";
  323. const CString kString80Music = "8.0 Music";
  324. const CString kString80Cube = "8.0 Cube";
  325. const CString kString81Cine = "8.1 Cine";
  326. const CString kString81Music = "8.1 Music";
  327. const CString kString90Cine = "9.0 Cine";
  328. const CString kString91Cine = "9.1 Cine";
  329. const CString kString100Cine = "10.0 Cine";
  330. const CString kString101Cine = "10.1 Cine";
  331. const CString kString102 = "10.2 Experimental";
  332. const CString kString122 = "12.2";
  333. const CString kString50_4 = "5.0.4";
  334. const CString kString51_4 = "5.1.4";
  335. const CString kString70_2 = "7.0.2";
  336. const CString kString71_2 = "7.1.2";
  337. const CString kString70_4 = "7.0.4";
  338. const CString kString71_4 = "7.1.4";
  339. const CString kString70_6 = "7.0.6";
  340. const CString kString71_6 = "7.1.6";
  341. const CString kString90_4 = "9.0.4";
  342. const CString kString91_4 = "9.1.4";
  343. const CString kString90_6 = "9.0.6";
  344. const CString kString91_6 = "9.1.6";
  345. const CString kString100 = "10.0 Auro-3D";
  346. const CString kString101 = "10.1 Auro-3D";
  347. const CString kString110 = "11.0 Auro-3D";
  348. const CString kString111 = "11.1 Auro-3D";
  349. const CString kString130 = "13.0 Auro-3D";
  350. const CString kString131 = "13.1 Auro-3D";
  351. const CString kString81MPEG = "8.1 MPEG";
  352. const CString kString140 = "14.0";
  353. const CString kString222 = "22.2";
  354. const CString kString220 = "22.0";
  355. const CString kStringAmbi1stOrder = "1st Order Ambisonics";
  356. const CString kStringAmbi2cdOrder = "2nd Order Ambisonics";
  357. const CString kStringAmbi3rdOrder = "3rd Order Ambisonics";
  358. /*@}*/
  359. //------------------------------------------------------------------------
  360. /** Speaker Arrangement String Representation with Speakers Name.
  361. \ingroup speakerArrangements */
  362. /*@{*/
  363. const CString kStringMonoS = "M";
  364. const CString kStringStereoS = "L R";
  365. const CString kStringStereoRS = "Ls Rs";
  366. const CString kStringStereoCS = "Lc Rc";
  367. const CString kStringStereoSS = "Sl Sr";
  368. const CString kStringStereoCLfeS= "C LFE";
  369. const CString kStringStereoTFS = "Tfl Tfr";
  370. const CString kStringStereoTSS = "Tsl Tsr";
  371. const CString kStringStereoTRS = "Trl Trr";
  372. const CString kStringStereoBFS = "Bfl Bfr";
  373. const CString kStringCineFrontS = "L R C Lc Rc";
  374. const CString kString30CineS = "L R C";
  375. const CString kString30MusicS = "L R S";
  376. const CString kString31CineS = "L R C LFE";
  377. const CString kString31MusicS = "L R LFE S";
  378. const CString kString40CineS = "L R C S";
  379. const CString kString40MusicS = "L R Ls Rs";
  380. const CString kString41CineS = "L R C LFE S";
  381. const CString kString41MusicS = "L R LFE Ls Rs";
  382. const CString kString50S = "L R C Ls Rs";
  383. const CString kString51S = "L R C LFE Ls Rs";
  384. const CString kString60CineS = "L R C Ls Rs Cs";
  385. const CString kString60MusicS = "L R Ls Rs Sl Sr";
  386. const CString kString61CineS = "L R C LFE Ls Rs Cs";
  387. const CString kString61MusicS = "L R LFE Ls Rs Sl Sr";
  388. const CString kString70CineS = "L R C Ls Rs Lc Rc";
  389. const CString kString70MusicS = "L R C Ls Rs Sl Sr";
  390. const CString kString71CineS = "L R C LFE Ls Rs Lc Rc";
  391. const CString kString71MusicS = "L R C LFE Ls Rs Sl Sr";
  392. const CString kString80CineS = "L R C Ls Rs Lc Rc Cs";
  393. const CString kString80MusicS = "L R C Ls Rs Cs Sl Sr";
  394. const CString kString81CineS = "L R C LFE Ls Rs Lc Rc Cs";
  395. const CString kString81MusicS = "L R C LFE Ls Rs Cs Sl Sr";
  396. const CString kString80CubeS = "L R Ls Rs Tfl Tfr Trl Trr";
  397. const CString kString71CineTopCenterS = "L R C LFE Ls Rs Cs Tc";
  398. const CString kString71CineCenterHighS = "L R C LFE Ls Rs Cs Tfc";
  399. const CString kString71CineFrontHighS = "L R C LFE Ls Rs Tfl Tfl";
  400. const CString kString71CineSideHighS = "L R C LFE Ls Rs Tsl Tsl";
  401. const CString kString71CineFullRearS = "L R C LFE Ls Rs Lcs Rcs";
  402. const CString kString71ProximityS = "L R C LFE Ls Rs Pl Pr";
  403. const CString kString90CineS = "L R C Ls Rs Lc Rc Sl Sr";
  404. const CString kString91CineS = "L R C Lfe Ls Rs Lc Rc Sl Sr";
  405. const CString kString100CineS = "L R C Ls Rs Lc Rc Cs Sl Sr";
  406. const CString kString101CineS = "L R C Lfe Ls Rs Lc Rc Cs Sl Sr";
  407. const CString kString50_4S = "L R C Ls Rs Tfl Tfr Trl Trr";
  408. const CString kString51_4S = "L R C LFE Ls Rs Tfl Tfr Trl Trr";
  409. const CString kString70_2S = "L R C Ls Rs Sl Sr Tsl Tsr";
  410. const CString kString71_2S = "L R C LFE Ls Rs Sl Sr Tsl Tsr";
  411. const CString kString70_4S = "L R C Ls Rs Sl Sr Tfl Tfr Trl Trr";
  412. const CString kString71_4S = "L R C LFE Ls Rs Sl Sr Tfl Tfr Trl Trr";
  413. const CString kString70_6S = "L R C Ls Rs Sl Sr Tfl Tfr Trl Trr Tsl Tsr";
  414. const CString kString71_6S = "L R C LFE Ls Rs Sl Sr Tfl Tfr Trl Trr Tsl Tsr";
  415. const CString kString90_4S = "L R C Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr";
  416. const CString kString91_4S = "L R C LFE Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr";
  417. const CString kString90_6S = "L R C Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr Tsl Tsr";
  418. const CString kString91_6S = "L R C LFE Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr Tsl Tsr";
  419. const CString kString100S = "L R C Ls Rs Tc Tfl Tfr Trl Trr";
  420. const CString kString101S = "L R C LFE Ls Rs Tc Tfl Tfr Trl Trr";
  421. const CString kString110S = "L R C Ls Rs Tc Tfl Tfc Tfr Trl Trr";
  422. const CString kString111S = "L R C LFE Ls Rs Tc Tfl Tfc Tfr Trl Trr";
  423. const CString kString130S = "L R C Ls Rs Sl Sr Tc Tfl Tfc Tfr Trl Trr";
  424. const CString kString131S = "L R C LFE Ls Rs Sl Sr Tc Tfl Tfc Tfr Trl Trr";
  425. const CString kString102S = "L R C LFE Ls Rs Tfl Tfc Tfr Trl Trr LFE2";
  426. const CString kString122S = "L R C LFE Ls Rs Lc Rc Tfl Tfc Tfr Trl Trr LFE2";
  427. const CString kString81MPEGS = "L R LFE Ls Rs Tfl Tfc Tfr Bfc";
  428. const CString kString140S = "L R Ls Rs Sl Sr Tfl Tfr Trl Trr Bfl Bfr Brl Brr";
  429. const CString kString222S = "L R C LFE Ls Rs Lc Rc Cs Sl Sr Tc Tfl Tfc Tfr Trl Trc Trr LFE2 Tsl Tsr Bfl Bfc Bfr";
  430. const CString kString220S = "L R C Ls Rs Lc Rc Cs Sl Sr Tc Tfl Tfc Tfr Trl Trc Trr Tsl Tsr Bfl Bfc Bfr";
  431. const CString kStringAmbi1stOrderS = "0 1 2 3";
  432. const CString kStringAmbi2cdOrderS = "0 1 2 3 4 5 6 7 8";
  433. const CString kStringAmbi3rdOrderS = "0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15";
  434. /*@}*/
  435. //------------------------------------------------------------------------
  436. /** Returns number of channels used in speaker arrangement.
  437. \ingroup speakerArrangements */
  438. /*@{*/
  439. inline int32 getChannelCount (SpeakerArrangement arr)
  440. {
  441. int32 count = 0;
  442. while (arr)
  443. {
  444. if (arr & (SpeakerArrangement)1)
  445. ++count;
  446. arr >>= 1;
  447. }
  448. return count;
  449. }
  450. //------------------------------------------------------------------------
  451. /** Returns the index of a given speaker in a speaker arrangement (-1 if speaker is not part of the
  452. * arrangement). */
  453. inline int32 getSpeakerIndex (Speaker speaker, SpeakerArrangement arrangement)
  454. {
  455. // check if speaker is present in arrangement
  456. if ((arrangement & speaker) == 0)
  457. return -1;
  458. int32 result = 0;
  459. Speaker i = 1;
  460. while (i < speaker)
  461. {
  462. if (arrangement & i)
  463. result++;
  464. i <<= 1;
  465. }
  466. return result;
  467. }
  468. //------------------------------------------------------------------------
  469. /** Returns the speaker for a given index in a speaker arrangement (return 0 when out of range). */
  470. inline Speaker getSpeaker (const SpeakerArrangement& arr, int32 index)
  471. {
  472. SpeakerArrangement arrTmp = arr;
  473. int32 index2 = -1;
  474. int32 pos = -1;
  475. while (arrTmp)
  476. {
  477. if (arrTmp & 0x1)
  478. index2++;
  479. pos++;
  480. if (index2 == index)
  481. return (Speaker)1 << pos;
  482. arrTmp = arrTmp >> 1;
  483. }
  484. return 0;
  485. }
  486. //------------------------------------------------------------------------
  487. /** Returns true if arrSubSet is a subset speaker of arr (means each speaker of arrSubSet is
  488. * included in arr). */
  489. inline bool isSubsetOf (const SpeakerArrangement& arrSubSet, const SpeakerArrangement& arr)
  490. {
  491. return (arrSubSet == (arrSubSet & arr));
  492. }
  493. //------------------------------------------------------------------------
  494. /** Returns true if arrangement is a Auro configuration. */
  495. inline bool isAuro (const SpeakerArrangement& arr)
  496. {
  497. if (arr == k90 || arr == k91 || arr == k100 || arr == k101 || arr == k110 || arr == k111 ||
  498. arr == k130 || arr == k131)
  499. {
  500. return true;
  501. }
  502. return false;
  503. }
  504. //------------------------------------------------------------------------
  505. /** Returns true if arrangement contains top (upper layer) speakers */
  506. inline bool hasTopSpeakers (const SpeakerArrangement& arr)
  507. {
  508. if (arr & kSpeakerTc || arr & kSpeakerTfl || arr & kSpeakerTfc || arr & kSpeakerTfr ||
  509. arr & kSpeakerTrl || arr & kSpeakerTrc || arr & kSpeakerTrr || arr & kSpeakerTsl ||
  510. arr & kSpeakerTsr)
  511. return true;
  512. return false;
  513. }
  514. //------------------------------------------------------------------------
  515. /** Returns true if arrangement contains bottom (lower layer) speakers */
  516. inline bool hasBottomSpeakers (const SpeakerArrangement& arr)
  517. {
  518. if (arr & kSpeakerBfl || arr & kSpeakerBfc || arr & kSpeakerBfl || arr & kSpeakerBfc ||
  519. arr & kSpeakerBfr)
  520. return true;
  521. return false;
  522. }
  523. //------------------------------------------------------------------------
  524. /** Returns true if arrangement contains middle layer (at ears level) speakers */
  525. inline bool hasMiddleSpeakers (const SpeakerArrangement& arr)
  526. {
  527. if (arr & kSpeakerL || arr & kSpeakerR || arr & kSpeakerC || arr & kSpeakerLs ||
  528. arr & kSpeakerRs || arr & kSpeakerLc || arr & kSpeakerRc || arr & kSpeakerCs ||
  529. arr & kSpeakerSl || arr & kSpeakerSr || arr & kSpeakerM || arr & kSpeakerPl ||
  530. arr & kSpeakerPr || arr & kSpeakerLcs || arr & kSpeakerRcs)
  531. return true;
  532. return false;
  533. }
  534. //------------------------------------------------------------------------
  535. /** Returns true if arrangement contains LFE speakers */
  536. inline bool hasLfe (const SpeakerArrangement& arr)
  537. {
  538. if (arr & kSpeakerLfe || arr & kSpeakerLfe2)
  539. return true;
  540. return false;
  541. }
  542. //------------------------------------------------------------------------
  543. /** Returns true if arrangement is a 3D configuration ((top or bottom) and middle) */
  544. inline bool is3D (const SpeakerArrangement& arr)
  545. {
  546. bool top = hasTopSpeakers (arr);
  547. bool bottom = hasBottomSpeakers (arr);
  548. bool middle = hasMiddleSpeakers (arr);
  549. if (((top || bottom) && middle) || (top && bottom))
  550. return true;
  551. return false;
  552. }
  553. //------------------------------------------------------------------------
  554. /** Returns true if arrangement is a Auro configuration. */
  555. inline bool isAmbisonics (const SpeakerArrangement& arr)
  556. {
  557. if (arr == kAmbi1stOrderACN || arr == kAmbi2cdOrderACN || arr == kAmbi3rdOrderACN)
  558. {
  559. return true;
  560. }
  561. return false;
  562. }
  563. //------------------------------------------------------------------------
  564. /** Returns the speaker arrangement associated to a string representation.
  565. Returns kEmpty if no associated arrangement is known. */
  566. inline SpeakerArrangement getSpeakerArrangementFromString (CString arrStr)
  567. {
  568. if (!strcmp8 (arrStr, kStringMono))
  569. return kMono;
  570. if (!strcmp8 (arrStr, kStringStereo))
  571. return kStereo;
  572. if (!strcmp8 (arrStr, kStringStereoR))
  573. return kStereoSurround;
  574. if (!strcmp8 (arrStr, kStringStereoC))
  575. return kStereoCenter;
  576. if (!strcmp8 (arrStr, kStringStereoSide))
  577. return kStereoSide;
  578. if (!strcmp8 (arrStr, kStringStereoCLfe))
  579. return kStereoCLfe;
  580. if (!strcmp8 (arrStr, kStringStereoTF))
  581. return kStereoTF;
  582. if (!strcmp8 (arrStr, kStringStereoTS))
  583. return kStereoTS;
  584. if (!strcmp8 (arrStr, kStringStereoTR))
  585. return kStereoTR;
  586. if (!strcmp8 (arrStr, kStringStereoBF))
  587. return kStereoBF;
  588. if (!strcmp8 (arrStr, kStringCineFront))
  589. return kCineFront;
  590. if (!strcmp8 (arrStr, kString30Cine))
  591. return k30Cine;
  592. if (!strcmp8 (arrStr, kString30Music))
  593. return k30Music;
  594. if (!strcmp8 (arrStr, kString31Cine))
  595. return k31Cine;
  596. if (!strcmp8 (arrStr, kString31Music))
  597. return k31Music;
  598. if (!strcmp8 (arrStr, kString40Cine))
  599. return k40Cine;
  600. if (!strcmp8 (arrStr, kString40Music))
  601. return k40Music;
  602. if (!strcmp8 (arrStr, kString41Cine))
  603. return k41Cine;
  604. if (!strcmp8 (arrStr, kString41Music))
  605. return k41Music;
  606. if (!strcmp8 (arrStr, kString50))
  607. return k50;
  608. if (!strcmp8 (arrStr, kString51))
  609. return k51;
  610. if (!strcmp8 (arrStr, kString60Cine))
  611. return k60Cine;
  612. if (!strcmp8 (arrStr, kString60Music))
  613. return k60Music;
  614. if (!strcmp8 (arrStr, kString61Cine))
  615. return k61Cine;
  616. if (!strcmp8 (arrStr, kString61Music))
  617. return k61Music;
  618. if (!strcmp8 (arrStr, kString70Cine) || !strcmp8 (arrStr, kString70CineOld))
  619. return k70Cine;
  620. if (!strcmp8 (arrStr, kString70Music) || !strcmp8 (arrStr, kString70MusicOld))
  621. return k70Music;
  622. if (!strcmp8 (arrStr, kString71Cine) || !strcmp8 (arrStr, kString71CineOld))
  623. return k71Cine;
  624. if (!strcmp8 (arrStr, kString71Music) || !strcmp8 (arrStr, kString71MusicOld))
  625. return k71Music;
  626. if (!strcmp8 (arrStr, kString71Proximity))
  627. return k71Proximity;
  628. if (!strcmp8 (arrStr, kString80Cine))
  629. return k80Cine;
  630. if (!strcmp8 (arrStr, kString80Music))
  631. return k80Music;
  632. if (!strcmp8 (arrStr, kString81Cine))
  633. return k81Cine;
  634. if (!strcmp8 (arrStr, kString81Music))
  635. return k81Music;
  636. if (!strcmp8 (arrStr, kString102))
  637. return k102;
  638. if (!strcmp8 (arrStr, kString122))
  639. return k122;
  640. if (!strcmp8 (arrStr, kString80Cube))
  641. return k80Cube;
  642. if (!strcmp8 (arrStr, kString71CineTopCenter))
  643. return k71CineTopCenter;
  644. if (!strcmp8 (arrStr, kString71CineCenterHigh))
  645. return k71CineCenterHigh;
  646. if (!strcmp8 (arrStr, kString71CineFrontHigh))
  647. return k71CineFrontHigh;
  648. if (!strcmp8 (arrStr, kString71CineSideHigh))
  649. return k71CineSideHigh;
  650. if (!strcmp8 (arrStr, kString71CineFullRear))
  651. return k71CineFullRear;
  652. if (!strcmp8 (arrStr, kString90Cine))
  653. return k90Cine;
  654. if (!strcmp8 (arrStr, kString91Cine))
  655. return k91Cine;
  656. if (!strcmp8 (arrStr, kString100Cine))
  657. return k100Cine;
  658. if (!strcmp8 (arrStr, kString101Cine))
  659. return k101Cine;
  660. if (!strcmp8 (arrStr, kString50_4))
  661. return k50_4;
  662. if (!strcmp8 (arrStr, kString51_4))
  663. return k51_4;
  664. if (!strcmp8 (arrStr, kString81MPEG))
  665. return k81MPEG3D;
  666. if (!strcmp8 (arrStr, kString70_2))
  667. return k70_2;
  668. if (!strcmp8 (arrStr, kString71_2))
  669. return k71_2;
  670. if (!strcmp8 (arrStr, kString70_4))
  671. return k70_4;
  672. if (!strcmp8 (arrStr, kString71_4))
  673. return k71_4;
  674. if (!strcmp8 (arrStr, kString70_6))
  675. return k70_6;
  676. if (!strcmp8 (arrStr, kString71_6))
  677. return k71_6;
  678. if (!strcmp8 (arrStr, kString90_4))
  679. return k90_4;
  680. if (!strcmp8 (arrStr, kString91_4))
  681. return k91_4;
  682. if (!strcmp8 (arrStr, kString90_6))
  683. return k90_6;
  684. if (!strcmp8 (arrStr, kString91_6))
  685. return k91_6;
  686. if (!strcmp8 (arrStr, kString100))
  687. return k100;
  688. if (!strcmp8 (arrStr, kString101))
  689. return k101;
  690. if (!strcmp8 (arrStr, kString110))
  691. return k110;
  692. if (!strcmp8 (arrStr, kString111))
  693. return k111;
  694. if (!strcmp8 (arrStr, kString130))
  695. return k130;
  696. if (!strcmp8 (arrStr, kString131))
  697. return k131;
  698. if (!strcmp8 (arrStr, kString140))
  699. return k140;
  700. if (!strcmp8 (arrStr, kString222))
  701. return k222;
  702. if (!strcmp8 (arrStr, kString220))
  703. return k220;
  704. if (!strcmp8 (arrStr, kStringAmbi1stOrder))
  705. return kAmbi1stOrderACN;
  706. if (!strcmp8 (arrStr, kStringAmbi2cdOrder))
  707. return kAmbi2cdOrderACN;
  708. if (!strcmp8 (arrStr, kStringAmbi3rdOrder))
  709. return kAmbi3rdOrderACN;
  710. return kEmpty;
  711. }
  712. //------------------------------------------------------------------------
  713. /** Returns the string representation of a given speaker arrangement.
  714. Returns kStringEmpty if arr is unknown. */
  715. inline CString getSpeakerArrangementString (SpeakerArrangement arr, bool withSpeakersName)
  716. {
  717. switch (arr)
  718. {
  719. case kMono: return withSpeakersName ? kStringMonoS : kStringMono;
  720. case kStereo: return withSpeakersName ? kStringStereoS : kStringStereo;
  721. case kStereoSurround: return withSpeakersName ? kStringStereoRS : kStringStereoR;
  722. case kStereoCenter: return withSpeakersName ? kStringStereoCS : kStringStereoC;
  723. case kStereoSide: return withSpeakersName ? kStringStereoSS : kStringStereoSide;
  724. case kStereoCLfe: return withSpeakersName ? kStringStereoCLfeS: kStringStereoCLfe;
  725. case kStereoTF: return withSpeakersName ? kStringStereoTFS : kStringStereoTF;
  726. case kStereoTS: return withSpeakersName ? kStringStereoTSS : kStringStereoTS;
  727. case kStereoTR: return withSpeakersName ? kStringStereoTRS : kStringStereoTR;
  728. case kStereoBF: return withSpeakersName ? kStringStereoBFS : kStringStereoBF;
  729. case kCineFront: return withSpeakersName ? kStringCineFrontS : kStringCineFront;
  730. case k30Cine: return withSpeakersName ? kString30CineS : kString30Cine;
  731. case k30Music: return withSpeakersName ? kString30MusicS : kString30Music;
  732. case k31Cine: return withSpeakersName ? kString31CineS : kString31Cine;
  733. case k31Music: return withSpeakersName ? kString31MusicS : kString31Music;
  734. case k40Cine: return withSpeakersName ? kString40CineS : kString40Cine;
  735. case k40Music: return withSpeakersName ? kString40MusicS : kString40Music;
  736. case k41Cine: return withSpeakersName ? kString41CineS : kString41Cine;
  737. case k41Music: return withSpeakersName ? kString41MusicS : kString41Music;
  738. case k50: return withSpeakersName ? kString50S : kString50;
  739. case k51: return withSpeakersName ? kString51S : kString51;
  740. case k60Cine: return withSpeakersName ? kString60CineS : kString60Cine;
  741. case k60Music: return withSpeakersName ? kString60MusicS : kString60Music;
  742. case k61Cine: return withSpeakersName ? kString61CineS : kString61Cine;
  743. case k61Music: return withSpeakersName ? kString61MusicS : kString61Music;
  744. case k70Cine: return withSpeakersName ? kString70CineS : kString70Cine;
  745. case k70Music: return withSpeakersName ? kString70MusicS : kString70Music;
  746. case k71Cine: return withSpeakersName ? kString71CineS : kString71Cine;
  747. case k71Music: return withSpeakersName ? kString71MusicS : kString71Music;
  748. case k71Proximity: return withSpeakersName ? kString71ProximityS : kString71Proximity;
  749. case k80Cine: return withSpeakersName ? kString80CineS : kString80Cine;
  750. case k80Music: return withSpeakersName ? kString80MusicS : kString80Music;
  751. case k81Cine: return withSpeakersName ? kString81CineS : kString81Cine;
  752. case k81Music: return withSpeakersName ? kString81MusicS : kString81Music;
  753. case k81MPEG3D: return withSpeakersName ? kString81MPEGS : kString81MPEG;
  754. case k102: return withSpeakersName ? kString102S : kString102;
  755. case k122: return withSpeakersName ? kString122S : kString122;
  756. case k80Cube: return withSpeakersName ? kString80CubeS : kString80Cube;
  757. case k71CineTopCenter: return withSpeakersName ? kString71CineTopCenterS : kString71CineTopCenter;
  758. case k71CineCenterHigh: return withSpeakersName ? kString71CineCenterHighS : kString71CineCenterHigh;
  759. case k71CineFrontHigh: return withSpeakersName ? kString71CineFrontHighS : kString71CineFrontHigh;
  760. case k71CineSideHigh: return withSpeakersName ? kString71CineSideHighS : kString71CineSideHigh;
  761. case k71CineFullRear: return withSpeakersName ? kString71CineFullRearS : kString71CineFullRear;
  762. case k90Cine: return withSpeakersName ? kString90CineS : kString90Cine;
  763. case k91Cine: return withSpeakersName ? kString91CineS : kString91Cine;
  764. case k100Cine: return withSpeakersName ? kString100CineS : kString100Cine;
  765. case k101Cine: return withSpeakersName ? kString101CineS : kString101Cine;
  766. case k100: return withSpeakersName ? kString100S : kString100;
  767. case k101: return withSpeakersName ? kString101S : kString101;
  768. case k110: return withSpeakersName ? kString110S : kString110;
  769. case k111: return withSpeakersName ? kString111S : kString111;
  770. case k50_4: return withSpeakersName ? kString50_4S : kString50_4;
  771. case k51_4: return withSpeakersName ? kString51_4S : kString51_4;
  772. case k70_2: return withSpeakersName ? kString70_2S : kString70_2;
  773. case k71_2: return withSpeakersName ? kString71_2S : kString71_2;
  774. case k70_4: return withSpeakersName ? kString70_4S : kString70_4;
  775. case k71_4: return withSpeakersName ? kString71_4S : kString71_4;
  776. case k70_6: return withSpeakersName ? kString70_6S : kString70_6;
  777. case k71_6: return withSpeakersName ? kString71_6S : kString71_6;
  778. case k90_4: return withSpeakersName ? kString90_4S : kString90_4;
  779. case k91_4: return withSpeakersName ? kString91_4S : kString91_4;
  780. case k90_6: return withSpeakersName ? kString90_6S : kString90_6;
  781. case k91_6: return withSpeakersName ? kString91_6S : kString91_6;
  782. case k130: return withSpeakersName ? kString130S : kString130;
  783. case k131: return withSpeakersName ? kString131S : kString131;
  784. case k140: return withSpeakersName ? kString140S : kString140;
  785. case k222: return withSpeakersName ? kString222S : kString222;
  786. case k220: return withSpeakersName ? kString220S : kString220;
  787. break;
  788. }
  789. if (arr == kAmbi1stOrderACN)
  790. return withSpeakersName ? kStringAmbi1stOrderS : kStringAmbi1stOrder;
  791. if (arr == kAmbi2cdOrderACN)
  792. return withSpeakersName ? kStringAmbi2cdOrderS : kStringAmbi2cdOrder;
  793. if (arr == kAmbi3rdOrderACN)
  794. return withSpeakersName ? kStringAmbi3rdOrderS : kStringAmbi3rdOrder;
  795. return kStringEmpty;
  796. }
  797. //------------------------------------------------------------------------
  798. /** Returns a CString representation of a given speaker in a given arrangement */
  799. inline CString getSpeakerShortName (const SpeakerArrangement& arr, int32 index)
  800. {
  801. SpeakerArrangement arrTmp = arr;
  802. bool found = false;
  803. int32 index2 = -1;
  804. int32 pos = -1;
  805. while (arrTmp)
  806. {
  807. if (arrTmp & 0x1)
  808. index2++;
  809. pos++;
  810. if (index2 == index)
  811. {
  812. found = true;
  813. break;
  814. }
  815. arrTmp = arrTmp >> 1;
  816. }
  817. if (!found)
  818. return "";
  819. Speaker speaker = (Speaker)1 << pos;
  820. if (speaker == kSpeakerL)
  821. return "L";
  822. if (speaker == kSpeakerR)
  823. return "R";
  824. if (speaker == kSpeakerC)
  825. return "C";
  826. if (speaker == kSpeakerLfe)
  827. return "LFE";
  828. if (speaker == kSpeakerLs)
  829. return "Ls";
  830. if (speaker == kSpeakerRs)
  831. return "Rs";
  832. if (speaker == kSpeakerLc)
  833. return "Lc";
  834. if (speaker == kSpeakerRc)
  835. return "Rc";
  836. if (speaker == kSpeakerCs)
  837. return "S";
  838. if (speaker == kSpeakerSl)
  839. return "Sl";
  840. if (speaker == kSpeakerSr)
  841. return "Sr";
  842. if (speaker == kSpeakerTc)
  843. return "Tc";
  844. if (speaker == kSpeakerTfl)
  845. return "Tfl";
  846. if (speaker == kSpeakerTfc)
  847. return "Tfc";
  848. if (speaker == kSpeakerTfr)
  849. return "Tfr";
  850. if (speaker == kSpeakerTrl)
  851. return "Trl";
  852. if (speaker == kSpeakerTrc)
  853. return "Trc";
  854. if (speaker == kSpeakerTrr)
  855. return "Trr";
  856. if (speaker == kSpeakerLfe2)
  857. return "LFE2";
  858. if (speaker == kSpeakerM)
  859. return "M";
  860. if (speaker == kSpeakerACN0)
  861. return "0";
  862. if (speaker == kSpeakerACN1)
  863. return "1";
  864. if (speaker == kSpeakerACN2)
  865. return "2";
  866. if (speaker == kSpeakerACN3)
  867. return "3";
  868. if (speaker == kSpeakerACN4)
  869. return "4";
  870. if (speaker == kSpeakerACN5)
  871. return "5";
  872. if (speaker == kSpeakerACN6)
  873. return "6";
  874. if (speaker == kSpeakerACN7)
  875. return "7";
  876. if (speaker == kSpeakerACN8)
  877. return "8";
  878. if (speaker == kSpeakerACN9)
  879. return "9";
  880. if (speaker == kSpeakerACN10)
  881. return "10";
  882. if (speaker == kSpeakerACN11)
  883. return "11";
  884. if (speaker == kSpeakerACN12)
  885. return "12";
  886. if (speaker == kSpeakerACN13)
  887. return "13";
  888. if (speaker == kSpeakerACN14)
  889. return "14";
  890. if (speaker == kSpeakerACN15)
  891. return "15";
  892. if (speaker == kSpeakerTsl)
  893. return "Tsl";
  894. if (speaker == kSpeakerTsr)
  895. return "Tsr";
  896. if (speaker == kSpeakerLcs)
  897. return "Lcs";
  898. if (speaker == kSpeakerRcs)
  899. return "Rcs";
  900. if (speaker == kSpeakerBfl)
  901. return "Bfl";
  902. if (speaker == kSpeakerBfc)
  903. return "Bfc";
  904. if (speaker == kSpeakerBfr)
  905. return "Bfr";
  906. if (speaker == kSpeakerPl)
  907. return "Pl";
  908. if (speaker == kSpeakerPr)
  909. return "Pr";
  910. if (speaker == kSpeakerBsl)
  911. return "Bsl";
  912. if (speaker == kSpeakerBsr)
  913. return "Bsr";
  914. if (speaker == kSpeakerBrl)
  915. return "Brl";
  916. if (speaker == kSpeakerBrc)
  917. return "Brc";
  918. if (speaker == kSpeakerBrr)
  919. return "Brr";
  920. return "";
  921. }
  922. /*@}*/
  923. //------------------------------------------------------------------------
  924. } // namespace SpeakerArr
  925. } // namespace Vst
  926. } // namespace Steinberg