History

updates for new DependencyManager API

Stephen Birarda committed 11 years ago

Commit 9f21b411 parent 7beb3a713 files · +60 −57Browse files

Showing the changes to interface/src/Application.cpp (1 of 13 files). Show all

Unified · Split

interface/src/Application.cpp+11−11
@@ -251,9 +251,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 250 unmodified lines
251 // put the audio processing on a separate thread251 // put the audio processing on a separate thread
252 QThread* audioThread = new QThread(this);252 QThread* audioThread = new QThread(this);
253 253
254 Audio::Pointer audioIO = DependencyManager::get<Audio>();254 Audio::SharedPointer audioIO = DependencyManager::get<Audio>();
255 audioIO->moveToThread(audioThread);255 audioIO->moveToThread(audioThread);
256 connect(audioThread, &QThread::started, audioIO, &Audio::start);256 connect(audioThread, &QThread::started, audioIO.data(), &Audio::start);
257 257
258 audioThread->start();258 audioThread->start();
259 259
@@ -306,17 +306,17 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 46 unmodified lines
306 // once the event loop has started, check and signal for an access token306 // once the event loop has started, check and signal for an access token
307 QMetaObject::invokeMethod(&accountManager, "checkAndSignalForAccessToken", Qt::QueuedConnection);307 QMetaObject::invokeMethod(&accountManager, "checkAndSignalForAccessToken", Qt::QueuedConnection);
308 308
309 AddressManager* addressManager = DependencyManager::get<AddressManager>();309 AddressManager::SharedPointer addressManager = DependencyManager::get<AddressManager>();
310 310
311 // use our MyAvatar position and quat for address manager path311 // use our MyAvatar position and quat for address manager path
312 addressManager->setPositionGetter(getPositionForPath);312 addressManager->setPositionGetter(getPositionForPath);
313 addressManager->setOrientationGetter(getOrientationForPath);313 addressManager->setOrientationGetter(getOrientationForPath);
314 314
315 // handle domain change signals from AddressManager315 // handle domain change signals from AddressManager
316 connect(addressManager, &AddressManager::possibleDomainChangeRequiredToHostname,316 connect(addressManager.data(), &AddressManager::possibleDomainChangeRequiredToHostname,
317 this, &Application::changeDomainHostname);317 this, &Application::changeDomainHostname);
318 318
319 connect(addressManager, &AddressManager::possibleDomainChangeRequiredViaICEForID,319 connect(addressManager.data(), &AddressManager::possibleDomainChangeRequiredViaICEForID,
320 &domainHandler, &DomainHandler::setIceServerHostnameAndID);320 &domainHandler, &DomainHandler::setIceServerHostnameAndID);
321 321
322 _settings = new QSettings(this);322 _settings = new QSettings(this);
@@ -425,7 +425,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 102 unmodified lines
425 _trayIcon->show();425 _trayIcon->show();
426 426
427 // set the local loopback interface for local sounds from audio scripts427 // set the local loopback interface for local sounds from audio scripts
428 AudioScriptingInterface::getInstance().setLocalAudioInterface(audioIO);428 AudioScriptingInterface::getInstance().setLocalAudioInterface(audioIO.data());
429 429
430#ifdef HAVE_RTMIDI430#ifdef HAVE_RTMIDI
431 // setup the MIDIManager431 // setup the MIDIManager
@@ -468,10 +468,10 @@ Application::~Application() { · 36 unmodified lines
468 // kill any audio injectors that are still around468 // kill any audio injectors that are still around
469 AudioScriptingInterface::getInstance().stopAllInjectors();469 AudioScriptingInterface::getInstance().stopAllInjectors();
470 470
471 Audio* audioIO = DependencyManager::get<Audio>();471 Audio::SharedPointer audioIO = DependencyManager::get<Audio>();
472 472
473 // stop the audio process473 // stop the audio process
474 QMetaObject::invokeMethod(audioIO, "stop");474 QMetaObject::invokeMethod(audioIO.data(), "stop");
475 475
476 // ask the audio thread to quit and wait until it is done476 // ask the audio thread to quit and wait until it is done
477 audioIO->thread()->quit();477 audioIO->thread()->quit();
@@ -2424,7 +2424,7 @@ void Application::update(float deltaTime) { · 1946 unmodified lines
2424 if (sinceLastNack > TOO_LONG_SINCE_LAST_SEND_DOWNSTREAM_AUDIO_STATS) {2424 if (sinceLastNack > TOO_LONG_SINCE_LAST_SEND_DOWNSTREAM_AUDIO_STATS) {
2425 _lastSendDownstreamAudioStats = now;2425 _lastSendDownstreamAudioStats = now;
2426 2426
2427 QMetaObject::invokeMethod(DependencyManager::get<Audio>(), "sendDownstreamAudioStatsPacket", Qt::QueuedConnection);2427 QMetaObject::invokeMethod(DependencyManager::get<Audio>().data(), "sendDownstreamAudioStatsPacket", Qt::QueuedConnection);
2428 }2428 }
2429 }2429 }
2430}2430}
@@ -3602,7 +3602,7 @@ void Application::resetSensors() { · 1171 unmodified lines
3602 3602
3603 _myAvatar->reset();3603 _myAvatar->reset();
3604 3604
3605 QMetaObject::invokeMethod(DependencyManager::get<Audio>(), "reset", Qt::QueuedConnection);3605 QMetaObject::invokeMethod(DependencyManager::get<Audio>().data(), "reset", Qt::QueuedConnection);
3606}3606}
3607 3607
3608static void setShortcutsEnabled(QWidget* widget, bool enabled) {3608static void setShortcutsEnabled(QWidget* widget, bool enabled) {
@@ -3765,7 +3765,7 @@ void Application::nodeKilled(SharedNodePointer node) { · 156 unmodified lines
3765 _entityEditSender.nodeKilled(node);3765 _entityEditSender.nodeKilled(node);
3766 3766
3767 if (node->getType() == NodeType::AudioMixer) {3767 if (node->getType() == NodeType::AudioMixer) {
3768 QMetaObject::invokeMethod(DependencyManager::get<Audio>(), "audioMixerKilled");3768 QMetaObject::invokeMethod(DependencyManager::get<Audio>().data(), "audioMixerKilled");
3769 }3769 }
3770 3770
3771 if (node->getType() == NodeType::VoxelServer) {3771 if (node->getType() == NodeType::VoxelServer) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t