annotate CloneChannel/plugins/common/DistrhoPluginMaxGen.hpp @ 25:404e262cd7e7 default tip

png rm
author Przemyslaw <prymula76@outlook.com>
date Mon, 01 Apr 2024 07:18:10 +0200
parents 24d60bdea349
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
1 /*
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
2 * DPF Max Gen
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
3 * Copyright (C) 2015-2022 Filipe Coelho <falktx@falktx.com>
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
4 *
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
5 * Permission to use, copy, modify, and/or distribute this software for any purpose with
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
6 * or without fee is hereby granted, provided that the above copyright notice and this
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
7 * permission notice appear in all copies.
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
8 *
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
10 * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
11 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
12 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
15 */
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
16
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
17 #ifndef DISTRHO_PLUGIN_MAX_GEN_HPP_INCLUDED
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
18 #define DISTRHO_PLUGIN_MAX_GEN_HPP_INCLUDED
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
19
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
20 #include "DistrhoPlugin.hpp"
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
21 #include "genlib.h"
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
22
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
23 START_NAMESPACE_DISTRHO
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
24
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
25 // -----------------------------------------------------------------------
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
26
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
27 class DistrhoPluginMaxGen : public Plugin
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
28 {
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
29 public:
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
30 DistrhoPluginMaxGen();
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
31 ~DistrhoPluginMaxGen() override;
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
32
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
33 protected:
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
34 // -------------------------------------------------------------------
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
35 // Information
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
36
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
37 const char* getLabel() const noexcept override
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
38 {
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
39 return DISTRHO_PLUGIN_NAME;
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
40 }
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
41
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
42 const char* getDescription() const noexcept override
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
43 {
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
44 return DISTRHO_PLUGIN_DESCRIPTION;
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
45 }
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
46
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
47 int64_t getUniqueId() const noexcept override
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
48 {
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
49 return DISTRHO_PLUGIN_VERSION;
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
50 }
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
51
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
52 const char* getMaker() const noexcept override
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
53 {
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
54 return "DISTRHO";
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
55 }
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
56
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
57 const char* getHomePage() const noexcept override
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
58 {
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
59 return "https://github.com/DISTRHO/DPF-Max-Gen";
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
60 }
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
61
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
62 const char* getLicense() const noexcept override
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
63 {
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
64 return "ISC";
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
65 }
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
66
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
67 uint32_t getVersion() const noexcept override
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
68 {
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
69 return d_version(0, 1, 0);
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
70 }
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
71
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
72 // -------------------------------------------------------------------
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
73 // Init
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
74
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
75 void initAudioPort(bool input, uint32_t index, AudioPort& port) override;
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
76 void initParameter(uint32_t index, Parameter& parameter) override;
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
77
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
78 // -------------------------------------------------------------------
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
79 // Internal data
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
80
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
81 float getParameterValue(uint32_t index) const override;
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
82 void setParameterValue(uint32_t index, float value) override;
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
83
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
84 // -------------------------------------------------------------------
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
85 // Process
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
86
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
87 void run(const float** inputs, float** outputs, uint32_t frames) override;
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
88
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
89 // -------------------------------------------------------------------
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
90
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
91 private:
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
92 CommonState* fGenState;
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
93
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
94 DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoPluginMaxGen)
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
95 };
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
96
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
97 // -----------------------------------------------------------------------
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
98
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
99 END_NAMESPACE_DISTRHO
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
100
24d60bdea349 ClonneChannel
prymula <prymula76@outlook.com>
parents:
diff changeset
101 #endif // DISTRHO_PLUGIN_MAX_GEN_HPP_INCLUDED