-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrecplay.hpp
67 lines (59 loc) · 1.5 KB
/
recplay.hpp
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef REC_H
#define REC_H
#include <QPushButton>
#include <QTextStream>
#include <QWidget>
#include <QMouseEvent>
#include <QTimer>
#include <chrono>
#include <QMap>
#include <QPair>
#include <QAction>
class keyBoard;
class Key;
class mainWindow;
class RecPlay : public QObject
{
Q_OBJECT
public:
RecPlay(QWidget*);
~RecPlay(){};
bool recording();
bool playing();
bool unsaved(){return this->_unsavedChanges;}
void send(Key*, std::chrono::high_resolution_clock::time_point,std::chrono::high_resolution_clock::time_point);
void setButtons(QAction*,QAction*,QAction*,QAction*,QAction*);
void writeFile(QString);
int status();
keyBoard* kb();
public slots:
void startRec();
void stopRec();
void Play();
void Pause();
void Stop();
void PlayNextNote();
void Clear();
void Open();
void Save();
void SaveAs();
protected:
private:
QAction* _startRec;
QAction* _stopRec;
QAction* _pause;
QAction* _startPlay;
QAction* _stopPlay;
std::chrono::high_resolution_clock::time_point _start;
std::chrono::high_resolution_clock::time_point _pausedAt;
bool _recording = false;
bool _playing = false;
bool _paused = false;
bool _unsavedChanges = false;
mainWindow* _mw;
QMap<int, QPair<QString, int>> _registration;
int _ms = 0;
QTimer* _timer;
QString _currentFile;
};
#endif