-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLooperClip.h
50 lines (45 loc) · 1.13 KB
/
LooperClip.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//
// Created by martin on 4/30/18.
//
#ifndef RTPIANO_LOOPERCLIP_H
#define RTPIANO_LOOPERCLIP_H
#include <vector>
#include "LooperChunk.h"
#include "LooperVoice.h"
using namespace std;
class LooperVoice;
class LooperChunk;
class LooperClip {
LooperChunk* firstChunk;
LooperChunk* lastChunk;
vector<LooperVoice*> voices;
int channel = 0;
int variation = 0;
bool master = false;
int offset = 0;
int totalSamples = 0;
int schedulePeriod = 0;
int scheduleCountdown = 0;
public:
LooperClip(int channel, int variation, bool master, int offset);
void writeSample(float sample);
void launch();
void launch(int fastForward);
LooperChunk* getFirstChunk();
bool isLastChunk(LooperChunk* chunk);
float renderVoices();
bool isPlaying();
bool isMaster();
int getOffset();
int getTotalSamples();
// Scheduler methods
void setSchedulePeriod(int period);
void slaveScheduleTick();
bool slaveScheduled();
void slaveReschedule();
int getChannel();
int getVariation();
void setVariation(int value);
void purge();
};
#endif //RTPIANO_LOOPERCLIP_H