comparison framework/MainWindowBase.h @ 482:01669adb0956 tony-2.0-integration

Merge through to branch for Tony 2.0
author Chris Cannam
date Thu, 20 Aug 2015 14:54:21 +0100
parents 411e019474e5
children 493f2af85497
comparison
equal deleted inserted replaced
448:b36042cb972a 482:01669adb0956
44 class Overview; 44 class Overview;
45 class Layer; 45 class Layer;
46 class WaveformLayer; 46 class WaveformLayer;
47 class WaveFileModel; 47 class WaveFileModel;
48 class AudioCallbackPlaySource; 48 class AudioCallbackPlaySource;
49 class AudioCallbackPlayTarget; 49 class AudioRecordTarget;
50 class CommandHistory; 50 class CommandHistory;
51 class QMenu; 51 class QMenu;
52 class AudioDial; 52 class AudioDial;
53 class QLabel; 53 class QLabel;
54 class QCheckBox; 54 class QCheckBox;
61 class Labeller; 61 class Labeller;
62 class ModelDataTableDialog; 62 class ModelDataTableDialog;
63 class QSignalMapper; 63 class QSignalMapper;
64 class QShortcut; 64 class QShortcut;
65 65
66 namespace breakfastquay {
67 class SystemPlaybackTarget;
68 class SystemAudioIO;
69 }
70
66 /** 71 /**
67 * The base class for the SV main window. This includes everything to 72 * The base class for the SV main window. This includes everything to
68 * do with general document and pane stack management, but nothing 73 * do with general document and pane stack management, but nothing
69 * that involves user interaction -- this doesn't create the widget or 74 * that involves user interaction -- this doesn't create the widget or
70 * menu structures or editing tools, and if a function needs to open a 75 * menu structures or editing tools, and if a function needs to open a
75 class MainWindowBase : public QMainWindow, public FrameTimer 80 class MainWindowBase : public QMainWindow, public FrameTimer
76 { 81 {
77 Q_OBJECT 82 Q_OBJECT
78 83
79 public: 84 public:
80 MainWindowBase(bool withAudioOutput, bool withMIDIInput); 85 enum SoundOption {
86 WithAudioOutput = 0x01,
87 WithAudioInput = 0x02,
88 WithMIDIInput = 0x04,
89 WithEverything = 0xff
90 };
91 typedef int SoundOptions;
92
93 MainWindowBase(SoundOptions options = WithEverything);
81 virtual ~MainWindowBase(); 94 virtual ~MainWindowBase();
82 95
83 enum AudioFileOpenMode { 96 enum AudioFileOpenMode {
84 ReplaceSession, 97 ReplaceSession,
85 ReplaceMainModel, 98 ReplaceMainModel,
144 void canRenumberInstants(bool); 157 void canRenumberInstants(bool);
145 void canDeleteCurrentLayer(bool); 158 void canDeleteCurrentLayer(bool);
146 void canZoom(bool); 159 void canZoom(bool);
147 void canScroll(bool); 160 void canScroll(bool);
148 void canPlay(bool); 161 void canPlay(bool);
162 void canRecord(bool);
149 void canFfwd(bool); 163 void canFfwd(bool);
150 void canRewind(bool); 164 void canRewind(bool);
151 void canPlaySelection(bool); 165 void canPlaySelection(bool);
152 void canSpeedUpPlayback(bool); 166 void canSpeedUpPlayback(bool);
153 void canSlowDownPlayback(bool); 167 void canSlowDownPlayback(bool);
157 void canSelectPreviousLayer(bool); 171 void canSelectPreviousLayer(bool);
158 void canSelectNextLayer(bool); 172 void canSelectNextLayer(bool);
159 void canSave(bool); 173 void canSave(bool);
160 void canSaveAs(bool); 174 void canSaveAs(bool);
161 void hideSplash(); 175 void hideSplash();
176 void hideSplash(QWidget *);
162 void sessionLoaded(); 177 void sessionLoaded();
163 void audioFileLoaded(); 178 void audioFileLoaded();
164 void replacedDocument(); 179 void replacedDocument();
165 void activity(QString); 180 void activity(QString);
166 181
193 virtual void play(); 208 virtual void play();
194 virtual void ffwd(); 209 virtual void ffwd();
195 virtual void ffwdEnd(); 210 virtual void ffwdEnd();
196 virtual void rewind(); 211 virtual void rewind();
197 virtual void rewindStart(); 212 virtual void rewindStart();
213 virtual void record();
198 virtual void stop(); 214 virtual void stop();
199 215
200 virtual void ffwdSimilar(); 216 virtual void ffwdSimilar();
201 virtual void rewindSimilar(); 217 virtual void rewindSimilar();
202 218
286 virtual FileOpenStatus openSessionFromRDF(FileSource source); 302 virtual FileOpenStatus openSessionFromRDF(FileSource source);
287 virtual FileOpenStatus openLayersFromRDF(FileSource source); 303 virtual FileOpenStatus openLayersFromRDF(FileSource source);
288 304
289 virtual void closeSession() = 0; 305 virtual void closeSession() = 0;
290 306
307 virtual void emitHideSplash();
308
291 virtual void newerVersionAvailable(QString) { } 309 virtual void newerVersionAvailable(QString) { }
292 310
293 virtual void menuActionMapperInvoked(QObject *); 311 virtual void menuActionMapperInvoked(QObject *);
294 312
295 protected: 313 protected:
299 317
300 PaneStack *m_paneStack; 318 PaneStack *m_paneStack;
301 ViewManager *m_viewManager; 319 ViewManager *m_viewManager;
302 Layer *m_timeRulerLayer; 320 Layer *m_timeRulerLayer;
303 321
304 bool m_audioOutput; 322 SoundOptions m_soundOptions;
323
305 AudioCallbackPlaySource *m_playSource; 324 AudioCallbackPlaySource *m_playSource;
306 AudioCallbackPlayTarget *m_playTarget; 325 AudioRecordTarget *m_recordTarget;
326 breakfastquay::SystemPlaybackTarget *m_playTarget; // only one of this...
327 breakfastquay::SystemAudioIO *m_audioIO; // ... and this exists
307 328
308 class OSCQueueStarter : public QThread 329 class OSCQueueStarter : public QThread
309 { 330 {
310 public: 331 public:
311 OSCQueueStarter(MainWindowBase *mwb) : QThread(mwb), m_mwb(mwb) { } 332 OSCQueueStarter(MainWindowBase *mwb) : QThread(mwb), m_mwb(mwb) { }
416 virtual void registerLastOpenedFilePath(FileFinder::FileType type, QString path); 437 virtual void registerLastOpenedFilePath(FileFinder::FileType type, QString path);
417 438
418 virtual QString getDefaultSessionTemplate() const; 439 virtual QString getDefaultSessionTemplate() const;
419 virtual void setDefaultSessionTemplate(QString); 440 virtual void setDefaultSessionTemplate(QString);
420 441
421 virtual void createPlayTarget(); 442 virtual void createAudioIO();
422 virtual void openHelpUrl(QString url); 443 virtual void openHelpUrl(QString url);
423 444
424 virtual void setupMenus() = 0; 445 virtual void setupMenus() = 0;
425 virtual void updateVisibleRangeDisplay(Pane *p) const = 0; 446 virtual void updateVisibleRangeDisplay(Pane *p) const = 0;
426 virtual void updatePositionStatusDisplays() const = 0; 447 virtual void updatePositionStatusDisplays() const = 0;