-
-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathMainWindow.h
More file actions
143 lines (111 loc) · 3.94 KB
/
MainWindow.h
File metadata and controls
143 lines (111 loc) · 3.94 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/*
* This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* ThePBone <tim.schneeberger(at)outlook.de> (c) 2020
*/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QCloseEvent>
#include <QFrame>
#include <QGraphicsColorizeEffect>
#include <QItemSelection>
#include <QMainWindow>
#include <QSystemTrayIcon>
#include "interface/fragment/AppManagerFragment.h"
#include "interface/fragment/FragmentHost.h"
#include "config/AppConfig.h"
#include "data/PresetProvider.h"
#include "EventArgs.h"
class IAudioService;
class IpcHandler;
class AutostartManager;
class TrayIcon;
class StyleHelper;
class StatusFragment;
class SettingsFragment;
class PresetFragment;
class EELEditor;
using namespace std;
namespace Ui
{
class MainWindow;
}
class MainWindow :
public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(IAudioService* audioService,
bool statupInTray,
QWidget *parent = nullptr);
~MainWindow();
protected:
void showEvent(QShowEvent* event) override;
void resizeEvent(QResizeEvent* event) override;
void closeEvent(QCloseEvent *event) override;
public slots:
void onResetRequested();
void onRelinkRequested();
void raiseWindow();
void launchFirstRunSetup();
private slots:
void applyConfig();
void onPassthroughToggled();
void onFragmentRequested();
void resetEQ();
void loadExternalFile();
void saveExternalFile();
void onBs2bPresetUpdated();
void onReverbPresetUpdated();
void onEqPresetUpdated();
void onEqModeUpdated();
void onEqTypeUpdated(int index);
void restoreGraphicEQView();
void saveGraphicEQView();
void onConvolverWaveformEdit();
void onTrayIconActivated();
void setVdcFile(const QString &path);
void setIrsFile(const QString &path);
void determineEqPresetName();
void determineIrsSelection();
void determineVdcSelection();
void onVdcDatabaseSelected(const QItemSelection&, const QItemSelection&);
void onAutoEqImportRequested();
void onConvolverInfoChanged(const ConvolverInfoEventArgs &args);
void onAppConfigUpdated(const AppConfig::Key& key, const QVariant& value);
private:
Ui::MainWindow *ui;
StyleHelper *_styleHelper = nullptr;
QGraphicsColorizeEffect *_redTintEffect = nullptr;
bool _startupInTraySwitch;
TrayIcon *_trayIcon;
AutostartManager *_autostart;
EELEditor *_eelEditor;
FragmentHost<AppManagerFragment*>* _appMgrFragment = nullptr;
FragmentHost<StatusFragment*>* _statusFragment = nullptr;
FragmentHost<SettingsFragment*>* _settingsFragment = nullptr;
FragmentHost<PresetFragment*>* _presetFragment = nullptr;
IAudioService* _audioService = nullptr;
IpcHandler* _ipcHandler = nullptr;
bool _blockApply = false;
bool _firstShowEvent = true;
QString _currentImpulseResponse = "";
QString _currentVdc = "";
QString _currentConvWaveformEdit = "";
void loadConfig();
void connectActions();
void installUnitData();
void setEq(const QVector<double> &data);
void setEqMode(int mode);
void setReverbData(PresetProvider::Reverb::sf_reverb_preset_data data);
};
#endif // MAINWINDOW_H