Mercurial > hg > svapp
comparison framework/MainWindowBase.cpp @ 551:b9d8c7a690d6 bqresample
Add a ResamplerWrapper
author | Chris Cannam |
---|---|
date | Wed, 07 Dec 2016 13:57:45 +0000 |
parents | baa11365ebdd |
children | 8c11ca1ebc39 |
comparison
equal
deleted
inserted
replaced
550:c732251237b1 | 551:b9d8c7a690d6 |
---|---|
74 #include "data/midi/MIDIInput.h" | 74 #include "data/midi/MIDIInput.h" |
75 | 75 |
76 #include <bqaudioio/SystemPlaybackTarget.h> | 76 #include <bqaudioio/SystemPlaybackTarget.h> |
77 #include <bqaudioio/SystemAudioIO.h> | 77 #include <bqaudioio/SystemAudioIO.h> |
78 #include <bqaudioio/AudioFactory.h> | 78 #include <bqaudioio/AudioFactory.h> |
79 #include <bqaudioio/ResamplerWrapper.h> | |
79 | 80 |
80 #include <QApplication> | 81 #include <QApplication> |
81 #include <QMessageBox> | 82 #include <QMessageBox> |
82 #include <QGridLayout> | 83 #include <QGridLayout> |
83 #include <QLabel> | 84 #include <QLabel> |
139 m_viewManager(0), | 140 m_viewManager(0), |
140 m_timeRulerLayer(0), | 141 m_timeRulerLayer(0), |
141 m_soundOptions(options), | 142 m_soundOptions(options), |
142 m_playSource(0), | 143 m_playSource(0), |
143 m_recordTarget(0), | 144 m_recordTarget(0), |
145 m_resamplerWrapper(0), | |
144 m_playTarget(0), | 146 m_playTarget(0), |
145 m_audioIO(0), | 147 m_audioIO(0), |
146 m_oscQueue(0), | 148 m_oscQueue(0), |
147 m_oscQueueStarter(0), | 149 m_oscQueueStarter(0), |
148 m_midiInput(0), | 150 m_midiInput(0), |
301 // Only one of these two exists! | 303 // Only one of these two exists! |
302 delete m_audioIO; | 304 delete m_audioIO; |
303 delete m_playTarget; | 305 delete m_playTarget; |
304 | 306 |
305 // Then delete the Application objects. | 307 // Then delete the Application objects. |
308 delete m_resamplerWrapper; | |
306 delete m_playSource; | 309 delete m_playSource; |
307 delete m_recordTarget; | 310 delete m_recordTarget; |
308 | 311 |
309 delete m_viewManager; | 312 delete m_viewManager; |
310 delete m_oscQueue; | 313 delete m_oscQueue; |
2326 SVCERR << "createAudioIO: Preferred playback device = \"" | 2329 SVCERR << "createAudioIO: Preferred playback device = \"" |
2327 << preference.playbackDevice << "\"" << endl; | 2330 << preference.playbackDevice << "\"" << endl; |
2328 SVCERR << "createAudioIO: Preferred record device = \"" | 2331 SVCERR << "createAudioIO: Preferred record device = \"" |
2329 << preference.recordDevice << "\"" << endl; | 2332 << preference.recordDevice << "\"" << endl; |
2330 | 2333 |
2334 if (!m_resamplerWrapper) { | |
2335 m_resamplerWrapper = new breakfastquay::ResamplerWrapper(m_playSource); | |
2336 m_playSource->setResamplerWrapper(m_resamplerWrapper); | |
2337 } | |
2338 | |
2331 if (m_soundOptions & WithAudioInput) { | 2339 if (m_soundOptions & WithAudioInput) { |
2332 m_audioIO = breakfastquay::AudioFactory:: | 2340 m_audioIO = breakfastquay::AudioFactory:: |
2333 createCallbackIO(m_recordTarget, m_playSource, preference); | 2341 createCallbackIO(m_recordTarget, m_resamplerWrapper, preference); |
2334 if (m_audioIO) { | 2342 if (m_audioIO) { |
2335 m_audioIO->suspend(); // start in suspended state | 2343 m_audioIO->suspend(); // start in suspended state |
2336 m_playSource->setSystemPlaybackTarget(m_audioIO); | 2344 m_playSource->setSystemPlaybackTarget(m_audioIO); |
2337 } | 2345 } |
2338 } else { | 2346 } else { |
2339 m_playTarget = breakfastquay::AudioFactory:: | 2347 m_playTarget = breakfastquay::AudioFactory:: |
2340 createCallbackPlayTarget(m_playSource, preference); | 2348 createCallbackPlayTarget(m_resamplerWrapper, preference); |
2341 if (m_playTarget) { | 2349 if (m_playTarget) { |
2342 m_playTarget->suspend(); // start in suspended state | 2350 m_playTarget->suspend(); // start in suspended state |
2343 m_playSource->setSystemPlaybackTarget(m_playTarget); | 2351 m_playSource->setSystemPlaybackTarget(m_playTarget); |
2344 } | 2352 } |
2345 } | 2353 } |