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.

703 lines
38KB

  1. /*
  2. * Carla Plugin Host
  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. #include "CarlaEngineInternal.hpp"
  18. #include "CarlaMIDI.h"
  19. CARLA_BACKEND_START_NAMESPACE
  20. // -----------------------------------------------------------------------
  21. #ifdef BUILD_BRIDGE
  22. void CarlaEngine::oscSend_bridge_plugin_info1(const PluginCategory category, const uint hints, const int64_t uniqueId) const noexcept
  23. {
  24. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  25. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  26. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  27. carla_debug("CarlaEngine::oscSend_bridge_plugin_info1(%i:%s, %X, " P_INT64 ")", category, PluginCategory2Str(category), hints, uniqueId);
  28. char targetPath[std::strlen(pData->oscData->path)+21];
  29. std::strcpy(targetPath, pData->oscData->path);
  30. std::strcat(targetPath, "/bridge_plugin_info1");
  31. try_lo_send(pData->oscData->target, targetPath, "iih", static_cast<int32_t>(category), static_cast<int32_t>(hints), uniqueId);
  32. }
  33. void CarlaEngine::oscSend_bridge_plugin_info2(const char* const realName, const char* const label, const char* const maker, const char* const copyright) const noexcept
  34. {
  35. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  36. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  37. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  38. CARLA_SAFE_ASSERT_RETURN(realName != nullptr && realName[0] != '\0',);
  39. CARLA_SAFE_ASSERT_RETURN(label != nullptr && label[0] != '\0',);
  40. CARLA_SAFE_ASSERT_RETURN(maker != nullptr,);
  41. CARLA_SAFE_ASSERT_RETURN(copyright != nullptr,);
  42. carla_debug("CarlaEngine::oscSend_bridge_plugin_info2(\"%s\", \"%s\", \"%s\", \"%s\")", realName, label, maker, copyright);
  43. char targetPath[std::strlen(pData->oscData->path)+21];
  44. std::strcpy(targetPath, pData->oscData->path);
  45. std::strcat(targetPath, "/bridge_plugin_info2");
  46. try_lo_send(pData->oscData->target, targetPath, "ssss", realName, label, maker, copyright);
  47. }
  48. void CarlaEngine::oscSend_bridge_audio_count(const uint32_t ins, const uint32_t outs) const noexcept
  49. {
  50. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  51. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  52. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  53. carla_debug("CarlaEngine::oscSend_bridge_audio_count(%i, %i)", ins, outs);
  54. char targetPath[std::strlen(pData->oscData->path)+20];
  55. std::strcpy(targetPath, pData->oscData->path);
  56. std::strcat(targetPath, "/bridge_audio_count");
  57. try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(ins), static_cast<int32_t>(outs));
  58. }
  59. void CarlaEngine::oscSend_bridge_midi_count(const uint32_t ins, const uint32_t outs) const noexcept
  60. {
  61. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  62. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  63. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  64. carla_debug("CarlaEngine::oscSend_bridge_midi_count(%i, %i)", ins, outs);
  65. char targetPath[std::strlen(pData->oscData->path)+19];
  66. std::strcpy(targetPath, pData->oscData->path);
  67. std::strcat(targetPath, "/bridge_midi_count");
  68. try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(ins), static_cast<int32_t>(outs));
  69. }
  70. void CarlaEngine::oscSend_bridge_parameter_count(const uint32_t ins, const uint32_t outs) const noexcept
  71. {
  72. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  73. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  74. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  75. carla_debug("CarlaEngine::oscSend_bridge_parameter_count(%i, %i)", ins, outs);
  76. char targetPath[std::strlen(pData->oscData->path)+24];
  77. std::strcpy(targetPath, pData->oscData->path);
  78. std::strcat(targetPath, "/bridge_parameter_count");
  79. try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(ins), static_cast<int32_t>(outs));
  80. }
  81. void CarlaEngine::oscSend_bridge_program_count(const uint32_t count) const noexcept
  82. {
  83. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  84. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  85. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  86. carla_debug("CarlaEngine::oscSend_bridge_program_count(%i)", count);
  87. char targetPath[std::strlen(pData->oscData->path)+23];
  88. std::strcpy(targetPath, pData->oscData->path);
  89. std::strcat(targetPath, "/bridge_program_count");
  90. try_lo_send(pData->oscData->target, targetPath, "i", static_cast<int32_t>(count));
  91. }
  92. void CarlaEngine::oscSend_bridge_midi_program_count(const uint32_t count) const noexcept
  93. {
  94. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  95. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  96. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  97. carla_debug("CarlaEngine::oscSend_bridge_midi_program_count(%i)", count);
  98. char targetPath[std::strlen(pData->oscData->path)+27];
  99. std::strcpy(targetPath, pData->oscData->path);
  100. std::strcat(targetPath, "/bridge_midi_program_count");
  101. try_lo_send(pData->oscData->target, targetPath, "i", static_cast<int32_t>(count));
  102. }
  103. void CarlaEngine::oscSend_bridge_parameter_data(const uint32_t index, const int32_t rindex, const ParameterType type, const uint hints, const char* const name, const char* const unit) const noexcept
  104. {
  105. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  106. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  107. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  108. CARLA_SAFE_ASSERT_RETURN(name != nullptr,);
  109. CARLA_SAFE_ASSERT_RETURN(unit != nullptr,);
  110. carla_debug("CarlaEngine::oscSend_bridge_parameter_data(%i, %i, %i:%s, %X, \"%s\", \"%s\")", index, rindex, type, ParameterType2Str(type), hints, name, unit);
  111. char targetPath[std::strlen(pData->oscData->path)+24];
  112. std::strcpy(targetPath, pData->oscData->path);
  113. std::strcat(targetPath, "/bridge_parameter_data");
  114. try_lo_send(pData->oscData->target, targetPath, "iiiiss", static_cast<int32_t>(index), static_cast<int32_t>(rindex), static_cast<int32_t>(type), static_cast<int32_t>(hints), name, unit);
  115. }
  116. void CarlaEngine::oscSend_bridge_parameter_ranges1(const uint32_t index, const float def, const float min, const float max) const noexcept
  117. {
  118. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  119. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  120. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  121. carla_debug("CarlaEngine::oscSend_bridge_parameter_ranges(%i, %f, %f, %f)", index, def, min, max);
  122. char targetPath[std::strlen(pData->oscData->path)+26];
  123. std::strcpy(targetPath, pData->oscData->path);
  124. std::strcat(targetPath, "/bridge_parameter_ranges1");
  125. try_lo_send(pData->oscData->target, targetPath, "ifff", static_cast<int32_t>(index), def, min, max);
  126. }
  127. void CarlaEngine::oscSend_bridge_parameter_ranges2(const uint32_t index, const float step, const float stepSmall, const float stepLarge) const noexcept
  128. {
  129. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  130. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  131. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  132. carla_debug("CarlaEngine::oscSend_bridge_parameter_ranges(%i, %f, %f, %f)", index, step, stepSmall, stepLarge);
  133. char targetPath[std::strlen(pData->oscData->path)+26];
  134. std::strcpy(targetPath, pData->oscData->path);
  135. std::strcat(targetPath, "/bridge_parameter_ranges2");
  136. try_lo_send(pData->oscData->target, targetPath, "ifff", static_cast<int32_t>(index), step, stepSmall, stepLarge);
  137. }
  138. void CarlaEngine::oscSend_bridge_parameter_midi_cc(const uint32_t index, const int16_t cc) const noexcept
  139. {
  140. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  141. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  142. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  143. carla_debug("CarlaEngine::oscSend_bridge_parameter_midi_cc(%i, %i)", index, cc);
  144. char targetPath[std::strlen(pData->oscData->path)+26];
  145. std::strcpy(targetPath, pData->oscData->path);
  146. std::strcat(targetPath, "/bridge_parameter_midi_cc");
  147. try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(index), static_cast<int32_t>(cc));
  148. }
  149. void CarlaEngine::oscSend_bridge_parameter_midi_channel(const uint32_t index, const uint8_t channel) const noexcept
  150. {
  151. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  152. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  153. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  154. carla_debug("CarlaEngine::oscSend_bridge_parameter_midi_channel(%i, %i)", index, channel);
  155. char targetPath[std::strlen(pData->oscData->path)+31];
  156. std::strcpy(targetPath, pData->oscData->path);
  157. std::strcat(targetPath, "/bridge_parameter_midi_channel");
  158. try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(index), static_cast<int32_t>(channel));
  159. }
  160. void CarlaEngine::oscSend_bridge_parameter_value(const uint32_t index, const float value) const noexcept
  161. {
  162. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  163. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  164. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  165. carla_debug("CarlaEngine::oscSend_bridge_parameter_value(%i, %f)", index, value);
  166. char targetPath[std::strlen(pData->oscData->path)+24];
  167. std::strcpy(targetPath, pData->oscData->path);
  168. std::strcat(targetPath, "/bridge_parameter_value");
  169. try_lo_send(pData->oscData->target, targetPath, "if", static_cast<int32_t>(index), value);
  170. }
  171. void CarlaEngine::oscSend_bridge_default_value(const uint32_t index, const float value) const noexcept
  172. {
  173. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  174. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  175. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  176. carla_debug("CarlaEngine::oscSend_bridge_default_value(%i, %f)", index, value);
  177. char targetPath[std::strlen(pData->oscData->path)+22];
  178. std::strcpy(targetPath, pData->oscData->path);
  179. std::strcat(targetPath, "/bridge_default_value");
  180. try_lo_send(pData->oscData->target, targetPath, "if", static_cast<int32_t>(index), value);
  181. }
  182. void CarlaEngine::oscSend_bridge_current_program(const int32_t index) const noexcept
  183. {
  184. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  185. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  186. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  187. carla_debug("CarlaEngine::oscSend_bridge_current_program(%i)", index);
  188. char targetPath[std::strlen(pData->oscData->path)+24];
  189. std::strcpy(targetPath, pData->oscData->path);
  190. std::strcat(targetPath, "/bridge_current_program");
  191. try_lo_send(pData->oscData->target, targetPath, "i", index);
  192. }
  193. void CarlaEngine::oscSend_bridge_current_midi_program(const int32_t index) const noexcept
  194. {
  195. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  196. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  197. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  198. carla_debug("CarlaEngine::oscSend_bridge_current_midi_program(%i)", index);
  199. char targetPath[std::strlen(pData->oscData->path)+30];
  200. std::strcpy(targetPath, pData->oscData->path);
  201. std::strcat(targetPath, "/bridge_current_midi_program");
  202. try_lo_send(pData->oscData->target, targetPath, "i", index);
  203. }
  204. void CarlaEngine::oscSend_bridge_program_name(const uint32_t index, const char* const name) const noexcept
  205. {
  206. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  207. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  208. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  209. CARLA_SAFE_ASSERT_RETURN(name != nullptr,);
  210. carla_debug("CarlaEngine::oscSend_bridge_program_name(%i, \"%s\")", index, name);
  211. char targetPath[std::strlen(pData->oscData->path)+21];
  212. std::strcpy(targetPath, pData->oscData->path);
  213. std::strcat(targetPath, "/bridge_program_name");
  214. try_lo_send(pData->oscData->target, targetPath, "is", static_cast<int32_t>(index), name);
  215. }
  216. void CarlaEngine::oscSend_bridge_midi_program_data(const uint32_t index, const uint32_t bank, const uint32_t program, const char* const name) const noexcept
  217. {
  218. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  219. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  220. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  221. CARLA_SAFE_ASSERT_RETURN(name != nullptr,);
  222. carla_debug("CarlaEngine::oscSend_bridge_midi_program_data(%i, %i, %i, \"%s\")", index, bank, program, name);
  223. char targetPath[std::strlen(pData->oscData->path)+26];
  224. std::strcpy(targetPath, pData->oscData->path);
  225. std::strcat(targetPath, "/bridge_midi_program_data");
  226. try_lo_send(pData->oscData->target, targetPath, "iiis", static_cast<int32_t>(index), static_cast<int32_t>(bank), static_cast<int32_t>(program), name);
  227. }
  228. void CarlaEngine::oscSend_bridge_configure(const char* const key, const char* const value) const noexcept
  229. {
  230. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  231. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  232. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  233. CARLA_SAFE_ASSERT_RETURN(key != nullptr && key[0] != '\0',);
  234. CARLA_SAFE_ASSERT_RETURN(value != nullptr,);
  235. carla_debug("CarlaEngine::oscSend_bridge_configure(\"%s\", \"%s\")", key, value);
  236. char targetPath[std::strlen(pData->oscData->path)+18];
  237. std::strcpy(targetPath, pData->oscData->path);
  238. std::strcat(targetPath, "/bridge_configure");
  239. try_lo_send(pData->oscData->target, targetPath, "ss", key, value);
  240. }
  241. void CarlaEngine::oscSend_bridge_set_custom_data(const char* const type, const char* const key, const char* const value) const noexcept
  242. {
  243. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  244. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  245. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  246. CARLA_SAFE_ASSERT_RETURN(type != nullptr && type[0] != '\0',);
  247. CARLA_SAFE_ASSERT_RETURN(key != nullptr && key[0] != '\0',);
  248. CARLA_SAFE_ASSERT_RETURN(value != nullptr,);
  249. carla_debug("CarlaEngine::oscSend_bridge_set_custom_data(\"%s\", \"%s\", \"%s\")", type, key, value);
  250. char targetPath[std::strlen(pData->oscData->path)+24];
  251. std::strcpy(targetPath, pData->oscData->path);
  252. std::strcat(targetPath, "/bridge_set_custom_data");
  253. try_lo_send(pData->oscData->target, targetPath, "sss", type, key, value);
  254. }
  255. void CarlaEngine::oscSend_bridge_set_chunk_data(const char* const chunkFile) const noexcept
  256. {
  257. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  258. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  259. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  260. CARLA_SAFE_ASSERT_RETURN(chunkFile != nullptr && chunkFile[0] != '\0',);
  261. carla_debug("CarlaEngine::oscSend_bridge_set_chunk_data(\"%s\")", chunkFile);
  262. char targetPath[std::strlen(pData->oscData->path)+23];
  263. std::strcpy(targetPath, pData->oscData->path);
  264. std::strcat(targetPath, "/bridge_set_chunk_data");
  265. try_lo_send(pData->oscData->target, targetPath, "s", chunkFile);
  266. }
  267. void CarlaEngine::oscSend_bridge_pong() const noexcept
  268. {
  269. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  270. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  271. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  272. //carla_debug("CarlaEngine::oscSend_pong()");
  273. char targetPath[std::strlen(pData->oscData->path)+13];
  274. std::strcpy(targetPath, pData->oscData->path);
  275. std::strcat(targetPath, "/bridge_pong");
  276. try_lo_send(pData->oscData->target, targetPath, "");
  277. }
  278. #else
  279. void CarlaEngine::oscSend_control_add_plugin_start(const uint pluginId, const char* const pluginName) const noexcept
  280. {
  281. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  282. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  283. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  284. CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,);
  285. CARLA_SAFE_ASSERT_RETURN(pluginName != nullptr && pluginName[0] != '\0',);
  286. carla_debug("CarlaEngine::oscSend_control_add_plugin_start(%i, \"%s\")", pluginId, pluginName);
  287. char targetPath[std::strlen(pData->oscData->path)+18];
  288. std::strcpy(targetPath, pData->oscData->path);
  289. std::strcat(targetPath, "/add_plugin_start");
  290. try_lo_send(pData->oscData->target, targetPath, "is", static_cast<int32_t>(pluginId), pluginName);
  291. }
  292. void CarlaEngine::oscSend_control_add_plugin_end(const uint pluginId) const noexcept
  293. {
  294. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  295. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  296. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  297. CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,);
  298. carla_debug("CarlaEngine::oscSend_control_add_plugin_end(%i)", pluginId);
  299. char targetPath[std::strlen(pData->oscData->path)+16];
  300. std::strcpy(targetPath, pData->oscData->path);
  301. std::strcat(targetPath, "/add_plugin_end");
  302. try_lo_send(pData->oscData->target, targetPath, "i", static_cast<int32_t>(pluginId));
  303. }
  304. void CarlaEngine::oscSend_control_remove_plugin(const uint pluginId) const noexcept
  305. {
  306. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  307. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  308. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  309. CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,);
  310. carla_debug("CarlaEngine::oscSend_control_remove_plugin(%i)", pluginId);
  311. char targetPath[std::strlen(pData->oscData->path)+15];
  312. std::strcpy(targetPath, pData->oscData->path);
  313. std::strcat(targetPath, "/remove_plugin");
  314. try_lo_send(pData->oscData->target, targetPath, "i", static_cast<int32_t>(pluginId));
  315. }
  316. void CarlaEngine::oscSend_control_set_plugin_info1(const uint pluginId, const PluginType type, const PluginCategory category, const uint hints, const int64_t uniqueId) const noexcept
  317. {
  318. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  319. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  320. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  321. CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,);
  322. CARLA_SAFE_ASSERT_RETURN(type != PLUGIN_NONE,);
  323. carla_debug("CarlaEngine::oscSend_control_set_plugin_data(%i, %i:%s, %i:%s, %X, " P_INT64 ")", pluginId, type, PluginType2Str(type), category, PluginCategory2Str(category), hints, uniqueId);
  324. char targetPath[std::strlen(pData->oscData->path)+18];
  325. std::strcpy(targetPath, pData->oscData->path);
  326. std::strcat(targetPath, "/set_plugin_info1");
  327. try_lo_send(pData->oscData->target, targetPath, "iiiih", static_cast<int32_t>(pluginId), static_cast<int32_t>(type), static_cast<int32_t>(category), static_cast<int32_t>(hints), static_cast<int64_t>(uniqueId));
  328. }
  329. void CarlaEngine::oscSend_control_set_plugin_info2(const uint pluginId, const char* const realName, const char* const label, const char* const maker, const char* const copyright) const noexcept
  330. {
  331. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  332. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  333. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  334. CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,);
  335. CARLA_SAFE_ASSERT_RETURN(realName != nullptr && realName[0] != '\0',);
  336. CARLA_SAFE_ASSERT_RETURN(label != nullptr && label[0] != '\0',);
  337. CARLA_SAFE_ASSERT_RETURN(maker != nullptr,);
  338. CARLA_SAFE_ASSERT_RETURN(copyright != nullptr,);
  339. carla_debug("CarlaEngine::oscSend_control_set_plugin_data(%i, \"%s\", \"%s\", \"%s\", \"%s\")", pluginId, realName, label, maker, copyright);
  340. char targetPath[std::strlen(pData->oscData->path)+18];
  341. std::strcpy(targetPath, pData->oscData->path);
  342. std::strcat(targetPath, "/set_plugin_info2");
  343. try_lo_send(pData->oscData->target, targetPath, "issss", static_cast<int32_t>(pluginId), realName, label, maker, copyright);
  344. }
  345. void CarlaEngine::oscSend_control_set_audio_count(const uint pluginId, const uint32_t ins, const uint32_t outs) const noexcept
  346. {
  347. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  348. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  349. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  350. CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,);
  351. carla_debug("CarlaEngine::oscSend_control_set_audio_count(%i, %i, %i)", pluginId, ins, outs);
  352. char targetPath[std::strlen(pData->oscData->path)+18];
  353. std::strcpy(targetPath, pData->oscData->path);
  354. std::strcat(targetPath, "/set_audio_count");
  355. try_lo_send(pData->oscData->target, targetPath, "iii", static_cast<int32_t>(pluginId), static_cast<int32_t>(ins), static_cast<int32_t>(outs));
  356. }
  357. void CarlaEngine::oscSend_control_set_midi_count(const uint pluginId, const uint32_t ins, const uint32_t outs) const noexcept
  358. {
  359. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  360. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  361. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  362. CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,);
  363. carla_debug("CarlaEngine::oscSend_control_set_midi_count(%i, %i, %i)", pluginId, ins, outs);
  364. char targetPath[std::strlen(pData->oscData->path)+18];
  365. std::strcpy(targetPath, pData->oscData->path);
  366. std::strcat(targetPath, "/set_midi_count");
  367. try_lo_send(pData->oscData->target, targetPath, "iii", static_cast<int32_t>(pluginId), static_cast<int32_t>(ins), static_cast<int32_t>(outs));
  368. }
  369. void CarlaEngine::oscSend_control_set_parameter_count(const uint pluginId, const uint32_t ins, const uint32_t outs) const noexcept
  370. {
  371. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  372. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  373. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  374. CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,);
  375. carla_debug("CarlaEngine::oscSend_control_set_parameter_count(%i, %i, %i)", pluginId, ins, outs);
  376. char targetPath[std::strlen(pData->oscData->path)+18];
  377. std::strcpy(targetPath, pData->oscData->path);
  378. std::strcat(targetPath, "/set_parameter_count");
  379. try_lo_send(pData->oscData->target, targetPath, "iii", static_cast<int32_t>(pluginId), static_cast<int32_t>(ins), static_cast<int32_t>(outs));
  380. }
  381. void CarlaEngine::oscSend_control_set_program_count(const uint pluginId, const uint32_t count) const noexcept
  382. {
  383. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  384. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  385. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  386. CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,);
  387. carla_debug("CarlaEngine::oscSend_control_set_program_count(%i, %i)", pluginId, count);
  388. char targetPath[std::strlen(pData->oscData->path)+19];
  389. std::strcpy(targetPath, pData->oscData->path);
  390. std::strcat(targetPath, "/set_program_count");
  391. try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(pluginId), static_cast<int32_t>(count));
  392. }
  393. void CarlaEngine::oscSend_control_set_midi_program_count(const uint pluginId, const uint32_t count) const noexcept
  394. {
  395. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  396. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  397. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  398. CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,);
  399. carla_debug("CarlaEngine::oscSend_control_set_midi_program_count(%i, %i)", pluginId, count);
  400. char targetPath[std::strlen(pData->oscData->path)+24];
  401. std::strcpy(targetPath, pData->oscData->path);
  402. std::strcat(targetPath, "/set_midi_program_count");
  403. try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(pluginId), static_cast<int32_t>(count));
  404. }
  405. void CarlaEngine::oscSend_control_set_parameter_data(const uint pluginId, const uint32_t index, const ParameterType type, const uint hints, const char* const name, const char* const unit) const noexcept
  406. {
  407. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  408. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  409. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  410. CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,);
  411. CARLA_SAFE_ASSERT_RETURN(name != nullptr && name[0] != '\0',);
  412. CARLA_SAFE_ASSERT_RETURN(unit != nullptr,);
  413. carla_debug("CarlaEngine::oscSend_control_set_parameter_data(%i, %i, %i:%s, %X, \"%s\", \"%s\")", pluginId, index, type, ParameterType2Str(type), hints, name, unit);
  414. char targetPath[std::strlen(pData->oscData->path)+20];
  415. std::strcpy(targetPath, pData->oscData->path);
  416. std::strcat(targetPath, "/set_parameter_data");
  417. try_lo_send(pData->oscData->target, targetPath, "iiiiss", static_cast<int32_t>(pluginId), static_cast<int32_t>(index), static_cast<int32_t>(type), static_cast<int32_t>(hints), name, unit);
  418. }
  419. void CarlaEngine::oscSend_control_set_parameter_ranges1(const uint pluginId, const uint32_t index, const float def, const float min, const float max) const noexcept
  420. {
  421. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  422. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  423. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  424. CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,);
  425. CARLA_SAFE_ASSERT_RETURN(def <= min && def >= max,);
  426. CARLA_SAFE_ASSERT_RETURN(min < max,);
  427. carla_debug("CarlaEngine::oscSend_control_set_parameter_ranges1(%i, %i, %f, %f, %f)", pluginId, index, def, min, max, def);
  428. char targetPath[std::strlen(pData->oscData->path)+23];
  429. std::strcpy(targetPath, pData->oscData->path);
  430. std::strcat(targetPath, "/set_parameter_ranges1");
  431. try_lo_send(pData->oscData->target, targetPath, "iifff", static_cast<int32_t>(pluginId), static_cast<int32_t>(index), def, min, max);
  432. }
  433. void CarlaEngine::oscSend_control_set_parameter_ranges2(const uint pluginId, const uint32_t index, const float step, const float stepSmall, const float stepLarge) const noexcept
  434. {
  435. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  436. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  437. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  438. CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,);
  439. CARLA_SAFE_ASSERT_RETURN(step <= stepSmall && step >= stepLarge,);
  440. CARLA_SAFE_ASSERT_RETURN(stepSmall <= stepLarge,);
  441. carla_debug("CarlaEngine::oscSend_control_set_parameter_ranges2(%i, %i, %f, %f, %f)", pluginId, index, step, stepSmall, stepLarge);
  442. char targetPath[std::strlen(pData->oscData->path)+23];
  443. std::strcpy(targetPath, pData->oscData->path);
  444. std::strcat(targetPath, "/set_parameter_ranges");
  445. try_lo_send(pData->oscData->target, targetPath, "iifff", static_cast<int32_t>(pluginId), static_cast<int32_t>(index), step, stepSmall, stepLarge);
  446. }
  447. void CarlaEngine::oscSend_control_set_parameter_midi_cc(const uint pluginId, const uint32_t index, const int16_t cc) const noexcept
  448. {
  449. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  450. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  451. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  452. CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,);
  453. CARLA_SAFE_ASSERT_RETURN(cc <= 0x5F,);
  454. carla_debug("CarlaEngine::oscSend_control_set_parameter_midi_cc(%i, %i, %i)", pluginId, index, cc);
  455. char targetPath[std::strlen(pData->oscData->path)+23];
  456. std::strcpy(targetPath, pData->oscData->path);
  457. std::strcat(targetPath, "/set_parameter_midi_cc");
  458. try_lo_send(pData->oscData->target, targetPath, "iii", static_cast<int32_t>(pluginId), static_cast<int32_t>(index), static_cast<int32_t>(cc));
  459. }
  460. void CarlaEngine::oscSend_control_set_parameter_midi_channel(const uint pluginId, const uint32_t index, const uint8_t channel) const noexcept
  461. {
  462. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  463. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  464. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  465. CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,);
  466. CARLA_SAFE_ASSERT_RETURN(channel < MAX_MIDI_CHANNELS,);
  467. carla_debug("CarlaEngine::oscSend_control_set_parameter_midi_channel(%i, %i, %i)", pluginId, index, channel);
  468. char targetPath[std::strlen(pData->oscData->path)+28];
  469. std::strcpy(targetPath, pData->oscData->path);
  470. std::strcat(targetPath, "/set_parameter_midi_channel");
  471. try_lo_send(pData->oscData->target, targetPath, "iii", static_cast<int32_t>(pluginId), static_cast<int32_t>(index), static_cast<int32_t>(channel));
  472. }
  473. void CarlaEngine::oscSend_control_set_parameter_value(const uint pluginId, const int32_t index, const float value) const noexcept
  474. {
  475. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  476. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  477. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  478. CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,);
  479. CARLA_SAFE_ASSERT_RETURN(index != PARAMETER_NULL,);
  480. carla_debug("CarlaEngine::oscSend_control_set_parameter_value(%i, %i:%s, %f)", pluginId, index, (index < 0) ? InternalParameterIndex2Str(static_cast<InternalParameterIndex>(index)) : "(none)", value);
  481. char targetPath[std::strlen(pData->oscData->path)+21];
  482. std::strcpy(targetPath, pData->oscData->path);
  483. std::strcat(targetPath, "/set_parameter_value");
  484. try_lo_send(pData->oscData->target, targetPath, "iif", static_cast<int32_t>(pluginId), index, value);
  485. }
  486. void CarlaEngine::oscSend_control_set_default_value(const uint pluginId, const uint32_t index, const float value) const noexcept
  487. {
  488. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  489. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  490. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  491. CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,);
  492. carla_debug("CarlaEngine::oscSend_control_set_default_value(%i, %i, %f)", pluginId, index, value);
  493. char targetPath[std::strlen(pData->oscData->path)+19];
  494. std::strcpy(targetPath, pData->oscData->path);
  495. std::strcat(targetPath, "/set_default_value");
  496. try_lo_send(pData->oscData->target, targetPath, "iif", static_cast<int32_t>(pluginId), static_cast<int32_t>(index), value);
  497. }
  498. void CarlaEngine::oscSend_control_set_current_program(const uint pluginId, const int32_t index) const noexcept
  499. {
  500. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  501. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  502. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  503. CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,);
  504. carla_debug("CarlaEngine::oscSend_control_set_current_program(%i, %i)", pluginId, index);
  505. char targetPath[std::strlen(pData->oscData->path)+21];
  506. std::strcpy(targetPath, pData->oscData->path);
  507. std::strcat(targetPath, "/set_current_program");
  508. try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(pluginId), index);
  509. }
  510. void CarlaEngine::oscSend_control_set_current_midi_program(const uint pluginId, const int32_t index) const noexcept
  511. {
  512. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  513. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  514. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  515. CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,);
  516. carla_debug("CarlaEngine::oscSend_control_set_current_midi_program(%i, %i)", pluginId, index);
  517. char targetPath[std::strlen(pData->oscData->path)+26];
  518. std::strcpy(targetPath, pData->oscData->path);
  519. std::strcat(targetPath, "/set_current_midi_program");
  520. try_lo_send(pData->oscData->target, targetPath, "ii", static_cast<int32_t>(pluginId), index);
  521. }
  522. void CarlaEngine::oscSend_control_set_program_name(const uint pluginId, const uint32_t index, const char* const name) const noexcept
  523. {
  524. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  525. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  526. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  527. CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,);
  528. CARLA_SAFE_ASSERT_RETURN(name != nullptr,);
  529. carla_debug("CarlaEngine::oscSend_control_set_program_name(%i, %i, \"%s\")", pluginId, index, name);
  530. char targetPath[std::strlen(pData->oscData->path)+18];
  531. std::strcpy(targetPath, pData->oscData->path);
  532. std::strcat(targetPath, "/set_program_name");
  533. try_lo_send(pData->oscData->target, targetPath, "iis", static_cast<int32_t>(pluginId), static_cast<int32_t>(index), name);
  534. }
  535. void CarlaEngine::oscSend_control_set_midi_program_data(const uint pluginId, const uint32_t index, const uint32_t bank, const uint32_t program, const char* const name) const noexcept
  536. {
  537. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  538. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  539. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  540. CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,);
  541. CARLA_SAFE_ASSERT_RETURN(name != nullptr,);
  542. carla_debug("CarlaEngine::oscSend_control_set_midi_program_data(%i, %i, %i, %i, \"%s\")", pluginId, index, bank, program, name);
  543. char targetPath[std::strlen(pData->oscData->path)+23];
  544. std::strcpy(targetPath, pData->oscData->path);
  545. std::strcat(targetPath, "/set_midi_program_data");
  546. try_lo_send(pData->oscData->target, targetPath, "iiiis", static_cast<int32_t>(pluginId), static_cast<int32_t>(index), static_cast<int32_t>(bank), static_cast<int32_t>(program), name);
  547. }
  548. void CarlaEngine::oscSend_control_note_on(const uint pluginId, const uint8_t channel, const uint8_t note, const uint8_t velo) const noexcept
  549. {
  550. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  551. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  552. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  553. CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,);
  554. CARLA_SAFE_ASSERT_RETURN(channel < MAX_MIDI_CHANNELS,);
  555. CARLA_SAFE_ASSERT_RETURN(note < MAX_MIDI_NOTE,);
  556. CARLA_SAFE_ASSERT_RETURN(velo < MAX_MIDI_VALUE,);
  557. carla_debug("CarlaEngine::oscSend_control_note_on(%i, %i, %i, %i)", pluginId, channel, note, velo);
  558. char targetPath[std::strlen(pData->oscData->path)+9];
  559. std::strcpy(targetPath, pData->oscData->path);
  560. std::strcat(targetPath, "/note_on");
  561. try_lo_send(pData->oscData->target, targetPath, "iiii", static_cast<int32_t>(pluginId), static_cast<int32_t>(channel), static_cast<int32_t>(note), static_cast<int32_t>(velo));
  562. }
  563. void CarlaEngine::oscSend_control_note_off(const uint pluginId, const uint8_t channel, const uint8_t note) const noexcept
  564. {
  565. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  566. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  567. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  568. CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,);
  569. CARLA_SAFE_ASSERT_RETURN(channel < MAX_MIDI_CHANNELS,);
  570. CARLA_SAFE_ASSERT_RETURN(note < MAX_MIDI_NOTE,);
  571. carla_debug("CarlaEngine::oscSend_control_note_off(%i, %i, %i)", pluginId, channel, note);
  572. char targetPath[std::strlen(pData->oscData->path)+10];
  573. std::strcpy(targetPath, pData->oscData->path);
  574. std::strcat(targetPath, "/note_off");
  575. try_lo_send(pData->oscData->target, targetPath, "iii", static_cast<int32_t>(pluginId), static_cast<int32_t>(channel), static_cast<int32_t>(note));
  576. }
  577. void CarlaEngine::oscSend_control_set_peaks(const uint pluginId) const noexcept
  578. {
  579. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  580. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  581. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  582. CARLA_SAFE_ASSERT_RETURN(pluginId < pData->curPluginCount,);
  583. // TODO - try and see if we can get peaks[4] ref
  584. const EnginePluginData& epData(pData->plugins[pluginId]);
  585. char targetPath[std::strlen(pData->oscData->path)+11];
  586. std::strcpy(targetPath, pData->oscData->path);
  587. std::strcat(targetPath, "/set_peaks");
  588. try_lo_send(pData->oscData->target, targetPath, "iffff", static_cast<int32_t>(pluginId), epData.insPeak[0], epData.insPeak[1], epData.outsPeak[0], epData.outsPeak[1]);
  589. }
  590. void CarlaEngine::oscSend_control_exit() const noexcept
  591. {
  592. CARLA_SAFE_ASSERT_RETURN(pData->oscData != nullptr,);
  593. CARLA_SAFE_ASSERT_RETURN(pData->oscData->path != nullptr && pData->oscData->path[0] != '\0',);
  594. CARLA_SAFE_ASSERT_RETURN(pData->oscData->target != nullptr,);
  595. carla_debug("CarlaEngine::oscSend_control_exit()");
  596. char targetPath[std::strlen(pData->oscData->path)+6];
  597. std::strcpy(targetPath, pData->oscData->path);
  598. std::strcat(targetPath, "/exit");
  599. try_lo_send(pData->oscData->target, targetPath, "");
  600. }
  601. #endif
  602. // -----------------------------------------------------------------------
  603. CARLA_BACKEND_END_NAMESPACE