1 /*
2  * DISTRHO PingPongPan Plugin, based on PingPongPan by Michael Gruhn
3  * Copyright (C) 2007 Michael Gruhn <michael-gruhn@web.de>
4  * Copyright (C) 2012-2015 Filipe Coelho <falktx@falktx.com>
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * For a full copy of the license see the LICENSE file.
16  */
17 
18 #ifndef DISTRHO_PLUGIN_PINGPONGPAN_HPP_INCLUDED
19 #define DISTRHO_PLUGIN_PINGPONGPAN_HPP_INCLUDED
20 
21 #include "DistrhoPlugin.hpp"
22 
23 START_NAMESPACE_DISTRHO
24 
25 // -----------------------------------------------------------------------
26 
27 class DistrhoPluginPingPongPan : public Plugin
28 {
29 public:
30     enum Parameters
31     {
32         paramFreq = 0,
33         paramWidth,
34         paramCount
35     };
36 
37     DistrhoPluginPingPongPan();
38 
39 protected:
40     // -------------------------------------------------------------------
41     // Information
42 
getLabel() const43     const char* getLabel() const noexcept override
44     {
45         return "PingPongPan";
46     }
47 
getDescription() const48     const char* getDescription() const override
49     {
50         return "Ping Pong Panning.";
51     }
52 
getMaker() const53     const char* getMaker() const noexcept override
54     {
55         return "DISTRHO";
56     }
57 
getHomePage() const58     const char* getHomePage() const override
59     {
60         return "https://github.com/DISTRHO/Mini-Series";
61     }
62 
getLicense() const63     const char* getLicense() const noexcept override
64     {
65         return "LGPL";
66     }
67 
getVersion() const68     uint32_t getVersion() const noexcept override
69     {
70         return d_version(1, 0, 0);
71     }
72 
getUniqueId() const73     int64_t getUniqueId() const noexcept override
74     {
75         return d_cconst('D', 'P', 'P', 'P');
76     }
77 
78     // -------------------------------------------------------------------
79     // Init
80 
81     void initParameter(uint32_t index, Parameter& parameter) override;
82     void initProgramName(uint32_t index, String& programName) override;
83 
84     // -------------------------------------------------------------------
85     // Internal data
86 
87     float getParameterValue(uint32_t index) const override;
88     void  setParameterValue(uint32_t index, float value) override;
89     void  loadProgram(uint32_t index) override;
90 
91     // -------------------------------------------------------------------
92     // Process
93 
94     void activate() override;
95     void deactivate() override;
96     void run(const float** inputs, float** outputs, uint32_t frames) override;
97 
98     // -------------------------------------------------------------------
99 
100 private:
101     float fFreq;
102     float fWidth;
103     float waveSpeed;
104 
105     float pan, wavePos;
106 
107     DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoPluginPingPongPan)
108 };
109 
110 // -----------------------------------------------------------------------
111 
112 END_NAMESPACE_DISTRHO
113 
114 #endif  // DISTRHO_PLUGIN_PINGPONGPAN_HPP_INCLUDED
115