From a11da43b0d274dabb42854b2d3373faeb445f21b Mon Sep 17 00:00:00 2001 From: milad Date: Tue, 10 Sep 2019 15:40:56 -0700 Subject: [PATCH 01/17] added additional branch in clearDomainAndNonOwnedEntities to handle localEntities parented --- libraries/entities-renderer/src/EntityTreeRenderer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/entities-renderer/src/EntityTreeRenderer.cpp b/libraries/entities-renderer/src/EntityTreeRenderer.cpp index fd82567a94..95f1f32dfc 100644 --- a/libraries/entities-renderer/src/EntityTreeRenderer.cpp +++ b/libraries/entities-renderer/src/EntityTreeRenderer.cpp @@ -229,7 +229,11 @@ void EntityTreeRenderer::clearDomainAndNonOwnedEntities() { for (const auto& entry : _entitiesInScene) { const auto& renderer = entry.second; const EntityItemPointer& entityItem = renderer->getEntity(); - if (!(entityItem->isLocalEntity() || (entityItem->isAvatarEntity() && entityItem->getOwningAvatarID() == sessionUUID))) { + auto parentID = entityItem->getParentID(); + auto parent = getTree()->findEntityByEntityItemID(parentID); + if ((!entityItem->isLocalEntity() || (entityItem->isAvatarEntity() && entityItem->getOwningAvatarID() == sessionUUID))) { + fadeOutRenderable(renderer); + } else if (entityItem->isLocalEntity() && parent && parent->getNestableType() == NestableType::Entity) { fadeOutRenderable(renderer); } else { savedEntities[entry.first] = entry.second; From 10f76da3ec867dd13ef84148adecd333321bda40 Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Mon, 23 Sep 2019 11:53:47 -0700 Subject: [PATCH 02/17] Reset look at values when goToLocation or sitting --- interface/src/avatar/MyAvatar.cpp | 11 +++++++++++ interface/src/avatar/MyAvatar.h | 6 +----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 112685e891..6f16e6e1bf 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -4144,6 +4144,7 @@ void MyAvatar::goToLocation(const glm::vec3& newPosition, _goToOrientation = quatOrientation; } + resetLookAtRotation(_goToPosition, _goToOrientation); emit transformChanged(); } @@ -5996,6 +5997,7 @@ bool MyAvatar::pinJoint(int index, const glm::vec3& position, const glm::quat& o } slamPosition(position); + resetLookAtRotation(position, orientation); setWorldOrientation(orientation); auto it = std::find(_pinnedJoints.begin(), _pinnedJoints.end(), index); @@ -6662,6 +6664,15 @@ void MyAvatar::resetHeadLookAt() { } } +void MyAvatar::resetLookAtRotation(const glm::vec3& avatarPosition, const glm::quat& avatarOrientation) { + // Align the look at values to the given avatar orientation + float yaw = safeEulerAngles(avatarOrientation).y; + _lookAtYaw = glm::angleAxis(yaw, avatarOrientation * Vectors::UP); + _lookAtPitch = Quaternions::IDENTITY; + _lookAtCameraTarget = avatarPosition + avatarOrientation * Vectors::FRONT; + resetHeadLookAt(); +} + void MyAvatar::updateHeadLookAt(float deltaTime) { if (_skeletonModelLoaded) { glm::vec3 lookAtTarget = _scriptControlsHeadLookAt ? _lookAtScriptTarget : _lookAtCameraTarget; diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index a6c53c1c0b..7b63e8e86b 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -2654,11 +2654,6 @@ private: bool _scriptControlsHeadLookAt { false }; float _scriptHeadControlTimer { 0.0f }; - // LookAt camera data - float _selfieTriggerAngle { 55.0f }; - float _frontLookAtSpeed { 0.15f }; - float _backLookAtSpeed { 0.25f }; - Setting::Handle _realWorldFieldOfView; Setting::Handle _useAdvancedMovementControls; Setting::Handle _showPlayArea; @@ -2685,6 +2680,7 @@ private: void initFlowFromFST(); void updateHeadLookAt(float deltaTime); void resetHeadLookAt(); + void resetLookAtRotation(const glm::vec3& avatarPosition, const glm::quat& avatarOrientation); // Avatar Preferences QUrl _fullAvatarURLFromPreferences; From e41632e3ec6b6867c88797d304f619b59346e892 Mon Sep 17 00:00:00 2001 From: RebeccaStankus Date: Mon, 23 Sep 2019 14:42:13 -0700 Subject: [PATCH 03/17] Removing connections to use inspect mode on mouse events --- interface/src/ui/overlays/ContextOverlayInterface.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/interface/src/ui/overlays/ContextOverlayInterface.cpp b/interface/src/ui/overlays/ContextOverlayInterface.cpp index 1c8a9019ea..796fbadee1 100644 --- a/interface/src/ui/overlays/ContextOverlayInterface.cpp +++ b/interface/src/ui/overlays/ContextOverlayInterface.cpp @@ -50,6 +50,9 @@ ContextOverlayInterface::ContextOverlayInterface() { _entityPropertyFlags += PROP_OWNING_AVATAR_ID; auto entityScriptingInterface = DependencyManager::get().data(); + /* REMOVING THIS AS AN EMERGENCY FIX. We will be returning to modify the code so that MP inspection is not intrusive in domains with a lot of certified content. + Jira bug to remove inspection temporarily: https://highfidelity.atlassian.net/browse/DEV-639 + Jira bug to modify it and bring it back: https://highfidelity.atlassian.net/browse/DEV-645 connect(entityScriptingInterface, &EntityScriptingInterface::mousePressOnEntity, this, &ContextOverlayInterface::clickDownOnEntity); connect(entityScriptingInterface, &EntityScriptingInterface::mouseReleaseOnEntity, this, &ContextOverlayInterface::mouseReleaseOnEntity); connect(entityScriptingInterface, &EntityScriptingInterface::hoverEnterEntity, this, &ContextOverlayInterface::contextOverlays_hoverEnterEntity); @@ -57,6 +60,7 @@ ContextOverlayInterface::ContextOverlayInterface() { connect(&qApp->getOverlays(), &Overlays::hoverEnterOverlay, this, &ContextOverlayInterface::contextOverlays_hoverEnterOverlay); connect(&qApp->getOverlays(), &Overlays::hoverLeaveOverlay, this, &ContextOverlayInterface::contextOverlays_hoverLeaveOverlay); + */ connect(_tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"), &TabletProxy::tabletShownChanged, this, [&]() { if (_contextOverlayJustClicked && _hmdScriptingInterface->isMounted()) { From 982bdf5c98ebfd04330e4a1b1c429c9a62904ff9 Mon Sep 17 00:00:00 2001 From: RebeccaStankus Date: Mon, 23 Sep 2019 16:08:14 -0700 Subject: [PATCH 04/17] Prereq work for 'Reduce User Friction' --- .../qml/hifi/simplifiedUI/topBar/SimplifiedTopBar.qml | 5 ++++- scripts/simplifiedUI/ui/simplifiedUI.js | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/simplifiedUI/topBar/SimplifiedTopBar.qml b/interface/resources/qml/hifi/simplifiedUI/topBar/SimplifiedTopBar.qml index 427e45abba..c92da7e6e5 100644 --- a/interface/resources/qml/hifi/simplifiedUI/topBar/SimplifiedTopBar.qml +++ b/interface/resources/qml/hifi/simplifiedUI/topBar/SimplifiedTopBar.qml @@ -40,6 +40,9 @@ Rectangle { property bool inventoryFullyReceived: false Component.onCompleted: { + var numTimesRun = Settings.getValue("simplifiedUI/SUIScriptExecutionCount", 0); + numTimesRun++; + Settings.setValue("simplifiedUI/SUIScriptExecutionCount", numTimesRun); Commerce.getLoginStatus(); } @@ -52,7 +55,7 @@ Rectangle { if ((MyAvatar.skeletonModelURL.indexOf("defaultAvatar") > -1 || MyAvatar.skeletonModelURL.indexOf("fst") === -1) && topBarInventoryModel.count > 0) { Settings.setValue("simplifiedUI/alreadyAutoSelectedAvatar", true); - MyAvatar.skeletonModelURL = topBarInventoryModel.get(0).download_url; + MyAvatar.useFullAvatarURL = topBarInventoryModel.get(0).download_url; } } } diff --git a/scripts/simplifiedUI/ui/simplifiedUI.js b/scripts/simplifiedUI/ui/simplifiedUI.js index affa6896d8..f1f1dd6dd3 100644 --- a/scripts/simplifiedUI/ui/simplifiedUI.js +++ b/scripts/simplifiedUI/ui/simplifiedUI.js @@ -532,6 +532,11 @@ function onGeometryChanged(rect) { } } +function onWindowMinimizedChanged() { + // prerequisite placeholder for Reduce Friction of Customer Acquisition sub task: https://highfidelity.atlassian.net/browse/DEV-585 + print("WINDOW MINIMIZED CHANGED SIGNAL"); +} + function onDisplayModeChanged(isHMDMode) { if (isHMDMode) { Camera.setModeString("first person"); @@ -612,6 +617,7 @@ function startup() { Audio.mutedDesktopChanged.connect(onDesktopInputDeviceMutedChanged); Audio.mutedHMDChanged.connect(onHMDInputDeviceMutedChanged); Window.geometryChanged.connect(onGeometryChanged); + Window.minimizedChanged.connect(onWindowMinimizedChanged); HMD.displayModeChanged.connect(onDisplayModeChanged); Audio.avatarGainChanged.connect(maybeUpdateOutputDeviceMutedOverlay); Audio.localInjectorGainChanged.connect(maybeUpdateOutputDeviceMutedOverlay); @@ -657,6 +663,7 @@ function shutdown() { Audio.mutedDesktopChanged.disconnect(onDesktopInputDeviceMutedChanged); Audio.mutedHMDChanged.disconnect(onHMDInputDeviceMutedChanged); Window.geometryChanged.disconnect(onGeometryChanged); + Window.minimizedChanged.disconnect(onWindowMinimizedChanged); HMD.displayModeChanged.disconnect(onDisplayModeChanged); Audio.avatarGainChanged.disconnect(maybeUpdateOutputDeviceMutedOverlay); Audio.localInjectorGainChanged.disconnect(maybeUpdateOutputDeviceMutedOverlay); From b174e002a9c13dd72b1cd567a20b85cdb83ceb9c Mon Sep 17 00:00:00 2001 From: David Rowe Date: Tue, 24 Sep 2019 12:52:51 +1200 Subject: [PATCH 05/17] Implement Recording.setPlayerVolume() --- assignment-client/src/Agent.cpp | 17 ++++++++++++++--- libraries/recording/src/recording/Deck.cpp | 4 ++++ libraries/recording/src/recording/Deck.h | 4 ++++ .../src/RecordingScriptingInterface.cpp | 2 +- .../src/RecordingScriptingInterface.h | 3 ++- 5 files changed, 25 insertions(+), 5 deletions(-) diff --git a/assignment-client/src/Agent.cpp b/assignment-client/src/Agent.cpp index 68464fef91..799afd64a6 100644 --- a/assignment-client/src/Agent.cpp +++ b/assignment-client/src/Agent.cpp @@ -433,7 +433,7 @@ void Agent::executeScript() { using namespace recording; static const FrameType AUDIO_FRAME_TYPE = Frame::registerFrameType(AudioConstants::getAudioFrameName()); - Frame::registerFrameHandler(AUDIO_FRAME_TYPE, [this, &scriptedAvatar](Frame::ConstPointer frame) { + Frame::registerFrameHandler(AUDIO_FRAME_TYPE, [this, &player, &scriptedAvatar](Frame::ConstPointer frame) { if (_shouldMuteRecordingAudio) { return; } @@ -442,10 +442,21 @@ void Agent::executeScript() { QByteArray audio(frame->data); - if (_isNoiseGateEnabled) { + auto volume = player->getVolume(); + if (volume != 1.0f || _isNoiseGateEnabled) { int16_t* samples = reinterpret_cast(audio.data()); int numSamples = AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL; - _audioGate.render(samples, samples, numSamples); + + if (volume != 1.0f) { + int32_t fract = (int32_t)(volume * 65536.0f); // Q16 + for (int i = 0; i < numSamples; i++) { // #######: i++ instead of ++i? + samples[i] = (fract * (int32_t)samples[i]) >> 16; + } + } + + if (_isNoiseGateEnabled) { + _audioGate.render(samples, samples, numSamples); + } } computeLoudness(&audio, scriptedAvatar); diff --git a/libraries/recording/src/recording/Deck.cpp b/libraries/recording/src/recording/Deck.cpp index 4d65f0eb1b..bdbbc05d50 100644 --- a/libraries/recording/src/recording/Deck.cpp +++ b/libraries/recording/src/recording/Deck.cpp @@ -103,6 +103,10 @@ float Deck::position() const { return Frame::frameTimeToSeconds(currentPosition); } +void Deck::setVolume(float volume) { + _volume = std::min(std::max(volume, 0.0f), 1.0f); +} + static const Frame::Time MIN_FRAME_WAIT_INTERVAL = Frame::secondsToFrameTime(0.001f); static const Frame::Time MAX_FRAME_PROCESSING_TIME = Frame::secondsToFrameTime(0.004f); diff --git a/libraries/recording/src/recording/Deck.h b/libraries/recording/src/recording/Deck.h index 1f8d58d5e1..12e2dd4b16 100644 --- a/libraries/recording/src/recording/Deck.h +++ b/libraries/recording/src/recording/Deck.h @@ -57,6 +57,9 @@ public: float position() const; void seek(float position); + float getVolume() { return _volume; } + void setVolume(float volume); + signals: void playbackStateChanged(); void looped(); @@ -76,6 +79,7 @@ private: bool _pause { true }; bool _loop { false }; float _length { 0 }; + float _volume { 1.0f }; }; } diff --git a/libraries/script-engine/src/RecordingScriptingInterface.cpp b/libraries/script-engine/src/RecordingScriptingInterface.cpp index e57d80274a..f95edb482b 100644 --- a/libraries/script-engine/src/RecordingScriptingInterface.cpp +++ b/libraries/script-engine/src/RecordingScriptingInterface.cpp @@ -117,7 +117,7 @@ void RecordingScriptingInterface::startPlaying() { } void RecordingScriptingInterface::setPlayerVolume(float volume) { - // FIXME + _player->setVolume(std::min(std::max(volume, 0.0f), 1.0f)); } void RecordingScriptingInterface::setPlayerAudioOffset(float audioOffset) { diff --git a/libraries/script-engine/src/RecordingScriptingInterface.h b/libraries/script-engine/src/RecordingScriptingInterface.h index 6a058feea5..604ec6bc2e 100644 --- a/libraries/script-engine/src/RecordingScriptingInterface.h +++ b/libraries/script-engine/src/RecordingScriptingInterface.h @@ -95,8 +95,9 @@ public slots: /**jsdoc + * Sets the playback audio volume. * @function Recording.setPlayerVolume - * @param {number} volume + * @param {number} volume - The playback audio volume, range 0.01.0. */ void setPlayerVolume(float volume); From f60e863b66bc7ee8413e8b67dbad4b96d4cc2bfc Mon Sep 17 00:00:00 2001 From: David Rowe Date: Tue, 24 Sep 2019 16:36:11 +1200 Subject: [PATCH 06/17] Remove wayward comment --- assignment-client/src/Agent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assignment-client/src/Agent.cpp b/assignment-client/src/Agent.cpp index 799afd64a6..e68262f712 100644 --- a/assignment-client/src/Agent.cpp +++ b/assignment-client/src/Agent.cpp @@ -449,7 +449,7 @@ void Agent::executeScript() { if (volume != 1.0f) { int32_t fract = (int32_t)(volume * 65536.0f); // Q16 - for (int i = 0; i < numSamples; i++) { // #######: i++ instead of ++i? + for (int i = 0; i < numSamples; i++) { samples[i] = (fract * (int32_t)samples[i]) >> 16; } } From 978bcaffebc8691fb7c8b2ca1fcce6a7d1bf29a4 Mon Sep 17 00:00:00 2001 From: RebeccaStankus Date: Tue, 24 Sep 2019 11:18:16 -0700 Subject: [PATCH 07/17] Undo removal of User Inspection --- interface/src/ui/overlays/ContextOverlayInterface.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/interface/src/ui/overlays/ContextOverlayInterface.cpp b/interface/src/ui/overlays/ContextOverlayInterface.cpp index 796fbadee1..1c8a9019ea 100644 --- a/interface/src/ui/overlays/ContextOverlayInterface.cpp +++ b/interface/src/ui/overlays/ContextOverlayInterface.cpp @@ -50,9 +50,6 @@ ContextOverlayInterface::ContextOverlayInterface() { _entityPropertyFlags += PROP_OWNING_AVATAR_ID; auto entityScriptingInterface = DependencyManager::get().data(); - /* REMOVING THIS AS AN EMERGENCY FIX. We will be returning to modify the code so that MP inspection is not intrusive in domains with a lot of certified content. - Jira bug to remove inspection temporarily: https://highfidelity.atlassian.net/browse/DEV-639 - Jira bug to modify it and bring it back: https://highfidelity.atlassian.net/browse/DEV-645 connect(entityScriptingInterface, &EntityScriptingInterface::mousePressOnEntity, this, &ContextOverlayInterface::clickDownOnEntity); connect(entityScriptingInterface, &EntityScriptingInterface::mouseReleaseOnEntity, this, &ContextOverlayInterface::mouseReleaseOnEntity); connect(entityScriptingInterface, &EntityScriptingInterface::hoverEnterEntity, this, &ContextOverlayInterface::contextOverlays_hoverEnterEntity); @@ -60,7 +57,6 @@ ContextOverlayInterface::ContextOverlayInterface() { connect(&qApp->getOverlays(), &Overlays::hoverEnterOverlay, this, &ContextOverlayInterface::contextOverlays_hoverEnterOverlay); connect(&qApp->getOverlays(), &Overlays::hoverLeaveOverlay, this, &ContextOverlayInterface::contextOverlays_hoverLeaveOverlay); - */ connect(_tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"), &TabletProxy::tabletShownChanged, this, [&]() { if (_contextOverlayJustClicked && _hmdScriptingInterface->isMounted()) { From 54dae34abeac49cb03f2981faa76388cef84bbda Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Tue, 24 Sep 2019 11:26:50 -0700 Subject: [PATCH 08/17] Revert "BUGZ-1551: Do not download Qt if Qt_CMAKE_PREFIX_PATH is set as an environment variable" --- hifi_vcpkg.py | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index f726a87945..821d9ae0b7 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -257,27 +257,26 @@ endif() def installQt(self): qt5InstallPath = self.getQt5InstallPath() - if os.getenv('QT_CMAKE_PREFIX_PATH') == None: - if not os.path.isdir(qt5InstallPath): - print ('Downloading Qt from AWS') - dest, tail = os.path.split(qt5InstallPath) + if not os.path.isdir(qt5InstallPath): + print ('Downloading Qt from AWS') + dest, tail = os.path.split(qt5InstallPath) - url = 'NOT DEFINED' - if platform.system() == 'Windows': - url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-windows3.tar.gz' - elif platform.system() == 'Darwin': - url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-macos3.tar.gz' - elif platform.system() == 'Linux': - if platform.linux_distribution()[1][:3] == '16.': - url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-16.04-with-symbols.tar.gz' - elif platform.linux_distribution()[1][:3] == '18.': - url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-18.04.tar.gz' - else: - print('UNKNOWN LINUX VERSION!!!') + url = 'NOT DEFINED' + if platform.system() == 'Windows': + url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-windows3.tar.gz' + elif platform.system() == 'Darwin': + url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-macos3.tar.gz' + elif platform.system() == 'Linux': + if platform.linux_distribution()[1][:3] == '16.': + url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-16.04-with-symbols.tar.gz' + elif platform.linux_distribution()[1][:3] == '18.': + url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-18.04.tar.gz' else: - print('UNKNOWN OPERATING SYSTEM!!!') - - print('Extracting ' + url + ' to ' + dest) - hifi_utils.downloadAndExtract(url, dest) + print('UNKNOWN LINUX VERSION!!!') else: - print ('Qt has already been downloaded') + print('UNKNOWN OPERATING SYSTEM!!!') + + print('Extracting ' + url + ' to ' + dest) + hifi_utils.downloadAndExtract(url, dest) + else: + print ('Qt has already been downloaded') From 2fe24b39dbe4f1c3d60d81f549aa5e6dba614eb0 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Wed, 25 Sep 2019 07:50:56 +1200 Subject: [PATCH 09/17] Code review --- assignment-client/src/Agent.cpp | 22 ++++++++++------------ libraries/recording/src/recording/Deck.h | 2 +- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/assignment-client/src/Agent.cpp b/assignment-client/src/Agent.cpp index e68262f712..ee1e21c837 100644 --- a/assignment-client/src/Agent.cpp +++ b/assignment-client/src/Agent.cpp @@ -442,21 +442,19 @@ void Agent::executeScript() { QByteArray audio(frame->data); + int16_t* samples = reinterpret_cast(audio.data()); + int numSamples = AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL; + auto volume = player->getVolume(); - if (volume != 1.0f || _isNoiseGateEnabled) { - int16_t* samples = reinterpret_cast(audio.data()); - int numSamples = AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL; - - if (volume != 1.0f) { - int32_t fract = (int32_t)(volume * 65536.0f); // Q16 - for (int i = 0; i < numSamples; i++) { - samples[i] = (fract * (int32_t)samples[i]) >> 16; - } + if (volume >= 0.0f && volume < 1.0f) { + int32_t fract = (int32_t)(volume * (float)(1 << 16)); // Q16 + for (int i = 0; i < numSamples; i++) { + samples[i] = (fract * (int32_t)samples[i]) >> 16; } + } - if (_isNoiseGateEnabled) { - _audioGate.render(samples, samples, numSamples); - } + if (_isNoiseGateEnabled) { + _audioGate.render(samples, samples, numSamples); } computeLoudness(&audio, scriptedAvatar); diff --git a/libraries/recording/src/recording/Deck.h b/libraries/recording/src/recording/Deck.h index 12e2dd4b16..6dce3a445b 100644 --- a/libraries/recording/src/recording/Deck.h +++ b/libraries/recording/src/recording/Deck.h @@ -57,7 +57,7 @@ public: float position() const; void seek(float position); - float getVolume() { return _volume; } + float getVolume() const { return _volume; } void setVolume(float volume); signals: From e275fe1da89cb96600cbf2358a3e8df1f4f0657a Mon Sep 17 00:00:00 2001 From: milad Date: Tue, 24 Sep 2019 16:07:04 -0700 Subject: [PATCH 10/17] Merge branch 'master' of github.com:highfidelity/hifi From edb135776af2edf7d5d743dfad97a94315018659 Mon Sep 17 00:00:00 2001 From: milad Date: Tue, 24 Sep 2019 16:44:34 -0700 Subject: [PATCH 11/17] Added selfie view and updated help --- .../helpApp/controls/ControlsTable.qml | 6 ++--- .../settingsApp/general/General.qml | 22 +++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/interface/resources/qml/hifi/simplifiedUI/helpApp/controls/ControlsTable.qml b/interface/resources/qml/hifi/simplifiedUI/helpApp/controls/ControlsTable.qml index b647d5ca24..ad4ecec707 100644 --- a/interface/resources/qml/hifi/simplifiedUI/helpApp/controls/ControlsTable.qml +++ b/interface/resources/qml/hifi/simplifiedUI/helpApp/controls/ControlsTable.qml @@ -699,8 +699,8 @@ Item { spacing: controlsTableRoot.rowPadding HifiStylesUit.GraphikRegular { - id: mirrorText - text: "Mirror Mode" + id: selfieText + text: "Selfie" width: paintedWidth height: parent.height horizontalAlignment: Text.AlignLeft @@ -711,7 +711,7 @@ Item { HifiStylesUit.GraphikRegular { text: "See your own avatar" - width: parent.width - mirrorText.width - parent.spacing - controlsTableRoot.rowPadding + width: parent.width - selfieText.width - parent.spacing - controlsTableRoot.rowPadding height: parent.height horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter diff --git a/interface/resources/qml/hifi/simplifiedUI/settingsApp/general/General.qml b/interface/resources/qml/hifi/simplifiedUI/settingsApp/general/General.qml index 24fff2dae4..3fd64cde49 100644 --- a/interface/resources/qml/hifi/simplifiedUI/settingsApp/general/General.qml +++ b/interface/resources/qml/hifi/simplifiedUI/settingsApp/general/General.qml @@ -239,6 +239,16 @@ Flickable { Camera.mode = "third person" } } + + SimplifiedControls.RadioButton { + id: selfie + text: "Selfie" + checked: Camera.mode === "mirror" + visible: true + onClicked: { + Camera.mode = "mirror" + } + } Connections { target: Camera @@ -248,6 +258,18 @@ Flickable { firstPerson.checked = true } else if (Camera.mode === "third person") { thirdPerson.checked = true + } else if (Camera.mode === "mirror" && HMD.active) { + selfie.checked = true + } + } + } + + Connections { + target: HMD + + onDisplayModeChanged { + if (isHMDMode) { + selfie.visible = false; } } } From 677dbe59ccd769dc92f1f20396bb4a9ed3e5253f Mon Sep 17 00:00:00 2001 From: milad Date: Tue, 24 Sep 2019 16:47:07 -0700 Subject: [PATCH 12/17] fixed qml typo --- .../qml/hifi/simplifiedUI/settingsApp/general/General.qml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/interface/resources/qml/hifi/simplifiedUI/settingsApp/general/General.qml b/interface/resources/qml/hifi/simplifiedUI/settingsApp/general/General.qml index 3fd64cde49..69543f34e8 100644 --- a/interface/resources/qml/hifi/simplifiedUI/settingsApp/general/General.qml +++ b/interface/resources/qml/hifi/simplifiedUI/settingsApp/general/General.qml @@ -267,10 +267,8 @@ Flickable { Connections { target: HMD - onDisplayModeChanged { - if (isHMDMode) { - selfie.visible = false; - } + onDisplayModeChanged: { + selfie.visible = isHMDMode ? false : true } } } From 96b58756b120e4a3e5dd40af6c61a90956519ded Mon Sep 17 00:00:00 2001 From: Clement Date: Tue, 24 Sep 2019 16:25:44 -0700 Subject: [PATCH 13/17] Add flag for account settings feature --- interface/src/Application.cpp | 4 ++-- libraries/networking/src/AccountManager.cpp | 13 +++++++++++-- libraries/networking/src/AccountManager.h | 3 ++- tools/ac-client/src/ACClientApp.cpp | 2 +- tools/atp-client/src/ATPClientApp.cpp | 2 +- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index ef3aafef4f..6a320e53ee 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -856,9 +856,9 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { DependencyManager::set(); DependencyManager::set(); #if defined(Q_OS_ANDROID) - DependencyManager::set(); // use the default user agent getter + DependencyManager::set(true); // use the default user agent getter #else - DependencyManager::set(std::bind(&Application::getUserAgent, qApp)); + DependencyManager::set(true, std::bind(&Application::getUserAgent, qApp)); #endif DependencyManager::set(); DependencyManager::set(ScriptEngine::CLIENT_SCRIPT, defaultScriptsOverrideOption); diff --git a/libraries/networking/src/AccountManager.cpp b/libraries/networking/src/AccountManager.cpp index a31d117f59..3de39902b1 100644 --- a/libraries/networking/src/AccountManager.cpp +++ b/libraries/networking/src/AccountManager.cpp @@ -73,9 +73,10 @@ QJsonObject AccountManager::dataObjectFromResponse(QNetworkReply* requestReply) } } -AccountManager::AccountManager(UserAgentGetter userAgentGetter) : +AccountManager::AccountManager(bool accountSettingsEnabled, UserAgentGetter userAgentGetter) : _userAgentGetter(userAgentGetter), - _authURL() + _authURL(), + _accountSettingsEnabled(accountSettingsEnabled) { qRegisterMetaType("OAuthAccessToken"); qRegisterMetaTypeStreamOperators("OAuthAccessToken"); @@ -796,6 +797,10 @@ void AccountManager::requestProfileError(QNetworkReply::NetworkError error) { } void AccountManager::requestAccountSettings() { + if (!_accountSettingsEnabled) { + return; + } + QNetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance(); QUrl lockerURL = _authURL; @@ -840,6 +845,10 @@ void AccountManager::requestAccountSettingsError(QNetworkReply::NetworkError err } void AccountManager::postAccountSettings() { + if (!_accountSettingsEnabled) { + return; + } + if (_settings.lastChangeTimestamp() <= _lastSuccessfulSyncTimestamp && _lastSuccessfulSyncTimestamp != 0) { // Nothing changed, skipping settings post return; diff --git a/libraries/networking/src/AccountManager.h b/libraries/networking/src/AccountManager.h index f29221d671..8c7789c218 100644 --- a/libraries/networking/src/AccountManager.h +++ b/libraries/networking/src/AccountManager.h @@ -60,7 +60,7 @@ const auto DEFAULT_USER_AGENT_GETTER = []() -> QString { return HIGH_FIDELITY_US class AccountManager : public QObject, public Dependency { Q_OBJECT public: - AccountManager(UserAgentGetter userAgentGetter = DEFAULT_USER_AGENT_GETTER); + AccountManager(bool accountSettingsEnabled = false, UserAgentGetter userAgentGetter = DEFAULT_USER_AGENT_GETTER); QNetworkRequest createRequest(QString path, AccountManagerAuth::Type authType); Q_INVOKABLE void sendRequest(const QString& path, @@ -182,6 +182,7 @@ private: bool _limitedCommerce { false }; QString _configFileURL; + bool _accountSettingsEnabled { false }; AccountSettings _settings; quint64 _currentSyncTimestamp { 0 }; quint64 _lastSuccessfulSyncTimestamp { 0 }; diff --git a/tools/ac-client/src/ACClientApp.cpp b/tools/ac-client/src/ACClientApp.cpp index 6b781a5bea..24805a3348 100644 --- a/tools/ac-client/src/ACClientApp.cpp +++ b/tools/ac-client/src/ACClientApp.cpp @@ -100,7 +100,7 @@ ACClientApp::ACClientApp(int argc, char* argv[]) : DependencyManager::registerInheritance(); - DependencyManager::set([&]{ return QString("Mozilla/5.0 (HighFidelityACClient)"); }); + DependencyManager::set(false, [&]{ return QString("Mozilla/5.0 (HighFidelityACClient)"); }); DependencyManager::set(); DependencyManager::set(NodeType::Agent, listenPort); diff --git a/tools/atp-client/src/ATPClientApp.cpp b/tools/atp-client/src/ATPClientApp.cpp index 8c2fd44adf..b2e7db5c87 100644 --- a/tools/atp-client/src/ATPClientApp.cpp +++ b/tools/atp-client/src/ATPClientApp.cpp @@ -138,7 +138,7 @@ ATPClientApp::ATPClientApp(int argc, char* argv[]) : DependencyManager::registerInheritance(); DependencyManager::set(); - DependencyManager::set([&]{ return QString(HIGH_FIDELITY_ATP_CLIENT_USER_AGENT); }); + DependencyManager::set(false, [&]{ return QString(HIGH_FIDELITY_ATP_CLIENT_USER_AGENT); }); DependencyManager::set(); DependencyManager::set(NodeType::Agent, _listenPort); From af5e01f96b9bf3f5b622022fda04e0873b4ebede Mon Sep 17 00:00:00 2001 From: milad Date: Tue, 24 Sep 2019 16:51:35 -0700 Subject: [PATCH 14/17] restored modified file --- libraries/entities-renderer/src/EntityTreeRenderer.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libraries/entities-renderer/src/EntityTreeRenderer.cpp b/libraries/entities-renderer/src/EntityTreeRenderer.cpp index 9c215ff09c..74f8f5793a 100644 --- a/libraries/entities-renderer/src/EntityTreeRenderer.cpp +++ b/libraries/entities-renderer/src/EntityTreeRenderer.cpp @@ -229,11 +229,7 @@ void EntityTreeRenderer::clearDomainAndNonOwnedEntities() { for (const auto& entry : _entitiesInScene) { const auto& renderer = entry.second; const EntityItemPointer& entityItem = renderer->getEntity(); - auto parentID = entityItem->getParentID(); - auto parent = getTree()->findEntityByEntityItemID(parentID); - if ((!entityItem->isLocalEntity() || (entityItem->isAvatarEntity() && entityItem->getOwningAvatarID() == sessionUUID))) { - fadeOutRenderable(renderer); - } else if (entityItem->isLocalEntity() && parent && parent->getNestableType() == NestableType::Entity) { + if (!(entityItem->isLocalEntity() || (entityItem->isAvatarEntity() && entityItem->getOwningAvatarID() == sessionUUID))) { fadeOutRenderable(renderer); } else { savedEntities[entry.first] = entry.second; @@ -1400,4 +1396,4 @@ bool EntityTreeRenderer::removeMaterialFromAvatar(const QUuid& avatarID, graphic return _removeMaterialFromAvatarOperator(avatarID, material, parentMaterialName); } return false; -} +} \ No newline at end of file From 103b10e2f913d863380a3a7eaf9b076c02384213 Mon Sep 17 00:00:00 2001 From: milad Date: Tue, 24 Sep 2019 16:52:37 -0700 Subject: [PATCH 15/17] restored modified file --- libraries/entities-renderer/src/EntityTreeRenderer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/entities-renderer/src/EntityTreeRenderer.cpp b/libraries/entities-renderer/src/EntityTreeRenderer.cpp index 74f8f5793a..3837be5c9c 100644 --- a/libraries/entities-renderer/src/EntityTreeRenderer.cpp +++ b/libraries/entities-renderer/src/EntityTreeRenderer.cpp @@ -1396,4 +1396,4 @@ bool EntityTreeRenderer::removeMaterialFromAvatar(const QUuid& avatarID, graphic return _removeMaterialFromAvatarOperator(avatarID, material, parentMaterialName); } return false; -} \ No newline at end of file +} From 39d96b76a692110858fc621ef0fb07e27fee3a65 Mon Sep 17 00:00:00 2001 From: milad Date: Wed, 25 Sep 2019 08:41:38 -0700 Subject: [PATCH 16/17] fixed help text --- .../qml/hifi/simplifiedUI/helpApp/controls/ControlsTable.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/simplifiedUI/helpApp/controls/ControlsTable.qml b/interface/resources/qml/hifi/simplifiedUI/helpApp/controls/ControlsTable.qml index ad4ecec707..84b37db31b 100644 --- a/interface/resources/qml/hifi/simplifiedUI/helpApp/controls/ControlsTable.qml +++ b/interface/resources/qml/hifi/simplifiedUI/helpApp/controls/ControlsTable.qml @@ -710,7 +710,7 @@ Item { } HifiStylesUit.GraphikRegular { - text: "See your own avatar" + text: "Look at self" width: parent.width - selfieText.width - parent.spacing - controlsTableRoot.rowPadding height: parent.height horizontalAlignment: Text.AlignLeft From aba6a28d5483ad9420ea180536f92e745be786cf Mon Sep 17 00:00:00 2001 From: milad Date: Wed, 25 Sep 2019 11:05:32 -0700 Subject: [PATCH 17/17] updated camera modes --- .../simplifiedUI/settingsApp/general/General.qml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/interface/resources/qml/hifi/simplifiedUI/settingsApp/general/General.qml b/interface/resources/qml/hifi/simplifiedUI/settingsApp/general/General.qml index 69543f34e8..7a98849b95 100644 --- a/interface/resources/qml/hifi/simplifiedUI/settingsApp/general/General.qml +++ b/interface/resources/qml/hifi/simplifiedUI/settingsApp/general/General.qml @@ -234,19 +234,19 @@ Flickable { SimplifiedControls.RadioButton { id: thirdPerson text: "Third Person View" - checked: Camera.mode === "third person" + checked: Camera.mode === "look at" onClicked: { - Camera.mode = "third person" + Camera.mode = "look at" } } SimplifiedControls.RadioButton { id: selfie text: "Selfie" - checked: Camera.mode === "mirror" + checked: Camera.mode === "selfie" visible: true onClicked: { - Camera.mode = "mirror" + Camera.mode = "selfie" } } @@ -256,9 +256,9 @@ Flickable { onModeUpdated: { if (Camera.mode === "first person") { firstPerson.checked = true - } else if (Camera.mode === "third person") { + } else if (Camera.mode === "look at") { thirdPerson.checked = true - } else if (Camera.mode === "mirror" && HMD.active) { + } else if (Camera.mode === "selfie" && HMD.active) { selfie.checked = true } }