comparison framework/MainWindowBase.h @ 714:fe268c16ae28

Make it possible to open an audio device for playback and upgrade it to I/O later on - avoiding the Mac microphone-permission dialog until we are actually wanting to record
author Chris Cannam
date Wed, 16 Oct 2019 15:26:59 +0100
parents 8e9702c0b9c7
children 453029d6e9bf
comparison
equal deleted inserted replaced
713:ce698f8d0831 714:fe268c16ae28
91 public OSCMessageCallback 91 public OSCMessageCallback
92 { 92 {
93 Q_OBJECT 93 Q_OBJECT
94 94
95 public: 95 public:
96 enum SoundOption { 96 /**
97 WithAudioOutput = 0x01, 97 * Determine what kind of audio device to open when the first
98 WithAudioInput = 0x02, 98 * model is loaded or record() is called.
99 WithMIDIInput = 0x04, 99 */
100 WithEverything = 0xff, 100 enum AudioMode {
101 WithNothing = 0x00 101
102 }; 102 /// Open no audio device, ever
103 typedef int SoundOptions; 103 AUDIO_NONE,
104 104
105 MainWindowBase(SoundOptions soundOptions = WithEverything, 105 /// Open for playback, never for recording
106 PaneStack::Options paneStackOptions = 0x0); 106 AUDIO_PLAYBACK_ONLY,
107
108 /// Open for playback when model loaded, switch to I/O if record called
109 AUDIO_PLAYBACK_NOW_RECORD_LATER,
110
111 /// Open for I/O as soon as model loaded or record called
112 AUDIO_PLAYBACK_AND_RECORD
113 };
114
115 /**
116 * Determine whether to open a MIDI input device.
117 */
118 enum MIDIMode {
119
120 /// Open no MIDI device
121 MIDI_NONE,
122
123 /// Open a MIDI device and listen for MIDI input
124 MIDI_LISTEN
125 };
126
127 MainWindowBase(AudioMode audioMode, MIDIMode midiMode,
128 PaneStack::Options paneStackOptions);
107 virtual ~MainWindowBase(); 129 virtual ~MainWindowBase();
108 130
109 enum AudioFileOpenMode { 131 enum AudioFileOpenMode {
110 ReplaceSession, 132 ReplaceSession,
111 ReplaceMainModel, 133 ReplaceMainModel,
363 385
364 PaneStack *m_paneStack; 386 PaneStack *m_paneStack;
365 ViewManager *m_viewManager; 387 ViewManager *m_viewManager;
366 Layer *m_timeRulerLayer; 388 Layer *m_timeRulerLayer;
367 389
368 SoundOptions m_soundOptions; 390 AudioMode m_audioMode;
391 MIDIMode m_midiMode;
369 392
370 AudioCallbackPlaySource *m_playSource; 393 AudioCallbackPlaySource *m_playSource;
371 AudioCallbackRecordTarget *m_recordTarget; 394 AudioCallbackRecordTarget *m_recordTarget;
372 breakfastquay::ResamplerWrapper *m_resamplerWrapper; 395 breakfastquay::ResamplerWrapper *m_resamplerWrapper;
373 breakfastquay::SystemPlaybackTarget *m_playTarget; // only one of this... 396 breakfastquay::SystemPlaybackTarget *m_playTarget; // only one of this...