Merge pull request #9546 from sethalves/tablet-ui

Tablet ui
This commit is contained in:
Seth Alves 2017-01-30 08:17:05 -08:00 committed by GitHub
commit 116eef0a78
4 changed files with 32 additions and 9 deletions

View file

@ -266,6 +266,9 @@ void Agent::handleSelectedAudioFormat(QSharedPointer<ReceivedMessage> message) {
}
void Agent::selectAudioFormat(const QString& selectedCodecName) {
if (_selectedCodecName == selectedCodecName) {
return;
}
_selectedCodecName = selectedCodecName;
qDebug() << "Selected Codec:" << _selectedCodecName;
@ -351,9 +354,15 @@ void Agent::executeScript() {
Transform audioTransform;
audioTransform.setTranslation(scriptedAvatar->getPosition());
audioTransform.setRotation(scriptedAvatar->getOrientation());
AbstractAudioInterface::emitAudioPacket(audio.data(), audio.size(), audioSequenceNumber,
QByteArray encodedBuffer;
if (_encoder) {
_encoder->encode(audio, encodedBuffer);
} else {
encodedBuffer = audio;
}
AbstractAudioInterface::emitAudioPacket(encodedBuffer.data(), encodedBuffer.size(), audioSequenceNumber,
audioTransform, scriptedAvatar->getPosition(), glm::vec3(0),
PacketType::MicrophoneAudioNoEcho);
PacketType::MicrophoneAudioNoEcho, _selectedCodecName);
});
auto avatarHashMap = DependencyManager::set<AvatarHashMap>();

View file

@ -314,7 +314,9 @@ void EntityServer::readAdditionalConfiguration(const QJsonObject& settingsSectio
// FIXME: handle atp rquests setup here. See Agent::requestScript()
qInfo() << "Requesting script at URL" << qPrintable(scriptRequest->getUrl().toString());
scriptRequest->send();
qDebug() << "script request sent";
_scriptRequestLoop.exec(); // Block here, but allow the request to be processed and its signals to be handled.
qDebug() << "script request event loop complete";
}
}
@ -351,6 +353,7 @@ static bool hadUncaughtExceptions(QScriptEngine& engine, const QString& fileName
return false;
}
void EntityServer::scriptRequestFinished() {
qDebug() << "script request completed";
auto scriptRequest = qobject_cast<ResourceRequest*>(sender());
const QString urlString = scriptRequest->getUrl().toString();
if (scriptRequest && scriptRequest->getResult() == ResourceRequest::Success) {
@ -364,9 +367,11 @@ void EntityServer::scriptRequestFinished() {
return hadUncaughtExceptions(_entityEditFilterEngine, _entityEditFilter);
});
scriptRequest->deleteLater();
qDebug() << "script request ending event loop. running:" << _scriptRequestLoop.isRunning();
if (_scriptRequestLoop.isRunning()) {
_scriptRequestLoop.quit();
}
qDebug() << "script request event loop quit";
return;
}
}
@ -379,10 +384,13 @@ void EntityServer::scriptRequestFinished() {
}
// 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.
// Alas, only indications will be the above logging with assignment client restarting repeatedly, and clients will not see any entities.
qDebug() << "script request failure causing stop";
stop();
qDebug() << "script request ending event loop. running:" << _scriptRequestLoop.isRunning();
if (_scriptRequestLoop.isRunning()) {
_scriptRequestLoop.quit();
}
qDebug() << "script request event loop quit";
}
void EntityServer::nodeAdded(SharedNodePointer node) {

View file

@ -158,8 +158,9 @@ Rectangle {
onSortIndicatorOrderChanged: sortModel()
TableViewColumn {
id: displayNameHeader
role: "displayName"
title: "NAMES"
title: table.rowCount + (table.rowCount === 1 ? " NAME" : " NAMES")
width: nameCardWidth
movable: false
resizable: false
@ -351,6 +352,11 @@ Rectangle {
visible: iAmAdmin
color: hifi.colors.lightGrayText
}
TextMetrics {
id: displayNameHeaderMetrics
text: displayNameHeader.title
font: displayNameHeader.font
}
// This Rectangle refers to the [?] popup button next to "NAMES"
Rectangle {
color: hifi.colors.tableBackgroundLight
@ -359,7 +365,7 @@ Rectangle {
anchors.left: table.left
anchors.top: table.top
anchors.topMargin: 1
anchors.leftMargin: nameCardWidth/2 + 24
anchors.leftMargin: nameCardWidth/2 + displayNameHeaderMetrics.width/2 + 6
RalewayRegular {
id: helpText
text: "[?]"

View file

@ -1742,7 +1742,7 @@ static const QString JSON_AVATAR_HEAD_MODEL = QStringLiteral("headModel");
static const QString JSON_AVATAR_BODY_MODEL = QStringLiteral("bodyModel");
static const QString JSON_AVATAR_DISPLAY_NAME = QStringLiteral("displayName");
// It isn't meaningful to persist sessionDisplayName.
static const QString JSON_AVATAR_ATTACHEMENTS = QStringLiteral("attachments");
static const QString JSON_AVATAR_ATTACHMENTS = QStringLiteral("attachments");
static const QString JSON_AVATAR_ENTITIES = QStringLiteral("attachedEntities");
static const QString JSON_AVATAR_SCALE = QStringLiteral("scale");
static const QString JSON_AVATAR_VERSION = QStringLiteral("version");
@ -1785,7 +1785,7 @@ QJsonObject AvatarData::toJson() const {
for (auto attachment : getAttachmentData()) {
attachmentsJson.push_back(attachment.toJson());
}
root[JSON_AVATAR_ATTACHEMENTS] = attachmentsJson;
root[JSON_AVATAR_ATTACHMENTS] = attachmentsJson;
}
_avatarEntitiesLock.withReadLock([&] {
@ -1898,8 +1898,8 @@ void AvatarData::fromJson(const QJsonObject& json) {
setTargetScale((float)json[JSON_AVATAR_SCALE].toDouble());
}
if (json.contains(JSON_AVATAR_ATTACHEMENTS) && json[JSON_AVATAR_ATTACHEMENTS].isArray()) {
QJsonArray attachmentsJson = json[JSON_AVATAR_ATTACHEMENTS].toArray();
if (json.contains(JSON_AVATAR_ATTACHMENTS) && json[JSON_AVATAR_ATTACHMENTS].isArray()) {
QJsonArray attachmentsJson = json[JSON_AVATAR_ATTACHMENTS].toArray();
QVector<AttachmentData> attachments;
for (auto attachmentJson : attachmentsJson) {
AttachmentData attachment;
@ -1910,7 +1910,7 @@ void AvatarData::fromJson(const QJsonObject& json) {
}
// if (json.contains(JSON_AVATAR_ENTITIES) && json[JSON_AVATAR_ENTITIES].isArray()) {
// QJsonArray attachmentsJson = json[JSON_AVATAR_ATTACHEMENTS].toArray();
// QJsonArray attachmentsJson = json[JSON_AVATAR_ATTACHMENTS].toArray();
// for (auto attachmentJson : attachmentsJson) {
// // TODO -- something
// }