Line 695: |
Line 695: |
| | | |
| =====DisthroPluginMain.cpp===== | | =====DisthroPluginMain.cpp===== |
− | | + | |
| #include "DistrhoPlugin.hpp" | | #include "DistrhoPlugin.hpp" |
− | | + | |
| START_NAMESPACE_DPF | | START_NAMESPACE_DPF |
− | | + | |
| class SimpleGainPlugin : public Plugin { | | class SimpleGainPlugin : public Plugin { |
| public: | | public: |
Line 705: |
Line 705: |
| gain = 1.0f; // Default gain (no change) | | gain = 1.0f; // Default gain (no change) |
| } | | } |
− | | + | |
| protected: | | protected: |
| const char* getLabel() const override { return "SimpleGain"; } | | const char* getLabel() const override { return "SimpleGain"; } |
Line 713: |
Line 713: |
| uint32_t getVersion() const override { return d_version(1, 0, 0); } | | uint32_t getVersion() const override { return d_version(1, 0, 0); } |
| int64_t getUniqueId() const override { return d_cconst('S', 'G', 'a', 'n'); } | | int64_t getUniqueId() const override { return d_cconst('S', 'G', 'a', 'n'); } |
− | | + | |
| void initParameter(uint32_t index, Parameter& parameter) override { | | void initParameter(uint32_t index, Parameter& parameter) override { |
| if (index != 0) return; | | if (index != 0) return; |
Line 724: |
Line 724: |
| parameter.ranges.max = 2.0f; | | parameter.ranges.max = 2.0f; |
| } | | } |
− | | + | |
| float getParameterValue(uint32_t index) const override { | | float getParameterValue(uint32_t index) const override { |
| if (index != 0) return 0.0f; | | if (index != 0) return 0.0f; |
| return gain; | | return gain; |
| } | | } |
− | | + | |
| void setParameterValue(uint32_t index, float value) override { | | void setParameterValue(uint32_t index, float value) override { |
| if (index != 0) return; | | if (index != 0) return; |
| gain = value; | | gain = value; |
| } | | } |
− | | + | |
| void run(const float** inputs, float** outputs, uint32_t frames) override { | | void run(const float** inputs, float** outputs, uint32_t frames) override { |
| const float* inL = inputs[0]; | | const float* inL = inputs[0]; |
Line 746: |
Line 746: |
| } | | } |
| } | | } |
− | | + | |
| private: | | private: |
| float gain; | | float gain; |
| DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(SimpleGainPlugin) | | DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(SimpleGainPlugin) |
| }; | | }; |
− | | + | |
| Plugin* createPlugin() { | | Plugin* createPlugin() { |
| return new SimpleGainPlugin(); | | return new SimpleGainPlugin(); |
| } | | } |
− | | + | |
| END_NAMESPACE_DPF | | END_NAMESPACE_DPF |
| | | |