annotate main/MainWindow.h @ 1369:2402164ffb4d mp3-gapless

Update m4a files to exports from CoreAudio, rather than FAAC; update tests accordingly, and add test for spurious data after end of decode
author Chris Cannam <cannam@all-day-breakfast.com>
date Tue, 29 Nov 2016 14:25:57 +0000
parents 3ef81d81b767
children 05d35ce6ea72
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@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@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@1253 55 /* F. Nicol patch 13 Aug. 2016 */
Chris@1253 56 virtual void openRecentFile(const QString& );
Chris@1253 57 /* End of F. Nicol patch 13 Aug. 2016 */
Chris@435 58 virtual void applyTemplate();
Chris@200 59 virtual void exportAudio();
Chris@631 60 virtual void exportAudioData();
Chris@200 61 virtual void importLayer();
Chris@200 62 virtual void exportLayer();
Chris@200 63 virtual void exportImage();
Chris@1056 64 virtual void browseRecordedAudio();
Chris@200 65 virtual void saveSession();
Chris@200 66 virtual void saveSessionAs();
Chris@200 67 virtual void newSession();
Chris@200 68 virtual void closeSession();
Chris@200 69 virtual void preferences();
Chris@0 70
Chris@921 71 virtual void sampleRateMismatch(sv_samplerate_t, sv_samplerate_t, bool);
Chris@200 72 virtual void audioOverloadPluginDisabled();
Chris@266 73 virtual void audioTimeStretchMultiChannelDisabled();
Chris@0 74
Chris@200 75 virtual void toolNavigateSelected();
Chris@200 76 virtual void toolSelectSelected();
Chris@200 77 virtual void toolEditSelected();
Chris@200 78 virtual void toolDrawSelected();
Chris@217 79 virtual void toolEraseSelected();
Chris@200 80 virtual void toolMeasureSelected();
Chris@7 81
Chris@200 82 virtual void documentModified();
Chris@200 83 virtual void documentRestored();
Chris@303 84 virtual void documentReplaced();
Chris@0 85
Chris@200 86 virtual void updateMenuStates();
Chris@200 87 virtual void updateDescriptionLabel();
Chris@0 88
Chris@200 89 virtual void setInstantsNumbering();
Chris@200 90 virtual void setInstantsCounterCycle();
Chris@597 91 virtual void setInstantsCounters();
Chris@200 92 virtual void resetInstantsCounters();
Chris@1355 93 virtual void subdivideInstants();
Chris@1356 94 virtual void winnowInstants();
Chris@0 95
Chris@233 96 virtual void modelGenerationFailed(QString, QString);
Chris@233 97 virtual void modelGenerationWarning(QString, QString);
Chris@233 98 virtual void modelRegenerationFailed(QString, QString, QString);
Chris@233 99 virtual void modelRegenerationWarning(QString, QString, QString);
Chris@1151 100 virtual void alignmentFailed(QString);
Chris@0 101
Chris@200 102 virtual void rightButtonMenuRequested(Pane *, QPoint point);
Chris@0 103
Chris@239 104 virtual void propertyStacksResized(int);
Chris@239 105
Chris@200 106 virtual void addPane();
Chris@200 107 virtual void addLayer();
Chris@274 108 virtual void addLayer(QString transformId);
Chris@200 109 virtual void renameCurrentLayer();
Chris@0 110
Chris@272 111 virtual void findTransform();
Chris@272 112
Chris@200 113 virtual void paneAdded(Pane *);
Chris@200 114 virtual void paneHidden(Pane *);
Chris@200 115 virtual void paneAboutToBeDeleted(Pane *);
Chris@200 116 virtual void paneDropAccepted(Pane *, QStringList);
Chris@200 117 virtual void paneDropAccepted(Pane *, QString);
Chris@0 118
Chris@200 119 virtual void setupRecentFilesMenu();
Chris@211 120 virtual void setupRecentTransformsMenu();
Chris@423 121 virtual void setupTemplatesMenu();
Chris@0 122
Chris@200 123 virtual void playSpeedChanged(int);
Chris@207 124 virtual void playSoloToggled();
Chris@206 125 virtual void alignToggled();
Chris@0 126
Chris@227 127 virtual void currentPaneChanged(Pane *);
Chris@227 128
Chris@200 129 virtual void speedUpPlayback();
Chris@200 130 virtual void slowDownPlayback();
Chris@200 131 virtual void restoreNormalPlayback();
Chris@0 132
Chris@200 133 virtual void outputLevelsChanged(float, float);
Chris@0 134
Chris@200 135 virtual void layerRemoved(Layer *);
Chris@200 136 virtual void layerInAView(Layer *, bool);
Chris@0 137
Chris@200 138 virtual void mainModelChanged(WaveFileModel *);
Chris@1035 139 virtual void mainModelGainChanged(float);
Chris@200 140 virtual void modelAdded(Model *);
Chris@760 141 virtual void modelAboutToBeDeleted(Model *);
Chris@0 142
Chris@200 143 virtual void showLayerTree();
Chris@306 144 virtual void showActivityLog();
Chris@891 145 virtual void showUnitConverter();
Chris@0 146
Chris@200 147 virtual void mouseEnteredWidget();
Chris@200 148 virtual void mouseLeftWidget();
Chris@73 149
Chris@200 150 virtual void handleOSCMessage(const OSCMessage &);
Chris@304 151 virtual void midiEventsAvailable();
Chris@305 152 virtual void playStatusChanged(bool);
Chris@193 153
Chris@1148 154 virtual void pluginPopulationWarning();
Chris@1087 155
Chris@425 156 virtual void saveSessionAsTemplate();
Chris@425 157 virtual void manageSavedTemplates();
Chris@425 158
Chris@200 159 virtual void website();
Chris@200 160 virtual void help();
Chris@200 161 virtual void about();
Chris@200 162 virtual void keyReference();
Chris@333 163 virtual void newerVersionAvailable(QString);
Chris@0 164
Chris@0 165 protected:
Chris@65 166 Overview *m_overview;
Chris@0 167 Fader *m_fader;
Chris@0 168 AudioDial *m_playSpeed;
Chris@0 169 WaveformLayer *m_panLayer;
Chris@489 170
Chris@489 171 QScrollArea *m_mainScroll;
Chris@34 172
Chris@0 173 bool m_mainMenusCreated;
Chris@0 174 QMenu *m_paneMenu;
Chris@0 175 QMenu *m_layerMenu;
Chris@34 176 QMenu *m_transformsMenu;
Chris@155 177 QMenu *m_playbackMenu;
Chris@0 178 QMenu *m_existingLayersMenu;
Chris@95 179 QMenu *m_sliceMenu;
Chris@0 180 QMenu *m_recentFilesMenu;
Chris@211 181 QMenu *m_recentTransformsMenu;
Chris@423 182 QMenu *m_templatesMenu;
Chris@0 183 QMenu *m_rightButtonMenu;
Chris@0 184 QMenu *m_rightButtonLayerMenu;
Chris@211 185 QMenu *m_rightButtonTransformsMenu;
Chris@155 186 QMenu *m_rightButtonPlaybackMenu;
Chris@155 187
Chris@164 188 QAction *m_deleteSelectedAction;
Chris@207 189 QAction *m_soloAction;
Chris@265 190 QAction *m_rwdStartAction;
Chris@323 191 QAction *m_rwdSimilarAction;
Chris@265 192 QAction *m_rwdAction;
Chris@155 193 QAction *m_ffwdAction;
Chris@323 194 QAction *m_ffwdSimilarAction;
Chris@265 195 QAction *m_ffwdEndAction;
Chris@265 196 QAction *m_playAction;
Chris@1047 197 QAction *m_recordAction;
Chris@265 198 QAction *m_playSelectionAction;
Chris@265 199 QAction *m_playLoopAction;
Chris@436 200 QAction *m_manageTemplatesAction;
Chris@494 201 QAction *m_zoomInAction;
Chris@494 202 QAction *m_zoomOutAction;
Chris@494 203 QAction *m_zoomFitAction;
Chris@494 204 QAction *m_scrollLeftAction;
Chris@494 205 QAction *m_scrollRightAction;
Chris@494 206 QAction *m_showPropertyBoxesAction;
Chris@0 207
Chris@207 208 bool m_soloModified;
Chris@207 209 bool m_prevSolo;
Chris@207 210
Chris@239 211 QFrame *m_playControlsSpacer;
Chris@239 212 int m_playControlsWidth;
Chris@239 213
Chris@518 214 QLabel *m_descriptionLabel;
Chris@340 215 QLabel *m_currentLabel;
Chris@340 216
Chris@0 217 QPointer<PreferencesDialog> m_preferencesDialog;
Chris@219 218 QPointer<LayerTreeDialog> m_layerTreeDialog;
Chris@0 219
Chris@302 220 ActivityLog *m_activityLog;
Chris@891 221 UnitConverter *m_unitConverter;
Chris@162 222 KeyReference *m_keyReference;
Chris@162 223
Chris@426 224 QFileSystemWatcher *m_templateWatcher;
Chris@426 225
Chris@662 226 Surveyer *m_surveyer;
Chris@573 227 VersionTester *m_versionTester;
Chris@573 228
Chris@232 229 struct LayerConfiguration {
Chris@232 230 LayerConfiguration(LayerFactory::LayerType _layer
Chris@0 231 = LayerFactory::TimeRuler,
Chris@232 232 Model *_source = 0,
Chris@232 233 int _channel = -1) :
Chris@66 234 layer(_layer), sourceModel(_source), channel(_channel) { }
Chris@0 235 LayerFactory::LayerType layer;
Chris@66 236 Model *sourceModel;
Chris@0 237 int channel;
Chris@0 238 };
Chris@0 239
Chris@232 240 typedef std::map<QAction *, LayerConfiguration> PaneActionMap;
Chris@0 241 PaneActionMap m_paneActions;
Chris@0 242
Chris@232 243 typedef std::map<QAction *, LayerConfiguration> LayerActionMap;
Chris@232 244 LayerActionMap m_layerActions;
Chris@232 245
Chris@211 246 typedef std::map<QAction *, TransformId> TransformActionMap;
Chris@211 247 TransformActionMap m_transformActions;
Chris@34 248
Chris@211 249 typedef std::map<TransformId, QAction *> TransformActionReverseMap;
Chris@211 250 TransformActionReverseMap m_transformActionsReverse;
Chris@0 251
Chris@0 252 typedef std::map<QAction *, Layer *> ExistingLayerActionMap;
Chris@0 253 ExistingLayerActionMap m_existingLayerActions;
Chris@95 254 ExistingLayerActionMap m_sliceActions;
Chris@0 255
Chris@0 256 typedef std::map<ViewManager::ToolMode, QAction *> ToolActionMap;
Chris@0 257 ToolActionMap m_toolActions;
Chris@0 258
Chris@189 259 typedef std::map<QAction *, int> NumberingActionMap;
Chris@189 260 NumberingActionMap m_numberingActions;
Chris@189 261
Chris@200 262 virtual void setupMenus();
Chris@200 263 virtual void setupFileMenu();
Chris@200 264 virtual void setupEditMenu();
Chris@200 265 virtual void setupViewMenu();
Chris@200 266 virtual void setupPaneAndLayerMenus();
Chris@211 267 virtual void setupTransformsMenu();
Chris@200 268 virtual void setupHelpMenu();
Chris@200 269 virtual void setupExistingLayersMenus();
Chris@200 270 virtual void setupToolbars();
Chris@66 271
Chris@232 272 virtual void addPane(const LayerConfiguration &configuration, QString text);
Chris@0 273
Chris@0 274 virtual void closeEvent(QCloseEvent *e);
Chris@200 275 virtual bool checkSaveModified();
Chris@265 276
Chris@631 277 virtual void exportAudio(bool asData);
Chris@631 278
Chris@265 279 virtual void updateVisibleRangeDisplay(Pane *p) const;
Chris@340 280 virtual void updatePositionStatusDisplays() const;
Chris@290 281
Chris@294 282 virtual bool shouldCreateNewSessionForRDFAudio(bool *cancel);
Chris@200 283
Chris@265 284 virtual void connectLayerEditDialog(ModelDataTableDialog *);
Chris@0 285 };
Chris@0 286
Chris@0 287
Chris@0 288 #endif