Mercurial > hg > svapp
comparison framework/MainWindowBase.cpp @ 304:c837368b1faf
Remove OSC option from constructor -- call startOSCQueue() after construction if you want it.
This needs to be handled this way in SV because we need to ask for network permission before opening the OSC port (that's the thing that gets the app blocked by e.g. Windows Firewall).
author | Chris Cannam |
---|---|
date | Thu, 12 Dec 2013 15:20:14 +0000 |
parents | 933b5aed341a |
children | 28c17ce7a6e9 |
comparison
equal
deleted
inserted
replaced
300:47964f188bd9 | 304:c837368b1faf |
---|---|
129 } | 129 } |
130 #undef Window | 130 #undef Window |
131 #endif | 131 #endif |
132 | 132 |
133 MainWindowBase::MainWindowBase(bool withAudioOutput, | 133 MainWindowBase::MainWindowBase(bool withAudioOutput, |
134 bool withOSCSupport, | |
135 bool withMIDIInput) : | 134 bool withMIDIInput) : |
136 m_document(0), | 135 m_document(0), |
137 m_paneStack(0), | 136 m_paneStack(0), |
138 m_viewManager(0), | 137 m_viewManager(0), |
139 m_timeRulerLayer(0), | 138 m_timeRulerLayer(0), |
250 m_labeller->setCounterCycleSize(cycle); | 249 m_labeller->setCounterCycleSize(cycle); |
251 | 250 |
252 if (withMIDIInput) { | 251 if (withMIDIInput) { |
253 m_midiInput = new MIDIInput(QApplication::applicationName(), this); | 252 m_midiInput = new MIDIInput(QApplication::applicationName(), this); |
254 } | 253 } |
255 | |
256 if (withOSCSupport) { | |
257 m_oscQueueStarter = new OSCQueueStarter(this); | |
258 connect(m_oscQueueStarter, SIGNAL(finished()), this, SLOT(oscReady())); | |
259 m_oscQueueStarter->start(); | |
260 } | |
261 } | 254 } |
262 | 255 |
263 MainWindowBase::~MainWindowBase() | 256 MainWindowBase::~MainWindowBase() |
264 { | 257 { |
265 SVDEBUG << "MainWindowBase::~MainWindowBase" << endl; | 258 SVDEBUG << "MainWindowBase::~MainWindowBase" << endl; |
266 if (m_playTarget) m_playTarget->shutdown(); | 259 if (m_playTarget) m_playTarget->shutdown(); |
267 // delete m_playTarget; | 260 // delete m_playTarget; |
268 delete m_playSource; | 261 delete m_playSource; |
269 delete m_viewManager; | 262 delete m_viewManager; |
270 delete m_oscQueue; | 263 delete m_oscQueue; |
264 delete m_oscQueueStarter; | |
271 delete m_midiInput; | 265 delete m_midiInput; |
272 Profiles::getInstance()->dump(); | 266 Profiles::getInstance()->dump(); |
273 } | 267 } |
274 | 268 |
275 void | 269 void |
278 QDesktopWidget *desktop = QApplication::desktop(); | 272 QDesktopWidget *desktop = QApplication::desktop(); |
279 QRect available = desktop->availableGeometry(); | 273 QRect available = desktop->availableGeometry(); |
280 QSize actual(std::min(size.width(), available.width()), | 274 QSize actual(std::min(size.width(), available.width()), |
281 std::min(size.height(), available.height())); | 275 std::min(size.height(), available.height())); |
282 resize(actual); | 276 resize(actual); |
277 } | |
278 | |
279 void | |
280 MainWindowBase::startOSCQueue() | |
281 { | |
282 m_oscQueueStarter = new OSCQueueStarter(this); | |
283 connect(m_oscQueueStarter, SIGNAL(finished()), this, SLOT(oscReady())); | |
284 m_oscQueueStarter->start(); | |
283 } | 285 } |
284 | 286 |
285 void | 287 void |
286 MainWindowBase::oscReady() | 288 MainWindowBase::oscReady() |
287 { | 289 { |