DISTRHO Plugin Framework
DistrhoPlugin.hpp
1 /*
2  * DISTRHO Plugin Framework (DPF)
3  * Copyright (C) 2012-2015 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 
94 /* ------------------------------------------------------------------------------------------------------------
95  * Base Plugin structs */
96 
97 /**
98  @defgroup BasePluginStructs Base Plugin Structs
99  @{
100  */
101 
102 /**
103  Audio Port.
104  */
105 struct AudioPort {
106  /**
107  Hints describing this audio port.
108  @see AudioPortHints
109  */
110  uint32_t hints;
111 
112  /**
113  The name of this audio port.@n
114  An audio port name can contain any character, but hosts might have a hard time with non-ascii ones.@n
115  The name doesn't have to be unique within a plugin instance, but it's recommended.
116  */
118 
119  /**
120  The symbol of this audio port.@n
121  An audio port symbol is a short restricted name used as a machine and human readable identifier.@n
122  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.
123  @note Audio port and parameter symbols MUST be unique within a plugin instance.
124  */
126 
127  /**
128  Default constructor for a regular audio port.
129  */
130  AudioPort() noexcept
131  : hints(0x0),
132  name(),
133  symbol() {}
134 };
135 
136 /**
137  Parameter ranges.@n
138  This is used to set the default, minimum and maximum values of a parameter.
139 
140  By default a parameter has 0.0 as minimum, 1.0 as maximum and 0.0 as default.@n
141  When changing this struct values you must ensure maximum > minimum and default is within range.
142  */
144  /**
145  Default value.
146  */
147  float def;
148 
149  /**
150  Minimum value.
151  */
152  float min;
153 
154  /**
155  Maximum value.
156  */
157  float max;
158 
159  /**
160  Default constructor, using 0.0 as minimum, 1.0 as maximum and 0.0 as default.
161  */
162  ParameterRanges() noexcept
163  : def(0.0f),
164  min(0.0f),
165  max(1.0f) {}
166 
167  /**
168  Constructor using custom values.
169  */
170  ParameterRanges(float df, float mn, float mx) noexcept
171  : def(df),
172  min(mn),
173  max(mx) {}
174 
175  /**
176  Fix the default value within range.
177  */
178  void fixDefault() noexcept
179  {
180  fixValue(def);
181  }
182 
183  /**
184  Fix a value within range.
185  */
186  void fixValue(float& value) const noexcept
187  {
188  if (value < min)
189  value = min;
190  else if (value > max)
191  value = max;
192  }
193 
194  /**
195  Get a fixed value within range.
196  */
197  const float& getFixedValue(const float& value) const noexcept
198  {
199  if (value <= min)
200  return min;
201  if (value >= max)
202  return max;
203  return value;
204  }
205 
206  /**
207  Get a value normalized to 0.0<->1.0.
208  */
209  float getNormalizedValue(const float& value) const noexcept
210  {
211  const float normValue((value - min) / (max - min));
212 
213  if (normValue <= 0.0f)
214  return 0.0f;
215  if (normValue >= 1.0f)
216  return 1.0f;
217  return normValue;
218  }
219 
220  /**
221  Get a value normalized to 0.0<->1.0, fixed within range.
222  */
223  float getFixedAndNormalizedValue(const float& value) const noexcept
224  {
225  if (value <= min)
226  return 0.0f;
227  if (value >= max)
228  return 1.0f;
229 
230  const float normValue((value - min) / (max - min));
231 
232  if (normValue <= 0.0f)
233  return 0.0f;
234  if (normValue >= 1.0f)
235  return 1.0f;
236 
237  return normValue;
238  }
239 
240  /**
241  Get a proper value previously normalized to 0.0<->1.0.
242  */
243  float getUnnormalizedValue(const float& value) const noexcept
244  {
245  if (value <= 0.0f)
246  return min;
247  if (value >= 1.0f)
248  return max;
249 
250  return value * (max - min) + min;
251  }
252 };
253 
254 /**
255  Parameter.
256  */
257 struct Parameter {
258  /**
259  Hints describing this parameter.
260  @see ParameterHints
261  */
262  uint32_t hints;
263 
264  /**
265  The name of this parameter.@n
266  A parameter name can contain any character, but hosts might have a hard time with non-ascii ones.@n
267  The name doesn't have to be unique within a plugin instance, but it's recommended.
268  */
270 
271  /**
272  The symbol of this parameter.@n
273  A parameter symbol is a short restricted name used as a machine and human readable identifier.@n
274  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.
275  @note Parameter symbols MUST be unique within a plugin instance.
276  */
278 
279  /**
280  The unit of this parameter.@n
281  This means something like "dB", "kHz" and "ms".@n
282  Can be left blank if a unit does not apply to this parameter.
283  */
285 
286  /**
287  Ranges of this parameter.@n
288  The ranges describe the default, minimum and maximum values.
289  */
291 
292  /**
293  Default constructor for a null parameter.
294  */
295  Parameter() noexcept
296  : hints(0x0),
297  name(),
298  symbol(),
299  unit(),
300  ranges() {}
301 
302  /**
303  Constructor using custom values.
304  */
305  Parameter(uint32_t h, const char* n, const char* s, const char* u, float def, float min, float max) noexcept
306  : hints(h),
307  name(n),
308  symbol(s),
309  unit(u),
310  ranges(def, min, max) {}
311 };
312 
313 /**
314  MIDI event.
315  */
316 struct MidiEvent {
317  /**
318  Size of internal data.
319  */
320  static const uint32_t kDataSize = 4;
321 
322  /**
323  Time offset in frames.
324  */
325  uint32_t frame;
326 
327  /**
328  Number of bytes used.
329  */
330  uint32_t size;
331 
332  /**
333  MIDI data.@n
334  If size > kDataSize, dataExt is used (otherwise null).
335  */
336  uint8_t data[kDataSize];
337  const uint8_t* dataExt;
338 };
339 
340 /**
341  Time position.@n
342  The @a playing and @a frame values are always valid.@n
343  BBT values are only valid when @a bbt.valid is true.
344 
345  This struct is inspired by the JACK Transport API.
346  */
347 struct TimePosition {
348  /**
349  Wherever the host transport is playing/rolling.
350  */
351  bool playing;
352 
353  /**
354  Current host transport position in frames.
355  */
356  uint64_t frame;
357 
358  /**
359  Bar-Beat-Tick time position.
360  */
361  struct BarBeatTick {
362  /**
363  Wherever the host transport is using BBT.@n
364  If false you must not read from this struct.
365  */
366  bool valid;
367 
368  /**
369  Current bar.@n
370  Should always be > 0.@n
371  The first bar is bar '1'.
372  */
373  int32_t bar;
374 
375  /**
376  Current beat within bar.@n
377  Should always be > 0 and <= @a beatsPerBar.@n
378  The first beat is beat '1'.
379  */
380  int32_t beat;
381 
382  /**
383  Current tick within beat.@n
384  Should always be > 0 and <= @a ticksPerBeat.@n
385  The first tick is tick '0'.
386  */
387  int32_t tick;
388 
389  /**
390  Number of ticks that have elapsed between frame 0 and the first beat of the current measure.
391  */
392  double barStartTick;
393 
394  /**
395  Time signature "numerator".
396  */
397  float beatsPerBar;
398 
399  /**
400  Time signature "denominator".
401  */
402  float beatType;
403 
404  /**
405  Number of ticks within a bar.@n
406  Usually a moderately large integer with many denominators, such as 1920.0.
407  */
408  double ticksPerBeat;
409 
410  /**
411  Number of beats per minute.
412  */
414 
415  /**
416  Default constructor for a null BBT time position.
417  */
418  BarBeatTick() noexcept
419  : valid(false),
420  bar(0),
421  beat(0),
422  tick(0),
423  barStartTick(0.0),
424  beatsPerBar(0.0f),
425  beatType(0.0f),
426  ticksPerBeat(0.0),
427  beatsPerMinute(0.0) {}
428  } bbt;
429 
430  /**
431  Default constructor for a time position.
432  */
433  TimePosition() noexcept
434  : playing(false),
435  frame(0),
436  bbt() {}
437 };
438 
439 /** @} */
440 
441 /* ------------------------------------------------------------------------------------------------------------
442  * DPF Plugin */
443 
444 /**
445  @defgroup MainClasses Main Classes
446  @{
447  */
448 
449 /**
450  DPF Plugin class from where plugin instances are created.
451 
452  The public methods (Host state) are called from the plugin to get or set host information.@n
453  They can be called from a plugin instance at anytime unless stated otherwise.@n
454  All other methods are to be implemented by the plugin and will be called by the host.
455 
456  Shortly after a plugin instance is created, the various init* functions will be called by the host.@n
457  Host will call activate() before run(), and deactivate() before the plugin instance is destroyed.@n
458  The host may call deactivate right after activate and vice-versa, but never activate/deactivate consecutively.@n
459  There is no limit on how many times run() is called, only that activate/deactivate will be called in between.
460 
461  The buffer size and sample rate values will remain constant between activate and deactivate.@n
462  Buffer size is only a hint though, the host might call run() with a higher or lower number of frames.
463 
464  Some of this class functions are only available according to some macros.
465 
466  DISTRHO_PLUGIN_WANT_PROGRAMS activates program related features.@n
467  When enabled you need to implement initProgramName() and loadProgram().
468 
469  DISTRHO_PLUGIN_WANT_STATE activates internal state features.@n
470  When enabled you need to implement initStateKey() and setState().
471 
472  The process function run() changes wherever DISTRHO_PLUGIN_WANT_MIDI_INPUT is enabled or not.@n
473  When enabled it provides midi input events.
474  */
475 class Plugin
476 {
477 public:
478  /**
479  Plugin class constructor.@n
480  You must set all parameter values to their defaults, matching ParameterRanges::def.
481  */
482  Plugin(uint32_t parameterCount, uint32_t programCount, uint32_t stateCount);
483 
484  /**
485  Destructor.
486  */
487  virtual ~Plugin();
488 
489  /* --------------------------------------------------------------------------------------------------------
490  * Host state */
491 
492  /**
493  Get the current buffer size that will probably be used during processing, in frames.@n
494  This value will remain constant between activate and deactivate.
495  @note This value is only a hint!@n
496  Hosts might call run() with a higher or lower number of frames.
497  @see bufferSizeChanged(uint32_t)
498  */
499  uint32_t getBufferSize() const noexcept;
500 
501  /**
502  Get the current sample rate that will be used during processing.@n
503  This value will remain constant between activate and deactivate.
504  @see sampleRateChanged(double)
505  */
506  double getSampleRate() const noexcept;
507 
508 #if DISTRHO_PLUGIN_WANT_TIMEPOS
509  /**
510  Get the current host transport time position.@n
511  This function should only be called during run().@n
512  You can call this during other times, but the returned position is not guaranteed to be in sync.
513  @note TimePosition is not supported in LADSPA and DSSI plugin formats.
514  */
515  const TimePosition& getTimePosition() const noexcept;
516 #endif
517 
518 #if DISTRHO_PLUGIN_WANT_LATENCY
519  /**
520  Change the plugin audio output latency to @a frames.@n
521  This function should only be called in the constructor, activate() and run().
522  @note This function is only available if DISTRHO_PLUGIN_WANT_LATENCY is enabled.
523  */
524  void setLatency(uint32_t frames) noexcept;
525 #endif
526 
527 #if DISTRHO_PLUGIN_WANT_MIDI_OUTPUT
528  /**
529  Write a MIDI output event.@n
530  This function must only be called during run().@n
531  Returns false when the host buffer is full, in which case do not call this again until the next run().
532  */
533  bool writeMidiEvent(const MidiEvent& midiEvent) noexcept;
534 #endif
535 
536 protected:
537  /* --------------------------------------------------------------------------------------------------------
538  * Information */
539 
540  /**
541  Get the plugin name.@n
542  Returns DISTRHO_PLUGIN_NAME by default.
543  */
544  virtual const char* getName() const { return DISTRHO_PLUGIN_NAME; }
545 
546  /**
547  Get the plugin label.@n
548  This label is a short restricted name consisting of only _, a-z, A-Z and 0-9 characters.
549  */
550  virtual const char* getLabel() const = 0;
551 
552  /**
553  Get the plugin author/maker.
554  */
555  virtual const char* getMaker() const = 0;
556 
557  /**
558  Get the plugin license name (a single line of text).@n
559  For commercial plugins this should return some short copyright information.
560  */
561  virtual const char* getLicense() const = 0;
562 
563  /**
564  Get the plugin version, in hexadecimal.@n
565  TODO format to be defined
566  */
567  virtual uint32_t getVersion() const = 0;
568 
569  /**
570  Get the plugin unique Id.@n
571  This value is used by LADSPA, DSSI and VST plugin formats.
572  */
573  virtual int64_t getUniqueId() const = 0;
574 
575  /* --------------------------------------------------------------------------------------------------------
576  * Init */
577 
578  /**
579  Initialize the audio port @a index.@n
580  This function will be called once, shortly after the plugin is created.
581  */
582  virtual void initAudioPort(bool input, uint32_t index, AudioPort& port);
583 
584  /**
585  Initialize the parameter @a index.@n
586  This function will be called once, shortly after the plugin is created.
587  */
588  virtual void initParameter(uint32_t index, Parameter& parameter) = 0;
589 
590 #if DISTRHO_PLUGIN_WANT_PROGRAMS
591  /**
592  Set the name of the program @a index.@n
593  This function will be called once, shortly after the plugin is created.@n
594  Must be implemented by your plugin class only if DISTRHO_PLUGIN_WANT_PROGRAMS is enabled.
595  */
596  virtual void initProgramName(uint32_t index, String& programName) = 0;
597 #endif
598 
599 #if DISTRHO_PLUGIN_WANT_STATE
600  /**
601  Set the state key and default value of @a index.@n
602  This function will be called once, shortly after the plugin is created.@n
603  Must be implemented by your plugin class only if DISTRHO_PLUGIN_WANT_STATE is enabled.
604  */
605  virtual void initState(uint32_t index, String& stateKey, String& defaultStateValue) = 0;
606 #endif
607 
608  /* --------------------------------------------------------------------------------------------------------
609  * Internal data */
610 
611  /**
612  Get the current value of a parameter.@n
613  The host may call this function from any context, including realtime processing.
614  */
615  virtual float getParameterValue(uint32_t index) const = 0;
616 
617  /**
618  Change a parameter value.@n
619  The host may call this function from any context, including realtime processing.@n
620  When a parameter is marked as automable, you must ensure no non-realtime operations are performed.
621  @note This function will only be called for parameter inputs.
622  */
623  virtual void setParameterValue(uint32_t index, float value) = 0;
624 
625 #if DISTRHO_PLUGIN_WANT_PROGRAMS
626  /**
627  Load a program.@n
628  The host may call this function from any context, including realtime processing.@n
629  Must be implemented by your plugin class only if DISTRHO_PLUGIN_WANT_PROGRAMS is enabled.
630  */
631  virtual void loadProgram(uint32_t index) = 0;
632 #endif
633 
634 #if DISTRHO_PLUGIN_WANT_STATE
635  /**
636  Change an internal state @a key to @a value.@n
637  Must be implemented by your plugin class only if DISTRHO_PLUGIN_WANT_STATE is enabled.
638  */
639  virtual void setState(const char* key, const char* value) = 0;
640 #endif
641 
642  /* --------------------------------------------------------------------------------------------------------
643  * Audio/MIDI Processing */
644 
645  /**
646  Activate this plugin.
647  */
648  virtual void activate() {}
649 
650  /**
651  Deactivate this plugin.
652  */
653  virtual void deactivate() {}
654 
655 #if DISTRHO_PLUGIN_WANT_MIDI_INPUT
656  /**
657  Run/process function for plugins with MIDI input.
658  @note Some parameters might be null if there are no audio inputs/outputs or MIDI events.
659  */
660  virtual void run(const float** inputs, float** outputs, uint32_t frames,
661  const MidiEvent* midiEvents, uint32_t midiEventCount) = 0;
662 #else
663  /**
664  Run/process function for plugins without MIDI input.
665  @note Some parameters might be null if there are no audio inputs or outputs.
666  */
667  virtual void run(const float** inputs, float** outputs, uint32_t frames) = 0;
668 #endif
669 
670  /* --------------------------------------------------------------------------------------------------------
671  * Callbacks (optional) */
672 
673  /**
674  Optional callback to inform the plugin about a buffer size change.@n
675  This function will only be called when the plugin is deactivated.
676  @note This value is only a hint!@n
677  Hosts might call run() with a higher or lower number of frames.
678  @see getBufferSize()
679  */
680  virtual void bufferSizeChanged(uint32_t newBufferSize);
681 
682  /**
683  Optional callback to inform the plugin about a sample rate change.@n
684  This function will only be called when the plugin is deactivated.
685  @see getSampleRate()
686  */
687  virtual void sampleRateChanged(double newSampleRate);
688 
689  // -------------------------------------------------------------------------------------------------------
690 
691 private:
692  struct PrivateData;
693  PrivateData* const pData;
694  friend class PluginExporter;
695 
696  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Plugin)
697 };
698 
699 /** @} */
700 
701 /* ------------------------------------------------------------------------------------------------------------
702  * Create plugin, entry point */
703 
704 /**
705  @defgroup EntryPoints Entry Points
706  @{
707  */
708 
709 /**
710  TODO.
711  */
712 extern Plugin* createPlugin();
713 
714 /** @} */
715 
716 // -----------------------------------------------------------------------------------------------------------
717 
718 END_NAMESPACE_DISTRHO
719 
720 #endif // DISTRHO_PLUGIN_HPP_INCLUDED
float min
Definition: DistrhoPlugin.hpp:152
Definition: DistrhoPlugin.hpp:105
virtual void activate()
Definition: DistrhoPlugin.hpp:648
virtual float getParameterValue(uint32_t index) const =0
Parameter() noexcept
Definition: DistrhoPlugin.hpp:295
Plugin * createPlugin()
uint32_t frame
Definition: DistrhoPlugin.hpp:325
uint32_t size
Definition: DistrhoPlugin.hpp:330
String name
Definition: DistrhoPlugin.hpp:117
uint32_t getBufferSize() const noexcept
String symbol
Definition: DistrhoPlugin.hpp:277
virtual void initState(uint32_t index, String &stateKey, String &defaultStateValue)=0
uint8_t data[kDataSize]
Definition: DistrhoPlugin.hpp:336
virtual void setState(const char *key, const char *value)=0
String symbol
Definition: DistrhoPlugin.hpp:125
void fixValue(float &value) const noexcept
Definition: DistrhoPlugin.hpp:186
virtual void deactivate()
Definition: DistrhoPlugin.hpp:653
double ticksPerBeat
Definition: DistrhoPlugin.hpp:408
Definition: DistrhoPlugin.hpp:316
int32_t bar
Definition: DistrhoPlugin.hpp:373
virtual void loadProgram(uint32_t index)=0
virtual uint32_t getVersion() const =0
virtual const char * getLabel() const =0
Definition: String.hpp:27
virtual void bufferSizeChanged(uint32_t newBufferSize)
#define DISTRHO_PLUGIN_NAME
Definition: DistrhoInfo.hpp:467
static const uint32_t kAudioPortIsSidechain
Definition: DistrhoPlugin.hpp:45
virtual const char * getLicense() const =0
ParameterRanges() noexcept
Definition: DistrhoPlugin.hpp:162
double beatsPerMinute
Definition: DistrhoPlugin.hpp:413
uint32_t hints
Definition: DistrhoPlugin.hpp:262
virtual void run(const float **inputs, float **outputs, uint32_t frames, const MidiEvent *midiEvents, uint32_t midiEventCount)=0
bool writeMidiEvent(const MidiEvent &midiEvent) noexcept
Definition: DistrhoPlugin.hpp:475
Plugin(uint32_t parameterCount, uint32_t programCount, uint32_t stateCount)
float getUnnormalizedValue(const float &value) const noexcept
Definition: DistrhoPlugin.hpp:243
bool playing
Definition: DistrhoPlugin.hpp:351
int32_t tick
Definition: DistrhoPlugin.hpp:387
float beatsPerBar
Definition: DistrhoPlugin.hpp:397
uint32_t hints
Definition: DistrhoPlugin.hpp:110
virtual ~Plugin()
TimePosition() noexcept
Definition: DistrhoPlugin.hpp:433
uint64_t frame
Definition: DistrhoPlugin.hpp:356
virtual void setParameterValue(uint32_t index, float value)=0
virtual const char * getMaker() const =0
BarBeatTick() noexcept
Definition: DistrhoPlugin.hpp:418
static const uint32_t kParameterIsAutomable
Definition: DistrhoPlugin.hpp:64
float beatType
Definition: DistrhoPlugin.hpp:402
float getNormalizedValue(const float &value) const noexcept
Definition: DistrhoPlugin.hpp:209
float def
Definition: DistrhoPlugin.hpp:147
ParameterRanges(float df, float mn, float mx) noexcept
Definition: DistrhoPlugin.hpp:170
virtual void initProgramName(uint32_t index, String &programName)=0
double barStartTick
Definition: DistrhoPlugin.hpp:392
Parameter(uint32_t h, const char *n, const char *s, const char *u, float def, float min, float max) noexcept
Definition: DistrhoPlugin.hpp:305
ParameterRanges ranges
Definition: DistrhoPlugin.hpp:290
AudioPort() noexcept
Definition: DistrhoPlugin.hpp:130
int32_t beat
Definition: DistrhoPlugin.hpp:380
const float & getFixedValue(const float &value) const noexcept
Definition: DistrhoPlugin.hpp:197
virtual void initParameter(uint32_t index, Parameter &parameter)=0
static const uint32_t kParameterIsBoolean
Definition: DistrhoPlugin.hpp:70
float max
Definition: DistrhoPlugin.hpp:157
Definition: DistrhoPlugin.hpp:143
String unit
Definition: DistrhoPlugin.hpp:284
virtual int64_t getUniqueId() const =0
static const uint32_t kParameterIsInteger
Definition: DistrhoPlugin.hpp:75
Definition: DistrhoPlugin.hpp:257
static const uint32_t kAudioPortIsCV
Definition: DistrhoPlugin.hpp:40
bool valid
Definition: DistrhoPlugin.hpp:366
virtual const char * getName() const
Definition: DistrhoPlugin.hpp:544
static const uint32_t kDataSize
Definition: DistrhoPlugin.hpp:320
virtual void initAudioPort(bool input, uint32_t index, AudioPort &port)
void fixDefault() noexcept
Definition: DistrhoPlugin.hpp:178
double getSampleRate() const noexcept
const TimePosition & getTimePosition() const noexcept
float getFixedAndNormalizedValue(const float &value) const noexcept
Definition: DistrhoPlugin.hpp:223
void setLatency(uint32_t frames) noexcept
static const uint32_t kParameterIsOutput
Definition: DistrhoPlugin.hpp:90
Definition: DistrhoPlugin.hpp:361
Definition: DistrhoPlugin.hpp:347
String name
Definition: DistrhoPlugin.hpp:269
virtual void sampleRateChanged(double newSampleRate)
static const uint32_t kParameterIsLogarithmic
Definition: DistrhoPlugin.hpp:80