History

Merge pull request #9546 from sethalves/tablet-ui

Tablet ui

Seth Alves committed 9 years ago

Commit 116eef02 parents 149fdcd ac475304 files · +32 −9Browse files

Unified · Split

4 files
  1. assignment-client/src/Agent.cpp +11 −2
  2. assignment-client/src/entities/EntityServer.cpp +8 −0
  3. interface/resources/qml/hifi/Pal.qml +8 −2
  4. libraries/avatars/src/AvatarData.cpp +5 −5
assignment-client/src/Agent.cpp+11−2
@@ -266,6 +266,9 @@ void Agent::handleSelectedAudioFormat(QSharedPointer<ReceivedMessage> message) { · 265 unmodified lines
266266 }
267267
268268 void Agent::selectAudioFormat(const QString& selectedCodecName) {
269+ if (_selectedCodecName == selectedCodecName) {
270+ return;
271+ }
269272 _selectedCodecName = selectedCodecName;
270273
271274 qDebug() << "Selected Codec:" << _selectedCodecName;
@@ -351,9 +354,15 @@ void Agent::executeScript() { · 79 unmodified lines
351354 Transform audioTransform;
352355 audioTransform.setTranslation(scriptedAvatar->getPosition());
353356 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,
355364 audioTransform, scriptedAvatar->getPosition(), glm::vec3(0),
356− PacketType::MicrophoneAudioNoEcho);
365+ PacketType::MicrophoneAudioNoEcho, _selectedCodecName);
357366 });
358367
359368 auto avatarHashMap = DependencyManager::set<AvatarHashMap>();
assignment-client/src/entities/EntityServer.cpp+8−0
@@ -314,7 +314,9 @@ void EntityServer::readAdditionalConfiguration(const QJsonObject& settingsSectio · 313 unmodified lines
314314 // FIXME: handle atp rquests setup here. See Agent::requestScript()
315315 qInfo() << "Requesting script at URL" << qPrintable(scriptRequest->getUrl().toString());
316316 scriptRequest->send();
317+ qDebug() << "script request sent";
317318 _scriptRequestLoop.exec(); // Block here, but allow the request to be processed and its signals to be handled.
319+ qDebug() << "script request event loop complete";
318320 }
319321 }
320322
@@ -351,6 +353,7 @@ static bool hadUncaughtExceptions(QScriptEngine& engine, const QString& fileName · 30 unmodified lines
351353 return false;
352354 }
353355 void EntityServer::scriptRequestFinished() {
356+ qDebug() << "script request completed";
354357 auto scriptRequest = qobject_cast<ResourceRequest*>(sender());
355358 const QString urlString = scriptRequest->getUrl().toString();
356359 if (scriptRequest && scriptRequest->getResult() == ResourceRequest::Success) {
@@ -364,9 +367,11 @@ void EntityServer::scriptRequestFinished() { · 7 unmodified lines
364367 return hadUncaughtExceptions(_entityEditFilterEngine, _entityEditFilter);
365368 });
366369 scriptRequest->deleteLater();
370+ qDebug() << "script request ending event loop. running:" << _scriptRequestLoop.isRunning();
367371 if (_scriptRequestLoop.isRunning()) {
368372 _scriptRequestLoop.quit();
369373 }
374+ qDebug() << "script request event loop quit";
370375 return;
371376 }
372377 }
@@ -379,10 +384,13 @@ void EntityServer::scriptRequestFinished() { · 6 unmodified lines
379384 }
380385 // 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.
381386 // 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";
382388 stop();
389+ qDebug() << "script request ending event loop. running:" << _scriptRequestLoop.isRunning();
383390 if (_scriptRequestLoop.isRunning()) {
384391 _scriptRequestLoop.quit();
385392 }
393+ qDebug() << "script request event loop quit";
386394 }
387395
388396 void EntityServer::nodeAdded(SharedNodePointer node) {
interface/resources/qml/hifi/Pal.qml+8−2
@@ -158,8 +158,9 @@ Rectangle { · 157 unmodified lines
158158 onSortIndicatorOrderChanged: sortModel()
159159
160160 TableViewColumn {
161+ id: displayNameHeader
161162 role: "displayName"
162− title: "NAMES"
163+ title: table.rowCount + (table.rowCount === 1 ? " NAME" : " NAMES")
163164 width: nameCardWidth
164165 movable: false
165166 resizable: false
@@ -351,6 +352,11 @@ Rectangle { · 185 unmodified lines
351352 visible: iAmAdmin
352353 color: hifi.colors.lightGrayText
353354 }
355+ TextMetrics {
356+ id: displayNameHeaderMetrics
357+ text: displayNameHeader.title
358+ font: displayNameHeader.font
359+ }
354360 // This Rectangle refers to the [?] popup button next to "NAMES"
355361 Rectangle {
356362 color: hifi.colors.tableBackgroundLight
@@ -359,7 +365,7 @@ Rectangle { · 2 unmodified lines
359365 anchors.left: table.left
360366 anchors.top: table.top
361367 anchors.topMargin: 1
362− anchors.leftMargin: nameCardWidth/2 + 24
368+ anchors.leftMargin: nameCardWidth/2 + displayNameHeaderMetrics.width/2 + 6
363369 RalewayRegular {
364370 id: helpText
365371 text: "[?]"
libraries/avatars/src/AvatarData.cpp+5−5
@@ -1742,7 +1742,7 @@ static const QString JSON_AVATAR_HEAD_MODEL = QStringLiteral("headModel"); · 1741 unmodified lines
17421742 static const QString JSON_AVATAR_BODY_MODEL = QStringLiteral("bodyModel");
17431743 static const QString JSON_AVATAR_DISPLAY_NAME = QStringLiteral("displayName");
17441744 // 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");
17461746 static const QString JSON_AVATAR_ENTITIES = QStringLiteral("attachedEntities");
17471747 static const QString JSON_AVATAR_SCALE = QStringLiteral("scale");
17481748 static const QString JSON_AVATAR_VERSION = QStringLiteral("version");
@@ -1785,7 +1785,7 @@ QJsonObject AvatarData::toJson() const { · 36 unmodified lines
17851785 for (auto attachment : getAttachmentData()) {
17861786 attachmentsJson.push_back(attachment.toJson());
17871787 }
1788− root[JSON_AVATAR_ATTACHEMENTS] = attachmentsJson;
1788+ root[JSON_AVATAR_ATTACHMENTS] = attachmentsJson;
17891789 }
17901790
17911791 _avatarEntitiesLock.withReadLock([&] {
@@ -1898,8 +1898,8 @@ void AvatarData::fromJson(const QJsonObject& json) { · 106 unmodified lines
18981898 setTargetScale((float)json[JSON_AVATAR_SCALE].toDouble());
18991899 }
19001900
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();
19031903 QVector<AttachmentData> attachments;
19041904 for (auto attachmentJson : attachmentsJson) {
19051905 AttachmentData attachment;
@@ -1910,7 +1910,7 @@ void AvatarData::fromJson(const QJsonObject& json) { · 4 unmodified lines
19101910 }
19111911
19121912 // 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();
19141914 // for (auto attachmentJson : attachmentsJson) {
19151915 // // TODO -- something
19161916 // }