diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index 9bc1878f94..cdd44d304e 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -262,9 +262,9 @@ endif() elif platform.system() == 'Darwin': url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-macos.tar.gz' elif platform.system() == 'Linux': - if platform.linux_distribution()[1] == '16.04': + if platform.linux_distribution()[1][:3] == '16.': url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-16.04.tar.gz' - elif platform.linux_distribution()[1] == '18.04': + 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!!!') diff --git a/interface/resources/qml/hifi/simplifiedUI/settingsApp/audio/Audio.qml b/interface/resources/qml/hifi/simplifiedUI/settingsApp/audio/Audio.qml index 9ac72fa3cd..b73c07c78b 100644 --- a/interface/resources/qml/hifi/simplifiedUI/settingsApp/audio/Audio.qml +++ b/interface/resources/qml/hifi/simplifiedUI/settingsApp/audio/Audio.qml @@ -60,7 +60,7 @@ Flickable { HifiStylesUit.GraphikRegular { id: volumeControlsTitle text: "Volume Controls" - Layout.maximumWidth: parent.width + Layout.preferredWidth: parent.width height: paintedHeight size: 22 color: simplifiedUI.colors.text.white @@ -68,8 +68,7 @@ Flickable { SimplifiedControls.Slider { id: peopleVolume - anchors.left: parent.left - anchors.right: parent.right + Layout.preferredWidth: parent.width Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin height: 30 labelText: "People Volume" @@ -96,8 +95,7 @@ Flickable { SimplifiedControls.Slider { id: environmentVolume - anchors.left: parent.left - anchors.right: parent.right + Layout.preferredWidth: parent.width Layout.topMargin: 2 height: 30 labelText: "Environment Volume" @@ -125,8 +123,7 @@ Flickable { SimplifiedControls.Slider { id: systemSoundVolume - anchors.left: parent.left - anchors.right: parent.right + Layout.preferredWidth: parent.width Layout.topMargin: 2 height: 30 labelText: "System Sound Volume" @@ -212,8 +209,7 @@ Flickable { ListView { id: inputDeviceListView - anchors.left: parent.left - anchors.right: parent.right + Layout.preferredWidth: parent.width Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin interactive: false height: contentItem.height @@ -228,7 +224,7 @@ Flickable { id: inputDeviceCheckbox anchors.left: parent.left width: parent.width - inputLevel.width - height: paintedHeight + height: 16 wrapLabel: false checked: selectedDesktop text: model.devicename @@ -251,6 +247,7 @@ Flickable { } SimplifiedControls.Button { + id: audioLoopbackButton property bool audioLoopedBack: AudioScriptingInterface.getLocalEcho() function startAudioLoopback() { @@ -266,29 +263,23 @@ Flickable { } } - Timer { - id: loopbackTimer - interval: 8000 - running: false - repeat: false - onTriggered: { + Component.onDestruction: stopAudioLoopback(); + + onVisibleChanged: { + if (!visible) { stopAudioLoopback(); } } - id: testYourMicButton enabled: !HMD.active - anchors.left: parent.left Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin width: 160 height: 32 text: audioLoopedBack ? "STOP TESTING" : "TEST YOUR MIC" onClicked: { if (audioLoopedBack) { - loopbackTimer.stop(); stopAudioLoopback(); } else { - loopbackTimer.restart(); startAudioLoopback(); } } @@ -313,8 +304,7 @@ Flickable { ListView { id: outputDeviceListView - anchors.left: parent.left - anchors.right: parent.right + Layout.preferredWidth: parent.width Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin interactive: false height: contentItem.height @@ -329,7 +319,7 @@ Flickable { id: outputDeviceCheckbox anchors.left: parent.left width: parent.width - height: paintedHeight + height: 16 checked: selectedDesktop text: model.devicename wrapLabel: false @@ -381,7 +371,6 @@ Flickable { id: testYourSoundButton enabled: !HMD.active - anchors.left: parent.left Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin width: 160 height: 32 diff --git a/interface/resources/qml/hifi/simplifiedUI/settingsApp/vr/VR.qml b/interface/resources/qml/hifi/simplifiedUI/settingsApp/vr/VR.qml index 96dbc5e180..97799921c2 100644 --- a/interface/resources/qml/hifi/simplifiedUI/settingsApp/vr/VR.qml +++ b/interface/resources/qml/hifi/simplifiedUI/settingsApp/vr/VR.qml @@ -198,8 +198,7 @@ Flickable { ListView { id: inputDeviceListView - anchors.left: parent.left - anchors.right: parent.right + Layout.preferredWidth: parent.width Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin interactive: false height: contentItem.height @@ -214,8 +213,10 @@ Flickable { id: inputDeviceCheckbox anchors.left: parent.left width: parent.width - inputLevel.width + height: 16 checked: selectedHMD text: model.devicename + wrapLabel: false ButtonGroup.group: inputDeviceButtonGroup onClicked: { AudioScriptingInterface.setStereoInput(false); // the next selected audio device might not support stereo @@ -235,6 +236,7 @@ Flickable { } SimplifiedControls.Button { + id: audioLoopbackButton property bool audioLoopedBack: AudioScriptingInterface.getLocalEcho() function startAudioLoopback() { @@ -250,29 +252,23 @@ Flickable { } } - Timer { - id: loopbackTimer - interval: 8000 - running: false - repeat: false - onTriggered: { + Component.onDestruction: stopAudioLoopback(); + + onVisibleChanged: { + if (!visible) { stopAudioLoopback(); } } - id: testYourMicButton enabled: HMD.active - anchors.left: parent.left Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin width: 160 height: 32 text: audioLoopedBack ? "STOP TESTING" : "TEST YOUR MIC" onClicked: { if (audioLoopedBack) { - loopbackTimer.stop(); stopAudioLoopback(); } else { - loopbackTimer.restart(); startAudioLoopback(); } } @@ -297,8 +293,7 @@ Flickable { ListView { id: outputDeviceListView - anchors.left: parent.left - anchors.right: parent.right + Layout.preferredWidth: parent.width Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin interactive: false height: contentItem.height @@ -313,11 +308,13 @@ Flickable { id: outputDeviceCheckbox anchors.left: parent.left width: parent.width - checked: selectedDesktop + height: 16 + checked: selectedHMD text: model.devicename + wrapLabel: false ButtonGroup.group: outputDeviceButtonGroup onClicked: { - AudioScriptingInterface.setOutputDevice(model.info, true); // `false` argument for Desktop mode setting + AudioScriptingInterface.setOutputDevice(model.info, true); // `true` argument for VR mode setting } } } @@ -363,7 +360,6 @@ Flickable { id: testYourSoundButton enabled: HMD.active - anchors.left: parent.left Layout.topMargin: simplifiedUI.margins.settings.settingsGroupTopMargin width: 160 height: 32 diff --git a/interface/src/avatar/AvatarManager.cpp b/interface/src/avatar/AvatarManager.cpp index 80b9762213..f153f66799 100755 --- a/interface/src/avatar/AvatarManager.cpp +++ b/interface/src/avatar/AvatarManager.cpp @@ -521,6 +521,7 @@ void AvatarManager::buildPhysicsTransaction(PhysicsEngine::Transaction& transact } } } + _otherAvatarsToChangeInPhysics.clear(); } void AvatarManager::handleProcessedPhysicsTransaction(PhysicsEngine::Transaction& transaction) { @@ -645,7 +646,7 @@ void AvatarManager::clearOtherAvatars() { } void AvatarManager::deleteAllAvatars() { - assert(_otherAvatarsToChangeInPhysics.empty()); + _otherAvatarsToChangeInPhysics.clear(); QReadLocker locker(&_hashLock); AvatarHash::iterator avatarIterator = _avatarHash.begin(); while (avatarIterator != _avatarHash.end()) { diff --git a/libraries/audio-client/src/AudioClient.cpp b/libraries/audio-client/src/AudioClient.cpp index cef6adcab0..da948f9917 100644 --- a/libraries/audio-client/src/AudioClient.cpp +++ b/libraries/audio-client/src/AudioClient.cpp @@ -2162,6 +2162,8 @@ qint64 AudioClient::AudioOutputIODevice::readData(char * data, qint64 maxSize) { } bytesWritten = framesPopped * AudioConstants::SAMPLE_SIZE * deviceChannelCount; + assert(bytesWritten <= maxSize); + } else { // nothing on network, don't grab anything from injectors, and just return 0s memset(data, 0, maxSize); @@ -2174,7 +2176,6 @@ qint64 AudioClient::AudioOutputIODevice::readData(char * data, qint64 maxSize) { _audio->_audioFileWav.addRawAudioChunk(reinterpret_cast(scratchBuffer), bytesWritten); } - int bytesAudioOutputUnplayed = _audio->_audioOutput->bufferSize() - _audio->_audioOutput->bytesFree(); float msecsAudioOutputUnplayed = bytesAudioOutputUnplayed / (float)_audio->_outputFormat.bytesForDuration(USECS_PER_MSEC); _audio->_stats.updateOutputMsUnplayed(msecsAudioOutputUnplayed); diff --git a/libraries/audio/src/InboundAudioStream.cpp b/libraries/audio/src/InboundAudioStream.cpp index 5ac3996029..7a81b8a67a 100644 --- a/libraries/audio/src/InboundAudioStream.cpp +++ b/libraries/audio/src/InboundAudioStream.cpp @@ -364,10 +364,19 @@ int InboundAudioStream::popSamples(int maxSamples, bool allOrNothing) { // buffer calculations. setToStarved(); _consecutiveNotMixedCount++; - //Kick PLC to generate a filler frame, reducing 'click' - lostAudioData(allOrNothing ? (maxSamples - samplesAvailable) / _ringBuffer.getNumFrameSamples() : 1); - samplesPopped = _ringBuffer.samplesAvailable(); - if (samplesPopped) { + + // use PLC to generate extrapolated audio data, to reduce clicking + if (allOrNothing) { + int samplesNeeded = maxSamples - samplesAvailable; + int packetsNeeded = (samplesNeeded + _ringBuffer.getNumFrameSamples() - 1) / _ringBuffer.getNumFrameSamples(); + lostAudioData(packetsNeeded); + } else { + lostAudioData(1); + } + samplesAvailable = _ringBuffer.samplesAvailable(); + + if (samplesAvailable > 0) { + samplesPopped = std::min(samplesAvailable, maxSamples); popSamplesNoCheck(samplesPopped); } else { // No samples available means a packet is currently being diff --git a/scripts/simplifiedUI/defaultScripts.js b/scripts/simplifiedUI/defaultScripts.js new file mode 100644 index 0000000000..0911c6518a --- /dev/null +++ b/scripts/simplifiedUI/defaultScripts.js @@ -0,0 +1,41 @@ +"use strict"; +/* jslint vars: true, plusplus: true */ + +// +// defaultScripts.js +// +// Authors: Zach Fox +// Created: 2019-05-23 +// Copyright 2019 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// +var DEFAULT_SCRIPTS_PATH_PREFIX = ScriptDiscoveryService.defaultScriptsPath + "/"; + + +var DEFAULT_SCRIPTS_SEPARATE = [ + DEFAULT_SCRIPTS_PATH_PREFIX + "system/controllers/controllerScripts.js", + Script.resolvePath("simplifiedUI.js") +]; +function loadSeparateDefaults() { + for (var i in DEFAULT_SCRIPTS_SEPARATE) { + Script.load(DEFAULT_SCRIPTS_SEPARATE[i]); + } +} + + +var DEFAULT_SCRIPTS_COMBINED = [ + DEFAULT_SCRIPTS_PATH_PREFIX + "system/request-service.js", + DEFAULT_SCRIPTS_PATH_PREFIX + "system/progress.js", + DEFAULT_SCRIPTS_PATH_PREFIX + "system/away.js" +]; +function runDefaultsTogether() { + for (var i in DEFAULT_SCRIPTS_COMBINED) { + Script.include(DEFAULT_SCRIPTS_COMBINED[i]); + } + loadSeparateDefaults(); +} + + +runDefaultsTogether(); diff --git a/scripts/system/simplifiedUI/images/inputDeviceMuted.svg b/scripts/simplifiedUI/images/inputDeviceMuted.svg similarity index 100% rename from scripts/system/simplifiedUI/images/inputDeviceMuted.svg rename to scripts/simplifiedUI/images/inputDeviceMuted.svg diff --git a/scripts/system/simplifiedUI/images/outputDeviceMuted.svg b/scripts/simplifiedUI/images/outputDeviceMuted.svg similarity index 100% rename from scripts/system/simplifiedUI/images/outputDeviceMuted.svg rename to scripts/simplifiedUI/images/outputDeviceMuted.svg diff --git a/scripts/system/simplifiedUI/simplifiedNametag/resources/modules/defaultLocalEntityProps.js b/scripts/simplifiedUI/simplifiedNametag/resources/modules/defaultLocalEntityProps.js similarity index 100% rename from scripts/system/simplifiedUI/simplifiedNametag/resources/modules/defaultLocalEntityProps.js rename to scripts/simplifiedUI/simplifiedNametag/resources/modules/defaultLocalEntityProps.js diff --git a/scripts/system/simplifiedUI/simplifiedNametag/resources/modules/entityMaker.js b/scripts/simplifiedUI/simplifiedNametag/resources/modules/entityMaker.js similarity index 100% rename from scripts/system/simplifiedUI/simplifiedNametag/resources/modules/entityMaker.js rename to scripts/simplifiedUI/simplifiedNametag/resources/modules/entityMaker.js diff --git a/scripts/system/simplifiedUI/simplifiedNametag/resources/modules/nameTagListManager.js b/scripts/simplifiedUI/simplifiedNametag/resources/modules/nameTagListManager.js similarity index 100% rename from scripts/system/simplifiedUI/simplifiedNametag/resources/modules/nameTagListManager.js rename to scripts/simplifiedUI/simplifiedNametag/resources/modules/nameTagListManager.js diff --git a/scripts/system/simplifiedUI/simplifiedNametag/resources/modules/objectAssign.js b/scripts/simplifiedUI/simplifiedNametag/resources/modules/objectAssign.js similarity index 100% rename from scripts/system/simplifiedUI/simplifiedNametag/resources/modules/objectAssign.js rename to scripts/simplifiedUI/simplifiedNametag/resources/modules/objectAssign.js diff --git a/scripts/system/simplifiedUI/simplifiedNametag/resources/modules/pickRayController.js b/scripts/simplifiedUI/simplifiedNametag/resources/modules/pickRayController.js similarity index 100% rename from scripts/system/simplifiedUI/simplifiedNametag/resources/modules/pickRayController.js rename to scripts/simplifiedUI/simplifiedNametag/resources/modules/pickRayController.js diff --git a/scripts/system/simplifiedUI/simplifiedNametag/resources/modules/textHelper.js b/scripts/simplifiedUI/simplifiedNametag/resources/modules/textHelper.js similarity index 100% rename from scripts/system/simplifiedUI/simplifiedNametag/resources/modules/textHelper.js rename to scripts/simplifiedUI/simplifiedNametag/resources/modules/textHelper.js diff --git a/scripts/system/simplifiedUI/simplifiedNametag/simplifiedNametag.js b/scripts/simplifiedUI/simplifiedNametag/simplifiedNametag.js similarity index 100% rename from scripts/system/simplifiedUI/simplifiedNametag/simplifiedNametag.js rename to scripts/simplifiedUI/simplifiedNametag/simplifiedNametag.js diff --git a/scripts/system/simplifiedUI/simplifiedStatusIndicator/simplifiedStatusIndicator.js b/scripts/simplifiedUI/simplifiedStatusIndicator/simplifiedStatusIndicator.js similarity index 100% rename from scripts/system/simplifiedUI/simplifiedStatusIndicator/simplifiedStatusIndicator.js rename to scripts/simplifiedUI/simplifiedStatusIndicator/simplifiedStatusIndicator.js diff --git a/scripts/system/simplifiedUI/simplifiedUI.js b/scripts/simplifiedUI/simplifiedUI.js similarity index 96% rename from scripts/system/simplifiedUI/simplifiedUI.js rename to scripts/simplifiedUI/simplifiedUI.js index 351372613b..a6183c5ab9 100644 --- a/scripts/system/simplifiedUI/simplifiedUI.js +++ b/scripts/simplifiedUI/simplifiedUI.js @@ -5,7 +5,7 @@ // simplifiedUI.js // // Authors: Wayne Chen & Zach Fox -// Created on: 5/1/2019 +// Created: 2019-05-01 // Copyright 2019 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. @@ -103,6 +103,8 @@ var AVATAR_APP_PRESENTATION_MODE = Desktop.PresentationMode.NATIVE; var AVATAR_APP_WIDTH_PX = 480; var AVATAR_APP_HEIGHT_PX = 615; var avatarAppWindow = false; +var POPOUT_SAFE_MARGIN_X = 30; +var POPOUT_SAFE_MARGIN_Y = 30; function toggleAvatarApp() { if (avatarAppWindow) { avatarAppWindow.close(); @@ -119,6 +121,10 @@ function toggleAvatarApp() { size: { x: AVATAR_APP_WIDTH_PX, y: AVATAR_APP_HEIGHT_PX + }, + position: { + x: Math.max(Window.x + POPOUT_SAFE_MARGIN_X, Window.x + Window.innerWidth / 2 - AVATAR_APP_WIDTH_PX / 2), + y: Math.max(Window.y + POPOUT_SAFE_MARGIN_Y, Window.y + Window.innerHeight / 2 - AVATAR_APP_HEIGHT_PX / 2) } }); @@ -181,6 +187,10 @@ function toggleSettingsApp() { size: { x: SETTINGS_APP_WIDTH_PX, y: SETTINGS_APP_HEIGHT_PX + }, + position: { + x: Math.max(Window.x + POPOUT_SAFE_MARGIN_X, Window.x + Window.innerWidth / 2 - SETTINGS_APP_WIDTH_PX / 2), + y: Math.max(Window.y + POPOUT_SAFE_MARGIN_Y, Window.y + Window.innerHeight / 2 - SETTINGS_APP_HEIGHT_PX / 2) } });