Superclass constructors

This commit is contained in:
Christian Colglazier 2020-09-19 13:40:38 -04:00
parent 1251eb53cd
commit 12029e3281
4 changed files with 12 additions and 7 deletions

View File

@ -1,5 +1,10 @@
#include "droplet.h" #include "droplet.h"
Droplet::Droplet(DaisyPatch* m_patch, DropletState m_state) {
patch = m_patch;
UpdateState(m_state);
}
void Droplet::DrawName(DaisyPatch* patch, std::string name) { void Droplet::DrawName(DaisyPatch* patch, std::string name) {
WriteCenteredString(*patch, (screen_min + screen_max) / 2, 0, WriteCenteredString(*patch, (screen_min + screen_max) / 2, 0,
Font_6x8, name); Font_6x8, name);

View File

@ -17,7 +17,7 @@ class Droplet {
public: public:
DaisyPatch* patch; DaisyPatch* patch;
DropletState state; DropletState state;
virtual ~Droplet() {}; Droplet(DaisyPatch*, DropletState);
virtual void Control()=0; virtual void Control()=0;
virtual void Process(float**, float**, size_t)=0; virtual void Process(float**, float**, size_t)=0;
virtual void Draw()=0; virtual void Draw()=0;

View File

@ -2,11 +2,11 @@
NoiseDroplet::NoiseDroplet(DaisyPatch* m_patch, NoiseDroplet::NoiseDroplet(DaisyPatch* m_patch,
float sample_rate, float sample_rate,
DropletState m_state) { DropletState m_state) :
patch = m_patch; Droplet(m_patch,
m_state) {
noise.Init(); noise.Init();
filter.Init(); filter.Init();
UpdateState(m_state);
} }
void NoiseDroplet::Control() {} void NoiseDroplet::Control() {}

View File

@ -2,9 +2,9 @@
VCODroplet::VCODroplet(DaisyPatch* m_patch, VCODroplet::VCODroplet(DaisyPatch* m_patch,
float sample_rate, float sample_rate,
DropletState m_state) { DropletState m_state) :
UpdateState(m_state); Droplet(m_patch,
patch = m_patch; m_state){
int num_waves = Oscillator::WAVE_LAST; int num_waves = Oscillator::WAVE_LAST;
osc.Init(sample_rate); osc.Init(sample_rate);
freqctrl.Init(patch->controls[patch->CTRL_1], 10.0, freqctrl.Init(patch->controls[patch->CTRL_1], 10.0,