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.

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