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 | 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 | 155 | // put the audio processing on a separate thread |
| 156 | 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 | 161 | audioThread->start(); |
| 162 | 162 | |
| 163 | − NodeList::getInstance()->addHook(&_voxels); | |
| 164 | − NodeList::getInstance()->addHook(this); | |
| 165 | − NodeList::getInstance()->addDomainListener(this); | |
| 166 | − NodeList::getInstance()->addDomainListener(&_voxels); | |
| 163 | + nodeList->addHook(&_voxels); | |
| 164 | + nodeList->addHook(this); | |
| 165 | + nodeList->addDomainListener(this); | |
| 166 | + nodeList->addDomainListener(&_voxels); | |
| 167 | 167 | |
| 168 | 168 | // network receive thread and voxel parsing thread are both controlled by the --nonblocking command line |
| 169 | 169 | _enableProcessVoxelsThread = _enableNetworkThread = !cmdOptionExists(argc, constArgv, "--nonblocking"); |
| @@ -196,7 +196,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 26 unmodified lines | ||
| 196 | 196 | _voxelsFilename = getCmdOption(argc, constArgv, "-i"); |
| 197 | 197 | |
| 198 | 198 | // the callback for our instance of NodeList is attachNewHeadToNode |
| 199 | − NodeList::getInstance()->linkedDataCreateCallback = &attachNewHeadToNode; | |
| 199 | + nodeList->linkedDataCreateCallback = &attachNewHeadToNode; | |
| 200 | 200 | |
| 201 | 201 | #ifdef _WIN32 |
| 202 | 202 | WSADATA WsaData; |
| @@ -205,10 +205,11 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 2 unmodified lines | ||
| 205 | 205 | |
| 206 | 206 | // tell the NodeList instance who to tell the domain server we care about |
| 207 | 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 | |
| 211 | − NodeList::getInstance()->startSilentNodeRemovalThread(); | |
| 210 | + QTimer* silentNodeTimer = new QTimer(this); | |
| 211 | + connect(silentNodeTimer, SIGNAL(timeout()), nodeList, SLOT(removeSilentNodes())); | |
| 212 | + silentNodeTimer->start(NODE_SILENCE_THRESHOLD_USECS / 1000); | |
| 212 | 213 | |
| 213 | 214 | _networkAccessManager = new QNetworkAccessManager(this); |
| 214 | 215 | QNetworkDiskCache* cache = new QNetworkDiskCache(_networkAccessManager); |