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.

579 lines
17KB

  1. /*
  2. * Carla Backend utils
  3. * Copyright (C) 2011-2013 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation; either version 2 of
  8. * the License, or any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * For a full copy of the GNU General Public License see the doc/GPL.txt file.
  16. */
  17. #ifndef CARLA_BACKEND_UTILS_HPP_INCLUDED
  18. #define CARLA_BACKEND_UTILS_HPP_INCLUDED
  19. #include "CarlaBackend.hpp"
  20. #include "CarlaString.hpp"
  21. CARLA_BACKEND_START_NAMESPACE
  22. // -----------------------------------------------------------------------
  23. static inline
  24. const char* PluginOption2Str(const unsigned int option)
  25. {
  26. switch (option)
  27. {
  28. case PLUGIN_OPTION_FIXED_BUFFERS:
  29. return "PLUGIN_OPTION_FIXED_BUFFERS";
  30. case PLUGIN_OPTION_FORCE_STEREO:
  31. return "PLUGIN_OPTION_FORCE_STEREO";
  32. case PLUGIN_OPTION_MAP_PROGRAM_CHANGES:
  33. return "PLUGIN_OPTION_MAP_PROGRAM_CHANGES";
  34. case PLUGIN_OPTION_USE_CHUNKS:
  35. return "PLUGIN_OPTION_USE_CHUNKS";
  36. case PLUGIN_OPTION_SEND_CONTROL_CHANGES:
  37. return "PLUGIN_OPTION_SEND_CONTROL_CHANGES";
  38. case PLUGIN_OPTION_SEND_CHANNEL_PRESSURE:
  39. return "PLUGIN_OPTION_SEND_CHANNEL_PRESSURE";
  40. case PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH:
  41. return "PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH";
  42. case PLUGIN_OPTION_SEND_PITCHBEND:
  43. return "PLUGIN_OPTION_SEND_PITCHBEND";
  44. case PLUGIN_OPTION_SEND_ALL_SOUND_OFF:
  45. return "PLUGIN_OPTION_SEND_ALL_SOUND_OFF";
  46. }
  47. carla_stderr("CarlaBackend::PluginOption2Str(%i) - invalid type", option);
  48. return nullptr;
  49. }
  50. static inline
  51. const char* BinaryType2Str(const BinaryType type)
  52. {
  53. switch (type)
  54. {
  55. case BINARY_NONE:
  56. return "BINARY_NONE";
  57. case BINARY_POSIX32:
  58. return "BINARY_POSIX32";
  59. case BINARY_POSIX64:
  60. return "BINARY_POSIX64";
  61. case BINARY_WIN32:
  62. return "BINARY_WIN32";
  63. case BINARY_WIN64:
  64. return "BINARY_WIN64";
  65. case BINARY_OTHER:
  66. return "BINARY_OTHER";
  67. }
  68. carla_stderr("CarlaBackend::BinaryType2Str(%i) - invalid type", type);
  69. return nullptr;
  70. }
  71. static inline
  72. const char* PluginType2Str(const PluginType type)
  73. {
  74. switch (type)
  75. {
  76. case PLUGIN_NONE:
  77. return "PLUGIN_NONE";
  78. case PLUGIN_INTERNAL:
  79. return "PLUGIN_INTERNAL";
  80. case PLUGIN_LADSPA:
  81. return "PLUGIN_LADSPA";
  82. case PLUGIN_DSSI:
  83. return "PLUGIN_DSSI";
  84. case PLUGIN_LV2:
  85. return "PLUGIN_LV2";
  86. case PLUGIN_VST:
  87. return "PLUGIN_VST";
  88. case PLUGIN_AU:
  89. return "PLUGIN_AU";
  90. case PLUGIN_CSOUND:
  91. return "PLUGIN_CSOUND";
  92. case PLUGIN_GIG:
  93. return "PLUGIN_GIG";
  94. case PLUGIN_SF2:
  95. return "PLUGIN_SF2";
  96. case PLUGIN_SFZ:
  97. return "PLUGIN_SFZ";
  98. }
  99. carla_stderr("CarlaBackend::PluginType2Str(%i) - invalid type", type);
  100. return nullptr;
  101. }
  102. static inline
  103. const char* PluginCategory2Str(const PluginCategory category)
  104. {
  105. switch (category)
  106. {
  107. case PLUGIN_CATEGORY_NONE:
  108. return "PLUGIN_CATEGORY_NONE";
  109. case PLUGIN_CATEGORY_SYNTH:
  110. return "PLUGIN_CATEGORY_SYNTH";
  111. case PLUGIN_CATEGORY_DELAY:
  112. return "PLUGIN_CATEGORY_DELAY";
  113. case PLUGIN_CATEGORY_EQ:
  114. return "PLUGIN_CATEGORY_EQ";
  115. case PLUGIN_CATEGORY_FILTER:
  116. return "PLUGIN_CATEGORY_FILTER";
  117. case PLUGIN_CATEGORY_DYNAMICS:
  118. return "PLUGIN_CATEGORY_DYNAMICS";
  119. case PLUGIN_CATEGORY_MODULATOR:
  120. return "PLUGIN_CATEGORY_MODULATOR";
  121. case PLUGIN_CATEGORY_UTILITY:
  122. return "PLUGIN_CATEGORY_UTILITY";
  123. case PLUGIN_CATEGORY_OTHER:
  124. return "PLUGIN_CATEGORY_OTHER";
  125. }
  126. carla_stderr("CarlaBackend::PluginCategory2Str(%i) - invalid category", category);
  127. return nullptr;
  128. }
  129. static inline
  130. const char* ParameterType2Str(const ParameterType type)
  131. {
  132. switch (type)
  133. {
  134. case PARAMETER_UNKNOWN:
  135. return "PARAMETER_UNKNOWN";
  136. case PARAMETER_INPUT:
  137. return "PARAMETER_INPUT";
  138. case PARAMETER_OUTPUT:
  139. return "PARAMETER_OUTPUT";
  140. case PARAMETER_LATENCY:
  141. return "PARAMETER_LATENCY";
  142. case PARAMETER_SAMPLE_RATE:
  143. return "PARAMETER_SAMPLE_RATE";
  144. #ifdef WANT_LV2
  145. case PARAMETER_LV2_FREEWHEEL:
  146. return "PARAMETER_LV2_FREEWHEEL";
  147. case PARAMETER_LV2_TIME:
  148. return "PARAMETER_LV2_TIME";
  149. #endif
  150. }
  151. carla_stderr("CarlaBackend::ParameterType2Str(%i) - invalid type", type);
  152. return nullptr;
  153. }
  154. static inline
  155. const char* InternalParametersIndex2Str(const InternalParametersIndex index)
  156. {
  157. switch (index)
  158. {
  159. case PARAMETER_NULL:
  160. return "PARAMETER_NULL";
  161. case PARAMETER_ACTIVE:
  162. return "PARAMETER_ACTIVE";
  163. case PARAMETER_DRYWET:
  164. return "PARAMETER_DRYWET";
  165. case PARAMETER_VOLUME:
  166. return "PARAMETER_VOLUME";
  167. case PARAMETER_BALANCE_LEFT:
  168. return "PARAMETER_BALANCE_LEFT";
  169. case PARAMETER_BALANCE_RIGHT:
  170. return "PARAMETER_BALANCE_RIGHT";
  171. case PARAMETER_PANNING:
  172. return "PARAMETER_PANNING";
  173. case PARAMETER_CTRL_CHANNEL:
  174. return "PARAMETER_CTRL_CHANNEL";
  175. case PARAMETER_MAX:
  176. return "PARAMETER_MAX";
  177. }
  178. carla_stderr("CarlaBackend::InternalParametersIndex2Str(%i) - invalid index", index);
  179. return nullptr;
  180. }
  181. static inline
  182. const char* OptionsType2Str(const OptionsType option)
  183. {
  184. switch (option)
  185. {
  186. case OPTION_PROCESS_NAME:
  187. return "OPTION_PROCESS_NAME";
  188. case OPTION_PROCESS_MODE:
  189. return "OPTION_PROCESS_MODE";
  190. case OPTION_TRANSPORT_MODE:
  191. return "OPTION_TRANSPORT_MODE";
  192. case OPTION_FORCE_STEREO:
  193. return "OPTION_FORCE_STEREO";
  194. case OPTION_PREFER_PLUGIN_BRIDGES:
  195. return "OPTION_PREFER_PLUGIN_BRIDGES";
  196. case OPTION_PREFER_UI_BRIDGES:
  197. return "OPTION_PREFER_UI_BRIDGES";
  198. case OPTION_UIS_ALWAYS_ON_TOP:
  199. return "OPTION_UIS_ALWAYS_ON_TOP";
  200. case OPTION_MAX_PARAMETERS:
  201. return "OPTION_MAX_PARAMETERS";
  202. case OPTION_UI_BRIDGES_TIMEOUT:
  203. return "OPTION_UI_BRIDGES_TIMEOUT";
  204. case OPTION_AUDIO_NUM_PERIODS:
  205. return "OPTION_AUDIO_NUM_PERIODS";
  206. case OPTION_AUDIO_BUFFER_SIZE:
  207. return "OPTION_AUDIO_BUFFER_SIZE";
  208. case OPTION_AUDIO_SAMPLE_RATE:
  209. return "OPTION_AUDIO_SAMPLE_RATE";
  210. case OPTION_AUDIO_DEVICE:
  211. return "OPTION_AUDIO_DEVICE";
  212. case OPTION_PATH_RESOURCES:
  213. return "OPTION_PATH_RESOURCES";
  214. #ifndef BUILD_BRIDGE
  215. case OPTION_PATH_BRIDGE_NATIVE:
  216. return "OPTION_PATH_BRIDGE_NATIVE";
  217. case OPTION_PATH_BRIDGE_POSIX32:
  218. return "OPTION_PATH_BRIDGE_POSIX32";
  219. case OPTION_PATH_BRIDGE_POSIX64:
  220. return "OPTION_PATH_BRIDGE_POSIX64";
  221. case OPTION_PATH_BRIDGE_WIN32:
  222. return "OPTION_PATH_BRIDGE_WIN32";
  223. case OPTION_PATH_BRIDGE_WIN64:
  224. return "OPTION_PATH_BRIDGE_WIN64";
  225. #endif
  226. #ifdef WANT_LV2
  227. case OPTION_PATH_BRIDGE_LV2_EXTERNAL:
  228. return "OPTION_PATH_BRIDGE_LV2_EXTERNAL";
  229. case OPTION_PATH_BRIDGE_LV2_GTK2:
  230. return "OPTION_PATH_BRIDGE_LV2_GTK2";
  231. case OPTION_PATH_BRIDGE_LV2_GTK3:
  232. return "OPTION_PATH_BRIDGE_LV2_GTK3";
  233. case OPTION_PATH_BRIDGE_LV2_QT4:
  234. return "OPTION_PATH_BRIDGE_LV2_QT4";
  235. case OPTION_PATH_BRIDGE_LV2_QT5:
  236. return "OPTION_PATH_BRIDGE_LV2_QT5";
  237. case OPTION_PATH_BRIDGE_LV2_COCOA:
  238. return "OPTION_PATH_BRIDGE_LV2_COCOA";
  239. case OPTION_PATH_BRIDGE_LV2_WINDOWS:
  240. return "OPTION_PATH_BRIDGE_LV2_WINDOWS";
  241. case OPTION_PATH_BRIDGE_LV2_X11:
  242. return "OPTION_PATH_BRIDGE_LV2_X11";
  243. #endif
  244. #ifdef WANT_VST
  245. case OPTION_PATH_BRIDGE_VST_MAC:
  246. return "OPTION_PATH_BRIDGE_VST_MAC";
  247. case OPTION_PATH_BRIDGE_VST_HWND:
  248. return "OPTION_PATH_BRIDGE_VST_HWND";
  249. case OPTION_PATH_BRIDGE_VST_X11:
  250. return "OPTION_PATH_BRIDGE_VST_X11";
  251. #endif
  252. }
  253. carla_stderr("CarlaBackend::OptionsType2Str(%i) - invalid option", option);
  254. return nullptr;
  255. }
  256. static inline
  257. const char* CallbackType2Str(const CallbackType type)
  258. {
  259. switch (type)
  260. {
  261. case CALLBACK_DEBUG:
  262. return "CALLBACK_DEBUG";
  263. case CALLBACK_PLUGIN_ADDED:
  264. return "CALLBACK_PLUGIN_ADDED";
  265. case CALLBACK_PLUGIN_REMOVED:
  266. return "CALLBACK_PLUGIN_REMOVED";
  267. case CALLBACK_PLUGIN_RENAMED:
  268. return "CALLBACK_PLUGIN_RENAMED";
  269. case CALLBACK_PARAMETER_VALUE_CHANGED:
  270. return "CALLBACK_PARAMETER_VALUE_CHANGED";
  271. case CALLBACK_PARAMETER_DEFAULT_CHANGED:
  272. return "CALLBACK_PARAMETER_DEFAULT_CHANGED";
  273. case CALLBACK_PARAMETER_MIDI_CHANNEL_CHANGED:
  274. return "CALLBACK_PARAMETER_MIDI_CHANNEL_CHANGED";
  275. case CALLBACK_PARAMETER_MIDI_CC_CHANGED:
  276. return "CALLBACK_PARAMETER_MIDI_CC_CHANGED";
  277. case CALLBACK_PROGRAM_CHANGED:
  278. return "CALLBACK_PROGRAM_CHANGED";
  279. case CALLBACK_MIDI_PROGRAM_CHANGED:
  280. return "CALLBACK_MIDI_PROGRAM_CHANGED";
  281. case CALLBACK_NOTE_ON:
  282. return "CALLBACK_NOTE_ON";
  283. case CALLBACK_NOTE_OFF:
  284. return "CALLBACK_NOTE_OFF";
  285. case CALLBACK_SHOW_GUI:
  286. return "CALLBACK_SHOW_GUI";
  287. case CALLBACK_UPDATE:
  288. return "CALLBACK_UPDATE";
  289. case CALLBACK_PATCHBAY_CLIENT_ADDED:
  290. return "CALLBACK_PATCHBAY_CLIENT_ADDED";
  291. case CALLBACK_PATCHBAY_CLIENT_REMOVED:
  292. return "CALLBACK_PATCHBAY_CLIENT_REMOVED";
  293. case CALLBACK_PATCHBAY_CLIENT_RENAMED:
  294. return "CALLBACK_PATCHBAY_CLIENT_RENAMED";
  295. case CALLBACK_PATCHBAY_PORT_ADDED:
  296. return "CALLBACK_PATCHBAY_PORT_ADDED";
  297. case CALLBACK_PATCHBAY_PORT_REMOVED:
  298. return "CALLBACK_PATCHBAY_PORT_REMOVED";
  299. case CALLBACK_PATCHBAY_PORT_RENAMED:
  300. return "CALLBACK_PATCHBAY_PORT_RENAMED";
  301. case CALLBACK_PATCHBAY_CONNECTION_ADDED:
  302. return "CALLBACK_PATCHBAY_CONNECTION_ADDED";
  303. case CALLBACK_PATCHBAY_CONNECTION_REMOVED:
  304. return "CALLBACK_PATCHBAY_CONNECTION_REMOVED";
  305. case CALLBACK_PATCHBAY_ICON_CHANGED:
  306. return "CALLBACK_PATCHBAY_ICON_CHANGED";
  307. case CALLBACK_RELOAD_INFO:
  308. return "CALLBACK_RELOAD_INFO";
  309. case CALLBACK_RELOAD_PARAMETERS:
  310. return "CALLBACK_RELOAD_PARAMETERS";
  311. case CALLBACK_RELOAD_PROGRAMS:
  312. return "CALLBACK_RELOAD_PROGRAMS";
  313. case CALLBACK_RELOAD_ALL:
  314. return "CALLBACK_RELOAD_ALL";
  315. case CALLBACK_BUFFER_SIZE_CHANGED:
  316. return "CALLBACK_BUFFER_SIZE_CHANGED";
  317. case CALLBACK_SAMPLE_RATE_CHANGED:
  318. return "CALLBACK_SAMPLE_RATE_CHANGED";
  319. case CALLBACK_PROCESS_MODE_CHANGED:
  320. return "CALLBACK_PROCESS_MODE_CHANGED";
  321. case CALLBACK_ENGINE_STARTED:
  322. return "CALLBACK_ENGINE_STARTED";
  323. case CALLBACK_ENGINE_STOPPED:
  324. return "CALLBACK_ENGINE_STOPPED";
  325. case CALLBACK_NSM_ANNOUNCE:
  326. return "CALLBACK_NSM_ANNOUNCE";
  327. case CALLBACK_NSM_OPEN:
  328. return "CALLBACK_NSM_OPEN";
  329. case CALLBACK_NSM_SAVE:
  330. return "CALLBACK_NSM_SAVE";
  331. case CALLBACK_ERROR:
  332. return "CALLBACK_ERROR";
  333. case CALLBACK_INFO:
  334. return "CALLBACK_INFO";
  335. case CALLBACK_QUIT:
  336. return "CALLBACK_QUIT";
  337. }
  338. carla_stderr("CarlaBackend::CallbackType2Str(%i) - invalid type", type);
  339. return nullptr;
  340. }
  341. static inline
  342. const char* ProcessMode2Str(const ProcessMode mode)
  343. {
  344. switch (mode)
  345. {
  346. case PROCESS_MODE_SINGLE_CLIENT:
  347. return "PROCESS_MODE_SINGLE_CLIENT";
  348. case PROCESS_MODE_MULTIPLE_CLIENTS:
  349. return "PROCESS_MODE_MULTIPLE_CLIENTS";
  350. case PROCESS_MODE_CONTINUOUS_RACK:
  351. return "PROCESS_MODE_CONTINUOUS_RACK";
  352. case PROCESS_MODE_PATCHBAY:
  353. return "PROCESS_MODE_PATCHBAY";
  354. case PROCESS_MODE_BRIDGE:
  355. return "PROCESS_MODE_BRIDGE";
  356. }
  357. carla_stderr("CarlaBackend::ProcessMode2Str(%i) - invalid mode", mode);
  358. return nullptr;
  359. }
  360. static inline
  361. const char* TransportMode2Str(const TransportMode mode)
  362. {
  363. switch (mode)
  364. {
  365. case TRANSPORT_MODE_INTERNAL:
  366. return "TRANSPORT_MODE_INTERNAL";
  367. case TRANSPORT_MODE_JACK:
  368. return "TRANSPORT_MODE_JACK";
  369. case TRANSPORT_MODE_PLUGIN:
  370. return "TRANSPORT_MODE_PLUGIN";
  371. case TRANSPORT_MODE_BRIDGE:
  372. return "TRANSPORT_MODE_BRIDGE";
  373. }
  374. carla_stderr("CarlaBackend::TransportMode2Str(%i) - invalid mode", mode);
  375. return nullptr;
  376. }
  377. // -----------------------------------------------------------------------
  378. static inline
  379. uintptr_t getAddressFromPointer(void* ptr)
  380. {
  381. CARLA_SAFE_ASSERT_RETURN(ptr != nullptr, 0);
  382. uintptr_t* const addr((uintptr_t*)&ptr);
  383. return *addr;
  384. }
  385. template<typename T>
  386. static inline
  387. T* getPointerFromAddress(uintptr_t& addr)
  388. {
  389. CARLA_SAFE_ASSERT_RETURN(addr != 0, nullptr);
  390. T** const ptr((T**)&addr);
  391. return *ptr;
  392. }
  393. // -----------------------------------------------------------------------
  394. static inline
  395. const char* getPluginTypeAsString(const PluginType type)
  396. {
  397. carla_debug("CarlaBackend::getPluginTypeAsString(%s)", PluginType2Str(type));
  398. switch (type)
  399. {
  400. case PLUGIN_NONE:
  401. return "NONE";
  402. case PLUGIN_INTERNAL:
  403. return "INTERNAL";
  404. case PLUGIN_LADSPA:
  405. return "LADSPA";
  406. case PLUGIN_DSSI:
  407. return "DSSI";
  408. case PLUGIN_LV2:
  409. return "LV2";
  410. case PLUGIN_VST:
  411. return "VST";
  412. case PLUGIN_AU:
  413. return "AU";
  414. case PLUGIN_CSOUND:
  415. return "CSOUND";
  416. case PLUGIN_GIG:
  417. return "GIG";
  418. case PLUGIN_SF2:
  419. return "SF2";
  420. case PLUGIN_SFZ:
  421. return "SFZ";
  422. }
  423. carla_stderr("CarlaBackend::getPluginTypeAsString(%i) - invalid type", type);
  424. return "NONE";
  425. }
  426. static inline
  427. PluginType getPluginTypeFromString(const char* const ctype)
  428. {
  429. CARLA_SAFE_ASSERT_RETURN(ctype != nullptr && ctype[0] != '\0', PLUGIN_NONE);
  430. carla_debug("CarlaBackend::getPluginTypeFromString(\"%s\")", ctype);
  431. CarlaString stype(ctype);
  432. stype.toLower();
  433. if (stype.isEmpty() || stype == "none")
  434. return PLUGIN_NONE;
  435. if (stype == "internal")
  436. return PLUGIN_INTERNAL;
  437. if (stype == "ladspa")
  438. return PLUGIN_LADSPA;
  439. if (stype == "dssi")
  440. return PLUGIN_DSSI;
  441. if (stype == "lv2")
  442. return PLUGIN_LV2;
  443. if (stype == "vst")
  444. return PLUGIN_VST;
  445. if (stype == "au")
  446. return PLUGIN_AU;
  447. if (stype == "csound")
  448. return PLUGIN_CSOUND;
  449. if (stype == "gig")
  450. return PLUGIN_GIG;
  451. if (stype == "sf2")
  452. return PLUGIN_SF2;
  453. if (stype == "sfz")
  454. return PLUGIN_SFZ;
  455. carla_stderr("CarlaBackend::getPluginTypeFromString(\"%s\") - invalid string type", ctype);
  456. return PLUGIN_NONE;
  457. }
  458. // -----------------------------------------------------------------------
  459. static inline
  460. PluginCategory getPluginCategoryFromName(const char* const name)
  461. {
  462. CARLA_SAFE_ASSERT_RETURN(name != nullptr && name[0] != '\0', PLUGIN_CATEGORY_NONE);
  463. carla_debug("CarlaBackend::getPluginCategoryFromName(\"%s\")", name);
  464. CarlaString sname(name);
  465. if (sname.isEmpty())
  466. return PLUGIN_CATEGORY_NONE;
  467. sname.toLower();
  468. // generic tags first
  469. if (sname.contains("delay"))
  470. return PLUGIN_CATEGORY_DELAY;
  471. if (sname.contains("reverb"))
  472. return PLUGIN_CATEGORY_DELAY;
  473. // filter
  474. if (sname.contains("filter"))
  475. return PLUGIN_CATEGORY_FILTER;
  476. // dynamics
  477. if (sname.contains("dynamics"))
  478. return PLUGIN_CATEGORY_DYNAMICS;
  479. if (sname.contains("amplifier"))
  480. return PLUGIN_CATEGORY_DYNAMICS;
  481. if (sname.contains("compressor"))
  482. return PLUGIN_CATEGORY_DYNAMICS;
  483. if (sname.contains("enhancer"))
  484. return PLUGIN_CATEGORY_DYNAMICS;
  485. if (sname.contains("exciter"))
  486. return PLUGIN_CATEGORY_DYNAMICS;
  487. if (sname.contains("gate"))
  488. return PLUGIN_CATEGORY_DYNAMICS;
  489. if (sname.contains("limiter"))
  490. return PLUGIN_CATEGORY_DYNAMICS;
  491. // modulator
  492. if (sname.contains("modulator"))
  493. return PLUGIN_CATEGORY_MODULATOR;
  494. if (sname.contains("chorus"))
  495. return PLUGIN_CATEGORY_MODULATOR;
  496. if (sname.contains("flanger"))
  497. return PLUGIN_CATEGORY_MODULATOR;
  498. if (sname.contains("phaser"))
  499. return PLUGIN_CATEGORY_MODULATOR;
  500. if (sname.contains("saturator"))
  501. return PLUGIN_CATEGORY_MODULATOR;
  502. // utility
  503. if (sname.contains("utility"))
  504. return PLUGIN_CATEGORY_UTILITY;
  505. if (sname.contains("analyzer"))
  506. return PLUGIN_CATEGORY_UTILITY;
  507. if (sname.contains("converter"))
  508. return PLUGIN_CATEGORY_UTILITY;
  509. if (sname.contains("deesser"))
  510. return PLUGIN_CATEGORY_UTILITY;
  511. if (sname.contains("mixer"))
  512. return PLUGIN_CATEGORY_UTILITY;
  513. // common tags
  514. if (sname.contains("verb"))
  515. return PLUGIN_CATEGORY_DELAY;
  516. if (sname.contains("eq"))
  517. return PLUGIN_CATEGORY_EQ;
  518. if (sname.contains("tool"))
  519. return PLUGIN_CATEGORY_UTILITY;
  520. return PLUGIN_CATEGORY_NONE;
  521. }
  522. // -----------------------------------------------------------------------
  523. CARLA_BACKEND_END_NAMESPACE
  524. #endif // CARLA_BACKEND_UTILS_HPP_INCLUDED