Showing the changes to interface/src/Application.cpp (1 of 44 files). Show all
Unified · Split
| @@ -182,7 +182,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 181 unmodified lines | ||
| 182 | 182 | _nodeThread->setPriority(QThread::TimeCriticalPriority); |
| 183 | 183 | |
| 184 | 184 | // put the NodeList and datagram processing on the node thread |
| 185 | − NodeList* nodeList = NodeList::createInstance(NODE_TYPE_AGENT, listenPort); | |
| 185 | + NodeList* nodeList = NodeList::createInstance(NodeType::Agent, listenPort); | |
| 186 | 186 | |
| 187 | 187 | nodeList->moveToThread(_nodeThread); |
| 188 | 188 | _datagramProcessor.moveToThread(_nodeThread); |
| @@ -229,9 +229,9 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 40 unmodified lines | ||
| 229 | 229 | #endif |
| 230 | 230 | |
| 231 | 231 | // tell the NodeList instance who to tell the domain server we care about |
| 232 | − nodeList->addSetOfNodeTypesToNodeInterestSet(QSet<NODE_TYPE>() << NODE_TYPE_AUDIO_MIXER << NODE_TYPE_AVATAR_MIXER | |
| 233 | − << NODE_TYPE_VOXEL_SERVER << NODE_TYPE_PARTICLE_SERVER | |
| 234 | − << NODE_TYPE_METAVOXEL_SERVER); | |
| 232 | + nodeList->addSetOfNodeTypesToNodeInterestSet(QSet<NodeType_t>() << NodeType::AudioMixer << NodeType::AvatarMixer | |
| 233 | + << NodeType::VoxelServer << NodeType::ParticleServer | |
| 234 | + << NodeType::MetavoxelServer); | |
| 235 | 235 | |
| 236 | 236 | // connect to the packet sent signal of the _voxelEditSender and the _particleEditSender |
| 237 | 237 | connect(&_voxelEditSender, &VoxelEditPacketSender::packetSent, this, &Application::packetSent); |
| @@ -649,24 +649,24 @@ void Application::resetProfile(const QString& username) { · 411 unmodified lines | ||
| 649 | 649 | } |
| 650 | 650 | |
| 651 | 651 | void Application::controlledBroadcastToNodes(const QByteArray& packet, |
| 652 | − const QSet<NODE_TYPE>& destinationNodeTypes) { | |
| 653 | − foreach(NODE_TYPE type, destinationNodeTypes) { | |
| 652 | + const QSet<NodeType_t>& destinationNodeTypes) { | |
| 653 | + foreach(NodeType_t type, destinationNodeTypes) { | |
| 654 | 654 | // Intercept data to voxel server when voxels are disabled |
| 655 | − if (type == NODE_TYPE_VOXEL_SERVER && !Menu::getInstance()->isOptionChecked(MenuOption::Voxels)) { | |
| 655 | + if (type == NodeType::VoxelServer && !Menu::getInstance()->isOptionChecked(MenuOption::Voxels)) { | |
| 656 | 656 | continue; |
| 657 | 657 | } |
| 658 | 658 | |
| 659 | 659 | // Perform the broadcast for one type |
| 660 | − int nReceivingNodes = NodeList::getInstance()->broadcastToNodes(packet, QSet<NODE_TYPE>() << type); | |
| 660 | + int nReceivingNodes = NodeList::getInstance()->broadcastToNodes(packet, QSet<NodeType_t>() << type); | |
| 661 | 661 | |
| 662 | 662 | // Feed number of bytes to corresponding channel of the bandwidth meter, if any (done otherwise) |
| 663 | 663 | BandwidthMeter::ChannelIndex channel; |
| 664 | 664 | switch (type) { |
| 665 | − case NODE_TYPE_AGENT: | |
| 666 | − case NODE_TYPE_AVATAR_MIXER: | |
| 665 | + case NodeType::Agent: | |
| 666 | + case NodeType::AvatarMixer: | |
| 667 | 667 | channel = BandwidthMeter::AVATARS; |
| 668 | 668 | break; |
| 669 | − case NODE_TYPE_VOXEL_SERVER: | |
| 669 | + case NodeType::VoxelServer: | |
| 670 | 670 | channel = BandwidthMeter::VOXELS; |
| 671 | 671 | break; |
| 672 | 672 | default: |
| @@ -1332,10 +1332,10 @@ void Application::wheelEvent(QWheelEvent* event) { · 659 unmodified lines | ||
| 1332 | 1332 | |
| 1333 | 1333 | void Application::sendPingPackets() { |
| 1334 | 1334 | QByteArray pingPacket = NodeList::getInstance()->constructPingPacket(); |
| 1335 | − getInstance()->controlledBroadcastToNodes(pingPacket, QSet<NODE_TYPE>() << NODE_TYPE_VOXEL_SERVER | |
| 1336 | − << NODE_TYPE_PARTICLE_SERVER | |
| 1337 | − << NODE_TYPE_AUDIO_MIXER << NODE_TYPE_AVATAR_MIXER | |
| 1338 | − << NODE_TYPE_METAVOXEL_SERVER); | |
| 1335 | + getInstance()->controlledBroadcastToNodes(pingPacket, QSet<NodeType_t>() << NodeType::VoxelServer | |
| 1336 | + << NodeType::ParticleServer | |
| 1337 | + << NodeType::AudioMixer << NodeType::AvatarMixer | |
| 1338 | + << NodeType::MetavoxelServer); | |
| 1339 | 1339 | } |
| 1340 | 1340 | |
| 1341 | 1341 | // Every second, check the frame rates and other stuff |
| @@ -2363,7 +2363,7 @@ void Application::updateAvatar(float deltaTime) { · 1021 unmodified lines | ||
| 2363 | 2363 | QByteArray avatarData = byteArrayWithPopluatedHeader(PacketTypeAvatarData); |
| 2364 | 2364 | avatarData.append(_myAvatar.toByteArray()); |
| 2365 | 2365 | |
| 2366 | − controlledBroadcastToNodes(avatarData, QSet<NODE_TYPE>() << NODE_TYPE_AVATAR_MIXER); | |
| 2366 | + controlledBroadcastToNodes(avatarData, QSet<NodeType_t>() << NodeType::AvatarMixer); | |
| 2367 | 2367 | |
| 2368 | 2368 | // Update _viewFrustum with latest camera and view frustum data... |
| 2369 | 2369 | // NOTE: we get this from the view frustum, to make it simpler, since the |
| @@ -2374,11 +2374,11 @@ void Application::updateAvatar(float deltaTime) { · 4 unmodified lines | ||
| 2374 | 2374 | loadViewFrustum(_myCamera, _viewFrustum); |
| 2375 | 2375 | |
| 2376 | 2376 | // Update my voxel servers with my current voxel query... |
| 2377 | − queryOctree(NODE_TYPE_VOXEL_SERVER, PacketTypeVoxelQuery, _voxelServerJurisdictions); | |
| 2378 | − queryOctree(NODE_TYPE_PARTICLE_SERVER, PacketTypeParticleQuery, _particleServerJurisdictions); | |
| 2377 | + queryOctree(NodeType::VoxelServer, PacketTypeVoxelQuery, _voxelServerJurisdictions); | |
| 2378 | + queryOctree(NodeType::ParticleServer, PacketTypeParticleQuery, _particleServerJurisdictions); | |
| 2379 | 2379 | } |
| 2380 | 2380 | |
| 2381 | −void Application::queryOctree(NODE_TYPE serverType, PacketType packetType, NodeToJurisdictionMap& jurisdictions) { | |
| 2381 | +void Application::queryOctree(NodeType_t serverType, PacketType packetType, NodeToJurisdictionMap& jurisdictions) { | |
| 2382 | 2382 | |
| 2383 | 2383 | // if voxels are disabled, then don't send this at all... |
| 2384 | 2384 | if (!Menu::getInstance()->isOptionChecked(MenuOption::Voxels)) { |
| @@ -3192,8 +3192,8 @@ void Application::displayStats() { · 807 unmodified lines | ||
| 3192 | 3192 | int pingAudio = 0, pingAvatar = 0, pingVoxel = 0, pingVoxelMax = 0; |
| 3193 | 3193 | |
| 3194 | 3194 | NodeList* nodeList = NodeList::getInstance(); |
| 3195 | − SharedNodePointer audioMixerNode = nodeList->soloNodeOfType(NODE_TYPE_AUDIO_MIXER); | |
| 3196 | − SharedNodePointer avatarMixerNode = nodeList->soloNodeOfType(NODE_TYPE_AVATAR_MIXER); | |
| 3195 | + SharedNodePointer audioMixerNode = nodeList->soloNodeOfType(NodeType::AudioMixer); | |
| 3196 | + SharedNodePointer avatarMixerNode = nodeList->soloNodeOfType(NodeType::AvatarMixer); | |
| 3197 | 3197 | |
| 3198 | 3198 | pingAudio = audioMixerNode ? audioMixerNode->getPingMs() : 0; |
| 3199 | 3199 | pingAvatar = avatarMixerNode ? avatarMixerNode->getPingMs() : 0; |
| @@ -3203,7 +3203,7 @@ void Application::displayStats() { · 3 unmodified lines | ||
| 3203 | 3203 | int voxelServerCount = 0; |
| 3204 | 3204 | |
| 3205 | 3205 | foreach (const SharedNodePointer& node, nodeList->getNodeHash()) { |
| 3206 | − if (node->getType() == NODE_TYPE_VOXEL_SERVER) { | |
| 3206 | + if (node->getType() == NodeType::VoxelServer) { | |
| 3207 | 3207 | totalPingVoxel += node->getPingMs(); |
| 3208 | 3208 | voxelServerCount++; |
| 3209 | 3209 | if (pingVoxelMax < node->getPingMs()) { |
| @@ -3274,7 +3274,7 @@ void Application::displayStats() { · 64 unmodified lines | ||
| 3274 | 3274 | drawtext(horizontalOffset, verticalOffset, 0.10f, 0, 1.0, 2, avatarBodyYaw, .93f, .93f, .93f); |
| 3275 | 3275 | |
| 3276 | 3276 | if (_statsExpanded) { |
| 3277 | − SharedNodePointer avatarMixer = NodeList::getInstance()->soloNodeOfType(NODE_TYPE_AVATAR_MIXER); | |
| 3277 | + SharedNodePointer avatarMixer = NodeList::getInstance()->soloNodeOfType(NodeType::AvatarMixer); | |
| 3278 | 3278 | if (avatarMixer) { |
| 3279 | 3279 | sprintf(avatarMixerStats, "Avatar Mixer: %.f kbps, %.f pps", |
| 3280 | 3280 | roundf(avatarMixer->getAverageKilobitsPerSecond()), |
| @@ -3952,7 +3952,7 @@ void Application::domainChanged(const QString& domainHostname) { · 671 unmodified lines | ||
| 3952 | 3952 | } |
| 3953 | 3953 | |
| 3954 | 3954 | void Application::nodeKilled(SharedNodePointer node) { |
| 3955 | − if (node->getType() == NODE_TYPE_VOXEL_SERVER) { | |
| 3955 | + if (node->getType() == NodeType::VoxelServer) { | |
| 3956 | 3956 | QUuid nodeUUID = node->getUUID(); |
| 3957 | 3957 | // see if this is the first we've heard of this node... |
| 3958 | 3958 | if (_voxelServerJurisdictions.find(nodeUUID) != _voxelServerJurisdictions.end()) { |
| @@ -3983,7 +3983,7 @@ void Application::nodeKilled(SharedNodePointer node) { · 24 unmodified lines | ||
| 3983 | 3983 | } |
| 3984 | 3984 | _voxelSceneStatsLock.unlock(); |
| 3985 | 3985 | |
| 3986 | − } else if (node->getType() == NODE_TYPE_PARTICLE_SERVER) { | |
| 3986 | + } else if (node->getType() == NodeType::ParticleServer) { | |
| 3987 | 3987 | QUuid nodeUUID = node->getUUID(); |
| 3988 | 3988 | // see if this is the first we've heard of this node... |
| 3989 | 3989 | if (_particleServerJurisdictions.find(nodeUUID) != _particleServerJurisdictions.end()) { |
| @@ -4014,7 +4014,7 @@ void Application::nodeKilled(SharedNodePointer node) { · 24 unmodified lines | ||
| 4014 | 4014 | } |
| 4015 | 4015 | _voxelSceneStatsLock.unlock(); |
| 4016 | 4016 | |
| 4017 | − } else if (node->getType() == NODE_TYPE_AVATAR_MIXER) { | |
| 4017 | + } else if (node->getType() == NodeType::AvatarMixer) { | |
| 4018 | 4018 | // our avatar mixer has gone away - clear the hash of avatars |
| 4019 | 4019 | _avatarManager.clearHash(); |
| 4020 | 4020 | } |
| @@ -4066,7 +4066,7 @@ int Application::parseOctreeStats(const QByteArray& packet, const HifiSockAddr& · 45 unmodified lines | ||
| 4066 | 4066 | |
| 4067 | 4067 | // see if this is the first we've heard of this node... |
| 4068 | 4068 | NodeToJurisdictionMap* jurisdiction = NULL; |
| 4069 | − if (server->getType() == NODE_TYPE_VOXEL_SERVER) { | |
| 4069 | + if (server->getType() == NodeType::VoxelServer) { | |
| 4070 | 4070 | jurisdiction = &_voxelServerJurisdictions; |
| 4071 | 4071 | } else { |
| 4072 | 4072 | jurisdiction = &_particleServerJurisdictions; |