mirror of
				https://github.com/AquaMorph/Droplets.git
				synced 2025-10-30 16:13:20 +00:00 
			
		
		
		
	Delete wave on droplet close
This commit is contained in:
		| @@ -4,7 +4,7 @@ VCODroplet::VCODroplet(DaisyPatch* m_patch, | |||||||
| 		       DropletState m_state, | 		       DropletState m_state, | ||||||
| 		       float sample_rate) : | 		       float sample_rate) : | ||||||
|   Droplet(m_patch, |   Droplet(m_patch, | ||||||
| 	  m_state){ | 	  m_state) { | ||||||
|   int num_waves = Oscillator::WAVE_LAST; |   int num_waves = Oscillator::WAVE_LAST; | ||||||
|   SetAnimationRate(10); |   SetAnimationRate(10); | ||||||
|   osc.Init(sample_rate); |   osc.Init(sample_rate); | ||||||
| @@ -18,6 +18,10 @@ VCODroplet::VCODroplet(DaisyPatch* m_patch, | |||||||
| 	       0.5f, Parameter::LINEAR); | 	       0.5f, Parameter::LINEAR); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | VCODroplet::~VCODroplet() { | ||||||
|  |   delete wave; | ||||||
|  | } | ||||||
|  |  | ||||||
| void VCODroplet::Control() {} | void VCODroplet::Control() {} | ||||||
|  |  | ||||||
| void VCODroplet::Process(float** in, float** out, size_t size) { | void VCODroplet::Process(float** in, float** out, size_t size) { | ||||||
| @@ -32,7 +36,6 @@ void VCODroplet::Process(float** in, float** out, size_t size) { | |||||||
|     wave = wavectrl.Process(); |     wave = wavectrl.Process(); | ||||||
|     amp = ampctrl.Process(); |     amp = ampctrl.Process(); | ||||||
|     // Set osc params |     // Set osc params | ||||||
|      |  | ||||||
|     osc.SetFreq(freq); |     osc.SetFreq(freq); | ||||||
|     osc.SetWaveform(wave); |     osc.SetWaveform(wave); | ||||||
|     osc.SetAmp(amp); |     osc.SetAmp(amp); | ||||||
|   | |||||||
| @@ -25,6 +25,7 @@ private: | |||||||
|   Sprite* wave = new Sprite(sine_width, kTitleHeight); |   Sprite* wave = new Sprite(sine_width, kTitleHeight); | ||||||
| public: | public: | ||||||
|   VCODroplet(DaisyPatch*, DropletState, float); |   VCODroplet(DaisyPatch*, DropletState, float); | ||||||
|  |   ~VCODroplet(); | ||||||
|   void Control(); |   void Control(); | ||||||
|   void Process(float**, float**, size_t); |   void Process(float**, float**, size_t); | ||||||
|   void Draw(); |   void Draw(); | ||||||
|   | |||||||
| @@ -12,6 +12,13 @@ Sprite::Sprite(int m_width, int m_height) { | |||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | Sprite::~Sprite() { | ||||||
|  |   for (int w = 0; w < width; w++) { | ||||||
|  |     delete[] sprite[w]; | ||||||
|  |   } | ||||||
|  |   delete[] sprite; | ||||||
|  | } | ||||||
|  |  | ||||||
| void Sprite::SetPixel(int x, int y, bool solid) { | void Sprite::SetPixel(int x, int y, bool solid) { | ||||||
|   sprite[x][y] = solid; |   sprite[x][y] = solid; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -13,6 +13,7 @@ class Sprite { | |||||||
|   bool** sprite; |   bool** sprite; | ||||||
|  public: |  public: | ||||||
|   Sprite(int, int); |   Sprite(int, int); | ||||||
|  |   ~Sprite(); | ||||||
|   void SetPixel(int, int, bool); |   void SetPixel(int, int, bool); | ||||||
|   int GetHeight(); |   int GetHeight(); | ||||||
|   int GetWidth(); |   int GetWidth(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user