Loopp/src/looper.hxx

66 lines
1.2 KiB
C++
Raw Normal View History

#ifndef LUPPP_LOOPER_H
#define LUPPP_LOOPER_H
#include <vector>
#include <iostream>
#include "buffers.hxx"
2013-07-27 19:34:48 +02:00
#include "audioprocessor.hxx"
2013-07-27 19:34:48 +02:00
#include "looperclip.hxx"
#include "observer/observer.hxx"
using namespace std;
2013-07-27 19:24:04 +02:00
/** Looper
* The class which reads from LooperClips, and reads/ writes the data using the
* track buffer. Scene recording / playback is the essential functionality here.
**/
class Looper : public Observer, public AudioProcessor
{
public:
Looper(int t);
void setSample(int c, AudioBuffer* ab);
void midi(unsigned char* data);
void bar();
void beat();
2013-07-27 19:34:48 +02:00
void setFpb(int f) { /*fpb = f;*/ }
2013-07-26 03:49:23 +02:00
void setScene( int sc );
2013-07-27 19:24:04 +02:00
//void setState( State s);
void updateControllers();
void process(int nframes, Buffers* buffers);
private:
const int track;
2013-07-27 19:24:04 +02:00
float* tmpRecordBuffer;
2013-07-27 19:34:48 +02:00
LooperClip clips[10];
// Pitch Shifting
void pitchShift(int count, float* input, float* output);
vector<float> tmpBuffer;
int IOTA;
float fVec0[65536];
float semitoneShift;
float windowSize;
float fRec0[2];
float crossfadeSize;
float fSamplingFreq;
int uiUpdateConstant;
int uiUpdateCounter;
};
#endif // LUPPP_LOOPER_H