annotate main/MainWindow.h @ 950:c9d87032f3da osx-retina

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