Chris@0
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
Chris@0
|
2
|
Chris@0
|
3 /*
|
Chris@0
|
4 Sonic Visualiser
|
Chris@0
|
5 An audio file viewer and annotation editor.
|
Chris@0
|
6 Centre for Digital Music, Queen Mary, University of London.
|
Chris@200
|
7 This file copyright 2006-2007 Chris Cannam and QMUL.
|
Chris@0
|
8
|
Chris@0
|
9 This program is free software; you can redistribute it and/or
|
Chris@0
|
10 modify it under the terms of the GNU General Public License as
|
Chris@0
|
11 published by the Free Software Foundation; either version 2 of the
|
Chris@0
|
12 License, or (at your option) any later version. See the file
|
Chris@0
|
13 COPYING included with this distribution for more information.
|
Chris@0
|
14 */
|
Chris@0
|
15
|
Chris@0
|
16 #ifndef _MAIN_WINDOW_H_
|
Chris@0
|
17 #define _MAIN_WINDOW_H_
|
Chris@0
|
18
|
Chris@672
|
19 #include "framework/MainWindowBase.h"
|
Chris@0
|
20
|
Chris@672
|
21 class VersionTester;
|
Chris@672
|
22 class Surveyer;
|
Chris@672
|
23 class LayerTreeDialog;
|
Chris@672
|
24 class ActivityLog;
|
Chris@891
|
25 class UnitConverter;
|
Chris@0
|
26
|
Chris@426
|
27 class QFileSystemWatcher;
|
Chris@489
|
28 class QScrollArea;
|
Chris@0
|
29
|
Chris@200
|
30 class MainWindow : public MainWindowBase
|
Chris@0
|
31 {
|
Chris@0
|
32 Q_OBJECT
|
Chris@0
|
33
|
Chris@0
|
34 public:
|
Chris@1045
|
35 MainWindow(SoundOptions options, bool withOSCSupport = true);
|
Chris@0
|
36 virtual ~MainWindow();
|
Chris@0
|
37
|
Chris@0
|
38 signals:
|
Chris@376
|
39 void canChangeSolo(bool);
|
Chris@376
|
40 void canAlign(bool);
|
Chris@0
|
41
|
Chris@118
|
42 public slots:
|
Chris@200
|
43 virtual void preferenceChanged(PropertyContainer::PropertyName);
|
Chris@1448
|
44 virtual void coloursChanged();
|
Chris@1448
|
45
|
Chris@200
|
46 virtual bool commitData(bool mayAskUser);
|
Chris@118
|
47
|
Chris@489
|
48 void goFullScreen();
|
Chris@492
|
49 void endFullScreen();
|
Chris@489
|
50
|
Chris@0
|
51 protected slots:
|
Chris@200
|
52 virtual void importAudio();
|
Chris@200
|
53 virtual void importMoreAudio();
|
Chris@508
|
54 virtual void replaceMainAudio();
|
Chris@200
|
55 virtual void openSomething();
|
Chris@200
|
56 virtual void openLocation();
|
Chris@1253
|
57 /* F. Nicol patch 13 Aug. 2016 */
|
Chris@1253
|
58 virtual void openRecentFile(const QString& );
|
Chris@1253
|
59 /* End of F. Nicol patch 13 Aug. 2016 */
|
Chris@435
|
60 virtual void applyTemplate();
|
Chris@200
|
61 virtual void exportAudio();
|
Chris@631
|
62 virtual void exportAudioData();
|
Chris@200
|
63 virtual void importLayer();
|
Chris@200
|
64 virtual void exportLayer();
|
Chris@200
|
65 virtual void exportImage();
|
Chris@1056
|
66 virtual void browseRecordedAudio();
|
Chris@200
|
67 virtual void saveSession();
|
Chris@200
|
68 virtual void saveSessionAs();
|
Chris@200
|
69 virtual void newSession();
|
Chris@200
|
70 virtual void closeSession();
|
Chris@200
|
71 virtual void preferences();
|
Chris@0
|
72
|
Chris@921
|
73 virtual void sampleRateMismatch(sv_samplerate_t, sv_samplerate_t, bool);
|
Chris@200
|
74 virtual void audioOverloadPluginDisabled();
|
Chris@266
|
75 virtual void audioTimeStretchMultiChannelDisabled();
|
Chris@0
|
76
|
Chris@200
|
77 virtual void toolNavigateSelected();
|
Chris@200
|
78 virtual void toolSelectSelected();
|
Chris@200
|
79 virtual void toolEditSelected();
|
Chris@200
|
80 virtual void toolDrawSelected();
|
Chris@217
|
81 virtual void toolEraseSelected();
|
Chris@200
|
82 virtual void toolMeasureSelected();
|
Chris@7
|
83
|
Chris@200
|
84 virtual void documentModified();
|
Chris@200
|
85 virtual void documentRestored();
|
Chris@303
|
86 virtual void documentReplaced();
|
Chris@0
|
87
|
Chris@200
|
88 virtual void updateMenuStates();
|
Chris@200
|
89 virtual void updateDescriptionLabel();
|
Chris@0
|
90
|
Chris@200
|
91 virtual void setInstantsNumbering();
|
Chris@200
|
92 virtual void setInstantsCounterCycle();
|
Chris@597
|
93 virtual void setInstantsCounters();
|
Chris@200
|
94 virtual void resetInstantsCounters();
|
Chris@1355
|
95 virtual void subdivideInstants();
|
Chris@1356
|
96 virtual void winnowInstants();
|
Chris@0
|
97
|
Chris@233
|
98 virtual void modelGenerationFailed(QString, QString);
|
Chris@233
|
99 virtual void modelGenerationWarning(QString, QString);
|
Chris@233
|
100 virtual void modelRegenerationFailed(QString, QString, QString);
|
Chris@233
|
101 virtual void modelRegenerationWarning(QString, QString, QString);
|
Chris@1151
|
102 virtual void alignmentFailed(QString);
|
Chris@0
|
103
|
Chris@200
|
104 virtual void rightButtonMenuRequested(Pane *, QPoint point);
|
Chris@0
|
105
|
Chris@239
|
106 virtual void propertyStacksResized(int);
|
Chris@239
|
107
|
Chris@200
|
108 virtual void addPane();
|
Chris@200
|
109 virtual void addLayer();
|
Chris@274
|
110 virtual void addLayer(QString transformId);
|
Chris@200
|
111 virtual void renameCurrentLayer();
|
Chris@0
|
112
|
Chris@272
|
113 virtual void findTransform();
|
Chris@272
|
114
|
Chris@200
|
115 virtual void paneAdded(Pane *);
|
Chris@200
|
116 virtual void paneHidden(Pane *);
|
Chris@200
|
117 virtual void paneAboutToBeDeleted(Pane *);
|
Chris@200
|
118 virtual void paneDropAccepted(Pane *, QStringList);
|
Chris@200
|
119 virtual void paneDropAccepted(Pane *, QString);
|
Chris@0
|
120
|
Chris@200
|
121 virtual void setupRecentFilesMenu();
|
Chris@211
|
122 virtual void setupRecentTransformsMenu();
|
Chris@423
|
123 virtual void setupTemplatesMenu();
|
Chris@0
|
124
|
Chris@200
|
125 virtual void playSpeedChanged(int);
|
Chris@207
|
126 virtual void playSoloToggled();
|
Chris@206
|
127 virtual void alignToggled();
|
Chris@0
|
128
|
Chris@227
|
129 virtual void currentPaneChanged(Pane *);
|
Chris@227
|
130
|
Chris@200
|
131 virtual void speedUpPlayback();
|
Chris@200
|
132 virtual void slowDownPlayback();
|
Chris@200
|
133 virtual void restoreNormalPlayback();
|
Chris@0
|
134
|
Chris@200
|
135 virtual void outputLevelsChanged(float, float);
|
Chris@0
|
136
|
Chris@200
|
137 virtual void layerRemoved(Layer *);
|
Chris@200
|
138 virtual void layerInAView(Layer *, bool);
|
Chris@0
|
139
|
Chris@200
|
140 virtual void mainModelChanged(WaveFileModel *);
|
Chris@1035
|
141 virtual void mainModelGainChanged(float);
|
Chris@1386
|
142 virtual void mainModelPanChanged(float);
|
Chris@200
|
143 virtual void modelAdded(Model *);
|
Chris@760
|
144 virtual void modelAboutToBeDeleted(Model *);
|
Chris@0
|
145
|
Chris@200
|
146 virtual void showLayerTree();
|
Chris@306
|
147 virtual void showActivityLog();
|
Chris@891
|
148 virtual void showUnitConverter();
|
Chris@0
|
149
|
Chris@200
|
150 virtual void mouseEnteredWidget();
|
Chris@200
|
151 virtual void mouseLeftWidget();
|
Chris@73
|
152
|
Chris@200
|
153 virtual void handleOSCMessage(const OSCMessage &);
|
Chris@304
|
154 virtual void midiEventsAvailable();
|
Chris@305
|
155 virtual void playStatusChanged(bool);
|
Chris@193
|
156
|
Chris@1148
|
157 virtual void pluginPopulationWarning();
|
Chris@1087
|
158
|
Chris@425
|
159 virtual void saveSessionAsTemplate();
|
Chris@425
|
160 virtual void manageSavedTemplates();
|
Chris@425
|
161
|
Chris@200
|
162 virtual void website();
|
Chris@200
|
163 virtual void help();
|
Chris@200
|
164 virtual void about();
|
Chris@200
|
165 virtual void keyReference();
|
Chris@333
|
166 virtual void newerVersionAvailable(QString);
|
Chris@0
|
167
|
Chris@0
|
168 protected:
|
Chris@65
|
169 Overview *m_overview;
|
Chris@1386
|
170 //!!! Fader *m_fader;
|
Chris@1431
|
171 LevelPanToolButton *m_mainLevelPan;
|
Chris@0
|
172 AudioDial *m_playSpeed;
|
Chris@0
|
173 WaveformLayer *m_panLayer;
|
Chris@489
|
174
|
Chris@489
|
175 QScrollArea *m_mainScroll;
|
Chris@34
|
176
|
Chris@0
|
177 bool m_mainMenusCreated;
|
Chris@0
|
178 QMenu *m_paneMenu;
|
Chris@0
|
179 QMenu *m_layerMenu;
|
Chris@34
|
180 QMenu *m_transformsMenu;
|
Chris@155
|
181 QMenu *m_playbackMenu;
|
Chris@0
|
182 QMenu *m_existingLayersMenu;
|
Chris@95
|
183 QMenu *m_sliceMenu;
|
Chris@0
|
184 QMenu *m_recentFilesMenu;
|
Chris@211
|
185 QMenu *m_recentTransformsMenu;
|
Chris@423
|
186 QMenu *m_templatesMenu;
|
Chris@0
|
187 QMenu *m_rightButtonMenu;
|
Chris@0
|
188 QMenu *m_rightButtonLayerMenu;
|
Chris@211
|
189 QMenu *m_rightButtonTransformsMenu;
|
Chris@155
|
190 QMenu *m_rightButtonPlaybackMenu;
|
Chris@155
|
191
|
Chris@164
|
192 QAction *m_deleteSelectedAction;
|
Chris@207
|
193 QAction *m_soloAction;
|
Chris@265
|
194 QAction *m_rwdStartAction;
|
Chris@323
|
195 QAction *m_rwdSimilarAction;
|
Chris@265
|
196 QAction *m_rwdAction;
|
Chris@155
|
197 QAction *m_ffwdAction;
|
Chris@323
|
198 QAction *m_ffwdSimilarAction;
|
Chris@265
|
199 QAction *m_ffwdEndAction;
|
Chris@265
|
200 QAction *m_playAction;
|
Chris@1047
|
201 QAction *m_recordAction;
|
Chris@265
|
202 QAction *m_playSelectionAction;
|
Chris@265
|
203 QAction *m_playLoopAction;
|
Chris@436
|
204 QAction *m_manageTemplatesAction;
|
Chris@494
|
205 QAction *m_zoomInAction;
|
Chris@494
|
206 QAction *m_zoomOutAction;
|
Chris@494
|
207 QAction *m_zoomFitAction;
|
Chris@494
|
208 QAction *m_scrollLeftAction;
|
Chris@494
|
209 QAction *m_scrollRightAction;
|
Chris@494
|
210 QAction *m_showPropertyBoxesAction;
|
Chris@0
|
211
|
Chris@207
|
212 bool m_soloModified;
|
Chris@207
|
213 bool m_prevSolo;
|
Chris@207
|
214
|
Chris@239
|
215 QFrame *m_playControlsSpacer;
|
Chris@239
|
216 int m_playControlsWidth;
|
Chris@239
|
217
|
Chris@518
|
218 QLabel *m_descriptionLabel;
|
Chris@340
|
219 QLabel *m_currentLabel;
|
Chris@340
|
220
|
Chris@0
|
221 QPointer<PreferencesDialog> m_preferencesDialog;
|
Chris@219
|
222 QPointer<LayerTreeDialog> m_layerTreeDialog;
|
Chris@0
|
223
|
Chris@302
|
224 ActivityLog *m_activityLog;
|
Chris@891
|
225 UnitConverter *m_unitConverter;
|
Chris@162
|
226 KeyReference *m_keyReference;
|
Chris@162
|
227
|
Chris@426
|
228 QFileSystemWatcher *m_templateWatcher;
|
Chris@426
|
229
|
Chris@662
|
230 Surveyer *m_surveyer;
|
Chris@573
|
231 VersionTester *m_versionTester;
|
Chris@573
|
232
|
Chris@232
|
233 struct LayerConfiguration {
|
Chris@232
|
234 LayerConfiguration(LayerFactory::LayerType _layer
|
Chris@0
|
235 = LayerFactory::TimeRuler,
|
Chris@232
|
236 Model *_source = 0,
|
Chris@232
|
237 int _channel = -1) :
|
Chris@66
|
238 layer(_layer), sourceModel(_source), channel(_channel) { }
|
Chris@0
|
239 LayerFactory::LayerType layer;
|
Chris@66
|
240 Model *sourceModel;
|
Chris@0
|
241 int channel;
|
Chris@0
|
242 };
|
Chris@0
|
243
|
Chris@232
|
244 typedef std::map<QAction *, LayerConfiguration> PaneActionMap;
|
Chris@0
|
245 PaneActionMap m_paneActions;
|
Chris@0
|
246
|
Chris@232
|
247 typedef std::map<QAction *, LayerConfiguration> LayerActionMap;
|
Chris@232
|
248 LayerActionMap m_layerActions;
|
Chris@232
|
249
|
Chris@211
|
250 typedef std::map<QAction *, TransformId> TransformActionMap;
|
Chris@211
|
251 TransformActionMap m_transformActions;
|
Chris@34
|
252
|
Chris@211
|
253 typedef std::map<TransformId, QAction *> TransformActionReverseMap;
|
Chris@211
|
254 TransformActionReverseMap m_transformActionsReverse;
|
Chris@0
|
255
|
Chris@0
|
256 typedef std::map<QAction *, Layer *> ExistingLayerActionMap;
|
Chris@0
|
257 ExistingLayerActionMap m_existingLayerActions;
|
Chris@95
|
258 ExistingLayerActionMap m_sliceActions;
|
Chris@0
|
259
|
Chris@0
|
260 typedef std::map<ViewManager::ToolMode, QAction *> ToolActionMap;
|
Chris@0
|
261 ToolActionMap m_toolActions;
|
Chris@0
|
262
|
Chris@189
|
263 typedef std::map<QAction *, int> NumberingActionMap;
|
Chris@189
|
264 NumberingActionMap m_numberingActions;
|
Chris@189
|
265
|
Chris@200
|
266 virtual void setupMenus();
|
Chris@200
|
267 virtual void setupFileMenu();
|
Chris@200
|
268 virtual void setupEditMenu();
|
Chris@200
|
269 virtual void setupViewMenu();
|
Chris@200
|
270 virtual void setupPaneAndLayerMenus();
|
Chris@211
|
271 virtual void setupTransformsMenu();
|
Chris@200
|
272 virtual void setupHelpMenu();
|
Chris@200
|
273 virtual void setupExistingLayersMenus();
|
Chris@200
|
274 virtual void setupToolbars();
|
Chris@66
|
275
|
Chris@232
|
276 virtual void addPane(const LayerConfiguration &configuration, QString text);
|
Chris@0
|
277
|
Chris@0
|
278 virtual void closeEvent(QCloseEvent *e);
|
Chris@200
|
279 virtual bool checkSaveModified();
|
Chris@265
|
280
|
Chris@631
|
281 virtual void exportAudio(bool asData);
|
Chris@631
|
282
|
Chris@265
|
283 virtual void updateVisibleRangeDisplay(Pane *p) const;
|
Chris@340
|
284 virtual void updatePositionStatusDisplays() const;
|
Chris@290
|
285
|
Chris@294
|
286 virtual bool shouldCreateNewSessionForRDFAudio(bool *cancel);
|
Chris@200
|
287
|
Chris@265
|
288 virtual void connectLayerEditDialog(ModelDataTableDialog *);
|
Chris@0
|
289 };
|
Chris@0
|
290
|
Chris@0
|
291
|
Chris@0
|
292 #endif
|