-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.h
103 lines (65 loc) · 1.96 KB
/
mainwindow.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
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
93
94
95
96
97
98
99
100
101
102
103
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QSettings>
#include "signalgenerator.h"
namespace Ui
{
class MainWindow;
}
class QMdiArea;
class FormScope;
class FormSigGen;
class FormAnalyzer;
class QTimer;
class QSignalMapper;
class RtAudio;
class AudioInterface;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow( QWidget *parent = 0 );
~MainWindow();
void setFormScopeClosed();
void setFormSigGenClosed();
void setFormAnalyzerClosed();
void formSigGenFreqChanged( SignalGenerator::SignalType sigType, unsigned int freq1, unsigned int freq2 );
protected:
virtual void closeEvent(QCloseEvent *event);
private slots:
void showFormScope(bool checked);
void showFormSigGen(bool checked);
void showFormAnalyzer(bool checked);
void showAudioDevices();
void onConnect();
void onDisconnect();
void onTestTimer();
void setActiveSubWindow(QWidget *window);
private:
void readSettings();
void writeSettings();
void readWidgetSettings( const QString prefix, QWidget* widget, const QPoint defaultPos, const QSize defaultSize );
void writeWidgetSettings( const QString prefix, const QWidget* widget, bool visible );
void createScopeForm();
void createSigGenForm();
void createAnalyzerForm();
void readAudioParameters();
private:
Ui::MainWindow* ui;
RtAudio* m_audio;
AudioInterface* m_audioInterface;
FormScope* m_formScope;
FormSigGen* m_formSigGen;
FormAnalyzer* m_formAnalyzer;
QSettings* m_config;
QMdiArea* m_pMdiArea;
QSignalMapper* m_windowMapper;
QTimer* m_testTimer;
double time;
bool m_connected;
unsigned int m_currentSampleRate;
unsigned int m_currentOutputDevice;
unsigned int m_currentInputDevice;
};
#endif // MAINWINDOW_H