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.

540 lines
17KB

  1. /*
  2. * Carla Backend utils
  3. * Copyright (C) 2011-2014 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.h"
  20. #include "CarlaHost.h"
  21. #include "CarlaString.hpp"
  22. CARLA_BACKEND_START_NAMESPACE
  23. // -----------------------------------------------------------------------
  24. static inline
  25. const char* PluginOption2Str(const unsigned int option) noexcept
  26. {
  27. switch (option)
  28. {
  29. case PLUGIN_OPTION_FIXED_BUFFERS:
  30. return "PLUGIN_OPTION_FIXED_BUFFERS";
  31. case PLUGIN_OPTION_FORCE_STEREO:
  32. return "PLUGIN_OPTION_FORCE_STEREO";
  33. case PLUGIN_OPTION_MAP_PROGRAM_CHANGES:
  34. return "PLUGIN_OPTION_MAP_PROGRAM_CHANGES";
  35. case PLUGIN_OPTION_USE_CHUNKS:
  36. return "PLUGIN_OPTION_USE_CHUNKS";
  37. case PLUGIN_OPTION_SEND_CONTROL_CHANGES:
  38. return "PLUGIN_OPTION_SEND_CONTROL_CHANGES";
  39. case PLUGIN_OPTION_SEND_CHANNEL_PRESSURE:
  40. return "PLUGIN_OPTION_SEND_CHANNEL_PRESSURE";
  41. case PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH:
  42. return "PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH";
  43. case PLUGIN_OPTION_SEND_PITCHBEND:
  44. return "PLUGIN_OPTION_SEND_PITCHBEND";
  45. case PLUGIN_OPTION_SEND_ALL_SOUND_OFF:
  46. return "PLUGIN_OPTION_SEND_ALL_SOUND_OFF";
  47. }
  48. carla_stderr("CarlaBackend::PluginOption2Str(%i) - invalid option", option);
  49. return nullptr;
  50. }
  51. // -----------------------------------------------------------------------
  52. static inline
  53. const char* BinaryType2Str(const BinaryType type) noexcept
  54. {
  55. switch (type)
  56. {
  57. case BINARY_NONE:
  58. return "BINARY_NONE";
  59. case BINARY_POSIX32:
  60. return "BINARY_POSIX32";
  61. case BINARY_POSIX64:
  62. return "BINARY_POSIX64";
  63. case BINARY_WIN32:
  64. return "BINARY_WIN32";
  65. case BINARY_WIN64:
  66. return "BINARY_WIN64";
  67. case BINARY_OTHER:
  68. return "BINARY_OTHER";
  69. }
  70. carla_stderr("CarlaBackend::BinaryType2Str(%i) - invalid type", type);
  71. return nullptr;
  72. }
  73. static inline
  74. const char* PluginType2Str(const PluginType type) noexcept
  75. {
  76. switch (type)
  77. {
  78. case PLUGIN_NONE:
  79. return "PLUGIN_NONE";
  80. case PLUGIN_INTERNAL:
  81. return "PLUGIN_INTERNAL";
  82. case PLUGIN_LADSPA:
  83. return "PLUGIN_LADSPA";
  84. case PLUGIN_DSSI:
  85. return "PLUGIN_DSSI";
  86. case PLUGIN_LV2:
  87. return "PLUGIN_LV2";
  88. case PLUGIN_VST:
  89. return "PLUGIN_VST";
  90. case PLUGIN_AU:
  91. return "PLUGIN_AU";
  92. case PLUGIN_FILE_CSD:
  93. return "PLUGIN_FILE_CSD";
  94. case PLUGIN_FILE_GIG:
  95. return "PLUGIN_FILE_GIG";
  96. case PLUGIN_FILE_SF2:
  97. return "PLUGIN_FILE_SF2";
  98. case PLUGIN_FILE_SFZ:
  99. return "PLUGIN_FILE_SFZ";
  100. }
  101. carla_stderr("CarlaBackend::PluginType2Str(%i) - invalid type", type);
  102. return nullptr;
  103. }
  104. static inline
  105. const char* PluginCategory2Str(const PluginCategory category) noexcept
  106. {
  107. switch (category)
  108. {
  109. case PLUGIN_CATEGORY_NONE:
  110. return "PLUGIN_CATEGORY_NONE";
  111. case PLUGIN_CATEGORY_SYNTH:
  112. return "PLUGIN_CATEGORY_SYNTH";
  113. case PLUGIN_CATEGORY_DELAY:
  114. return "PLUGIN_CATEGORY_DELAY";
  115. case PLUGIN_CATEGORY_EQ:
  116. return "PLUGIN_CATEGORY_EQ";
  117. case PLUGIN_CATEGORY_FILTER:
  118. return "PLUGIN_CATEGORY_FILTER";
  119. case PLUGIN_CATEGORY_DISTORTION:
  120. return "PLUGIN_CATEGORY_DISTORTION";
  121. case PLUGIN_CATEGORY_DYNAMICS:
  122. return "PLUGIN_CATEGORY_DYNAMICS";
  123. case PLUGIN_CATEGORY_MODULATOR:
  124. return "PLUGIN_CATEGORY_MODULATOR";
  125. case PLUGIN_CATEGORY_UTILITY:
  126. return "PLUGIN_CATEGORY_UTILITY";
  127. case PLUGIN_CATEGORY_OTHER:
  128. return "PLUGIN_CATEGORY_OTHER";
  129. }
  130. carla_stderr("CarlaBackend::PluginCategory2Str(%i) - invalid category", category);
  131. return nullptr;
  132. }
  133. static inline
  134. const char* ParameterType2Str(const ParameterType type) noexcept
  135. {
  136. switch (type)
  137. {
  138. case PARAMETER_UNKNOWN:
  139. return "PARAMETER_UNKNOWN";
  140. case PARAMETER_INPUT:
  141. return "PARAMETER_INPUT";
  142. case PARAMETER_OUTPUT:
  143. return "PARAMETER_OUTPUT";
  144. case PARAMETER_SPECIAL:
  145. return "PARAMETER_SPECIAL";
  146. }
  147. carla_stderr("CarlaBackend::ParameterType2Str(%i) - invalid type", type);
  148. return nullptr;
  149. }
  150. static inline
  151. const char* InternalParameterIndex2Str(const InternalParameterIndex index) noexcept
  152. {
  153. switch (index)
  154. {
  155. case PARAMETER_NULL:
  156. return "PARAMETER_NULL";
  157. case PARAMETER_ACTIVE:
  158. return "PARAMETER_ACTIVE";
  159. case PARAMETER_DRYWET:
  160. return "PARAMETER_DRYWET";
  161. case PARAMETER_VOLUME:
  162. return "PARAMETER_VOLUME";
  163. case PARAMETER_BALANCE_LEFT:
  164. return "PARAMETER_BALANCE_LEFT";
  165. case PARAMETER_BALANCE_RIGHT:
  166. return "PARAMETER_BALANCE_RIGHT";
  167. case PARAMETER_PANNING:
  168. return "PARAMETER_PANNING";
  169. case PARAMETER_CTRL_CHANNEL:
  170. return "PARAMETER_CTRL_CHANNEL";
  171. case PARAMETER_MAX:
  172. return "PARAMETER_MAX";
  173. }
  174. carla_stderr("CarlaBackend::InternalParameterIndex2Str(%i) - invalid index", index);
  175. return nullptr;
  176. }
  177. static inline
  178. const char* EngineCallbackOpcode2Str(const EngineCallbackOpcode opcode) noexcept
  179. {
  180. switch (opcode)
  181. {
  182. case ENGINE_CALLBACK_DEBUG:
  183. return "ENGINE_CALLBACK_DEBUG";
  184. case ENGINE_CALLBACK_PLUGIN_ADDED:
  185. return "ENGINE_CALLBACK_PLUGIN_ADDED";
  186. case ENGINE_CALLBACK_PLUGIN_REMOVED:
  187. return "ENGINE_CALLBACK_PLUGIN_REMOVED";
  188. case ENGINE_CALLBACK_PLUGIN_RENAMED:
  189. return "ENGINE_CALLBACK_PLUGIN_RENAMED";
  190. case ENGINE_CALLBACK_PLUGIN_UNAVAILABLE:
  191. return "ENGINE_CALLBACK_PLUGIN_UNAVAILABLE";
  192. case ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED:
  193. return "ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED";
  194. case ENGINE_CALLBACK_PARAMETER_DEFAULT_CHANGED:
  195. return "ENGINE_CALLBACK_PARAMETER_DEFAULT_CHANGED";
  196. case ENGINE_CALLBACK_PARAMETER_MIDI_CHANNEL_CHANGED:
  197. return "ENGINE_CALLBACK_PARAMETER_MIDI_CHANNEL_CHANGED";
  198. case ENGINE_CALLBACK_PARAMETER_MIDI_CC_CHANGED:
  199. return "ENGINE_CALLBACK_PARAMETER_MIDI_CC_CHANGED";
  200. case ENGINE_CALLBACK_PROGRAM_CHANGED:
  201. return "ENGINE_CALLBACK_PROGRAM_CHANGED";
  202. case ENGINE_CALLBACK_MIDI_PROGRAM_CHANGED:
  203. return "ENGINE_CALLBACK_MIDI_PROGRAM_CHANGED";
  204. case ENGINE_CALLBACK_UI_STATE_CHANGED:
  205. return "ENGINE_CALLBACK_UI_STATE_CHANGED";
  206. case ENGINE_CALLBACK_NOTE_ON:
  207. return "ENGINE_CALLBACK_NOTE_ON";
  208. case ENGINE_CALLBACK_NOTE_OFF:
  209. return "ENGINE_CALLBACK_NOTE_OFF";
  210. case ENGINE_CALLBACK_UPDATE:
  211. return "ENGINE_CALLBACK_UPDATE";
  212. case ENGINE_CALLBACK_RELOAD_INFO:
  213. return "ENGINE_CALLBACK_RELOAD_INFO";
  214. case ENGINE_CALLBACK_RELOAD_PARAMETERS:
  215. return "ENGINE_CALLBACK_RELOAD_PARAMETERS";
  216. case ENGINE_CALLBACK_RELOAD_PROGRAMS:
  217. return "ENGINE_CALLBACK_RELOAD_PROGRAMS";
  218. case ENGINE_CALLBACK_RELOAD_ALL:
  219. return "ENGINE_CALLBACK_RELOAD_ALL";
  220. case ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED:
  221. return "ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED";
  222. case ENGINE_CALLBACK_PATCHBAY_CLIENT_REMOVED:
  223. return "ENGINE_CALLBACK_PATCHBAY_CLIENT_REMOVED";
  224. case ENGINE_CALLBACK_PATCHBAY_CLIENT_RENAMED:
  225. return "ENGINE_CALLBACK_PATCHBAY_CLIENT_RENAMED";
  226. case ENGINE_CALLBACK_PATCHBAY_CLIENT_DATA_CHANGED:
  227. return "ENGINE_CALLBACK_PATCHBAY_CLIENT_DATA_CHANGED";
  228. case ENGINE_CALLBACK_PATCHBAY_PORT_ADDED:
  229. return "ENGINE_CALLBACK_PATCHBAY_PORT_ADDED";
  230. case ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED:
  231. return "ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED";
  232. case ENGINE_CALLBACK_PATCHBAY_PORT_RENAMED:
  233. return "ENGINE_CALLBACK_PATCHBAY_PORT_RENAMED";
  234. case ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED:
  235. return "ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED";
  236. case ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED:
  237. return "ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED";
  238. case ENGINE_CALLBACK_ENGINE_STARTED:
  239. return "ENGINE_CALLBACK_ENGINE_STARTED";
  240. case ENGINE_CALLBACK_ENGINE_STOPPED:
  241. return "ENGINE_CALLBACK_ENGINE_STOPPED";
  242. case ENGINE_CALLBACK_PROCESS_MODE_CHANGED:
  243. return "ENGINE_CALLBACK_PROCESS_MODE_CHANGED";
  244. case ENGINE_CALLBACK_TRANSPORT_MODE_CHANGED:
  245. return "ENGINE_CALLBACK_TRANSPORT_MODE_CHANGED";
  246. case ENGINE_CALLBACK_BUFFER_SIZE_CHANGED:
  247. return "ENGINE_CALLBACK_BUFFER_SIZE_CHANGED";
  248. case ENGINE_CALLBACK_SAMPLE_RATE_CHANGED:
  249. return "ENGINE_CALLBACK_SAMPLE_RATE_CHANGED";
  250. case ENGINE_CALLBACK_INFO:
  251. return "ENGINE_CALLBACK_INFO";
  252. case ENGINE_CALLBACK_ERROR:
  253. return "ENGINE_CALLBACK_ERROR";
  254. case ENGINE_CALLBACK_QUIT:
  255. return "ENGINE_CALLBACK_QUIT";
  256. }
  257. carla_stderr("CarlaBackend::EngineCallbackOpcode2Str(%i) - invalid opcode", opcode);
  258. return nullptr;
  259. }
  260. static inline
  261. const char* EngineOption2Str(const EngineOption option) noexcept
  262. {
  263. switch (option)
  264. {
  265. case ENGINE_OPTION_DEBUG:
  266. return "ENGINE_OPTION_DEBUG";
  267. case ENGINE_OPTION_PROCESS_MODE:
  268. return "ENGINE_OPTION_PROCESS_MODE";
  269. case ENGINE_OPTION_TRANSPORT_MODE:
  270. return "ENGINE_OPTION_TRANSPORT_MODE";
  271. case ENGINE_OPTION_FORCE_STEREO:
  272. return "ENGINE_OPTION_FORCE_STEREO";
  273. case ENGINE_OPTION_PREFER_PLUGIN_BRIDGES:
  274. return "ENGINE_OPTION_PREFER_PLUGIN_BRIDGES";
  275. case ENGINE_OPTION_PREFER_UI_BRIDGES:
  276. return "ENGINE_OPTION_PREFER_UI_BRIDGES";
  277. case ENGINE_OPTION_UIS_ALWAYS_ON_TOP:
  278. return "ENGINE_OPTION_UIS_ALWAYS_ON_TOP";
  279. case ENGINE_OPTION_MAX_PARAMETERS:
  280. return "ENGINE_OPTION_MAX_PARAMETERS";
  281. case ENGINE_OPTION_UI_BRIDGES_TIMEOUT:
  282. return "ENGINE_OPTION_UI_BRIDGES_TIMEOUT";
  283. case ENGINE_OPTION_AUDIO_NUM_PERIODS:
  284. return "ENGINE_OPTION_AUDIO_NUM_PERIODS";
  285. case ENGINE_OPTION_AUDIO_BUFFER_SIZE:
  286. return "ENGINE_OPTION_AUDIO_BUFFER_SIZE";
  287. case ENGINE_OPTION_AUDIO_SAMPLE_RATE:
  288. return "ENGINE_OPTION_AUDIO_SAMPLE_RATE";
  289. case ENGINE_OPTION_AUDIO_DEVICE:
  290. return "ENGINE_OPTION_AUDIO_DEVICE";
  291. case ENGINE_OPTION_PATH_BINARIES:
  292. return "ENGINE_OPTION_PATH_BINARIES";
  293. case ENGINE_OPTION_PATH_RESOURCES:
  294. return "ENGINE_OPTION_PATH_RESOURCES";
  295. }
  296. carla_stderr("CarlaBackend::EngineOption2Str(%i) - invalid option", option);
  297. return nullptr;
  298. }
  299. static inline
  300. const char* EngineProcessMode2Str(const EngineProcessMode mode) noexcept
  301. {
  302. switch (mode)
  303. {
  304. case ENGINE_PROCESS_MODE_SINGLE_CLIENT:
  305. return "ENGINE_PROCESS_MODE_SINGLE_CLIENT";
  306. case ENGINE_PROCESS_MODE_MULTIPLE_CLIENTS:
  307. return "ENGINE_PROCESS_MODE_MULTIPLE_CLIENTS";
  308. case ENGINE_PROCESS_MODE_CONTINUOUS_RACK:
  309. return "ENGINE_PROCESS_MODE_CONTINUOUS_RACK";
  310. case ENGINE_PROCESS_MODE_PATCHBAY:
  311. return "ENGINE_PROCESS_MODE_PATCHBAY";
  312. case ENGINE_PROCESS_MODE_BRIDGE:
  313. return "ENGINE_PROCESS_MODE_BRIDGE";
  314. }
  315. carla_stderr("CarlaBackend::EngineProcessMode2Str(%i) - invalid mode", mode);
  316. return nullptr;
  317. }
  318. static inline
  319. const char* EngineTransportMode2Str(const EngineTransportMode mode) noexcept
  320. {
  321. switch (mode)
  322. {
  323. case ENGINE_TRANSPORT_MODE_INTERNAL:
  324. return "ENGINE_TRANSPORT_MODE_INTERNAL";
  325. case ENGINE_TRANSPORT_MODE_JACK:
  326. return "ENGINE_TRANSPORT_MODE_JACK";
  327. case ENGINE_TRANSPORT_MODE_PLUGIN:
  328. return "ENGINE_TRANSPORT_MODE_PLUGIN";
  329. case ENGINE_TRANSPORT_MODE_BRIDGE:
  330. return "ENGINE_TRANSPORT_MODE_BRIDGE";
  331. }
  332. carla_stderr("CarlaBackend::EngineTransportMode2Str(%i) - invalid mode", mode);
  333. return nullptr;
  334. }
  335. // -----------------------------------------------------------------------
  336. static inline
  337. const char* FileCallbackOpcode2Str(const FileCallbackOpcode opcode) noexcept
  338. {
  339. switch (opcode)
  340. {
  341. case FILE_CALLBACK_DEBUG:
  342. return "FILE_CALLBACK_DEBUG";
  343. case FILE_CALLBACK_OPEN:
  344. return "FILE_CALLBACK_OPEN";
  345. case FILE_CALLBACK_SAVE:
  346. return "FILE_CALLBACK_SAVE";
  347. }
  348. carla_stderr("CarlaBackend::FileCallbackOpcode2Str(%i) - invalid opcode", opcode);
  349. return nullptr;
  350. }
  351. // -----------------------------------------------------------------------
  352. static inline
  353. const char* getPluginTypeAsString(const PluginType type) noexcept
  354. {
  355. carla_debug("CarlaBackend::getPluginTypeAsString(%i:%s)", type, PluginType2Str(type));
  356. switch (type)
  357. {
  358. case PLUGIN_NONE:
  359. return "NONE";
  360. case PLUGIN_INTERNAL:
  361. return "INTERNAL";
  362. case PLUGIN_LADSPA:
  363. return "LADSPA";
  364. case PLUGIN_DSSI:
  365. return "DSSI";
  366. case PLUGIN_LV2:
  367. return "LV2";
  368. case PLUGIN_VST:
  369. return "VST";
  370. case PLUGIN_AU:
  371. return "AU";
  372. case PLUGIN_FILE_CSD:
  373. return "CSD";
  374. case PLUGIN_FILE_GIG:
  375. return "GIG";
  376. case PLUGIN_FILE_SF2:
  377. return "SF2";
  378. case PLUGIN_FILE_SFZ:
  379. return "SFZ";
  380. }
  381. carla_stderr("CarlaBackend::getPluginTypeAsString(%i) - invalid type", type);
  382. return "NONE";
  383. }
  384. static inline
  385. PluginType getPluginTypeFromString(const char* const ctype)
  386. {
  387. CARLA_SAFE_ASSERT_RETURN(ctype != nullptr && ctype[0] != '\0', PLUGIN_NONE);
  388. carla_debug("CarlaBackend::getPluginTypeFromString(\"%s\")", ctype);
  389. CarlaString stype(ctype);
  390. stype.toLower();
  391. if (stype.isEmpty() || stype == "none")
  392. return PLUGIN_NONE;
  393. if (stype == "internal")
  394. return PLUGIN_INTERNAL;
  395. if (stype == "ladspa")
  396. return PLUGIN_LADSPA;
  397. if (stype == "dssi")
  398. return PLUGIN_DSSI;
  399. if (stype == "lv2")
  400. return PLUGIN_LV2;
  401. if (stype == "vst")
  402. return PLUGIN_VST;
  403. if (stype == "au")
  404. return PLUGIN_AU;
  405. if (stype == "csd")
  406. return PLUGIN_FILE_CSD;
  407. if (stype == "gig")
  408. return PLUGIN_FILE_GIG;
  409. if (stype == "sf2")
  410. return PLUGIN_FILE_SF2;
  411. if (stype == "sfz")
  412. return PLUGIN_FILE_SFZ;
  413. carla_stderr("CarlaBackend::getPluginTypeFromString(\"%s\") - invalid string type", ctype);
  414. return PLUGIN_NONE;
  415. }
  416. // -----------------------------------------------------------------------
  417. static inline
  418. PluginCategory getPluginCategoryFromName(const char* const name)
  419. {
  420. CARLA_SAFE_ASSERT_RETURN(name != nullptr && name[0] != '\0', PLUGIN_CATEGORY_NONE);
  421. carla_debug("CarlaBackend::getPluginCategoryFromName(\"%s\")", name);
  422. CarlaString sname(name);
  423. if (sname.isEmpty())
  424. return PLUGIN_CATEGORY_NONE;
  425. sname.toLower();
  426. // generic tags first
  427. if (sname.contains("delay"))
  428. return PLUGIN_CATEGORY_DELAY;
  429. if (sname.contains("reverb"))
  430. return PLUGIN_CATEGORY_DELAY;
  431. // filter
  432. if (sname.contains("filter"))
  433. return PLUGIN_CATEGORY_FILTER;
  434. // distortion
  435. if (sname.contains("distortion"))
  436. return PLUGIN_CATEGORY_DISTORTION;
  437. // dynamics
  438. if (sname.contains("dynamics"))
  439. return PLUGIN_CATEGORY_DYNAMICS;
  440. if (sname.contains("amplifier"))
  441. return PLUGIN_CATEGORY_DYNAMICS;
  442. if (sname.contains("compressor"))
  443. return PLUGIN_CATEGORY_DYNAMICS;
  444. if (sname.contains("enhancer"))
  445. return PLUGIN_CATEGORY_DYNAMICS;
  446. if (sname.contains("exciter"))
  447. return PLUGIN_CATEGORY_DYNAMICS;
  448. if (sname.contains("gate"))
  449. return PLUGIN_CATEGORY_DYNAMICS;
  450. if (sname.contains("limiter"))
  451. return PLUGIN_CATEGORY_DYNAMICS;
  452. // modulator
  453. if (sname.contains("modulator"))
  454. return PLUGIN_CATEGORY_MODULATOR;
  455. if (sname.contains("chorus"))
  456. return PLUGIN_CATEGORY_MODULATOR;
  457. if (sname.contains("flanger"))
  458. return PLUGIN_CATEGORY_MODULATOR;
  459. if (sname.contains("phaser"))
  460. return PLUGIN_CATEGORY_MODULATOR;
  461. if (sname.contains("saturator"))
  462. return PLUGIN_CATEGORY_MODULATOR;
  463. // utility
  464. if (sname.contains("utility"))
  465. return PLUGIN_CATEGORY_UTILITY;
  466. if (sname.contains("analyzer"))
  467. return PLUGIN_CATEGORY_UTILITY;
  468. if (sname.contains("converter"))
  469. return PLUGIN_CATEGORY_UTILITY;
  470. if (sname.contains("deesser"))
  471. return PLUGIN_CATEGORY_UTILITY;
  472. if (sname.contains("mixer"))
  473. return PLUGIN_CATEGORY_UTILITY;
  474. // common tags
  475. if (sname.contains("verb"))
  476. return PLUGIN_CATEGORY_DELAY;
  477. if (sname.contains("eq"))
  478. return PLUGIN_CATEGORY_EQ;
  479. if (sname.contains("tool"))
  480. return PLUGIN_CATEGORY_UTILITY;
  481. return PLUGIN_CATEGORY_NONE;
  482. }
  483. // -----------------------------------------------------------------------
  484. CARLA_BACKEND_END_NAMESPACE
  485. #endif // CARLA_BACKEND_UTILS_HPP_INCLUDED