mirror of
https://github.com/AquaMorph/Droplets.git
synced 2025-04-30 09:45:35 +00:00
Superclass constructors
This commit is contained in:
parent
1251eb53cd
commit
12029e3281
@ -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);
|
||||||
|
@ -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;
|
||||||
|
@ -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() {}
|
||||||
|
@ -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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user