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