Showing the changes to assignment-client/src/scripts/EntityScriptServer.cpp (1 of 9 files). Show all
Unified · Split
| @@ -399,10 +399,10 @@ void EntityScriptServer::nodeKilled(SharedNodePointer killedNode) { · 398 unmodified lines | |||
| 399 | void EntityScriptServer::negotiateAudioFormat() { | 399 | void EntityScriptServer::negotiateAudioFormat() { |
| 400 | auto nodeList = DependencyManager::get<NodeList>(); | 400 | auto nodeList = DependencyManager::get<NodeList>(); |
| 401 | auto negotiateFormatPacket = NLPacket::create(PacketType::NegotiateAudioFormat); | 401 | auto negotiateFormatPacket = NLPacket::create(PacketType::NegotiateAudioFormat); |
| 402 | auto codecPlugins = PluginManager::getInstance()->getCodecPlugins(); | 402 | const auto& codecPlugins = PluginManager::getInstance()->getCodecPlugins(); |
| 403 | quint8 numberOfCodecs = (quint8)codecPlugins.size(); | 403 | quint8 numberOfCodecs = (quint8)codecPlugins.size(); |
| 404 | negotiateFormatPacket->writePrimitive(numberOfCodecs); | 404 | negotiateFormatPacket->writePrimitive(numberOfCodecs); |
| 405 | for (auto& plugin : codecPlugins) { | 405 | for (const auto& plugin : codecPlugins) { |
| 406 | auto codecName = plugin->getName(); | 406 | auto codecName = plugin->getName(); |
| 407 | negotiateFormatPacket->writeString(codecName); | 407 | negotiateFormatPacket->writeString(codecName); |
| 408 | } | 408 | } |
| @@ -433,8 +433,8 @@ void EntityScriptServer::selectAudioFormat(const QString& selectedCodecName) { · 24 unmodified lines | |||
| 433 | _codec = nullptr; | 433 | _codec = nullptr; |
| 434 | } | 434 | } |
| 435 | 435 | ||
| 436 | auto codecPlugins = PluginManager::getInstance()->getCodecPlugins(); | 436 | const auto& codecPlugins = PluginManager::getInstance()->getCodecPlugins(); |
| 437 | for (auto& plugin : codecPlugins) { | 437 | for (const auto& plugin : codecPlugins) { |
| 438 | if (_selectedCodecName == plugin->getName()) { | 438 | if (_selectedCodecName == plugin->getName()) { |
| 439 | _codec = plugin; | 439 | _codec = plugin; |
| 440 | _encoder = plugin->createEncoder(AudioConstants::SAMPLE_RATE, AudioConstants::MONO); | 440 | _encoder = plugin->createEncoder(AudioConstants::SAMPLE_RATE, AudioConstants::MONO); |