// Interface File for the class COsc
//

// Step 1: prevent compiler from compiling more than once
#pragma once

// Step 2: declare the class - this one is not derived from a base class so it is simple
class COsc
{
// Step 3: declare the constructor and destructor
public:
	COsc(void);
	COsc(float frequency, int sampleRate = 44100);
	~COsc(void);

// Step 4: declare the member variables; hide them as protected, in case we use this 
//         object as a base class
protected:
	// filter coeffs
	float m_f_a0;
	float m_f_a1;
	float m_f_a2;
	double m_f_b1;
	double m_f_b2;

	float m_f_z1_1;
	float m_f_z2_1;
	double m_f_z3_1;
	double m_f_z4_1;

	double pi;
	int samplerate;
	double frequency;
	double outMax;
	double rangeMin;
	double rangeMax;

// Step 5: declare the functions; they need to be public for our plugin object to call them
public:
	// return type "void" means nothing is returned
	void setCoeffs(float a0, float a1, float a2, float b1, float b2);
	
	// a function to setup the filter just before play occurs
	void prepareForPlay();

	void start();
	float getNextSample();
	void setSampleRate(int samplespersec);
	void setFrequency(float hz);
	void setRange(float min, float max);

	// the filter itself
	float doFilter(float* pIn);
};

