-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTapeCoder.h
More file actions
45 lines (28 loc) · 899 Bytes
/
TapeCoder.h
File metadata and controls
45 lines (28 loc) · 899 Bytes
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
#ifndef ZXTAPERFIXER_TAPECODER_H
#define ZXTAPERFIXER_TAPECODER_H
#include <string>
#include "utils/Wave.h"
using namespace std;
class TapeCoder {
private:
string destName;
int sampleRate;
int maxPauseInSeconds = 0;
int splitOutputWavesOverMB = 0;
WaveFile* dest;
int nrOrder = 0;
string generateNextNameInfix();
string getCurrentNameInfix();
void openNewOutputDest();
int zerosCount = 0;
unsigned int currentAbsoluteStartOffset = 0;
public:
TapeCoder(string destName, int sampleRate, int maxPauseInSeconds = 0, int splitOutputWavesOverMB = 0);
void writeBit(int lastSignalCount, int signalType, int fullSignal);
~TapeCoder();
void writeSample(double value);
void writeZero();
string getDestOffset(unsigned int sourceOffset);
void possibleSplit(unsigned int sourceOffset);
};
#endif //ZXTAPERFIXER_TAPECODER_H