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@0
|
25
|
Chris@426
|
26 class QFileSystemWatcher;
|
Chris@489
|
27 class QScrollArea;
|
Chris@0
|
28
|
Chris@200
|
29 class MainWindow : public MainWindowBase
|
Chris@0
|
30 {
|
Chris@0
|
31 Q_OBJECT
|
Chris@0
|
32
|
Chris@0
|
33 public:
|
Chris@70
|
34 MainWindow(bool withAudioOutput = true,
|
Chris@70
|
35 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@200
|
44 virtual bool commitData(bool mayAskUser);
|
Chris@118
|
45
|
Chris@489
|
46 void goFullScreen();
|
Chris@492
|
47 void endFullScreen();
|
Chris@489
|
48
|
Chris@0
|
49 protected slots:
|
Chris@200
|
50 virtual void importAudio();
|
Chris@200
|
51 virtual void importMoreAudio();
|
Chris@508
|
52 virtual void replaceMainAudio();
|
Chris@200
|
53 virtual void openSomething();
|
Chris@200
|
54 virtual void openLocation();
|
Chris@200
|
55 virtual void openRecentFile();
|
Chris@435
|
56 virtual void applyTemplate();
|
Chris@200
|
57 virtual void exportAudio();
|
Chris@631
|
58 virtual void exportAudioData();
|
Chris@200
|
59 virtual void importLayer();
|
Chris@200
|
60 virtual void exportLayer();
|
Chris@200
|
61 virtual void exportImage();
|
Chris@200
|
62 virtual void saveSession();
|
Chris@200
|
63 virtual void saveSessionAs();
|
Chris@200
|
64 virtual void newSession();
|
Chris@200
|
65 virtual void closeSession();
|
Chris@200
|
66 virtual void preferences();
|
Chris@0
|
67
|
Chris@730
|
68 virtual void sampleRateMismatch(int, int, bool);
|
Chris@200
|
69 virtual void audioOverloadPluginDisabled();
|
Chris@266
|
70 virtual void audioTimeStretchMultiChannelDisabled();
|
Chris@0
|
71
|
Chris@200
|
72 virtual void toolNavigateSelected();
|
Chris@200
|
73 virtual void toolSelectSelected();
|
Chris@200
|
74 virtual void toolEditSelected();
|
Chris@200
|
75 virtual void toolDrawSelected();
|
Chris@217
|
76 virtual void toolEraseSelected();
|
Chris@200
|
77 virtual void toolMeasureSelected();
|
Chris@7
|
78
|
Chris@200
|
79 virtual void documentModified();
|
Chris@200
|
80 virtual void documentRestored();
|
Chris@303
|
81 virtual void documentReplaced();
|
Chris@0
|
82
|
Chris@200
|
83 virtual void updateMenuStates();
|
Chris@200
|
84 virtual void updateDescriptionLabel();
|
Chris@0
|
85
|
Chris@200
|
86 virtual void setInstantsNumbering();
|
Chris@200
|
87 virtual void setInstantsCounterCycle();
|
Chris@597
|
88 virtual void setInstantsCounters();
|
Chris@200
|
89 virtual void resetInstantsCounters();
|
Chris@0
|
90
|
Chris@233
|
91 virtual void modelGenerationFailed(QString, QString);
|
Chris@233
|
92 virtual void modelGenerationWarning(QString, QString);
|
Chris@233
|
93 virtual void modelRegenerationFailed(QString, QString, QString);
|
Chris@233
|
94 virtual void modelRegenerationWarning(QString, QString, QString);
|
Chris@233
|
95 virtual void alignmentFailed(QString, QString);
|
Chris@0
|
96
|
Chris@200
|
97 virtual void rightButtonMenuRequested(Pane *, QPoint point);
|
Chris@0
|
98
|
Chris@239
|
99 virtual void propertyStacksResized(int);
|
Chris@239
|
100
|
Chris@200
|
101 virtual void addPane();
|
Chris@200
|
102 virtual void addLayer();
|
Chris@274
|
103 virtual void addLayer(QString transformId);
|
Chris@200
|
104 virtual void renameCurrentLayer();
|
Chris@0
|
105
|
Chris@272
|
106 virtual void findTransform();
|
Chris@272
|
107
|
Chris@200
|
108 virtual void paneAdded(Pane *);
|
Chris@200
|
109 virtual void paneHidden(Pane *);
|
Chris@200
|
110 virtual void paneAboutToBeDeleted(Pane *);
|
Chris@200
|
111 virtual void paneDropAccepted(Pane *, QStringList);
|
Chris@200
|
112 virtual void paneDropAccepted(Pane *, QString);
|
Chris@0
|
113
|
Chris@200
|
114 virtual void setupRecentFilesMenu();
|
Chris@211
|
115 virtual void setupRecentTransformsMenu();
|
Chris@423
|
116 virtual void setupTemplatesMenu();
|
Chris@0
|
117
|
Chris@200
|
118 virtual void playSpeedChanged(int);
|
Chris@207
|
119 virtual void playSoloToggled();
|
Chris@206
|
120 virtual void alignToggled();
|
Chris@0
|
121
|
Chris@227
|
122 virtual void currentPaneChanged(Pane *);
|
Chris@227
|
123
|
Chris@200
|
124 virtual void speedUpPlayback();
|
Chris@200
|
125 virtual void slowDownPlayback();
|
Chris@200
|
126 virtual void restoreNormalPlayback();
|
Chris@0
|
127
|
Chris@200
|
128 virtual void outputLevelsChanged(float, float);
|
Chris@0
|
129
|
Chris@200
|
130 virtual void layerRemoved(Layer *);
|
Chris@200
|
131 virtual void layerInAView(Layer *, bool);
|
Chris@0
|
132
|
Chris@200
|
133 virtual void mainModelChanged(WaveFileModel *);
|
Chris@200
|
134 virtual void modelAdded(Model *);
|
Chris@0
|
135
|
Chris@200
|
136 virtual void showLayerTree();
|
Chris@306
|
137 virtual void showActivityLog();
|
Chris@0
|
138
|
Chris@200
|
139 virtual void mouseEnteredWidget();
|
Chris@200
|
140 virtual void mouseLeftWidget();
|
Chris@73
|
141
|
Chris@200
|
142 virtual void handleOSCMessage(const OSCMessage &);
|
Chris@304
|
143 virtual void midiEventsAvailable();
|
Chris@305
|
144 virtual void playStatusChanged(bool);
|
Chris@193
|
145
|
Chris@425
|
146 virtual void saveSessionAsTemplate();
|
Chris@425
|
147 virtual void manageSavedTemplates();
|
Chris@425
|
148
|
Chris@200
|
149 virtual void website();
|
Chris@200
|
150 virtual void help();
|
Chris@200
|
151 virtual void about();
|
Chris@200
|
152 virtual void keyReference();
|
Chris@333
|
153 virtual void newerVersionAvailable(QString);
|
Chris@0
|
154
|
Chris@0
|
155 protected:
|
Chris@65
|
156 Overview *m_overview;
|
Chris@0
|
157 Fader *m_fader;
|
Chris@0
|
158 AudioDial *m_playSpeed;
|
Chris@0
|
159 WaveformLayer *m_panLayer;
|
Chris@489
|
160
|
Chris@489
|
161 QScrollArea *m_mainScroll;
|
Chris@34
|
162
|
Chris@0
|
163 bool m_mainMenusCreated;
|
Chris@0
|
164 QMenu *m_paneMenu;
|
Chris@0
|
165 QMenu *m_layerMenu;
|
Chris@34
|
166 QMenu *m_transformsMenu;
|
Chris@155
|
167 QMenu *m_playbackMenu;
|
Chris@0
|
168 QMenu *m_existingLayersMenu;
|
Chris@95
|
169 QMenu *m_sliceMenu;
|
Chris@0
|
170 QMenu *m_recentFilesMenu;
|
Chris@211
|
171 QMenu *m_recentTransformsMenu;
|
Chris@423
|
172 QMenu *m_templatesMenu;
|
Chris@0
|
173 QMenu *m_rightButtonMenu;
|
Chris@0
|
174 QMenu *m_rightButtonLayerMenu;
|
Chris@211
|
175 QMenu *m_rightButtonTransformsMenu;
|
Chris@155
|
176 QMenu *m_rightButtonPlaybackMenu;
|
Chris@155
|
177
|
Chris@164
|
178 QAction *m_deleteSelectedAction;
|
Chris@207
|
179 QAction *m_soloAction;
|
Chris@265
|
180 QAction *m_rwdStartAction;
|
Chris@323
|
181 QAction *m_rwdSimilarAction;
|
Chris@265
|
182 QAction *m_rwdAction;
|
Chris@155
|
183 QAction *m_ffwdAction;
|
Chris@323
|
184 QAction *m_ffwdSimilarAction;
|
Chris@265
|
185 QAction *m_ffwdEndAction;
|
Chris@265
|
186 QAction *m_playAction;
|
Chris@265
|
187 QAction *m_playSelectionAction;
|
Chris@265
|
188 QAction *m_playLoopAction;
|
Chris@436
|
189 QAction *m_manageTemplatesAction;
|
Chris@494
|
190 QAction *m_zoomInAction;
|
Chris@494
|
191 QAction *m_zoomOutAction;
|
Chris@494
|
192 QAction *m_zoomFitAction;
|
Chris@494
|
193 QAction *m_scrollLeftAction;
|
Chris@494
|
194 QAction *m_scrollRightAction;
|
Chris@494
|
195 QAction *m_showPropertyBoxesAction;
|
Chris@0
|
196
|
Chris@207
|
197 bool m_soloModified;
|
Chris@207
|
198 bool m_prevSolo;
|
Chris@207
|
199
|
Chris@239
|
200 QFrame *m_playControlsSpacer;
|
Chris@239
|
201 int m_playControlsWidth;
|
Chris@239
|
202
|
Chris@518
|
203 QLabel *m_descriptionLabel;
|
Chris@340
|
204 QLabel *m_currentLabel;
|
Chris@340
|
205
|
Chris@0
|
206 QPointer<PreferencesDialog> m_preferencesDialog;
|
Chris@219
|
207 QPointer<LayerTreeDialog> m_layerTreeDialog;
|
Chris@0
|
208
|
Chris@302
|
209 ActivityLog *m_activityLog;
|
Chris@162
|
210 KeyReference *m_keyReference;
|
Chris@162
|
211
|
Chris@426
|
212 QFileSystemWatcher *m_templateWatcher;
|
Chris@426
|
213
|
Chris@662
|
214 Surveyer *m_surveyer;
|
Chris@573
|
215 VersionTester *m_versionTester;
|
Chris@573
|
216
|
Chris@232
|
217 struct LayerConfiguration {
|
Chris@232
|
218 LayerConfiguration(LayerFactory::LayerType _layer
|
Chris@0
|
219 = LayerFactory::TimeRuler,
|
Chris@232
|
220 Model *_source = 0,
|
Chris@232
|
221 int _channel = -1) :
|
Chris@66
|
222 layer(_layer), sourceModel(_source), channel(_channel) { }
|
Chris@0
|
223 LayerFactory::LayerType layer;
|
Chris@66
|
224 Model *sourceModel;
|
Chris@0
|
225 int channel;
|
Chris@0
|
226 };
|
Chris@0
|
227
|
Chris@232
|
228 typedef std::map<QAction *, LayerConfiguration> PaneActionMap;
|
Chris@0
|
229 PaneActionMap m_paneActions;
|
Chris@0
|
230
|
Chris@232
|
231 typedef std::map<QAction *, LayerConfiguration> LayerActionMap;
|
Chris@232
|
232 LayerActionMap m_layerActions;
|
Chris@232
|
233
|
Chris@211
|
234 typedef std::map<QAction *, TransformId> TransformActionMap;
|
Chris@211
|
235 TransformActionMap m_transformActions;
|
Chris@34
|
236
|
Chris@211
|
237 typedef std::map<TransformId, QAction *> TransformActionReverseMap;
|
Chris@211
|
238 TransformActionReverseMap m_transformActionsReverse;
|
Chris@0
|
239
|
Chris@0
|
240 typedef std::map<QAction *, Layer *> ExistingLayerActionMap;
|
Chris@0
|
241 ExistingLayerActionMap m_existingLayerActions;
|
Chris@95
|
242 ExistingLayerActionMap m_sliceActions;
|
Chris@0
|
243
|
Chris@0
|
244 typedef std::map<ViewManager::ToolMode, QAction *> ToolActionMap;
|
Chris@0
|
245 ToolActionMap m_toolActions;
|
Chris@0
|
246
|
Chris@189
|
247 typedef std::map<QAction *, int> NumberingActionMap;
|
Chris@189
|
248 NumberingActionMap m_numberingActions;
|
Chris@189
|
249
|
Chris@200
|
250 virtual void setupMenus();
|
Chris@200
|
251 virtual void setupFileMenu();
|
Chris@200
|
252 virtual void setupEditMenu();
|
Chris@200
|
253 virtual void setupViewMenu();
|
Chris@200
|
254 virtual void setupPaneAndLayerMenus();
|
Chris@211
|
255 virtual void setupTransformsMenu();
|
Chris@200
|
256 virtual void setupHelpMenu();
|
Chris@200
|
257 virtual void setupExistingLayersMenus();
|
Chris@200
|
258 virtual void setupToolbars();
|
Chris@66
|
259
|
Chris@232
|
260 virtual void addPane(const LayerConfiguration &configuration, QString text);
|
Chris@0
|
261
|
Chris@0
|
262 virtual void closeEvent(QCloseEvent *e);
|
Chris@200
|
263 virtual bool checkSaveModified();
|
Chris@265
|
264
|
Chris@631
|
265 virtual void exportAudio(bool asData);
|
Chris@631
|
266
|
Chris@265
|
267 virtual void updateVisibleRangeDisplay(Pane *p) const;
|
Chris@340
|
268 virtual void updatePositionStatusDisplays() const;
|
Chris@290
|
269
|
Chris@294
|
270 virtual bool shouldCreateNewSessionForRDFAudio(bool *cancel);
|
Chris@200
|
271
|
Chris@265
|
272 virtual void connectLayerEditDialog(ModelDataTableDialog *);
|
Chris@0
|
273 };
|
Chris@0
|
274
|
Chris@0
|
275
|
Chris@0
|
276 #endif
|