-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathmainwindow.h
More file actions
92 lines (75 loc) · 2.35 KB
/
mainwindow.h
File metadata and controls
92 lines (75 loc) · 2.35 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QCloseEvent>
#include <QComboBox>
#include <QListWidget>
#include <QMainWindow>
#include <QStringList>
#include <QTimer>
#include <memory> //for std::unique_ptr
// LSL
#include <lsl_cpp.h>
namespace Ui {
class MainWindow;
}
class recording;
class RemoteControlSocket;
class StreamItem {
public:
StreamItem(std::string stream_name, std::string stream_type, std::string source_id,
std::string hostname, bool required)
: name(stream_name), type(stream_type), id(source_id), host(hostname), checked(required) {}
QString listName() { return QString::fromStdString(name + " (" + host + ")"); }
std::string name;
std::string type;
std::string id;
std::string host;
bool checked;
};
class MainWindow : public QMainWindow {
Q_OBJECT
public:
explicit MainWindow(QWidget *parent, const char *config_file);
~MainWindow() noexcept override;
private slots:
void statusUpdate(void) const;
void closeEvent(QCloseEvent *ev) override;
void blockSelected(const QString &block);
std::vector<lsl::stream_info> refreshStreams(void);
void startRecording(void);
void stopRecording(void);
void selectAllStreams();
void selectStreams(const QString& search_str);
void selectRegexStreams(const QString& regex_pattern);
void selectNoStreams();
void buildFilename();
void buildBidsTemplate();
void printReplacedFilename();
void enableRcs(bool bEnable);
void rcsCheckBoxChanged(bool checked);
void rcsUpdateFilename(QString s);
void rcsStartRecording();
void rcsStopRecording();
void rcsportValueChangedInt(int value);
private:
QString replaceFilename(QString fullfile) const;
// function for loading / saving the config file
QString find_config_file(const char *filename);
QString counterPlaceholder() const;
void load_config(QString filename);
void save_config(QString filename);
std::unique_ptr<recording> currentRecording;
std::unique_ptr<RemoteControlSocket> rcs;
int startTime;
std::unique_ptr<QTimer> timer;
QList<StreamItem> knownStreams;
QSet<QString> missingStreams;
std::map<std::string, int> syncOptionsByStreamName;
// QString recFilename;
QString legacyTemplate;
std::unique_ptr<Ui::MainWindow> ui; // window pointer
// @Doug1983 added to suppress pop-ups when remotely starting recording
// and missing streams or having some unchecked streams
bool hideWarnings = false;
};
#endif // MAINWINDOW_H