History

resolve conflicts and merge with upstream master

Stephen Birarda committed 11 years ago

Commit c7a5f3c2 parents 9f21b41 0ef26b1158 files · +4391 −1862Browse files

Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 158 files). Show all

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+11−6
@@ -485,17 +485,17 @@ void ScriptEngine::run() { · 484 unmodified lines
485 485
486 // write audio packet to AudioMixer nodes486 // write audio packet to AudioMixer nodes
487 NodeList* nodeList = NodeList::getInstance();487 NodeList* nodeList = NodeList::getInstance();
488 foreach(const SharedNodePointer& node, nodeList->getNodeHash()) {488 nodeList->eachNode([this, &nodeList, &audioPacket, &numPreSequenceNumberBytes](const SharedNodePointer& node){
489 // only send to nodes of type AudioMixer489 // only send to nodes of type AudioMixer
490 if (node->getType() == NodeType::AudioMixer) {490 if (node->getType() == NodeType::AudioMixer) {
491 // pack sequence number491 // pack sequence number
492 quint16 sequence = _outgoingScriptAudioSequenceNumbers[node->getUUID()]++;492 quint16 sequence = _outgoingScriptAudioSequenceNumbers[node->getUUID()]++;
493 memcpy(audioPacket.data() + numPreSequenceNumberBytes, &sequence, sizeof(quint16));493 memcpy(audioPacket.data() + numPreSequenceNumberBytes, &sequence, sizeof(quint16));
494 494
495 // send audio packet495 // send audio packet
496 nodeList->writeDatagram(audioPacket, node);496 nodeList->writeDatagram(audioPacket, node);
497 }497 }
498 }498 });
499 }499 }
500 }500 }
501 501
@@ -602,16 +602,20 @@ void ScriptEngine::stopTimer(QTimer *timer) { · 100 unmodified lines
602}602}
603 603
604QUrl ScriptEngine::resolvePath(const QString& include) const {604QUrl ScriptEngine::resolvePath(const QString& include) const {
605 // first lets check to see if it's already a full URL
606 QUrl url(include);605 QUrl url(include);
606 // first lets check to see if it's already a full URL
607 if (!url.scheme().isEmpty()) {607 if (!url.scheme().isEmpty()) {
608 return url;608 return url;
609 }609 }
610 610
611 // we apparently weren't a fully qualified url, so, let's assume we're relative611 // we apparently weren't a fully qualified url, so, let's assume we're relative
612 // to the original URL of our script612 // to the original URL of our script
613 QUrl parentURL(_fileNameString);613 QUrl parentURL;
614 614 if (_parentURL.isEmpty()) {
615 parentURL = QUrl(_fileNameString);
616 } else {
617 parentURL = QUrl(_parentURL);
618 }
615 // if the parent URL's scheme is empty, then this is probably a local file...619 // if the parent URL's scheme is empty, then this is probably a local file...
616 if (parentURL.scheme().isEmpty()) {620 if (parentURL.scheme().isEmpty()) {
617 parentURL = QUrl::fromLocalFile(_fileNameString);621 parentURL = QUrl::fromLocalFile(_fileNameString);
@@ -644,6 +648,7 @@ void ScriptEngine::include(const QString& includeFile) { · 26 unmodified lines
644#else648#else
645 QString fileName = url.toLocalFile();649 QString fileName = url.toLocalFile();
646#endif650#endif
651
647 QFile scriptFile(fileName);652 QFile scriptFile(fileName);
648 if (scriptFile.open(QFile::ReadOnly | QFile::Text)) {653 if (scriptFile.open(QFile::ReadOnly | QFile::Text)) {
649 qDebug() << "Including file:" << fileName;654 qDebug() << "Including file:" << fileName;