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.

822 lines
24KB

  1. /*
  2. * Carla Plugin API
  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 GPL.txt file
  16. */
  17. #ifndef __CARLA_PLUGIN_HPP__
  18. #define __CARLA_PLUGIN_HPP__
  19. #include "carla_backend.hpp"
  20. #include "carla_native.h"
  21. #include "carla_utils.hpp"
  22. // FIXME
  23. #include "carla_state_utils.hpp"
  24. // Avoid including extra libs here
  25. struct LADSPA_RDF_Descriptor;
  26. typedef void* lo_address;
  27. CARLA_BACKEND_START_NAMESPACE
  28. #if 0
  29. } // Fix editor indentation
  30. #endif
  31. #if 0 //ndef BUILD_BRIDGE
  32. enum PluginBridgeInfoType {
  33. kPluginBridgeAudioCount,
  34. kPluginBridgeMidiCount,
  35. kPluginBridgeParameterCount,
  36. kPluginBridgeProgramCount,
  37. kPluginBridgeMidiProgramCount,
  38. kPluginBridgePluginInfo,
  39. kPluginBridgeParameterInfo,
  40. kPluginBridgeParameterData,
  41. kPluginBridgeParameterRanges,
  42. kPluginBridgeProgramInfo,
  43. kPluginBridgeMidiProgramInfo,
  44. kPluginBridgeConfigure,
  45. kPluginBridgeSetParameterValue,
  46. kPluginBridgeSetDefaultValue,
  47. kPluginBridgeSetProgram,
  48. kPluginBridgeSetMidiProgram,
  49. kPluginBridgeSetCustomData,
  50. kPluginBridgeSetChunkData,
  51. kPluginBridgeUpdateNow,
  52. kPluginBridgeError
  53. };
  54. #endif
  55. enum PluginPostRtEventType {
  56. kPluginPostRtEventNull,
  57. kPluginPostRtEventDebug,
  58. kPluginPostRtEventParameterChange, // param, N, value
  59. kPluginPostRtEventProgramChange, // index
  60. kPluginPostRtEventMidiProgramChange, // index
  61. kPluginPostRtEventNoteOn, // channel, note, velo
  62. kPluginPostRtEventNoteOff // channel, note
  63. };
  64. // -----------------------------------------------------------------------
  65. /*!
  66. * Protected data used in CarlaPlugin and subclasses.\n
  67. * Non-plugin code MUST NEVER have direct access to this.
  68. */
  69. struct CarlaPluginProtectedData;
  70. /*!
  71. * \class CarlaPlugin
  72. *
  73. * \brief Carla Backend base plugin class
  74. *
  75. * This is the base class for all available plugin types available in Carla Backend.\n
  76. * All virtual calls are implemented in this class as fallback, so it's safe to only override needed calls.
  77. *
  78. * \see PluginType
  79. */
  80. class CarlaPlugin
  81. {
  82. public:
  83. /*!
  84. * This is the constructor of the base plugin class.
  85. *
  86. * \param engine The engine which this plugin belongs to, must not be null
  87. * \param id The 'id' of this plugin, must be between 0 and CarlaEngine::maxPluginNumber()
  88. */
  89. CarlaPlugin(CarlaEngine* const engine, const unsigned int id);
  90. /*!
  91. * This is the destructor of the base plugin class.
  92. */
  93. virtual ~CarlaPlugin();
  94. // -------------------------------------------------------------------
  95. // Information (base)
  96. /*!
  97. * Get the plugin's type (ie, a subclass of CarlaPlugin).
  98. *
  99. * \note Plugin bridges will return their respective plugin type, there is no plugin type such as "bridge".\n
  100. * To check if a plugin is a bridge use:
  101. * \code
  102. * if (hints() & PLUGIN_IS_BRIDGE)
  103. * ...
  104. * \endcode
  105. */
  106. virtual PluginType type() const
  107. {
  108. return PLUGIN_NONE;
  109. }
  110. /*!
  111. * Get the plugin's id (as passed in the constructor).
  112. *
  113. * \see setId()
  114. */
  115. unsigned int id() const;
  116. /*!
  117. * Get the plugin's hints.
  118. *
  119. * \see PluginHints
  120. */
  121. unsigned int hints() const;
  122. /*!
  123. * Get the plugin's options.
  124. *
  125. * \see PluginOptions
  126. */
  127. unsigned int options() const;
  128. /*!
  129. * Check if the plugin is enabled.
  130. *
  131. * \see setEnabled()
  132. */
  133. bool enabled() const;
  134. /*!
  135. * Get the plugin's internal name.\n
  136. * This name is unique within all plugins in an engine.
  137. *
  138. * \see getRealName()
  139. */
  140. const char* name() const;
  141. /*!
  142. * Get the currently loaded DLL filename for this plugin.\n
  143. * (Sound kits return their exact filename).
  144. */
  145. const char* filename() const;
  146. /*!
  147. * Get the plugin's category (delay, filter, synth, etc).
  148. */
  149. virtual PluginCategory category() const
  150. {
  151. return PLUGIN_CATEGORY_NONE;
  152. }
  153. /*!
  154. * Get the plugin's native unique Id.\n
  155. * May return 0 on plugin types that don't support Ids.
  156. */
  157. virtual long uniqueId() const
  158. {
  159. return 0;
  160. }
  161. /*!
  162. * Get the plugin's latency, in samples.
  163. */
  164. uint32_t latency() const;
  165. // -------------------------------------------------------------------
  166. // Information (count)
  167. /*!
  168. * Get the number of audio inputs.
  169. */
  170. virtual uint32_t audioInCount() const;
  171. /*!
  172. * Get the number of audio outputs.
  173. */
  174. virtual uint32_t audioOutCount() const;
  175. /*!
  176. * Get the number of MIDI inputs.
  177. */
  178. virtual uint32_t midiInCount() const;
  179. /*!
  180. * Get the number of MIDI outputs.
  181. */
  182. virtual uint32_t midiOutCount() const;
  183. /*!
  184. * Get the number of parameters.\n
  185. * To know the number of parameter inputs and outputs separately use getParameterCountInfo() instead.
  186. */
  187. uint32_t parameterCount() const;
  188. /*!
  189. * Get the number of scalepoints for parameter \a parameterId.
  190. */
  191. virtual uint32_t parameterScalePointCount(const uint32_t parameterId) const;
  192. /*!
  193. * Get the number of programs.
  194. */
  195. uint32_t programCount() const;
  196. /*!
  197. * Get the number of MIDI programs.
  198. */
  199. uint32_t midiProgramCount() const;
  200. /*!
  201. * Get the number of custom data sets.
  202. */
  203. size_t customDataCount() const;
  204. // -------------------------------------------------------------------
  205. // Information (current data)
  206. /*!
  207. * Get the current program number (-1 if unset).
  208. *
  209. * \see setProgram()
  210. */
  211. int32_t currentProgram() const;
  212. /*!
  213. * Get the current MIDI program number (-1 if unset).
  214. *
  215. * \see setMidiProgram()
  216. * \see setMidiProgramById()
  217. */
  218. int32_t currentMidiProgram() const;
  219. /*!
  220. * Get the parameter data of \a parameterId.
  221. */
  222. const ParameterData& parameterData(const uint32_t parameterId) const;
  223. /*!
  224. * Get the parameter ranges of \a parameterId.
  225. */
  226. const ParameterRanges& parameterRanges(const uint32_t parameterId) const;
  227. /*!
  228. * Check if parameter \a parameterId is of output type.
  229. */
  230. bool parameterIsOutput(const uint32_t parameterId) const;
  231. /*!
  232. * Get the MIDI program at \a index.
  233. *
  234. * \see getMidiProgramName()
  235. */
  236. const MidiProgramData& midiProgramData(const uint32_t index) const;
  237. /*!
  238. * Get the custom data set at \a index.
  239. *
  240. * \see setCustomData()
  241. */
  242. const CustomData& customData(const size_t index) const;
  243. /*!
  244. * Get the complete plugin chunk data into \a dataPtr.
  245. *
  246. * \return The size of the chunk or 0 if invalid.
  247. *
  248. * \note Make sure to verify the plugin supports chunks before calling this function!
  249. *
  250. * \see setChunkData()
  251. */
  252. virtual int32_t chunkData(void** const dataPtr);
  253. // -------------------------------------------------------------------
  254. // Information (per-plugin data)
  255. /*!
  256. * Get the current parameter value of \a parameterId.
  257. */
  258. virtual float getParameterValue(const uint32_t parameterId);
  259. /*!
  260. * Get the scalepoint \a scalePointId value of the parameter \a parameterId.
  261. */
  262. virtual float getParameterScalePointValue(const uint32_t parameterId, const uint32_t scalePointId);
  263. /*!
  264. * Get the plugin's label (URI for PLUGIN_LV2).
  265. */
  266. virtual void getLabel(char* const strBuf);
  267. /*!
  268. * Get the plugin's maker.
  269. */
  270. virtual void getMaker(char* const strBuf);
  271. /*!
  272. * Get the plugin's copyright/license.
  273. */
  274. virtual void getCopyright(char* const strBuf);
  275. /*!
  276. * Get the plugin's (real) name.
  277. *
  278. * \see name()
  279. */
  280. virtual void getRealName(char* const strBuf);
  281. /*!
  282. * Get the name of the parameter \a parameterId.
  283. */
  284. virtual void getParameterName(const uint32_t parameterId, char* const strBuf);
  285. /*!
  286. * Get the symbol of the parameter \a parameterId.
  287. */
  288. virtual void getParameterSymbol(const uint32_t parameterId, char* const strBuf);
  289. /*!
  290. * Get the custom text of the parameter \a parameterId.
  291. */
  292. virtual void getParameterText(const uint32_t parameterId, char* const strBuf);
  293. /*!
  294. * Get the unit of the parameter \a parameterId.
  295. */
  296. virtual void getParameterUnit(const uint32_t parameterId, char* const strBuf);
  297. /*!
  298. * Get the scalepoint \a scalePointId label of the parameter \a parameterId.
  299. */
  300. virtual void getParameterScalePointLabel(const uint32_t parameterId, const uint32_t scalePointId, char* const strBuf);
  301. /*!
  302. * Get the name of the program at \a index.
  303. */
  304. void getProgramName(const uint32_t index, char* const strBuf);
  305. /*!
  306. * Get the name of the MIDI program at \a index.
  307. *
  308. * \see getMidiProgramInfo()
  309. */
  310. void getMidiProgramName(const uint32_t index, char* const strBuf);
  311. /*!
  312. * Get information about the plugin's parameter count.\n
  313. * This is used to check how many input, output and total parameters are available.\n
  314. *
  315. * \note Some parameters might not be input or output (ie, invalid).
  316. *
  317. * \see parameterCount()
  318. */
  319. void getParameterCountInfo(uint32_t* const ins, uint32_t* const outs, uint32_t* const total);
  320. /*!
  321. * Get the plugin's save state.\n
  322. * The plugin will automatically call prepareForSave() as needed.
  323. *
  324. * \see loadSaveState()
  325. */
  326. virtual const SaveState& getSaveState();
  327. /*!
  328. * Get the plugin's save state.
  329. *
  330. * \see getSaveState()
  331. */
  332. virtual void loadSaveState(const SaveState& saveState);
  333. // -------------------------------------------------------------------
  334. // Set data (internal stuff)
  335. /*!
  336. * Set the plugin's id to \a id.
  337. *
  338. * \see id()
  339. */
  340. void setId(const unsigned int id);
  341. /*!
  342. * Enable or disable the plugin according to \a yesNo.
  343. *
  344. * When a plugin is disabled, it will never be processed or managed in any way.\n
  345. * To 'bypass' a plugin use setActive() instead.
  346. *
  347. * \see enabled()
  348. */
  349. void setEnabled(const bool yesNo);
  350. /*!
  351. * Set plugin as active according to \a active.
  352. *
  353. * \param sendOsc Send message change over OSC
  354. * \param sendCallback Send message change to registered callback
  355. */
  356. void setActive(const bool active, const bool sendOsc, const bool sendCallback);
  357. /*!
  358. * Set the plugin's dry/wet signal value to \a value.\n
  359. * \a value must be between 0.0 and 1.0.
  360. *
  361. * \param sendOsc Send message change over OSC
  362. * \param sendCallback Send message change to registered callback
  363. */
  364. void setDryWet(const float value, const bool sendOsc, const bool sendCallback);
  365. /*!
  366. * Set the plugin's output volume to \a value.\n
  367. * \a value must be between 0.0 and 1.27.
  368. *
  369. * \param sendOsc Send message change over OSC
  370. * \param sendCallback Send message change to registered callback
  371. */
  372. void setVolume(const float value, const bool sendOsc, const bool sendCallback);
  373. /*!
  374. * Set the plugin's output left balance value to \a value.\n
  375. * \a value must be between -1.0 and 1.0.
  376. *
  377. * \param sendOsc Send message change over OSC
  378. * \param sendCallback Send message change to registered callback
  379. *
  380. * \note Pure-Stereo plugins only!
  381. */
  382. void setBalanceLeft(const float value, const bool sendOsc, const bool sendCallback);
  383. /*!
  384. * Set the plugin's output right balance value to \a value.\n
  385. * \a value must be between -1.0 and 1.0.
  386. *
  387. * \param sendOsc Send message change over OSC
  388. * \param sendCallback Send message change to registered callback
  389. *
  390. * \note Pure-Stereo plugins only!
  391. */
  392. void setBalanceRight(const float value, const bool sendOsc, const bool sendCallback);
  393. /*!
  394. * Set the plugin's output panning value to \a value.\n
  395. * \a value must be between -1.0 and 1.0.
  396. *
  397. * \param sendOsc Send message change over OSC
  398. * \param sendCallback Send message change to registered callback
  399. *
  400. * \note Force-Stereo plugins only!
  401. */
  402. void setPanning(const float value, const bool sendOsc, const bool sendCallback);
  403. #if 0 //ndef BUILD_BRIDGE
  404. /*!
  405. * BridgePlugin call used to set internal data.
  406. */
  407. virtual int setOscBridgeInfo(const PluginBridgeInfoType type, const int argc, const lo_arg* const* const argv, const char* const types);
  408. #endif
  409. // -------------------------------------------------------------------
  410. // Set data (plugin-specific stuff)
  411. /*!
  412. * Set a plugin's parameter value.
  413. *
  414. * \param parameterId The parameter to change
  415. * \param value The new parameter value, must be within the parameter's range
  416. * \param sendGui Send message change to plugin's custom GUI, if any
  417. * \param sendOsc Send message change over OSC
  418. * \param sendCallback Send message change to registered callback
  419. *
  420. * \see getParameterValue()
  421. */
  422. virtual void setParameterValue(const uint32_t parameterId, const float value, const bool sendGui, const bool sendOsc, const bool sendCallback);
  423. /*!
  424. * Set a plugin's parameter value, including internal parameters.\n
  425. * \a rindex can be negative to allow internal parameters change (as defined in InternalParametersIndex).
  426. *
  427. * \see setParameterValue()
  428. * \see setActive()
  429. * \see setDryWet()
  430. * \see setVolume()
  431. * \see setBalanceLeft()
  432. * \see setBalanceRight()
  433. */
  434. void setParameterValueByRIndex(const int32_t rindex, const float value, const bool sendGui, const bool sendOsc, const bool sendCallback);
  435. /*!
  436. * Set parameter's \a parameterId MIDI channel to \a channel.\n
  437. * \a channel must be between 0 and 15.
  438. */
  439. void setParameterMidiChannel(const uint32_t parameterId, uint8_t channel, const bool sendOsc, const bool sendCallback);
  440. /*!
  441. * Set parameter's \a parameterId MIDI CC to \a cc.\n
  442. * \a cc must be between 0 and 95 (0x5F), or -1 for invalid.
  443. */
  444. void setParameterMidiCC(const uint32_t parameterId, int16_t cc, const bool sendOsc, const bool sendCallback);
  445. /*!
  446. * Add a custom data set.\n
  447. * If \a key already exists, its current value will be swapped with \a value.
  448. *
  449. * \param type Type of data used in \a value.
  450. * \param key A key identifing this data set.
  451. * \param value The value of the data set, of type \a type.
  452. * \param sendGui Send message change to plugin's custom GUI, if any
  453. *
  454. * \see customData()
  455. */
  456. virtual void setCustomData(const char* const type, const char* const key, const char* const value, const bool sendGui);
  457. /*!
  458. * Set the complete chunk data as \a stringData.\n
  459. * \a stringData must a base64 encoded string of binary data.
  460. *
  461. * \see chunkData()
  462. *
  463. * \note Make sure to verify the plugin supports chunks before calling this function!
  464. */
  465. virtual void setChunkData(const char* const stringData);
  466. /*!
  467. * Change the current plugin program to \a index.
  468. *
  469. * If \a index is negative the plugin's program will be considered unset.\n
  470. * The plugin's default parameter values will be updated when this function is called.
  471. *
  472. * \param index New program index to use
  473. * \param sendGui Send message change to plugin's custom GUI, if any
  474. * \param sendOsc Send message change over OSC
  475. * \param sendCallback Send message change to registered callback
  476. * \param block Block the audio callback
  477. */
  478. virtual void setProgram(const int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback, const bool block);
  479. /*!
  480. * Change the current MIDI plugin program to \a index.
  481. *
  482. * If \a index is negative the plugin's program will be considered unset.\n
  483. * The plugin's default parameter values will be updated when this function is called.
  484. *
  485. * \param index New program index to use
  486. * \param sendGui Send message change to plugin's custom GUI, if any
  487. * \param sendOsc Send message change over OSC
  488. * \param sendCallback Send message change to registered callback
  489. * \param block Block the audio callback
  490. */
  491. virtual void setMidiProgram(const int32_t index, const bool sendGui, const bool sendOsc, const bool sendCallback, const bool block);
  492. /*!
  493. * This is an overloaded call to setMidiProgram().\n
  494. * It changes the current MIDI program using \a bank and \a program values instead of index.
  495. */
  496. void setMidiProgramById(const uint32_t bank, const uint32_t program, const bool sendGui, const bool sendOsc, const bool sendCallback, const bool block);
  497. // -------------------------------------------------------------------
  498. // Set gui stuff
  499. /*!
  500. * Show (or hide) the plugin's custom GUI according to \a yesNo.
  501. *
  502. * \note This function must be always called from the main thread.
  503. */
  504. virtual void showGui(const bool yesNo);
  505. /*!
  506. * Idle the plugin's custom GUI.
  507. *
  508. * \note This function must be always called from the main thread.
  509. */
  510. virtual void idleGui();
  511. // -------------------------------------------------------------------
  512. // Plugin state
  513. /*!
  514. * Reload the plugin's entire state (including programs).\n
  515. * The plugin will be disabled during this call.
  516. */
  517. virtual void reload();
  518. /*!
  519. * Reload the plugin's programs state.
  520. */
  521. virtual void reloadPrograms(const bool init);
  522. /*!
  523. * Tell the plugin to prepare for save.
  524. */
  525. virtual void prepareForSave();
  526. // -------------------------------------------------------------------
  527. // Plugin processing
  528. /*!
  529. * Plugin process callback.
  530. */
  531. virtual void process(float** const inBuffer, float** const outBuffer, const uint32_t frames, const uint32_t framesOffset = 0);
  532. /*!
  533. * Tell the plugin the current buffer size has changed.
  534. */
  535. virtual void bufferSizeChanged(const uint32_t newBufferSize);
  536. /*!
  537. * Tell the plugin the current sample rate has changed.
  538. */
  539. virtual void sampleRateChanged(const double newSampleRate);
  540. /*!
  541. * Recreate latency audio buffers.
  542. */
  543. void recreateLatencyBuffers();
  544. // -------------------------------------------------------------------
  545. // OSC stuff
  546. /*!
  547. * Register this plugin to the engine's OSC client (controller or bridge).
  548. */
  549. void registerToOscClient();
  550. /*!
  551. * Update the plugin's internal OSC data according to \a source and \a url.\n
  552. * This is used for OSC-GUI bridges.
  553. */
  554. void updateOscData(const lo_address& source, const char* const url);
  555. /*!
  556. * Free the plugin's internal OSC memory data.
  557. */
  558. void freeOscData();
  559. /*!
  560. * Show the plugin's OSC based GUI.\n
  561. * This is a handy function that waits for the GUI to respond and automatically asks it to show itself.
  562. */
  563. bool waitForOscGuiShow();
  564. // -------------------------------------------------------------------
  565. // MIDI events
  566. /*!
  567. * Send a single midi note to be processed in the next audio callback.\n
  568. * A note with 0 velocity means note-off.
  569. * \note Non-RT call
  570. */
  571. void sendMidiSingleNote(const uint8_t channel, const uint8_t note, const uint8_t velo, const bool sendGui, const bool sendOsc, const bool sendCallback);
  572. /*!
  573. * Send all midi notes off for the next audio callback.\n
  574. * This doesn't send the actual MIDI All-Notes-Off event, but 128 note-offs instead.
  575. */
  576. void sendMidiAllNotesOff();
  577. // -------------------------------------------------------------------
  578. // Post-poned events
  579. /*!
  580. * Post pone an event of type \a type.\n
  581. * The event will be processed later, but as soon as possible.
  582. */
  583. void postponeRtEvent(const PluginPostRtEventType type, const int32_t value1, const int32_t value2, const double value3);
  584. /*!
  585. * Process all the post-poned events.
  586. * This function must be called from the main thread (ie, idleGui()) if PLUGIN_USES_SINGLE_THREAD is set.
  587. */
  588. void postRtEventsRun();
  589. /*!
  590. * Tell the UI a parameter has changed.
  591. */
  592. virtual void uiParameterChange(const uint32_t index, const double value);
  593. /*!
  594. * Tell the UI the current program has changed.
  595. */
  596. virtual void uiProgramChange(const uint32_t index);
  597. /*!
  598. * Tell the UI the current midi program has changed.
  599. */
  600. virtual void uiMidiProgramChange(const uint32_t index);
  601. /*!
  602. * Tell the UI a note has been pressed.
  603. */
  604. virtual void uiNoteOn(const uint8_t channel, const uint8_t note, const uint8_t velo);
  605. /*!
  606. * Tell the UI a note has been released.
  607. */
  608. virtual void uiNoteOff(const uint8_t channel, const uint8_t note);
  609. // -------------------------------------------------------------------
  610. // Cleanup
  611. /*!
  612. * Initialize all RT buffers of the plugin.
  613. */
  614. virtual void initBuffers();
  615. /*!
  616. * Delete all temporary buffers of the plugin.
  617. */
  618. virtual void deleteBuffers();
  619. // -------------------------------------------------------------------
  620. // Library functions
  621. /*!
  622. * Open the DLL \a filename.
  623. */
  624. bool libOpen(const char* const filename);
  625. /*!
  626. * Close the DLL previously loaded in libOpen().
  627. */
  628. bool libClose();
  629. /*!
  630. * Get the symbol entry \a symbol of the currently loaded DLL.
  631. */
  632. void* libSymbol(const char* const symbol);
  633. /*!
  634. * Get the last DLL related error.
  635. */
  636. const char* libError(const char* const filename);
  637. // -------------------------------------------------------------------
  638. // Engine helpers
  639. /*!
  640. * TODO.
  641. */
  642. float* getAudioInPortBuffer(uint32_t index);
  643. /*!
  644. * TODO.
  645. */
  646. float* getAudioOutPortBuffer(uint32_t index);
  647. /*!
  648. * TODO.
  649. */
  650. CarlaEngine* getEngine() const;
  651. // -------------------------------------------------------------------
  652. // Plugin initializers
  653. struct Initializer {
  654. CarlaEngine* const engine;
  655. const unsigned int id;
  656. const char* const filename;
  657. const char* const name;
  658. const char* const label;
  659. };
  660. static size_t getNativePluginCount();
  661. static const PluginDescriptor* getNativePluginDescriptor(const size_t index);
  662. static CarlaPlugin* newNative(const Initializer& init);
  663. static CarlaPlugin* newBridge(const Initializer& init, const BinaryType btype, const PluginType ptype, const char* const bridgeFilename);
  664. static CarlaPlugin* newLADSPA(const Initializer& init, const LADSPA_RDF_Descriptor* const rdfDescriptor);
  665. static CarlaPlugin* newDSSI(const Initializer& init, const char* const guiFilename);
  666. static CarlaPlugin* newLV2(const Initializer& init);
  667. static CarlaPlugin* newVST(const Initializer& init);
  668. static CarlaPlugin* newGIG(const Initializer& init);
  669. static CarlaPlugin* newSFZ(const Initializer& init);
  670. static CarlaPlugin* newSF2(const Initializer& init);
  671. // -------------------------------------------------------------------
  672. protected:
  673. ScopedPointer<CarlaPluginProtectedData> const fData;
  674. class ScopedDisabler
  675. {
  676. public:
  677. ScopedDisabler(CarlaPlugin* const plugin);
  678. ~ScopedDisabler();
  679. private:
  680. CarlaPlugin* const kPlugin;
  681. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ScopedDisabler)
  682. };
  683. private:
  684. CARLA_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CarlaPlugin)
  685. };
  686. /**@}*/
  687. CARLA_BACKEND_END_NAMESPACE
  688. #endif // __CARLA_PLUGIN_HPP__