1 /*
2 * DISTRHO Plugin Framework (DPF)
3 * Copyright (C) 2012-2019 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 #include "DistrhoPlugin.hpp"
18
19 #include <string.h>
20
21 START_NAMESPACE_DISTRHO
22
23 class CairoExamplePlugin : public Plugin
24 {
25 public:
CairoExamplePlugin()26 CairoExamplePlugin()
27 : Plugin(0, 0, 0)
28 {
29 }
30
getLabel() const31 const char* getLabel() const
32 {
33 return "Cairo DPF Example";
34 }
35
getMaker() const36 const char* getMaker() const
37 {
38 return "Jean Pierre Cimalando";
39 }
40
getLicense() const41 const char* getLicense() const
42 {
43 return "ISC";
44 }
45
getVersion() const46 uint32_t getVersion() const
47 {
48 return 0;
49 }
50
getUniqueId() const51 int64_t getUniqueId() const
52 {
53 return 0;
54 }
55
initParameter(uint32_t index,Parameter & parameter)56 void initParameter(uint32_t index, Parameter& parameter)
57 {
58 // unused
59 (void)index;
60 (void)parameter;
61 }
62
getParameterValue(uint32_t index) const63 float getParameterValue(uint32_t index) const
64 {
65 return 0;
66
67 // unused
68 (void)index;
69 }
70
setParameterValue(uint32_t index,float value)71 void setParameterValue(uint32_t index, float value)
72 {
73 // unused
74 (void)index;
75 (void)value;
76 }
77
run(const float ** inputs,float ** outputs,uint32_t frames)78 void run(const float** inputs, float** outputs, uint32_t frames)
79 {
80 memcpy(outputs[0], inputs[0], frames * sizeof(float));
81 }
82 };
83
createPlugin()84 Plugin* createPlugin()
85 {
86 return new CairoExamplePlugin;
87 }
88
89 END_NAMESPACE_DISTRHO
90