Showing the changes to interface/src/Application.cpp (1 of 7 files). Show all
Unified · Split
| @@ -150,7 +150,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 149 unmodified lines | |||
| 150 | listenPort = atoi(portStr); | 150 | listenPort = atoi(portStr); |
| 151 | } | 151 | } |
| 152 | 152 | ||
| 153 | NodeList::createInstance(NODE_TYPE_AGENT, listenPort); | 153 | NodeList* nodeList = NodeList::createInstance(NODE_TYPE_AGENT, listenPort); |
| 154 | 154 | ||
| 155 | // put the audio processing on a separate thread | 155 | // put the audio processing on a separate thread |
| 156 | QThread* audioThread = new QThread(this); | 156 | QThread* audioThread = new QThread(this); |
| @@ -160,10 +160,10 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 3 unmodified lines | |||
| 160 | 160 | ||
| 161 | audioThread->start(); | 161 | audioThread->start(); |
| 162 | 162 | ||
| 163 | NodeList::getInstance()->addHook(&_voxels); | 163 | nodeList->addHook(&_voxels); |
| 164 | NodeList::getInstance()->addHook(this); | 164 | nodeList->addHook(this); |
| 165 | NodeList::getInstance()->addDomainListener(this); | 165 | nodeList->addDomainListener(this); |
| 166 | NodeList::getInstance()->addDomainListener(&_voxels); | 166 | nodeList->addDomainListener(&_voxels); |
| 167 | 167 | ||
| 168 | // network receive thread and voxel parsing thread are both controlled by the --nonblocking command line | 168 | // network receive thread and voxel parsing thread are both controlled by the --nonblocking command line |
| 169 | _enableProcessVoxelsThread = _enableNetworkThread = !cmdOptionExists(argc, constArgv, "--nonblocking"); | 169 | _enableProcessVoxelsThread = _enableNetworkThread = !cmdOptionExists(argc, constArgv, "--nonblocking"); |
| @@ -196,7 +196,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 26 unmodified lines | |||
| 196 | _voxelsFilename = getCmdOption(argc, constArgv, "-i"); | 196 | _voxelsFilename = getCmdOption(argc, constArgv, "-i"); |
| 197 | 197 | ||
| 198 | // the callback for our instance of NodeList is attachNewHeadToNode | 198 | // the callback for our instance of NodeList is attachNewHeadToNode |
| 199 | NodeList::getInstance()->linkedDataCreateCallback = &attachNewHeadToNode; | 199 | nodeList->linkedDataCreateCallback = &attachNewHeadToNode; |
| 200 | 200 | ||
| 201 | #ifdef _WIN32 | 201 | #ifdef _WIN32 |
| 202 | WSADATA WsaData; | 202 | WSADATA WsaData; |
| @@ -205,10 +205,11 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 2 unmodified lines | |||
| 205 | 205 | ||
| 206 | // tell the NodeList instance who to tell the domain server we care about | 206 | // tell the NodeList instance who to tell the domain server we care about |
| 207 | const char nodeTypesOfInterest[] = {NODE_TYPE_AUDIO_MIXER, NODE_TYPE_AVATAR_MIXER, NODE_TYPE_VOXEL_SERVER}; | 207 | const char nodeTypesOfInterest[] = {NODE_TYPE_AUDIO_MIXER, NODE_TYPE_AVATAR_MIXER, NODE_TYPE_VOXEL_SERVER}; |
| 208 | NodeList::getInstance()->setNodeTypesOfInterest(nodeTypesOfInterest, sizeof(nodeTypesOfInterest)); | 208 | nodeList->setNodeTypesOfInterest(nodeTypesOfInterest, sizeof(nodeTypesOfInterest)); |
| 209 | 209 | ||
| 210 | // start the nodeList threads | 210 | QTimer* silentNodeTimer = new QTimer(this); |
| 211 | NodeList::getInstance()->startSilentNodeRemovalThread(); | 211 | connect(silentNodeTimer, SIGNAL(timeout()), nodeList, SLOT(removeSilentNodes())); |
| 212 | silentNodeTimer->start(NODE_SILENCE_THRESHOLD_USECS / 1000); | ||
| 212 | 213 | ||
| 213 | _networkAccessManager = new QNetworkAccessManager(this); | 214 | _networkAccessManager = new QNetworkAccessManager(this); |
| 214 | QNetworkDiskCache* cache = new QNetworkDiskCache(_networkAccessManager); | 215 | QNetworkDiskCache* cache = new QNetworkDiskCache(_networkAccessManager); |