Tablet ui
Unified · Split
| @@ -266,6 +266,9 @@ void Agent::handleSelectedAudioFormat(QSharedPointer<ReceivedMessage> message) { · 265 unmodified lines | ||
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | void Agent::selectAudioFormat(const QString& selectedCodecName) { |
| 269 | + if (_selectedCodecName == selectedCodecName) { | |
| 270 | + return; | |
| 271 | + } | |
| 269 | 272 | _selectedCodecName = selectedCodecName; |
| 270 | 273 | |
| 271 | 274 | qDebug() << "Selected Codec:" << _selectedCodecName; |
| @@ -351,9 +354,15 @@ void Agent::executeScript() { · 79 unmodified lines | ||
| 351 | 354 | Transform audioTransform; |
| 352 | 355 | audioTransform.setTranslation(scriptedAvatar->getPosition()); |
| 353 | 356 | audioTransform.setRotation(scriptedAvatar->getOrientation()); |
| 354 | − AbstractAudioInterface::emitAudioPacket(audio.data(), audio.size(), audioSequenceNumber, | |
| 357 | + QByteArray encodedBuffer; | |
| 358 | + if (_encoder) { | |
| 359 | + _encoder->encode(audio, encodedBuffer); | |
| 360 | + } else { | |
| 361 | + encodedBuffer = audio; | |
| 362 | + } | |
| 363 | + AbstractAudioInterface::emitAudioPacket(encodedBuffer.data(), encodedBuffer.size(), audioSequenceNumber, | |
| 355 | 364 | audioTransform, scriptedAvatar->getPosition(), glm::vec3(0), |
| 356 | − PacketType::MicrophoneAudioNoEcho); | |
| 365 | + PacketType::MicrophoneAudioNoEcho, _selectedCodecName); | |
| 357 | 366 | }); |
| 358 | 367 | |
| 359 | 368 | auto avatarHashMap = DependencyManager::set<AvatarHashMap>(); |
| @@ -314,7 +314,9 @@ void EntityServer::readAdditionalConfiguration(const QJsonObject& settingsSectio · 313 unmodified lines | ||
| 314 | 314 | // FIXME: handle atp rquests setup here. See Agent::requestScript() |
| 315 | 315 | qInfo() << "Requesting script at URL" << qPrintable(scriptRequest->getUrl().toString()); |
| 316 | 316 | scriptRequest->send(); |
| 317 | + qDebug() << "script request sent"; | |
| 317 | 318 | _scriptRequestLoop.exec(); // Block here, but allow the request to be processed and its signals to be handled. |
| 319 | + qDebug() << "script request event loop complete"; | |
| 318 | 320 | } |
| 319 | 321 | } |
| 320 | 322 | |
| @@ -351,6 +353,7 @@ static bool hadUncaughtExceptions(QScriptEngine& engine, const QString& fileName · 30 unmodified lines | ||
| 351 | 353 | return false; |
| 352 | 354 | } |
| 353 | 355 | void EntityServer::scriptRequestFinished() { |
| 356 | + qDebug() << "script request completed"; | |
| 354 | 357 | auto scriptRequest = qobject_cast<ResourceRequest*>(sender()); |
| 355 | 358 | const QString urlString = scriptRequest->getUrl().toString(); |
| 356 | 359 | if (scriptRequest && scriptRequest->getResult() == ResourceRequest::Success) { |
| @@ -364,9 +367,11 @@ void EntityServer::scriptRequestFinished() { · 7 unmodified lines | ||
| 364 | 367 | return hadUncaughtExceptions(_entityEditFilterEngine, _entityEditFilter); |
| 365 | 368 | }); |
| 366 | 369 | scriptRequest->deleteLater(); |
| 370 | + qDebug() << "script request ending event loop. running:" << _scriptRequestLoop.isRunning(); | |
| 367 | 371 | if (_scriptRequestLoop.isRunning()) { |
| 368 | 372 | _scriptRequestLoop.quit(); |
| 369 | 373 | } |
| 374 | + qDebug() << "script request event loop quit"; | |
| 370 | 375 | return; |
| 371 | 376 | } |
| 372 | 377 | } |
| @@ -379,10 +384,13 @@ void EntityServer::scriptRequestFinished() { · 6 unmodified lines | ||
| 379 | 384 | } |
| 380 | 385 | // Hard stop of the assignment client on failure. We don't want anyone to think they have a filter in place when they don't. |
| 381 | 386 | // Alas, only indications will be the above logging with assignment client restarting repeatedly, and clients will not see any entities. |
| 387 | + qDebug() << "script request failure causing stop"; | |
| 382 | 388 | stop(); |
| 389 | + qDebug() << "script request ending event loop. running:" << _scriptRequestLoop.isRunning(); | |
| 383 | 390 | if (_scriptRequestLoop.isRunning()) { |
| 384 | 391 | _scriptRequestLoop.quit(); |
| 385 | 392 | } |
| 393 | + qDebug() << "script request event loop quit"; | |
| 386 | 394 | } |
| 387 | 395 | |
| 388 | 396 | void EntityServer::nodeAdded(SharedNodePointer node) { |
| @@ -158,8 +158,9 @@ Rectangle { · 157 unmodified lines | ||
| 158 | 158 | onSortIndicatorOrderChanged: sortModel() |
| 159 | 159 | |
| 160 | 160 | TableViewColumn { |
| 161 | + id: displayNameHeader | |
| 161 | 162 | role: "displayName" |
| 162 | − title: "NAMES" | |
| 163 | + title: table.rowCount + (table.rowCount === 1 ? " NAME" : " NAMES") | |
| 163 | 164 | width: nameCardWidth |
| 164 | 165 | movable: false |
| 165 | 166 | resizable: false |
| @@ -351,6 +352,11 @@ Rectangle { · 185 unmodified lines | ||
| 351 | 352 | visible: iAmAdmin |
| 352 | 353 | color: hifi.colors.lightGrayText |
| 353 | 354 | } |
| 355 | + TextMetrics { | |
| 356 | + id: displayNameHeaderMetrics | |
| 357 | + text: displayNameHeader.title | |
| 358 | + font: displayNameHeader.font | |
| 359 | + } | |
| 354 | 360 | // This Rectangle refers to the [?] popup button next to "NAMES" |
| 355 | 361 | Rectangle { |
| 356 | 362 | color: hifi.colors.tableBackgroundLight |
| @@ -359,7 +365,7 @@ Rectangle { · 2 unmodified lines | ||
| 359 | 365 | anchors.left: table.left |
| 360 | 366 | anchors.top: table.top |
| 361 | 367 | anchors.topMargin: 1 |
| 362 | − anchors.leftMargin: nameCardWidth/2 + 24 | |
| 368 | + anchors.leftMargin: nameCardWidth/2 + displayNameHeaderMetrics.width/2 + 6 | |
| 363 | 369 | RalewayRegular { |
| 364 | 370 | id: helpText |
| 365 | 371 | text: "[?]" |
| @@ -1742,7 +1742,7 @@ static const QString JSON_AVATAR_HEAD_MODEL = QStringLiteral("headModel"); · 1741 unmodified lines | ||
| 1742 | 1742 | static const QString JSON_AVATAR_BODY_MODEL = QStringLiteral("bodyModel"); |
| 1743 | 1743 | static const QString JSON_AVATAR_DISPLAY_NAME = QStringLiteral("displayName"); |
| 1744 | 1744 | // It isn't meaningful to persist sessionDisplayName. |
| 1745 | −static const QString JSON_AVATAR_ATTACHEMENTS = QStringLiteral("attachments"); | |
| 1745 | +static const QString JSON_AVATAR_ATTACHMENTS = QStringLiteral("attachments"); | |
| 1746 | 1746 | static const QString JSON_AVATAR_ENTITIES = QStringLiteral("attachedEntities"); |
| 1747 | 1747 | static const QString JSON_AVATAR_SCALE = QStringLiteral("scale"); |
| 1748 | 1748 | static const QString JSON_AVATAR_VERSION = QStringLiteral("version"); |
| @@ -1785,7 +1785,7 @@ QJsonObject AvatarData::toJson() const { · 36 unmodified lines | ||
| 1785 | 1785 | for (auto attachment : getAttachmentData()) { |
| 1786 | 1786 | attachmentsJson.push_back(attachment.toJson()); |
| 1787 | 1787 | } |
| 1788 | − root[JSON_AVATAR_ATTACHEMENTS] = attachmentsJson; | |
| 1788 | + root[JSON_AVATAR_ATTACHMENTS] = attachmentsJson; | |
| 1789 | 1789 | } |
| 1790 | 1790 | |
| 1791 | 1791 | _avatarEntitiesLock.withReadLock([&] { |
| @@ -1898,8 +1898,8 @@ void AvatarData::fromJson(const QJsonObject& json) { · 106 unmodified lines | ||
| 1898 | 1898 | setTargetScale((float)json[JSON_AVATAR_SCALE].toDouble()); |
| 1899 | 1899 | } |
| 1900 | 1900 | |
| 1901 | − if (json.contains(JSON_AVATAR_ATTACHEMENTS) && json[JSON_AVATAR_ATTACHEMENTS].isArray()) { | |
| 1902 | − QJsonArray attachmentsJson = json[JSON_AVATAR_ATTACHEMENTS].toArray(); | |
| 1901 | + if (json.contains(JSON_AVATAR_ATTACHMENTS) && json[JSON_AVATAR_ATTACHMENTS].isArray()) { | |
| 1902 | + QJsonArray attachmentsJson = json[JSON_AVATAR_ATTACHMENTS].toArray(); | |
| 1903 | 1903 | QVector<AttachmentData> attachments; |
| 1904 | 1904 | for (auto attachmentJson : attachmentsJson) { |
| 1905 | 1905 | AttachmentData attachment; |
| @@ -1910,7 +1910,7 @@ void AvatarData::fromJson(const QJsonObject& json) { · 4 unmodified lines | ||
| 1910 | 1910 | } |
| 1911 | 1911 | |
| 1912 | 1912 | // if (json.contains(JSON_AVATAR_ENTITIES) && json[JSON_AVATAR_ENTITIES].isArray()) { |
| 1913 | − // QJsonArray attachmentsJson = json[JSON_AVATAR_ATTACHEMENTS].toArray(); | |
| 1913 | + // QJsonArray attachmentsJson = json[JSON_AVATAR_ATTACHMENTS].toArray(); | |
| 1914 | 1914 | // for (auto attachmentJson : attachmentsJson) { |
| 1915 | 1915 | // // TODO -- something |
| 1916 | 1916 | // } |