comparison framework/MainWindowBase.cpp @ 470:4480b031fe38 3.0-integration

Merge from branch bqaudioio
author Chris Cannam
date Tue, 04 Aug 2015 16:39:40 +0100
parents ea30a8c4cb93 56acd9368532
children 52c0aff69478
comparison
equal deleted inserted replaced
469:85e7d2418d9a 470:4480b031fe38
45 #include "widgets/MIDIFileImportDialog.h" 45 #include "widgets/MIDIFileImportDialog.h"
46 #include "widgets/CSVFormatDialog.h" 46 #include "widgets/CSVFormatDialog.h"
47 #include "widgets/ModelDataTableDialog.h" 47 #include "widgets/ModelDataTableDialog.h"
48 #include "widgets/InteractiveFileFinder.h" 48 #include "widgets/InteractiveFileFinder.h"
49 49
50 #include "audioio/AudioCallbackPlaySource.h" 50 #include "audio/AudioCallbackPlaySource.h"
51 #include "audioio/AudioCallbackPlayTarget.h" 51 #include "audio/PlaySpeedRangeMapper.h"
52 #include "audioio/AudioTargetFactory.h"
53 #include "audioio/PlaySpeedRangeMapper.h"
54 #include "data/fileio/DataFileReaderFactory.h" 52 #include "data/fileio/DataFileReaderFactory.h"
55 #include "data/fileio/PlaylistFileReader.h" 53 #include "data/fileio/PlaylistFileReader.h"
56 #include "data/fileio/WavFileWriter.h" 54 #include "data/fileio/WavFileWriter.h"
57 #include "data/fileio/MIDIFileWriter.h" 55 #include "data/fileio/MIDIFileWriter.h"
58 #include "data/fileio/BZipFileDevice.h" 56 #include "data/fileio/BZipFileDevice.h"
70 #include "base/Exceptions.h" 68 #include "base/Exceptions.h"
71 #include "base/ResourceFinder.h" 69 #include "base/ResourceFinder.h"
72 70
73 #include "data/osc/OSCQueue.h" 71 #include "data/osc/OSCQueue.h"
74 #include "data/midi/MIDIInput.h" 72 #include "data/midi/MIDIInput.h"
73
74 #include <bqaudioio/SystemPlaybackTarget.h>
75 #include <bqaudioio/AudioFactory.h>
75 76
76 #include <QApplication> 77 #include <QApplication>
77 #include <QMessageBox> 78 #include <QMessageBox>
78 #include <QGridLayout> 79 #include <QGridLayout>
79 #include <QLabel> 80 #include <QLabel>
264 } 265 }
265 266
266 MainWindowBase::~MainWindowBase() 267 MainWindowBase::~MainWindowBase()
267 { 268 {
268 SVDEBUG << "MainWindowBase::~MainWindowBase" << endl; 269 SVDEBUG << "MainWindowBase::~MainWindowBase" << endl;
269 if (m_playTarget) m_playTarget->shutdown(); 270 delete m_playTarget;
270 // delete m_playTarget;
271 delete m_playSource; 271 delete m_playSource;
272 delete m_viewManager; 272 delete m_viewManager;
273 delete m_oscQueue; 273 delete m_oscQueue;
274 delete m_oscQueueStarter; 274 delete m_oscQueueStarter;
275 delete m_midiInput; 275 delete m_midiInput;
2160 void 2160 void
2161 MainWindowBase::createPlayTarget() 2161 MainWindowBase::createPlayTarget()
2162 { 2162 {
2163 if (m_playTarget) return; 2163 if (m_playTarget) return;
2164 2164
2165 //!!! how to handle preferences
2166 /*
2165 QSettings settings; 2167 QSettings settings;
2166 settings.beginGroup("Preferences"); 2168 settings.beginGroup("Preferences");
2167 QString targetName = settings.value("audio-target", "").toString(); 2169 QString targetName = settings.value("audio-target", "").toString();
2168 settings.endGroup(); 2170 settings.endGroup();
2169
2170 AudioTargetFactory *factory = AudioTargetFactory::getInstance(); 2171 AudioTargetFactory *factory = AudioTargetFactory::getInstance();
2171 2172
2172 factory->setDefaultCallbackTarget(targetName); 2173 factory->setDefaultCallbackTarget(targetName);
2173 m_playTarget = factory->createCallbackTarget(m_playSource); 2174 */
2175
2176 m_playTarget =
2177 breakfastquay::AudioFactory::createCallbackPlayTarget(m_playSource);
2178
2179 m_playSource->setSystemPlaybackTarget(m_playTarget);
2174 2180
2175 if (!m_playTarget) { 2181 if (!m_playTarget) {
2176 emit hideSplash(); 2182 emit hideSplash();
2177 2183
2178 if (factory->isAutoCallbackTarget(targetName)) { 2184 // if (factory->isAutoCallbackTarget(targetName)) {
2179 QMessageBox::warning 2185 QMessageBox::warning
2180 (this, tr("Couldn't open audio device"), 2186 (this, tr("Couldn't open audio device"),
2181 tr("<b>No audio available</b><p>Could not open an audio device for playback.<p>Automatic audio device detection failed. Audio playback will not be available during this session.</p>"), 2187 tr("<b>No audio available</b><p>Could not open an audio device for playback.<p>Automatic audio device detection failed. Audio playback will not be available during this session.</p>"),
2182 QMessageBox::Ok); 2188 QMessageBox::Ok);
2189 /*
2183 } else { 2190 } else {
2184 QMessageBox::warning 2191 QMessageBox::warning
2185 (this, tr("Couldn't open audio device"), 2192 (this, tr("Couldn't open audio device"),
2186 tr("<b>No audio available</b><p>Failed to open your preferred audio device (\"%1\").<p>Audio playback will not be available during this session.</p>") 2193 tr("<b>No audio available</b><p>Failed to open your preferred audio device (\"%1\").<p>Audio playback will not be available during this session.</p>")
2187 .arg(factory->getCallbackTargetDescription(targetName)), 2194 .arg(factory->getCallbackTargetDescription(targetName)),
2188 QMessageBox::Ok); 2195 QMessageBox::Ok);
2189 } 2196 }
2197 */
2190 } 2198 }
2191 } 2199 }
2192 2200
2193 WaveFileModel * 2201 WaveFileModel *
2194 MainWindowBase::getMainModel() 2202 MainWindowBase::getMainModel()