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.

848 lines
22KB

  1. /*
  2. * Carla Native Plugins
  3. * Copyright (C) 2012-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 "CarlaNative.hpp"
  18. #include "CarlaMIDI.h"
  19. #include "CarlaThread.hpp"
  20. #include "LinkedList.hpp"
  21. #include "CarlaMathUtils.hpp"
  22. #include "DSP/FFTwrapper.h"
  23. #include "Misc/Master.h"
  24. #include "Misc/Part.h"
  25. #include "Misc/Util.h"
  26. #ifdef WANT_ZYNADDSUBFX_UI
  27. # ifdef override
  28. # define override_hack
  29. # undef override
  30. # endif
  31. # include "UI/common.H"
  32. # include "UI/MasterUI.h"
  33. # include <FL/Fl_Shared_Image.H>
  34. # include <FL/Fl_Tiled_Image.H>
  35. # include <FL/Fl_Theme.H>
  36. # ifdef override_hack
  37. # define override
  38. # undef override_hack
  39. # endif
  40. #endif
  41. #include <ctime>
  42. #include <set>
  43. #include <string>
  44. #include "juce_audio_basics.h"
  45. using juce::FloatVectorOperations;
  46. #ifdef WANT_ZYNADDSUBFX_UI
  47. static Fl_Tiled_Image* gModuleBackdrop = nullptr;
  48. static CarlaString gPixmapPath;
  49. extern CarlaString gUiPixmapPath;
  50. void set_module_parameters(Fl_Widget* o)
  51. {
  52. CARLA_SAFE_ASSERT_RETURN(gModuleBackdrop != nullptr,);
  53. o->box(FL_DOWN_FRAME);
  54. o->align(o->align() | FL_ALIGN_IMAGE_BACKDROP);
  55. o->color(FL_BLACK);
  56. o->labeltype(FL_SHADOW_LABEL);
  57. if (gModuleBackdrop != nullptr)
  58. o->image(gModuleBackdrop);
  59. }
  60. #endif
  61. // -----------------------------------------------------------------------
  62. class ZynAddSubFxPrograms
  63. {
  64. public:
  65. ZynAddSubFxPrograms()
  66. : fInitiated(false),
  67. #ifdef CARLA_PROPER_CPP11_SUPPORT
  68. fRetProgram({0, 0, nullptr}),
  69. #endif
  70. fPrograms() {}
  71. ~ZynAddSubFxPrograms()
  72. {
  73. if (! fInitiated)
  74. return;
  75. for (LinkedList<const ProgramInfo*>::Itenerator it = fPrograms.begin(); it.valid(); it.next())
  76. {
  77. const ProgramInfo* const& pInfo(it.getValue());
  78. delete pInfo;
  79. }
  80. fPrograms.clear();
  81. FFT_cleanup();
  82. }
  83. void init()
  84. {
  85. if (fInitiated)
  86. return;
  87. fInitiated = true;
  88. fPrograms.append(new ProgramInfo(0, 0, "default"));
  89. Master& master(Master::getInstance());
  90. pthread_mutex_lock(&master.mutex);
  91. // refresh banks
  92. master.bank.rescanforbanks();
  93. for (uint32_t i=0, size=static_cast<uint32_t>(master.bank.banks.size()); i<size; ++i)
  94. {
  95. if (master.bank.banks[i].dir.empty())
  96. continue;
  97. master.bank.loadbank(master.bank.banks[i].dir);
  98. for (unsigned int instrument = 0; instrument < BANK_SIZE; ++instrument)
  99. {
  100. const std::string insName(master.bank.getname(instrument));
  101. if (insName.empty() || insName[0] == '\0' || insName[0] == ' ')
  102. continue;
  103. fPrograms.append(new ProgramInfo(i+1, instrument, insName.c_str()));
  104. }
  105. }
  106. pthread_mutex_unlock(&master.mutex);
  107. }
  108. void load(Master* const master, const uint8_t channel, const uint32_t bank, const uint32_t program)
  109. {
  110. if (bank == 0)
  111. {
  112. pthread_mutex_lock(&master->mutex);
  113. master->partonoff(channel, 1);
  114. master->part[channel]->defaults();
  115. master->part[channel]->applyparameters(false);
  116. pthread_mutex_unlock(&master->mutex);
  117. return;
  118. }
  119. const std::string& bankdir(master->bank.banks[bank-1].dir);
  120. if (! bankdir.empty())
  121. {
  122. pthread_mutex_lock(&master->mutex);
  123. master->partonoff(channel, 1);
  124. master->bank.loadbank(bankdir);
  125. master->bank.loadfromslot(program, master->part[channel]);
  126. master->part[channel]->applyparameters(false);
  127. pthread_mutex_unlock(&master->mutex);
  128. }
  129. }
  130. uint32_t count() const noexcept
  131. {
  132. return static_cast<uint32_t>(fPrograms.count());
  133. }
  134. const NativeMidiProgram* getInfo(const uint32_t index) const noexcept
  135. {
  136. if (index >= fPrograms.count())
  137. return nullptr;
  138. const ProgramInfo* const pInfo(fPrograms.getAt(index, nullptr));
  139. CARLA_SAFE_ASSERT_RETURN(pInfo != nullptr, nullptr);
  140. fRetProgram.bank = pInfo->bank;
  141. fRetProgram.program = pInfo->prog;
  142. fRetProgram.name = pInfo->name;
  143. return &fRetProgram;
  144. }
  145. private:
  146. struct ProgramInfo {
  147. uint32_t bank;
  148. uint32_t prog;
  149. const char* name;
  150. ProgramInfo(uint32_t bank_, uint32_t prog_, const char* name_) noexcept
  151. : bank(bank_),
  152. prog(prog_),
  153. name(carla_strdup_safe(name_)) {}
  154. ~ProgramInfo() noexcept
  155. {
  156. if (name != nullptr)
  157. {
  158. delete[] name;
  159. name = nullptr;
  160. }
  161. }
  162. #ifdef CARLA_PROPER_CPP11_SUPPORT
  163. ProgramInfo() = delete;
  164. ProgramInfo(ProgramInfo&) = delete;
  165. ProgramInfo(const ProgramInfo&) = delete;
  166. ProgramInfo& operator=(ProgramInfo&);
  167. ProgramInfo& operator=(const ProgramInfo&);
  168. #endif
  169. };
  170. bool fInitiated;
  171. mutable NativeMidiProgram fRetProgram;
  172. LinkedList<const ProgramInfo*> fPrograms;
  173. CARLA_PREVENT_HEAP_ALLOCATION
  174. CARLA_DECLARE_NON_COPY_CLASS(ZynAddSubFxPrograms)
  175. };
  176. static ZynAddSubFxPrograms sPrograms;
  177. // -----------------------------------------------------------------------
  178. class ZynAddSubFxInstanceCount
  179. {
  180. public:
  181. ZynAddSubFxInstanceCount()
  182. : fCount(0)
  183. {
  184. }
  185. ~ZynAddSubFxInstanceCount()
  186. {
  187. CARLA_ASSERT(fCount == 0);
  188. }
  189. void addOne(const NativeHostDescriptor* const host)
  190. {
  191. if (fCount++ == 0)
  192. {
  193. CARLA_ASSERT(synth == nullptr);
  194. CARLA_ASSERT(denormalkillbuf == nullptr);
  195. reinit(host);
  196. #ifdef WANT_ZYNADDSUBFX_UI
  197. if (gPixmapPath.isEmpty())
  198. {
  199. gPixmapPath = host->resourceDir;
  200. gPixmapPath += "/zynaddsubfx/";
  201. gUiPixmapPath = gPixmapPath;
  202. }
  203. #endif
  204. }
  205. }
  206. void removeOne()
  207. {
  208. if (--fCount == 0)
  209. {
  210. CARLA_ASSERT(synth != nullptr);
  211. CARLA_ASSERT(denormalkillbuf != nullptr);
  212. Master::deleteInstance();
  213. delete[] denormalkillbuf;
  214. denormalkillbuf = nullptr;
  215. delete synth;
  216. synth = nullptr;
  217. }
  218. }
  219. void reinit(const NativeHostDescriptor* const host)
  220. {
  221. Master::deleteInstance();
  222. if (denormalkillbuf != nullptr)
  223. {
  224. delete[] denormalkillbuf;
  225. denormalkillbuf = nullptr;
  226. }
  227. if (synth != nullptr)
  228. {
  229. delete synth;
  230. synth = nullptr;
  231. }
  232. synth = new SYNTH_T();
  233. synth->buffersize = static_cast<int>(host->get_buffer_size(host->handle));
  234. synth->samplerate = static_cast<uint>(host->get_sample_rate(host->handle));
  235. if (synth->buffersize > 32)
  236. synth->buffersize = 32;
  237. synth->alias();
  238. config.init();
  239. config.cfg.SoundBufferSize = synth->buffersize;
  240. config.cfg.SampleRate = static_cast<int>(synth->samplerate);
  241. config.cfg.GzipCompression = 0;
  242. sprng(static_cast<prng_t>(std::time(nullptr)));
  243. denormalkillbuf = new float[synth->buffersize];
  244. for (int i=0; i < synth->buffersize; ++i)
  245. denormalkillbuf[i] = (RND - 0.5f) * 1e-16f;
  246. Master::getInstance();
  247. }
  248. void maybeReinit(const NativeHostDescriptor* const host)
  249. {
  250. if (host->get_buffer_size(host->handle) == static_cast<uint32_t>(synth->buffersize) &&
  251. carla_compareFloats(host->get_sample_rate(host->handle), static_cast<double>(synth->samplerate)))
  252. return;
  253. reinit(host);
  254. }
  255. private:
  256. int fCount;
  257. CARLA_PREVENT_HEAP_ALLOCATION
  258. CARLA_DECLARE_NON_COPY_CLASS(ZynAddSubFxInstanceCount)
  259. };
  260. static ZynAddSubFxInstanceCount sInstanceCount;
  261. // -----------------------------------------------------------------------
  262. class ZynAddSubFxThread : public CarlaThread
  263. {
  264. public:
  265. ZynAddSubFxThread(Master* const master, const NativeHostDescriptor* const host)
  266. : CarlaThread("ZynAddSubFxThread"),
  267. fMaster(master),
  268. kHost(host),
  269. #ifdef WANT_ZYNADDSUBFX_UI
  270. fUi(nullptr),
  271. fUiClosed(0),
  272. fNextUiAction(-1),
  273. #endif
  274. fChangeProgram(false),
  275. fNextChannel(0),
  276. fNextBank(0),
  277. fNextProgram(0)
  278. {
  279. }
  280. ~ZynAddSubFxThread()
  281. {
  282. #ifdef WANT_ZYNADDSUBFX_UI
  283. // must be closed by now
  284. CARLA_ASSERT(fUi == nullptr);
  285. #endif
  286. }
  287. void loadProgramLater(const uint8_t channel, const uint32_t bank, const uint32_t program)
  288. {
  289. fNextChannel = channel;
  290. fNextBank = bank;
  291. fNextProgram = program;
  292. fChangeProgram = true;
  293. }
  294. void stopLoadProgramLater()
  295. {
  296. fChangeProgram = false;
  297. fNextChannel = 0;
  298. fNextBank = 0;
  299. fNextProgram = 0;
  300. }
  301. void setMaster(Master* const master)
  302. {
  303. fMaster = master;
  304. }
  305. #ifdef WANT_ZYNADDSUBFX_UI
  306. void uiHide()
  307. {
  308. fNextUiAction = 0;
  309. }
  310. void uiShow()
  311. {
  312. fNextUiAction = 1;
  313. }
  314. void uiRepaint()
  315. {
  316. if (fUi != nullptr)
  317. fNextUiAction = 2;
  318. }
  319. void uiChangeName(const char* const name)
  320. {
  321. if (fUi != nullptr)
  322. {
  323. Fl::lock();
  324. fUi->masterwindow->label(name);
  325. Fl::unlock();
  326. }
  327. }
  328. #endif
  329. protected:
  330. void run() override
  331. {
  332. while (! shouldThreadExit())
  333. {
  334. #ifdef WANT_ZYNADDSUBFX_UI
  335. Fl::lock();
  336. if (fNextUiAction == 2) // repaint
  337. {
  338. CARLA_ASSERT(fUi != nullptr);
  339. if (fUi != nullptr)
  340. fUi->refresh_master_ui();
  341. }
  342. else if (fNextUiAction == 1) // init/show
  343. {
  344. static bool initialized = false;
  345. if (! initialized)
  346. {
  347. initialized = true;
  348. fl_register_images();
  349. Fl_Dial::default_style(Fl_Dial::PIXMAP_DIAL);
  350. if (Fl_Shared_Image* const img = Fl_Shared_Image::get(gPixmapPath + "knob.png"))
  351. Fl_Dial::default_image(img);
  352. if (Fl_Shared_Image* const img = Fl_Shared_Image::get(gPixmapPath + "window_backdrop.png"))
  353. Fl::scheme_bg(new Fl_Tiled_Image(img));
  354. if(Fl_Shared_Image* const img = Fl_Shared_Image::get(gPixmapPath + "module_backdrop.png"))
  355. gModuleBackdrop = new Fl_Tiled_Image(img);
  356. Fl::background(50, 50, 50);
  357. Fl::background2(70, 70, 70);
  358. Fl::foreground(255, 255, 255);
  359. Fl_Theme::set("Cairo");
  360. }
  361. if (fUi == nullptr)
  362. {
  363. fUiClosed = 0;
  364. fUi = new MasterUI(fMaster, &fUiClosed);
  365. fUi->masterwindow->label(kHost->uiName);
  366. fUi->showUI();
  367. }
  368. else
  369. fUi->showUI();
  370. }
  371. else if (fNextUiAction == 0) // close
  372. {
  373. CARLA_ASSERT(fUi != nullptr);
  374. if (fUi != nullptr)
  375. {
  376. delete fUi;
  377. fUi = nullptr;
  378. }
  379. }
  380. fNextUiAction = -1;
  381. if (fUiClosed != 0)
  382. {
  383. fUiClosed = 0;
  384. fNextUiAction = 0;
  385. kHost->ui_closed(kHost->handle);
  386. }
  387. Fl::check();
  388. Fl::unlock();
  389. #endif
  390. if (fChangeProgram)
  391. {
  392. fChangeProgram = false;
  393. sPrograms.load(fMaster, fNextChannel, fNextBank, fNextProgram);
  394. fNextChannel = 0;
  395. fNextBank = 0;
  396. fNextProgram = 0;
  397. #ifdef WANT_ZYNADDSUBFX_UI
  398. if (fUi != nullptr)
  399. {
  400. Fl::lock();
  401. fUi->refresh_master_ui();
  402. Fl::unlock();
  403. }
  404. #endif
  405. carla_msleep(15);
  406. }
  407. else
  408. {
  409. carla_msleep(30);
  410. }
  411. }
  412. #ifdef WANT_ZYNADDSUBFX_UI
  413. if (shouldThreadExit() || fUi != nullptr)
  414. {
  415. Fl::lock();
  416. delete fUi;
  417. fUi = nullptr;
  418. Fl::check();
  419. Fl::unlock();
  420. }
  421. #endif
  422. }
  423. private:
  424. Master* fMaster;
  425. const NativeHostDescriptor* const kHost;
  426. #ifdef WANT_ZYNADDSUBFX_UI
  427. MasterUI* fUi;
  428. int fUiClosed;
  429. volatile int fNextUiAction;
  430. #endif
  431. volatile bool fChangeProgram;
  432. volatile uint8_t fNextChannel;
  433. volatile uint32_t fNextBank;
  434. volatile uint32_t fNextProgram;
  435. CARLA_PREVENT_VIRTUAL_HEAP_ALLOCATION
  436. CARLA_DECLARE_NON_COPY_CLASS(ZynAddSubFxThread)
  437. };
  438. // -----------------------------------------------------------------------
  439. class ZynAddSubFxPlugin : public NativePluginClass
  440. {
  441. public:
  442. ZynAddSubFxPlugin(const NativeHostDescriptor* const host)
  443. : NativePluginClass(host),
  444. fMaster(new Master()),
  445. fSampleRate(static_cast<uint>(getSampleRate())),
  446. fIsActive(false),
  447. fThread(fMaster, host),
  448. leakDetector_ZynAddSubFxPlugin()
  449. {
  450. fThread.startThread();
  451. for (int i = 0; i < NUM_MIDI_PARTS; ++i)
  452. fMaster->partonoff(i, 1);
  453. sPrograms.init();
  454. }
  455. ~ZynAddSubFxPlugin() override
  456. {
  457. deleteMaster();
  458. }
  459. protected:
  460. // -------------------------------------------------------------------
  461. // Plugin midi-program calls
  462. uint32_t getMidiProgramCount() const override
  463. {
  464. return sPrograms.count();
  465. }
  466. const NativeMidiProgram* getMidiProgramInfo(const uint32_t index) const override
  467. {
  468. return sPrograms.getInfo(index);
  469. }
  470. // -------------------------------------------------------------------
  471. // Plugin state calls
  472. void setMidiProgram(const uint8_t channel, const uint32_t bank, const uint32_t program) override
  473. {
  474. if (bank >= fMaster->bank.banks.size())
  475. return;
  476. if (program >= BANK_SIZE)
  477. return;
  478. if (isOffline() || ! fIsActive)
  479. {
  480. sPrograms.load(fMaster, channel, bank, program);
  481. #ifdef WANT_ZYNADDSUBFX_UI
  482. fThread.uiRepaint();
  483. #endif
  484. }
  485. else
  486. fThread.loadProgramLater(channel, bank, program);
  487. }
  488. void setCustomData(const char* const key, const char* const value) override
  489. {
  490. CARLA_SAFE_ASSERT_RETURN(key != nullptr,);
  491. CARLA_SAFE_ASSERT_RETURN(value != nullptr,);
  492. pthread_mutex_lock(&fMaster->mutex);
  493. if (std::strcmp(key, "CarlaAlternateFile1") == 0) // xmz
  494. {
  495. fMaster->defaults();
  496. fMaster->loadXML(value);
  497. }
  498. else if (std::strcmp(key, "CarlaAlternateFile2") == 0) // xiz
  499. {
  500. fMaster->part[0]->defaultsinstrument();
  501. fMaster->part[0]->loadXMLinstrument(value);
  502. }
  503. pthread_mutex_unlock(&fMaster->mutex);
  504. fMaster->applyparameters();
  505. }
  506. // -------------------------------------------------------------------
  507. // Plugin process calls
  508. void activate() override
  509. {
  510. fIsActive = true;
  511. }
  512. void deactivate() override
  513. {
  514. fIsActive = false;
  515. }
  516. void process(float**, float** const outBuffer, const uint32_t frames, const NativeMidiEvent* const midiEvents, const uint32_t midiEventCount) override
  517. {
  518. if (pthread_mutex_trylock(&fMaster->mutex) != 0)
  519. {
  520. FloatVectorOperations::clear(outBuffer[0], static_cast<int>(frames));
  521. FloatVectorOperations::clear(outBuffer[1], static_cast<int>(frames));
  522. return;
  523. }
  524. for (uint32_t i=0; i < midiEventCount; ++i)
  525. {
  526. const NativeMidiEvent* const midiEvent(&midiEvents[i]);
  527. const uint8_t status = MIDI_GET_STATUS_FROM_DATA(midiEvent->data);
  528. const char channel = MIDI_GET_CHANNEL_FROM_DATA(midiEvent->data);
  529. if (MIDI_IS_STATUS_NOTE_OFF(status))
  530. {
  531. const char note = static_cast<char>(midiEvent->data[1]);
  532. fMaster->noteOff(channel, note);
  533. }
  534. else if (MIDI_IS_STATUS_NOTE_ON(status))
  535. {
  536. const char note = static_cast<char>(midiEvent->data[1]);
  537. const char velo = static_cast<char>(midiEvent->data[2]);
  538. fMaster->noteOn(channel, note, velo);
  539. }
  540. else if (MIDI_IS_STATUS_POLYPHONIC_AFTERTOUCH(status))
  541. {
  542. const char note = static_cast<char>(midiEvent->data[1]);
  543. const char pressure = static_cast<char>(midiEvent->data[2]);
  544. fMaster->polyphonicAftertouch(channel, note, pressure);
  545. }
  546. else if (MIDI_IS_STATUS_CONTROL_CHANGE(status))
  547. {
  548. const int control = midiEvent->data[1];
  549. const int value = midiEvent->data[2];
  550. fMaster->setController(channel, control, value);
  551. }
  552. else if (MIDI_IS_STATUS_PITCH_WHEEL_CONTROL(status))
  553. {
  554. const uint8_t lsb = midiEvent->data[1];
  555. const uint8_t msb = midiEvent->data[2];
  556. const int value = ((msb << 7) | lsb) - 8192;
  557. fMaster->setController(channel, C_pitchwheel, value);
  558. }
  559. }
  560. fMaster->GetAudioOutSamples(frames, fSampleRate, outBuffer[0], outBuffer[1]);
  561. pthread_mutex_unlock(&fMaster->mutex);
  562. }
  563. #ifdef WANT_ZYNADDSUBFX_UI
  564. // -------------------------------------------------------------------
  565. // Plugin UI calls
  566. void uiShow(const bool show) override
  567. {
  568. if (show)
  569. fThread.uiShow();
  570. else
  571. fThread.uiHide();
  572. }
  573. #endif
  574. // -------------------------------------------------------------------
  575. // Plugin state calls
  576. char* getState() const override
  577. {
  578. config.save();
  579. char* data = nullptr;
  580. fMaster->getalldata(&data);
  581. return data;
  582. }
  583. void setState(const char* const data) override
  584. {
  585. fThread.stopLoadProgramLater();
  586. fMaster->putalldata(const_cast<char*>(data), 0);
  587. fMaster->applyparameters(true);
  588. }
  589. // -------------------------------------------------------------------
  590. // Plugin dispatcher
  591. // TODO - save&load current state
  592. void bufferSizeChanged(const uint32_t) final
  593. {
  594. deleteMaster();
  595. sInstanceCount.maybeReinit(getHostHandle());
  596. initMaster();
  597. }
  598. void sampleRateChanged(const double sampleRate) final
  599. {
  600. fSampleRate = static_cast<uint>(sampleRate);
  601. deleteMaster();
  602. sInstanceCount.maybeReinit(getHostHandle());
  603. initMaster();
  604. }
  605. void initMaster()
  606. {
  607. fMaster = new Master();
  608. fThread.setMaster(fMaster);
  609. fThread.startThread();
  610. for (int i = 0; i < NUM_MIDI_PARTS; ++i)
  611. fMaster->partonoff(i, 1);
  612. }
  613. void deleteMaster()
  614. {
  615. //ensure that everything has stopped
  616. pthread_mutex_lock(&fMaster->mutex);
  617. pthread_mutex_unlock(&fMaster->mutex);
  618. fThread.stopThread(-1);
  619. delete fMaster;
  620. fMaster = nullptr;
  621. }
  622. #ifdef WANT_ZYNADDSUBFX_UI
  623. void uiNameChanged(const char* const uiName) override
  624. {
  625. fThread.uiChangeName(uiName);
  626. }
  627. #endif
  628. // -------------------------------------------------------------------
  629. private:
  630. Master* fMaster;
  631. uint fSampleRate;
  632. bool fIsActive;
  633. ZynAddSubFxThread fThread;
  634. // -------------------------------------------------------------------
  635. public:
  636. static NativePluginHandle _instantiate(const NativeHostDescriptor* host)
  637. {
  638. sInstanceCount.addOne(host);
  639. return new ZynAddSubFxPlugin(host);
  640. }
  641. static void _cleanup(NativePluginHandle handle)
  642. {
  643. delete (ZynAddSubFxPlugin*)handle;
  644. sInstanceCount.removeOne();
  645. }
  646. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ZynAddSubFxPlugin)
  647. };
  648. // -----------------------------------------------------------------------
  649. static const NativePluginDescriptor zynaddsubfxDesc = {
  650. /* category */ NATIVE_PLUGIN_CATEGORY_SYNTH,
  651. /* hints */ static_cast<NativePluginHints>(NATIVE_PLUGIN_IS_SYNTH
  652. #ifdef WANT_ZYNADDSUBFX_UI
  653. |NATIVE_PLUGIN_HAS_UI
  654. #endif
  655. |NATIVE_PLUGIN_USES_MULTI_PROGS
  656. |NATIVE_PLUGIN_USES_STATE),
  657. /* supports */ static_cast<NativePluginSupports>(NATIVE_PLUGIN_SUPPORTS_CONTROL_CHANGES
  658. |NATIVE_PLUGIN_SUPPORTS_NOTE_AFTERTOUCH
  659. |NATIVE_PLUGIN_SUPPORTS_PITCHBEND
  660. |NATIVE_PLUGIN_SUPPORTS_ALL_SOUND_OFF),
  661. /* audioIns */ 0,
  662. /* audioOuts */ 2,
  663. /* midiIns */ 1,
  664. /* midiOuts */ 0,
  665. /* paramIns */ 0,
  666. /* paramOuts */ 0,
  667. /* name */ "ZynAddSubFX",
  668. /* label */ "zynaddsubfx",
  669. /* maker */ "falkTX, Mark McCurry, Nasca Octavian Paul",
  670. /* copyright */ "GNU GPL v2+",
  671. PluginDescriptorFILL(ZynAddSubFxPlugin)
  672. };
  673. // -----------------------------------------------------------------------
  674. CARLA_EXPORT
  675. void carla_register_native_plugin_zynaddsubfx_synth();
  676. CARLA_EXPORT
  677. void carla_register_native_plugin_zynaddsubfx_synth()
  678. {
  679. carla_register_native_plugin(&zynaddsubfxDesc);
  680. }
  681. // -----------------------------------------------------------------------