-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathStepRecorder.h
52 lines (40 loc) · 1.19 KB
/
StepRecorder.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
51
52
/*
* StepRecorder.h
*
* Created on: Aug 28, 2014
* Author: bastl
*/
#ifndef STEPRECORDER_H_
#define STEPRECORDER_H_
#include "Player.h"
#include "PlayerSettings.h"
#include "IStepMemory.h"
#include <BastlStepper.h>
class StepRecorder {
public:
StepRecorder();
void init(Player * player, IStepMemory * memory, PlayerSettings * playerSettings, BastlStepper * stepper);
void update();
void record(bool record);
unsigned int startRecordNote(unsigned char instrumentIndex);
void stopRecordNote(unsigned char instrumentIndex);
void recordMIDINote(unsigned char channel, unsigned char note);
void setCurrentStepper(BastlStepper * stepper);
private:
Player * player_;
IStepMemory * memory_;
PlayerSettings * playerSettings_;
BastlStepper * stepper_;
bool record_;
bool recordInstrumentStatuses_[6];
unsigned char lastQuantizedSteps_[6];
unsigned char getCurrentQuantizedSubstep(unsigned char instrumentIndex);
void recordSubsteps(unsigned char instrumentIndex, unsigned char subStepStartIndex);
};
inline void StepRecorder::record(bool record) {
record_ = record;
}
inline void StepRecorder::setCurrentStepper(BastlStepper * stepper) {
stepper_ = stepper;
}
#endif /* STEPRECORDER_H_ */