History

Merge pull request #1336 from birarda/master

some NodeList cleanup

ZappoMan committed 12 years ago

Commit ba83fa42 parents 349b7b4 992a4189 files · +928 −967Browse files

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

Unified · Split

interface/src/Application.cpp+10−9
@@ -150,7 +150,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 149 unmodified lines
150150 listenPort = atoi(portStr);
151151 }
152152
153− NodeList::createInstance(NODE_TYPE_AGENT, listenPort);
153+ NodeList* nodeList = NodeList::createInstance(NODE_TYPE_AGENT, listenPort);
154154
155155 // put the audio processing on a separate thread
156156 QThread* audioThread = new QThread(this);
@@ -160,10 +160,10 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 3 unmodified lines
160160
161161 audioThread->start();
162162
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);
167167
168168 // network receive thread and voxel parsing thread are both controlled by the --nonblocking command line
169169 _enableProcessVoxelsThread = _enableNetworkThread = !cmdOptionExists(argc, constArgv, "--nonblocking");
@@ -196,7 +196,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 26 unmodified lines
196196 _voxelsFilename = getCmdOption(argc, constArgv, "-i");
197197
198198 // the callback for our instance of NodeList is attachNewHeadToNode
199− NodeList::getInstance()->linkedDataCreateCallback = &attachNewHeadToNode;
199+ nodeList->linkedDataCreateCallback = &attachNewHeadToNode;
200200
201201 #ifdef _WIN32
202202 WSADATA WsaData;
@@ -205,10 +205,11 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 2 unmodified lines
205205
206206 // tell the NodeList instance who to tell the domain server we care about
207207 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));
209209
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);
212213
213214 _networkAccessManager = new QNetworkAccessManager(this);
214215 QNetworkDiskCache* cache = new QNetworkDiskCache(_networkAccessManager);

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