DISTRHO Plugin Framework
DistrhoPlugin.hpp
1 /*
2  * DISTRHO Plugin Framework (DPF)
3  * Copyright (C) 2012-2018 Filipe Coelho <falktx@falktx.com>
4  *
5  * Permission to use, copy, modify, and/or distribute this software for any purpose with
6  * or without fee is hereby granted, provided that the above copyright notice and this
7  * permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
10  * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
11  * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
12  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
13  * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 #ifndef DISTRHO_PLUGIN_HPP_INCLUDED
18 #define DISTRHO_PLUGIN_HPP_INCLUDED
19 
20 #include "extra/String.hpp"
21 #include "extra/LeakDetector.hpp"
22 #include "src/DistrhoPluginChecks.h"
23 
24 START_NAMESPACE_DISTRHO
25 
26 /* ------------------------------------------------------------------------------------------------------------
27  * Audio Port Hints */
28 
29 /**
30  @defgroup AudioPortHints Audio Port Hints
31 
32  Various audio port hints.
33  @see AudioPort::hints
34  @{
35  */
36 
37 /**
38  Audio port can be used as control voltage (LV2 only).
39  */
40 static const uint32_t kAudioPortIsCV = 0x1;
41 
42 /**
43  Audio port should be used as sidechan (LV2 only).
44  */
45 static const uint32_t kAudioPortIsSidechain = 0x2;
46 
47 /** @} */
48 
49 /* ------------------------------------------------------------------------------------------------------------
50  * Parameter Hints */
51 
52 /**
53  @defgroup ParameterHints Parameter Hints
54 
55  Various parameter hints.
56  @see Parameter::hints
57  @{
58  */
59 
60 /**
61  Parameter is automable (real-time safe).
62  @see Plugin::setParameterValue(uint32_t, float)
63  */
64 static const uint32_t kParameterIsAutomable = 0x01;
65 
66 /**
67  Parameter value is boolean.@n
68  It's always at either minimum or maximum value.
69  */
70 static const uint32_t kParameterIsBoolean = 0x02;
71 
72 /**
73  Parameter value is integer.
74  */
75 static const uint32_t kParameterIsInteger = 0x04;
76 
77 /**
78  Parameter value is logarithmic.
79  */
80 static const uint32_t kParameterIsLogarithmic = 0x08;
81 
82 /**
83  Parameter is of output type.@n
84  When unset, parameter is assumed to be of input type.
85 
86  Parameter inputs are changed by the host and must not be changed by the plugin.@n
87  The only exception being when changing programs, see Plugin::loadProgram().@n
88  Outputs are changed by the plugin and never modified by the host.
89  */
90 static const uint32_t kParameterIsOutput = 0x10;
91 
92 /**
93  Parameter value is a trigger.@n
94  This means the value resets back to its default after each process/run call.@n
95  Cannot be used for output parameters.
96 
97  @note Only officially supported under LV2. For other formats DPF simulates the behaviour.
98 */
99 static const uint32_t kParameterIsTrigger = 0x20 | kParameterIsBoolean;
100 
101 /** @} */
102 
103 /* ------------------------------------------------------------------------------------------------------------
104  * Base Plugin structs */
105 
106 /**
107  @defgroup BasePluginStructs Base Plugin Structs
108  @{
109  */
110 
111 /**
112  Audio Port.
113  */
114 struct AudioPort {
115  /**
116  Hints describing this audio port.
117  @see AudioPortHints
118  */
119  uint32_t hints;
120 
121  /**
122  The name of this audio port.@n
123  An audio port name can contain any character, but hosts might have a hard time with non-ascii ones.@n
124  The name doesn't have to be unique within a plugin instance, but it's recommended.
125  */
127 
128  /**
129  The symbol of this audio port.@n
130  An audio port symbol is a short restricted name used as a machine and human readable identifier.@n
131  The first character must be one of _, a-z or A-Z and subsequent characters can be from _, a-z, A-Z and 0-9.
132  @note Audio port and parameter symbols MUST be unique within a plugin instance.
133  */
135 
136  /**
137  Default constructor for a regular audio port.
138  */
139  AudioPort() noexcept
140  : hints(0x0),
141  name(),
142  symbol() {}
143 };
144 
145 /**
146  Parameter designation.@n
147  Allows a parameter to be specially designated for a task, like bypass.
148 
149  Each designation is unique, there must be only one parameter that uses it.@n
150  The use of designated parameters is completely optional.
151 
152  @note Designated parameters have strict ranges.
153  @see ParameterRanges::adjustForDesignation()
154  */
156  /**
157  Null or unset designation.
158  */
160 
161  /**
162  Bypass designation.@n
163  When on (> 0.5f), it means the plugin must run in a bypassed state.
164  */
166 };
167 
168 /**
169  Parameter ranges.@n
170  This is used to set the default, minimum and maximum values of a parameter.
171 
172  By default a parameter has 0.0 as minimum, 1.0 as maximum and 0.0 as default.@n
173  When changing this struct values you must ensure maximum > minimum and default is within range.
174  */
176  /**
177  Default value.
178  */
179  float def;
180 
181  /**
182  Minimum value.
183  */
184  float min;
185 
186  /**
187  Maximum value.
188  */
189  float max;
190 
191  /**
192  Default constructor, using 0.0 as minimum, 1.0 as maximum and 0.0 as default.
193  */
194  ParameterRanges() noexcept
195  : def(0.0f),
196  min(0.0f),
197  max(1.0f) {}
198 
199  /**
200  Constructor using custom values.
201  */
202  ParameterRanges(float df, float mn, float mx) noexcept
203  : def(df),
204  min(mn),
205  max(mx) {}
206 
207  /**
208  Fix the default value within range.
209  */
210  void fixDefault() noexcept
211  {
212  fixValue(def);
213  }
214 
215  /**
216  Fix a value within range.
217  */
218  void fixValue(float& value) const noexcept
219  {
220  if (value < min)
221  value = min;
222  else if (value > max)
223  value = max;
224  }
225 
226  /**
227  Get a fixed value within range.
228  */
229  const float& getFixedValue(const float& value) const noexcept
230  {
231  if (value <= min)
232  return min;
233  if (value >= max)
234  return max;
235  return value;
236  }
237 
238  /**
239  Get a value normalized to 0.0<->1.0.
240  */
241  float getNormalizedValue(const float& value) const noexcept
242  {
243  const float normValue((value - min) / (max - min));
244 
245  if (normValue <= 0.0f)
246  return 0.0f;
247  if (normValue >= 1.0f)
248  return 1.0f;
249  return normValue;
250  }
251 
252  /**
253  Get a value normalized to 0.0<->1.0, fixed within range.
254  */
255  float getFixedAndNormalizedValue(const float& value) const noexcept
256  {
257  if (value <= min)
258  return 0.0f;
259  if (value >= max)
260  return 1.0f;
261 
262  const float normValue((value - min) / (max - min));
263 
264  if (normValue <= 0.0f)
265  return 0.0f;
266  if (normValue >= 1.0f)
267  return 1.0f;
268 
269  return normValue;
270  }
271 
272  /**
273  Get a proper value previously normalized to 0.0<->1.0.
274  */
275  float getUnnormalizedValue(const float& value) const noexcept
276  {
277  if (value <= 0.0f)
278  return min;
279  if (value >= 1.0f)
280  return max;
281 
282  return value * (max - min) + min;
283  }
284 };
285 
286 /**
287  Parameter enumeration value.@n
288  A string representation of a plugin parameter value.@n
289  Used together can be used to give meaning to parameter values, working as an enumeration.
290  */
292  /**
293  Parameter value.
294  */
295  float value;
296 
297  /**
298  String representation of this value.
299  */
301 
302  /**
303  Default constructor, using 0.0 as value and empty label.
304  */
306  : value(0.0f),
307  label() {}
308 
309  /**
310  Constructor using custom values.
311  */
312  ParameterEnumerationValue(float v, const char* l) noexcept
313  : value(v),
314  label(l) {}
315 };
316 
317 /**
318  Collection of parameter enumeration values.@n
319  Handy class to handle the lifetime and count of all enumeration values.
320  */
322  /**
323  Number of elements allocated in @values.
324  */
325  uint8_t count;
326 
327  /**
328  Wherever the host is to be restricted to only use enumeration values.
329 
330  @note This mode is only a hint! Not all hosts and plugin formats support this mode.
331  */
333 
334  /**
335  Array of @ParameterEnumerationValue items.@n
336  This pointer must be null or have been allocated on the heap with `new`.
337  */
339 
340  /**
341  Default constructor, for zero enumeration values.
342  */
344  : count(0),
345  restrictedMode(false),
346  values() {}
347 
348  /**
349  Constructor using custom values.@n
350  The pointer to @values must have been allocated on the heap with `new`.
351  */
352  ParameterEnumerationValues(uint32_t c, bool r, const ParameterEnumerationValue* v) noexcept
353  : count(c),
354  restrictedMode(r),
355  values(v) {}
356 
357  ~ParameterEnumerationValues() noexcept
358  {
359  count = 0;
360  restrictedMode = false;
361 
362  if (values != nullptr)
363  {
364  delete[] values;
365  values = nullptr;
366  }
367  }
368 };
369 
370 /**
371  Parameter.
372  */
373 struct Parameter {
374  /**
375  Hints describing this parameter.
376  @see ParameterHints
377  */
378  uint32_t hints;
379 
380  /**
381  The name of this parameter.@n
382  A parameter name can contain any character, but hosts might have a hard time with non-ascii ones.@n
383  The name doesn't have to be unique within a plugin instance, but it's recommended.
384  */
386 
387  /**
388  The symbol of this parameter.@n
389  A parameter symbol is a short restricted name used as a machine and human readable identifier.@n
390  The first character must be one of _, a-z or A-Z and subsequent characters can be from _, a-z, A-Z and 0-9.
391  @note Parameter symbols MUST be unique within a plugin instance.
392  */
394 
395  /**
396  The unit of this parameter.@n
397  This means something like "dB", "kHz" and "ms".@n
398  Can be left blank if a unit does not apply to this parameter.
399  */
401 
402  /**
403  Ranges of this parameter.@n
404  The ranges describe the default, minimum and maximum values.
405  */
407 
408  /**
409  Enumeration values.@n
410  Can be used to give meaning to parameter values, working as an enumeration.
411  */
413 
414  /**
415  Designation for this parameter.
416  */
418 
419  /**
420  MIDI CC to use by default on this parameter.@n
421  A value of 0 or 32 (bank change) is considered invalid.@n
422  Must also be less or equal to 120.
423  @note This value is only a hint! Hosts might map it automatically or completely ignore it.
424  */
425  uint8_t midiCC;
426 
427  /**
428  Default constructor for a null parameter.
429  */
430  Parameter() noexcept
431  : hints(0x0),
432  name(),
433  symbol(),
434  unit(),
435  ranges(),
436  enumValues(),
437  designation(kParameterDesignationNull),
438  midiCC(0) {}
439 
440  /**
441  Constructor using custom values.
442  */
443  Parameter(uint32_t h, const char* n, const char* s, const char* u, float def, float min, float max) noexcept
444  : hints(h),
445  name(n),
446  symbol(s),
447  unit(u),
448  ranges(def, min, max),
449  enumValues(),
450  designation(kParameterDesignationNull),
451  midiCC(0) {}
452 
453  /**
454  Initialize a parameter for a specific designation.
455  */
457  {
458  designation = d;
459 
460  switch (d)
461  {
463  break;
466  name = "Bypass";
467  symbol = "dpf_bypass";
468  unit = "";
469  midiCC = 0;
470  ranges.def = 0.0f;
471  ranges.min = 0.0f;
472  ranges.max = 1.0f;
473  break;
474  }
475  }
476 };
477 
478 /**
479  MIDI event.
480  */
481 struct MidiEvent {
482  /**
483  Size of internal data.
484  */
485  static const uint32_t kDataSize = 4;
486 
487  /**
488  Time offset in frames.
489  */
490  uint32_t frame;
491 
492  /**
493  Number of bytes used.
494  */
495  uint32_t size;
496 
497  /**
498  MIDI data.@n
499  If size > kDataSize, dataExt is used (otherwise null).
500  */
501  uint8_t data[kDataSize];
502  const uint8_t* dataExt;
503 };
504 
505 /**
506  Time position.@n
507  The @a playing and @a frame values are always valid.@n
508  BBT values are only valid when @a bbt.valid is true.
509 
510  This struct is inspired by the JACK Transport API.
511  */
512 struct TimePosition {
513  /**
514  Wherever the host transport is playing/rolling.
515  */
516  bool playing;
517 
518  /**
519  Current host transport position in frames.
520  */
521  uint64_t frame;
522 
523  /**
524  Bar-Beat-Tick time position.
525  */
526  struct BarBeatTick {
527  /**
528  Wherever the host transport is using BBT.@n
529  If false you must not read from this struct.
530  */
531  bool valid;
532 
533  /**
534  Current bar.@n
535  Should always be > 0.@n
536  The first bar is bar '1'.
537  */
538  int32_t bar;
539 
540  /**
541  Current beat within bar.@n
542  Should always be > 0 and <= @a beatsPerBar.@n
543  The first beat is beat '1'.
544  */
545  int32_t beat;
546 
547  /**
548  Current tick within beat.@n
549  Should always be > 0 and <= @a ticksPerBeat.@n
550  The first tick is tick '0'.
551  */
552  int32_t tick;
553 
554  /**
555  Number of ticks that have elapsed between frame 0 and the first beat of the current measure.
556  */
557  double barStartTick;
558 
559  /**
560  Time signature "numerator".
561  */
562  float beatsPerBar;
563 
564  /**
565  Time signature "denominator".
566  */
567  float beatType;
568 
569  /**
570  Number of ticks within a bar.@n
571  Usually a moderately large integer with many denominators, such as 1920.0.
572  */
573  double ticksPerBeat;
574 
575  /**
576  Number of beats per minute.
577  */
579 
580  /**
581  Default constructor for a null BBT time position.
582  */
583  BarBeatTick() noexcept
584  : valid(false),
585  bar(0),
586  beat(0),
587  tick(0),
588  barStartTick(0.0),
589  beatsPerBar(0.0f),
590  beatType(0.0f),
591  ticksPerBeat(0.0),
592  beatsPerMinute(0.0) {}
593  } bbt;
594 
595  /**
596  Default constructor for a time position.
597  */
598  TimePosition() noexcept
599  : playing(false),
600  frame(0),
601  bbt() {}
602 };
603 
604 /** @} */
605 
606 /* ------------------------------------------------------------------------------------------------------------
607  * DPF Plugin */
608 
609 /**
610  @defgroup MainClasses Main Classes
611  @{
612  */
613 
614 /**
615  DPF Plugin class from where plugin instances are created.
616 
617  The public methods (Host state) are called from the plugin to get or set host information.@n
618  They can be called from a plugin instance at anytime unless stated otherwise.@n
619  All other methods are to be implemented by the plugin and will be called by the host.
620 
621  Shortly after a plugin instance is created, the various init* functions will be called by the host.@n
622  Host will call activate() before run(), and deactivate() before the plugin instance is destroyed.@n
623  The host may call deactivate right after activate and vice-versa, but never activate/deactivate consecutively.@n
624  There is no limit on how many times run() is called, only that activate/deactivate will be called in between.
625 
626  The buffer size and sample rate values will remain constant between activate and deactivate.@n
627  Buffer size is only a hint though, the host might call run() with a higher or lower number of frames.
628 
629  Some of this class functions are only available according to some macros.
630 
631  DISTRHO_PLUGIN_WANT_PROGRAMS activates program related features.@n
632  When enabled you need to implement initProgramName() and loadProgram().
633 
634  DISTRHO_PLUGIN_WANT_STATE activates internal state features.@n
635  When enabled you need to implement initStateKey() and setState().
636 
637  The process function run() changes wherever DISTRHO_PLUGIN_WANT_MIDI_INPUT is enabled or not.@n
638  When enabled it provides midi input events.
639  */
640 class Plugin
641 {
642 public:
643  /**
644  Plugin class constructor.@n
645  You must set all parameter values to their defaults, matching ParameterRanges::def.
646  */
647  Plugin(uint32_t parameterCount, uint32_t programCount, uint32_t stateCount);
648 
649  /**
650  Destructor.
651  */
652  virtual ~Plugin();
653 
654  /* --------------------------------------------------------------------------------------------------------
655  * Host state */
656 
657  /**
658  Get the current buffer size that will probably be used during processing, in frames.@n
659  This value will remain constant between activate and deactivate.
660  @note This value is only a hint!@n
661  Hosts might call run() with a higher or lower number of frames.
662  @see bufferSizeChanged(uint32_t)
663  */
664  uint32_t getBufferSize() const noexcept;
665 
666  /**
667  Get the current sample rate that will be used during processing.@n
668  This value will remain constant between activate and deactivate.
669  @see sampleRateChanged(double)
670  */
671  double getSampleRate() const noexcept;
672 
673 #if DISTRHO_PLUGIN_WANT_TIMEPOS
674  /**
675  Get the current host transport time position.@n
676  This function should only be called during run().@n
677  You can call this during other times, but the returned position is not guaranteed to be in sync.
678  @note TimePosition is not supported in LADSPA and DSSI plugin formats.
679  */
680  const TimePosition& getTimePosition() const noexcept;
681 #endif
682 
683 #if DISTRHO_PLUGIN_WANT_LATENCY
684  /**
685  Change the plugin audio output latency to @a frames.@n
686  This function should only be called in the constructor, activate() and run().
687  @note This function is only available if DISTRHO_PLUGIN_WANT_LATENCY is enabled.
688  */
689  void setLatency(uint32_t frames) noexcept;
690 #endif
691 
692 #if DISTRHO_PLUGIN_WANT_MIDI_OUTPUT
693  /**
694  Write a MIDI output event.@n
695  This function must only be called during run().@n
696  Returns false when the host buffer is full, in which case do not call this again until the next run().
697  */
698  bool writeMidiEvent(const MidiEvent& midiEvent) noexcept;
699 #endif
700 
701 protected:
702  /* --------------------------------------------------------------------------------------------------------
703  * Information */
704 
705  /**
706  Get the plugin name.@n
707  Returns DISTRHO_PLUGIN_NAME by default.
708  */
709  virtual const char* getName() const { return DISTRHO_PLUGIN_NAME; }
710 
711  /**
712  Get the plugin label.@n
713  This label is a short restricted name consisting of only _, a-z, A-Z and 0-9 characters.
714  */
715  virtual const char* getLabel() const = 0;
716 
717  /**
718  Get an extensive comment/description about the plugin.@n
719  Optional, returns nothing by default.
720  */
721  virtual const char* getDescription() const { return ""; }
722 
723  /**
724  Get the plugin author/maker.
725  */
726  virtual const char* getMaker() const = 0;
727 
728  /**
729  Get the plugin homepage.@n
730  Optional, returns nothing by default.
731  */
732  virtual const char* getHomePage() const { return ""; }
733 
734  /**
735  Get the plugin license (a single line of text or a URL).@n
736  For commercial plugins this should return some short copyright information.
737  */
738  virtual const char* getLicense() const = 0;
739 
740  /**
741  Get the plugin version, in hexadecimal.
742  @see d_version()
743  */
744  virtual uint32_t getVersion() const = 0;
745 
746  /**
747  Get the plugin unique Id.@n
748  This value is used by LADSPA, DSSI and VST plugin formats.
749  @see d_cconst()
750  */
751  virtual int64_t getUniqueId() const = 0;
752 
753  /* --------------------------------------------------------------------------------------------------------
754  * Init */
755 
756  /**
757  Initialize the audio port @a index.@n
758  This function will be called once, shortly after the plugin is created.
759  */
760  virtual void initAudioPort(bool input, uint32_t index, AudioPort& port);
761 
762  /**
763  Initialize the parameter @a index.@n
764  This function will be called once, shortly after the plugin is created.
765  */
766  virtual void initParameter(uint32_t index, Parameter& parameter) = 0;
767 
768 #if DISTRHO_PLUGIN_WANT_PROGRAMS
769  /**
770  Set the name of the program @a index.@n
771  This function will be called once, shortly after the plugin is created.@n
772  Must be implemented by your plugin class only if DISTRHO_PLUGIN_WANT_PROGRAMS is enabled.
773  */
774  virtual void initProgramName(uint32_t index, String& programName) = 0;
775 #endif
776 
777 #if DISTRHO_PLUGIN_WANT_STATE
778  /**
779  Set the state key and default value of @a index.@n
780  This function will be called once, shortly after the plugin is created.@n
781  Must be implemented by your plugin class only if DISTRHO_PLUGIN_WANT_STATE is enabled.
782  */
783  virtual void initState(uint32_t index, String& stateKey, String& defaultStateValue) = 0;
784 #endif
785 
786  /* --------------------------------------------------------------------------------------------------------
787  * Internal data */
788 
789  /**
790  Get the current value of a parameter.@n
791  The host may call this function from any context, including realtime processing.
792  */
793  virtual float getParameterValue(uint32_t index) const = 0;
794 
795  /**
796  Change a parameter value.@n
797  The host may call this function from any context, including realtime processing.@n
798  When a parameter is marked as automable, you must ensure no non-realtime operations are performed.
799  @note This function will only be called for parameter inputs.
800  */
801  virtual void setParameterValue(uint32_t index, float value) = 0;
802 
803 #if DISTRHO_PLUGIN_WANT_PROGRAMS
804  /**
805  Load a program.@n
806  The host may call this function from any context, including realtime processing.@n
807  Must be implemented by your plugin class only if DISTRHO_PLUGIN_WANT_PROGRAMS is enabled.
808  */
809  virtual void loadProgram(uint32_t index) = 0;
810 #endif
811 
812 #if DISTRHO_PLUGIN_WANT_FULL_STATE
813  /**
814  Get the value of an internal state.@n
815  The host may call this function from any non-realtime context.@n
816  Must be implemented by your plugin class if DISTRHO_PLUGIN_WANT_FULL_STATE is enabled.
817  @note The use of this function breaks compatibility with the DSSI format.
818  */
819  virtual String getState(const char* key) const = 0;
820 #endif
821 
822 #if DISTRHO_PLUGIN_WANT_STATE
823  /**
824  Change an internal state @a key to @a value.@n
825  Must be implemented by your plugin class only if DISTRHO_PLUGIN_WANT_STATE is enabled.
826  */
827  virtual void setState(const char* key, const char* value) = 0;
828 #endif
829 
830  /* --------------------------------------------------------------------------------------------------------
831  * Audio/MIDI Processing */
832 
833  /**
834  Activate this plugin.
835  */
836  virtual void activate() {}
837 
838  /**
839  Deactivate this plugin.
840  */
841  virtual void deactivate() {}
842 
843 #if DISTRHO_PLUGIN_WANT_MIDI_INPUT
844  /**
845  Run/process function for plugins with MIDI input.
846  @note Some parameters might be null if there are no audio inputs/outputs or MIDI events.
847  */
848  virtual void run(const float** inputs, float** outputs, uint32_t frames,
849  const MidiEvent* midiEvents, uint32_t midiEventCount) = 0;
850 #else
851  /**
852  Run/process function for plugins without MIDI input.
853  @note Some parameters might be null if there are no audio inputs or outputs.
854  */
855  virtual void run(const float** inputs, float** outputs, uint32_t frames) = 0;
856 #endif
857 
858  /* --------------------------------------------------------------------------------------------------------
859  * Callbacks (optional) */
860 
861  /**
862  Optional callback to inform the plugin about a buffer size change.@n
863  This function will only be called when the plugin is deactivated.
864  @note This value is only a hint!@n
865  Hosts might call run() with a higher or lower number of frames.
866  @see getBufferSize()
867  */
868  virtual void bufferSizeChanged(uint32_t newBufferSize);
869 
870  /**
871  Optional callback to inform the plugin about a sample rate change.@n
872  This function will only be called when the plugin is deactivated.
873  @see getSampleRate()
874  */
875  virtual void sampleRateChanged(double newSampleRate);
876 
877  // -------------------------------------------------------------------------------------------------------
878 
879 private:
880  struct PrivateData;
881  PrivateData* const pData;
882  friend class PluginExporter;
883 
884  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Plugin)
885 };
886 
887 /** @} */
888 
889 /* ------------------------------------------------------------------------------------------------------------
890  * Create plugin, entry point */
891 
892 /**
893  @defgroup EntryPoints Entry Points
894  @{
895  */
896 
897 /**
898  TODO.
899  */
900 extern Plugin* createPlugin();
901 
902 /** @} */
903 
904 // -----------------------------------------------------------------------------------------------------------
905 
906 END_NAMESPACE_DISTRHO
907 
908 #endif // DISTRHO_PLUGIN_HPP_INCLUDED
float min
Definition: DistrhoPlugin.hpp:184
Definition: DistrhoPlugin.hpp:114
ParameterDesignation designation
Definition: DistrhoPlugin.hpp:417
virtual void activate()
Definition: DistrhoPlugin.hpp:836
void initDesignation(ParameterDesignation d) noexcept
Definition: DistrhoPlugin.hpp:456
uint8_t midiCC
Definition: DistrhoPlugin.hpp:425
Parameter() noexcept
Definition: DistrhoPlugin.hpp:430
Plugin * createPlugin()
uint32_t frame
Definition: DistrhoPlugin.hpp:490
uint32_t size
Definition: DistrhoPlugin.hpp:495
String name
Definition: DistrhoPlugin.hpp:126
String symbol
Definition: DistrhoPlugin.hpp:393
String symbol
Definition: DistrhoPlugin.hpp:134
void fixValue(float &value) const noexcept
Definition: DistrhoPlugin.hpp:218
ParameterEnumerationValue() noexcept
Definition: DistrhoPlugin.hpp:305
virtual void deactivate()
Definition: DistrhoPlugin.hpp:841
Definition: DistrhoPlugin.hpp:159
ParameterEnumerationValues(uint32_t c, bool r, const ParameterEnumerationValue *v) noexcept
Definition: DistrhoPlugin.hpp:352
double ticksPerBeat
Definition: DistrhoPlugin.hpp:573
Definition: DistrhoPlugin.hpp:481
int32_t bar
Definition: DistrhoPlugin.hpp:538
Definition: DistrhoPlugin.hpp:291
Definition: String.hpp:29
ParameterEnumerationValues() noexcept
Definition: DistrhoPlugin.hpp:343
#define DISTRHO_PLUGIN_NAME
Definition: DistrhoInfo.hpp:466
Definition: DistrhoPlugin.hpp:321
static const uint32_t kAudioPortIsSidechain
Definition: DistrhoPlugin.hpp:45
ParameterRanges() noexcept
Definition: DistrhoPlugin.hpp:194
double beatsPerMinute
Definition: DistrhoPlugin.hpp:578
uint8_t count
Definition: DistrhoPlugin.hpp:325
float value
Definition: DistrhoPlugin.hpp:295
uint32_t hints
Definition: DistrhoPlugin.hpp:378
Definition: DistrhoPlugin.hpp:640
float getUnnormalizedValue(const float &value) const noexcept
Definition: DistrhoPlugin.hpp:275
bool playing
Definition: DistrhoPlugin.hpp:516
int32_t tick
Definition: DistrhoPlugin.hpp:552
float beatsPerBar
Definition: DistrhoPlugin.hpp:562
uint32_t hints
Definition: DistrhoPlugin.hpp:119
virtual const char * getHomePage() const
Definition: DistrhoPlugin.hpp:732
TimePosition() noexcept
Definition: DistrhoPlugin.hpp:598
ParameterEnumerationValues enumValues
Definition: DistrhoPlugin.hpp:412
uint64_t frame
Definition: DistrhoPlugin.hpp:521
BarBeatTick() noexcept
Definition: DistrhoPlugin.hpp:583
ParameterEnumerationValue(float v, const char *l) noexcept
Definition: DistrhoPlugin.hpp:312
static const uint32_t kParameterIsAutomable
Definition: DistrhoPlugin.hpp:64
float beatType
Definition: DistrhoPlugin.hpp:567
float getNormalizedValue(const float &value) const noexcept
Definition: DistrhoPlugin.hpp:241
float def
Definition: DistrhoPlugin.hpp:179
ParameterRanges(float df, float mn, float mx) noexcept
Definition: DistrhoPlugin.hpp:202
double barStartTick
Definition: DistrhoPlugin.hpp:557
Parameter(uint32_t h, const char *n, const char *s, const char *u, float def, float min, float max) noexcept
Definition: DistrhoPlugin.hpp:443
ParameterRanges ranges
Definition: DistrhoPlugin.hpp:406
AudioPort() noexcept
Definition: DistrhoPlugin.hpp:139
int32_t beat
Definition: DistrhoPlugin.hpp:545
virtual const char * getName() const
Definition: DistrhoPlugin.hpp:709
const float & getFixedValue(const float &value) const noexcept
Definition: DistrhoPlugin.hpp:229
static const uint32_t kParameterIsBoolean
Definition: DistrhoPlugin.hpp:70
float max
Definition: DistrhoPlugin.hpp:189
Definition: DistrhoPlugin.hpp:175
String label
Definition: DistrhoPlugin.hpp:300
virtual const char * getDescription() const
Definition: DistrhoPlugin.hpp:721
String unit
Definition: DistrhoPlugin.hpp:400
static const uint32_t kParameterIsInteger
Definition: DistrhoPlugin.hpp:75
Definition: DistrhoPlugin.hpp:165
Definition: DistrhoPlugin.hpp:373
static const uint32_t kAudioPortIsCV
Definition: DistrhoPlugin.hpp:40
bool valid
Definition: DistrhoPlugin.hpp:531
ParameterDesignation
Definition: DistrhoPlugin.hpp:155
bool restrictedMode
Definition: DistrhoPlugin.hpp:332
const ParameterEnumerationValue * values
Definition: DistrhoPlugin.hpp:338
void fixDefault() noexcept
Definition: DistrhoPlugin.hpp:210
float getFixedAndNormalizedValue(const float &value) const noexcept
Definition: DistrhoPlugin.hpp:255
static const uint32_t kParameterIsOutput
Definition: DistrhoPlugin.hpp:90
Definition: DistrhoPlugin.hpp:526
Definition: DistrhoPlugin.hpp:512
static const uint32_t kParameterIsTrigger
Definition: DistrhoPlugin.hpp:99
String name
Definition: DistrhoPlugin.hpp:385
static const uint32_t kParameterIsLogarithmic
Definition: DistrhoPlugin.hpp:80