DISTRHO Plugin Framework
 All Classes Functions Variables Modules Pages
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 /**
304  MIDI event.
305  */
306 struct MidiEvent {
307  /**
308  Size of internal data.
309  */
310  static const uint32_t kDataSize = 4;
311 
312  /**
313  Time offset in frames.
314  */
315  uint32_t frame;
316 
317  /**
318  Number of bytes used.
319  */
320  uint32_t size;
321 
322  /**
323  MIDI data.@n
324  If size > kDataSize, dataExt is used (otherwise null).
325  */
326  uint8_t data[kDataSize];
327  const uint8_t* dataExt;
328 };
329 
330 /**
331  Time position.@n
332  The @a playing and @a frame values are always valid.@n
333  BBT values are only valid when @a bbt.valid is true.
334 
335  This struct is inspired by the JACK Transport API.
336  */
337 struct TimePosition {
338  /**
339  Wherever the host transport is playing/rolling.
340  */
341  bool playing;
342 
343  /**
344  Current host transport position in frames.
345  */
346  uint64_t frame;
347 
348  /**
349  Bar-Beat-Tick time position.
350  */
351  struct BarBeatTick {
352  /**
353  Wherever the host transport is using BBT.@n
354  If false you must not read from this struct.
355  */
356  bool valid;
357 
358  /**
359  Current bar.@n
360  Should always be > 0.@n
361  The first bar is bar '1'.
362  */
363  int32_t bar;
364 
365  /**
366  Current beat within bar.@n
367  Should always be > 0 and <= @a beatsPerBar.@n
368  The first beat is beat '1'.
369  */
370  int32_t beat;
371 
372  /**
373  Current tick within beat.@n
374  Should always be > 0 and <= @a ticksPerBeat.@n
375  The first tick is tick '0'.
376  */
377  int32_t tick;
378 
379  /**
380  Number of ticks that have elapsed between frame 0 and the first beat of the current measure.
381  */
382  double barStartTick;
383 
384  /**
385  Time signature "numerator".
386  */
387  float beatsPerBar;
388 
389  /**
390  Time signature "denominator".
391  */
392  float beatType;
393 
394  /**
395  Number of ticks within a bar.@n
396  Usually a moderately large integer with many denominators, such as 1920.0.
397  */
398  double ticksPerBeat;
399 
400  /**
401  Number of beats per minute.
402  */
404 
405  /**
406  Default constructor for a null BBT time position.
407  */
408  BarBeatTick() noexcept
409  : valid(false),
410  bar(0),
411  beat(0),
412  tick(0),
413  barStartTick(0.0),
414  beatsPerBar(0.0f),
415  beatType(0.0f),
416  ticksPerBeat(0.0),
417  beatsPerMinute(0.0) {}
418  } bbt;
419 
420  /**
421  Default constructor for a time position.
422  */
423  TimePosition() noexcept
424  : playing(false),
425  frame(0),
426  bbt() {}
427 };
428 
429 /** @} */
430 
431 /* ------------------------------------------------------------------------------------------------------------
432  * DPF Plugin */
433 
434 /**
435  @defgroup MainClasses Main Classes
436  @{
437  */
438 
439 /**
440  DPF Plugin class from where plugin instances are created.
441 
442  The public methods (Host state) are called from the plugin to get or set host information.@n
443  They can be called from a plugin instance at anytime unless stated otherwise.@n
444  All other methods are to be implemented by the plugin and will be called by the host.
445 
446  Shortly after a plugin instance is created, the various init* functions will be called by the host.@n
447  Host will call activate() before run(), and deactivate() before the plugin instance is destroyed.@n
448  The host may call deactivate right after activate and vice-versa, but never activate/deactivate consecutively.@n
449  There is no limit on how many times run() is called, only that activate/deactivate will be called in between.
450 
451  The buffer size and sample rate values will remain constant between activate and deactivate.@n
452  Buffer size is only a hint though, the host might call run() with a higher or lower number of frames.
453 
454  Some of this class functions are only available according to some macros.
455 
456  DISTRHO_PLUGIN_WANT_PROGRAMS activates program related features.@n
457  When enabled you need to implement initProgramName() and loadProgram().
458 
459  DISTRHO_PLUGIN_WANT_STATE activates internal state features.@n
460  When enabled you need to implement initStateKey() and setState().
461 
462  The process function run() changes wherever DISTRHO_PLUGIN_WANT_MIDI_INPUT is enabled or not.@n
463  When enabled it provides midi input events.
464  */
465 class Plugin
466 {
467 public:
468  /**
469  Plugin class constructor.@n
470  You must set all parameter values to their defaults, matching ParameterRanges::def.
471  */
472  Plugin(uint32_t parameterCount, uint32_t programCount, uint32_t stateCount);
473 
474  /**
475  Destructor.
476  */
477  virtual ~Plugin();
478 
479  /* --------------------------------------------------------------------------------------------------------
480  * Host state */
481 
482  /**
483  Get the current buffer size that will probably be used during processing, in frames.@n
484  This value will remain constant between activate and deactivate.
485  @note This value is only a hint!@n
486  Hosts might call run() with a higher or lower number of frames.
487  @see bufferSizeChanged(uint32_t)
488  */
489  uint32_t getBufferSize() const noexcept;
490 
491  /**
492  Get the current sample rate that will be used during processing.@n
493  This value will remain constant between activate and deactivate.
494  @see sampleRateChanged(double)
495  */
496  double getSampleRate() const noexcept;
497 
498 #if DISTRHO_PLUGIN_WANT_TIMEPOS
499  /**
500  Get the current host transport time position.@n
501  This function should only be called during run().@n
502  You can call this during other times, but the returned position is not guaranteed to be in sync.
503  @note TimePosition is not supported in LADSPA and DSSI plugin formats.
504  */
505  const TimePosition& getTimePosition() const noexcept;
506 #endif
507 
508 #if DISTRHO_PLUGIN_WANT_LATENCY
509  /**
510  Change the plugin audio output latency to @a frames.@n
511  This function should only be called in the constructor, activate() and run().
512  @note This function is only available if DISTRHO_PLUGIN_WANT_LATENCY is enabled.
513  */
514  void setLatency(uint32_t frames) noexcept;
515 #endif
516 
517 #if DISTRHO_PLUGIN_WANT_MIDI_OUTPUT
518  /**
519  Write a MIDI output event.@n
520  This function must only be called during run().@n
521  Returns false when the host buffer is full, in which case do not call this again until the next run().
522  */
523  bool writeMidiEvent(const MidiEvent& midiEvent) noexcept;
524 #endif
525 
526 protected:
527  /* --------------------------------------------------------------------------------------------------------
528  * Information */
529 
530  /**
531  Get the plugin name.@n
532  Returns DISTRHO_PLUGIN_NAME by default.
533  */
534  virtual const char* getName() const { return DISTRHO_PLUGIN_NAME; }
535 
536  /**
537  Get the plugin label.@n
538  This label is a short restricted name consisting of only _, a-z, A-Z and 0-9 characters.
539  */
540  virtual const char* getLabel() const = 0;
541 
542  /**
543  Get the plugin author/maker.
544  */
545  virtual const char* getMaker() const = 0;
546 
547  /**
548  Get the plugin license name (a single line of text).@n
549  For commercial plugins this should return some short copyright information.
550  */
551  virtual const char* getLicense() const = 0;
552 
553  /**
554  Get the plugin version, in hexadecimal.@n
555  TODO format to be defined
556  */
557  virtual uint32_t getVersion() const = 0;
558 
559  /**
560  Get the plugin unique Id.@n
561  This value is used by LADSPA, DSSI and VST plugin formats.
562  */
563  virtual int64_t getUniqueId() const = 0;
564 
565  /* --------------------------------------------------------------------------------------------------------
566  * Init */
567 
568  /**
569  Initialize the audio port @a index.@n
570  This function will be called once, shortly after the plugin is created.
571  */
572  virtual void initAudioPort(bool input, uint32_t index, AudioPort& port);
573 
574  /**
575  Initialize the parameter @a index.@n
576  This function will be called once, shortly after the plugin is created.
577  */
578  virtual void initParameter(uint32_t index, Parameter& parameter) = 0;
579 
580 #if DISTRHO_PLUGIN_WANT_PROGRAMS
581  /**
582  Set the name of the program @a index.@n
583  This function will be called once, shortly after the plugin is created.@n
584  Must be implemented by your plugin class only if DISTRHO_PLUGIN_WANT_PROGRAMS is enabled.
585  */
586  virtual void initProgramName(uint32_t index, String& programName) = 0;
587 #endif
588 
589 #if DISTRHO_PLUGIN_WANT_STATE
590  /**
591  Set the state key and default value of @a index.@n
592  This function will be called once, shortly after the plugin is created.@n
593  Must be implemented by your plugin class only if DISTRHO_PLUGIN_WANT_STATE is enabled.
594  */
595  virtual void initState(uint32_t index, String& stateKey, String& defaultStateValue) = 0;
596 #endif
597 
598  /* --------------------------------------------------------------------------------------------------------
599  * Internal data */
600 
601  /**
602  Get the current value of a parameter.@n
603  The host may call this function from any context, including realtime processing.
604  */
605  virtual float getParameterValue(uint32_t index) const = 0;
606 
607  /**
608  Change a parameter value.@n
609  The host may call this function from any context, including realtime processing.@n
610  When a parameter is marked as automable, you must ensure no non-realtime operations are performed.
611  @note This function will only be called for parameter inputs.
612  */
613  virtual void setParameterValue(uint32_t index, float value) = 0;
614 
615 #if DISTRHO_PLUGIN_WANT_PROGRAMS
616  /**
617  Load a program.@n
618  The host may call this function from any context, including realtime processing.@n
619  Must be implemented by your plugin class only if DISTRHO_PLUGIN_WANT_PROGRAMS is enabled.
620  */
621  virtual void loadProgram(uint32_t index) = 0;
622 #endif
623 
624 #if DISTRHO_PLUGIN_WANT_STATE
625  /**
626  Change an internal state @a key to @a value.@n
627  Must be implemented by your plugin class only if DISTRHO_PLUGIN_WANT_STATE is enabled.
628  */
629  virtual void setState(const char* key, const char* value) = 0;
630 #endif
631 
632  /* --------------------------------------------------------------------------------------------------------
633  * Audio/MIDI Processing */
634 
635  /**
636  Activate this plugin.
637  */
638  virtual void activate() {}
639 
640  /**
641  Deactivate this plugin.
642  */
643  virtual void deactivate() {}
644 
645 #if DISTRHO_PLUGIN_WANT_MIDI_INPUT
646  /**
647  Run/process function for plugins with MIDI input.
648  @note Some parameters might be null if there are no audio inputs/outputs or MIDI events.
649  */
650  virtual void run(const float** inputs, float** outputs, uint32_t frames,
651  const MidiEvent* midiEvents, uint32_t midiEventCount) = 0;
652 #else
653  /**
654  Run/process function for plugins without MIDI input.
655  @note Some parameters might be null if there are no audio inputs or outputs.
656  */
657  virtual void run(const float** inputs, float** outputs, uint32_t frames) = 0;
658 #endif
659 
660  /* --------------------------------------------------------------------------------------------------------
661  * Callbacks (optional) */
662 
663  /**
664  Optional callback to inform the plugin about a buffer size change.@n
665  This function will only be called when the plugin is deactivated.
666  @note This value is only a hint!@n
667  Hosts might call run() with a higher or lower number of frames.
668  @see getBufferSize()
669  */
670  virtual void bufferSizeChanged(uint32_t newBufferSize);
671 
672  /**
673  Optional callback to inform the plugin about a sample rate change.@n
674  This function will only be called when the plugin is deactivated.
675  @see getSampleRate()
676  */
677  virtual void sampleRateChanged(double newSampleRate);
678 
679  // -------------------------------------------------------------------------------------------------------
680 
681 private:
682  struct PrivateData;
683  PrivateData* const pData;
684  friend class PluginExporter;
685 
686  DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Plugin)
687 };
688 
689 /** @} */
690 
691 /* ------------------------------------------------------------------------------------------------------------
692  * Create plugin, entry point */
693 
694 /**
695  @defgroup EntryPoints Entry Points
696  @{
697  */
698 
699 /**
700  TODO.
701  */
702 extern Plugin* createPlugin();
703 
704 /** @} */
705 
706 // -----------------------------------------------------------------------------------------------------------
707 
708 END_NAMESPACE_DISTRHO
709 
710 #endif // DISTRHO_PLUGIN_HPP_INCLUDED
float min
Definition: DistrhoPlugin.hpp:152
Definition: DistrhoPlugin.hpp:105
virtual void activate()
Definition: DistrhoPlugin.hpp:638
virtual float getParameterValue(uint32_t index) const =0
Parameter() noexcept
Definition: DistrhoPlugin.hpp:295
Plugin * createPlugin()
uint32_t frame
Definition: DistrhoPlugin.hpp:315
uint32_t size
Definition: DistrhoPlugin.hpp:320
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:326
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:643
double ticksPerBeat
Definition: DistrhoPlugin.hpp:398
Definition: DistrhoPlugin.hpp:306
int32_t bar
Definition: DistrhoPlugin.hpp:363
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:403
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:465
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:341
int32_t tick
Definition: DistrhoPlugin.hpp:377
float beatsPerBar
Definition: DistrhoPlugin.hpp:387
uint32_t hints
Definition: DistrhoPlugin.hpp:110
virtual ~Plugin()
TimePosition() noexcept
Definition: DistrhoPlugin.hpp:423
uint64_t frame
Definition: DistrhoPlugin.hpp:346
virtual void setParameterValue(uint32_t index, float value)=0
virtual const char * getMaker() const =0
BarBeatTick() noexcept
Definition: DistrhoPlugin.hpp:408
static const uint32_t kParameterIsAutomable
Definition: DistrhoPlugin.hpp:64
float beatType
Definition: DistrhoPlugin.hpp:392
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:382
ParameterRanges ranges
Definition: DistrhoPlugin.hpp:290
AudioPort() noexcept
Definition: DistrhoPlugin.hpp:130
int32_t beat
Definition: DistrhoPlugin.hpp:370
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:356
virtual const char * getName() const
Definition: DistrhoPlugin.hpp:534
static const uint32_t kDataSize
Definition: DistrhoPlugin.hpp:310
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:351
Definition: DistrhoPlugin.hpp:337
String name
Definition: DistrhoPlugin.hpp:269
virtual void sampleRateChanged(double newSampleRate)
static const uint32_t kParameterIsLogarithmic
Definition: DistrhoPlugin.hpp:80