Skip to content

Commit

Permalink
Properly use activate and deactivate instead of constructor and destr…
Browse files Browse the repository at this point in the history
…uctor.
  • Loading branch information
jeremysalwen committed Jun 5, 2011
1 parent 16409a3 commit 55e9141
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
16 changes: 9 additions & 7 deletions kn0ck0ut6.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/* kn0ck0ut v0.4 by st3pan0va 2004 */

#include "kn0ck0ut6.hpp"
#include <stdio.h>
#include <string.h>
#include <math.h>



void CQuickTrigConsts::Initialize() // function to initialise quick sin & cos
Expand Down Expand Up @@ -40,14 +38,18 @@ AKnockout::AKnockout(double rate) : Plugin<AKnockout>(p_n_ports)
sampleRate=rate;
gfftSize=8192;
goverlap=8;
}
void AKnockout::activate() {
AllocateNewBuffers(gfftSize);
clearBuffers();
clearBuffers();
}

void AKnockout::deactivate() {// delete buffers when deactivated
FreeOldBuffers();
}

//-----------------------------------------------------------------------------------------
AKnockout::~AKnockout() // delete buffers in destructor
AKnockout::~AKnockout()
{
FreeOldBuffers();
}

void AKnockout::AllocateNewBuffers(unsigned int fftSize) {
Expand Down
10 changes: 8 additions & 2 deletions kn0ck0ut6.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
/* kn0ck0ut v0.5 by st3pan0va 2004 */

#ifndef __AGAIN_H
#define __AGAIN_H
#define __AGAIN_H

#include <stdio.h>
#include <string.h>
#include <math.h>

#include <lv2plugin.hpp>
#include <fftw3.h>
Expand All @@ -17,7 +21,9 @@ class AKnockout:public Plugin<AKnockout> {
public:
AKnockout(double srate);
~AKnockout();
void run(uint32_t numsamples);
void run(uint32_t numsamples);
void activate();
void deactivate();
CQuickTrig myQT;


Expand Down

0 comments on commit 55e9141

Please sign in to comment.