/src/audio/plugin_client/juce_PluginHostType.h

https://github.com/baeksanchang/juce · C Header · 188 lines · 137 code · 21 blank · 30 comment · 72 complexity · 43c28b7542e4af214b9d7bbde93a2d0a MD5 · raw file

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-11 by Raw Material Software Ltd.
  5. ------------------------------------------------------------------------------
  6. JUCE can be redistributed and/or modified under the terms of the GNU General
  7. Public License (Version 2), as published by the Free Software Foundation.
  8. A copy of the license is included in the JUCE distribution, or can be found
  9. online at www.gnu.org/licenses.
  10. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  13. ------------------------------------------------------------------------------
  14. To release a closed-source product which uses JUCE, commercial licenses are
  15. available: visit www.rawmaterialsoftware.com/juce for more information.
  16. ==============================================================================
  17. */
  18. //==============================================================================
  19. class PluginHostType
  20. {
  21. public:
  22. //==============================================================================
  23. PluginHostType() : type (getHostType())
  24. {
  25. }
  26. //==============================================================================
  27. enum HostType
  28. {
  29. UnknownHost,
  30. AbletonLive6,
  31. AbletonLive7,
  32. AbletonLive8,
  33. AbletonLiveGeneric,
  34. AdobePremierePro,
  35. AppleLogic,
  36. CakewalkSonar8,
  37. CakewalkSonarGeneric,
  38. DigidesignProTools,
  39. EmagicLogic,
  40. Reaper,
  41. MackieTracktion3,
  42. MackieTracktionGeneric,
  43. SteinbergCubase4,
  44. SteinbergCubase5,
  45. SteinbergCubase5Bridged,
  46. SteinbergCubaseGeneric,
  47. SteinbergWavelab5,
  48. SteinbergWavelab6,
  49. SteinbergWavelab7,
  50. SteinbergWavelabGeneric,
  51. MuseReceptorGeneric,
  52. MagixSamplitude,
  53. FruityLoops
  54. };
  55. const HostType type;
  56. //==============================================================================
  57. bool isAbletonLive() const noexcept
  58. {
  59. return type == AbletonLive6 || type == AbletonLive7 || type == AbletonLive8 || type == AbletonLiveGeneric;
  60. }
  61. bool isCubase() const noexcept
  62. {
  63. return type == SteinbergCubase4 || type == SteinbergCubase5 || type == SteinbergCubase5Bridged || type == SteinbergCubaseGeneric;
  64. }
  65. bool isCubaseBridged() const noexcept
  66. {
  67. return type == SteinbergCubase5Bridged;
  68. }
  69. bool isTracktion() const noexcept
  70. {
  71. return type == MackieTracktion3 || type == MackieTracktionGeneric;
  72. }
  73. bool isSonar() const noexcept
  74. {
  75. return type == CakewalkSonar8 || type == CakewalkSonarGeneric;
  76. }
  77. bool isWavelab() const noexcept
  78. {
  79. return type == SteinbergWavelab5 || type == SteinbergWavelab6 || type == SteinbergWavelab7 || type == SteinbergWavelabGeneric;
  80. }
  81. bool isWavelabLegacy() const noexcept
  82. {
  83. return type == SteinbergWavelab5 || type == SteinbergWavelab6;
  84. }
  85. bool isPremiere() const noexcept
  86. {
  87. return type == AdobePremierePro;
  88. }
  89. bool isLogic() const noexcept
  90. {
  91. return type == AppleLogic || type == EmagicLogic;
  92. }
  93. bool isReceptor() const noexcept
  94. {
  95. return type == MuseReceptorGeneric;
  96. }
  97. bool isSamplitude() const noexcept
  98. {
  99. return type == MagixSamplitude;
  100. }
  101. bool isFruityLoops() const noexcept
  102. {
  103. return type == FruityLoops;
  104. }
  105. //==============================================================================
  106. static String getHostPath()
  107. {
  108. return File::getSpecialLocation (File::hostApplicationPath).getFullPathName();
  109. }
  110. //==============================================================================
  111. private:
  112. static HostType getHostType()
  113. {
  114. const String hostPath (getHostPath());
  115. const String hostFilename (File (hostPath).getFileName());
  116. #if JUCE_MAC
  117. if (hostPath.containsIgnoreCase ("Live 6.")) return AbletonLive6;
  118. if (hostPath.containsIgnoreCase ("Live 7.")) return AbletonLive7;
  119. if (hostPath.containsIgnoreCase ("Live 8.")) return AbletonLive8;
  120. if (hostFilename.containsIgnoreCase ("Live")) return AbletonLiveGeneric;
  121. if (hostFilename.containsIgnoreCase ("Adobe Premiere")) return AdobePremierePro;
  122. if (hostFilename.contains ("Logic")) return AppleLogic;
  123. if (hostFilename.containsIgnoreCase ("Pro Tools")) return DigidesignProTools;
  124. if (hostFilename.containsIgnoreCase ("Cubase 4")) return SteinbergCubase4;
  125. if (hostFilename.containsIgnoreCase ("Cubase 5")) return SteinbergCubase5;
  126. if (hostPath.containsIgnoreCase ("Wavelab 7")) return SteinbergWavelab7;
  127. if (hostFilename.containsIgnoreCase ("Wavelab")) return SteinbergWavelabGeneric;
  128. #elif JUCE_WINDOWS
  129. if (hostFilename.containsIgnoreCase ("Live 6.")) return AbletonLive6;
  130. if (hostFilename.containsIgnoreCase ("Live 7.")) return AbletonLive7;
  131. if (hostFilename.containsIgnoreCase ("Live 8.")) return AbletonLive8;
  132. if (hostFilename.containsIgnoreCase ("Live ")) return AbletonLiveGeneric;
  133. if (hostFilename.containsIgnoreCase ("Adobe Premiere")) return AdobePremierePro;
  134. if (hostFilename.containsIgnoreCase ("ProTools")) return DigidesignProTools;
  135. if (hostPath.containsIgnoreCase ("SONAR 8")) return CakewalkSonar8;
  136. if (hostFilename.containsIgnoreCase ("SONAR")) return CakewalkSonarGeneric;
  137. if (hostFilename.containsIgnoreCase ("Logic")) return EmagicLogic;
  138. if (hostPath.containsIgnoreCase ("Tracktion 3")) return MackieTracktion3;
  139. if (hostFilename.containsIgnoreCase ("Tracktion")) return MackieTracktionGeneric;
  140. if (hostFilename.containsIgnoreCase ("reaper")) return Reaper;
  141. if (hostFilename.containsIgnoreCase ("Cubase4")) return SteinbergCubase4;
  142. if (hostFilename.containsIgnoreCase ("Cubase5")) return SteinbergCubase5;
  143. if (hostFilename.containsIgnoreCase ("Cubase")) return SteinbergCubaseGeneric;
  144. if (hostFilename.containsIgnoreCase ("VSTBridgeApp")) return SteinbergCubase5Bridged;
  145. if (hostPath.containsIgnoreCase ("Wavelab 5")) return SteinbergWavelab5;
  146. if (hostPath.containsIgnoreCase ("Wavelab 6")) return SteinbergWavelab6;
  147. if (hostPath.containsIgnoreCase ("Wavelab 7")) return SteinbergWavelab7;
  148. if (hostFilename.containsIgnoreCase ("Wavelab")) return SteinbergWavelabGeneric;
  149. if (hostFilename.containsIgnoreCase ("rm-host")) return MuseReceptorGeneric;
  150. if (hostFilename.startsWithIgnoreCase ("Sam")) return MagixSamplitude;
  151. if (hostFilename.startsWith ("FL")) return FruityLoops;
  152. #elif JUCE_LINUX
  153. jassertfalse // not yet done!
  154. #else
  155. #error
  156. #endif
  157. return UnknownHost;
  158. }
  159. JUCE_DECLARE_NON_COPYABLE (PluginHostType);
  160. };