mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 00:17:25 +02:00
adding sound to login screen
This commit is contained in:
parent
d12655ed7b
commit
51f5942a7f
4 changed files with 30 additions and 4 deletions
|
@ -1033,8 +1033,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
_maxOctreePPS(maxOctreePacketsPerSecond.get()),
|
_maxOctreePPS(maxOctreePacketsPerSecond.get()),
|
||||||
_lastFaceTrackerUpdate(0),
|
_lastFaceTrackerUpdate(0),
|
||||||
_snapshotSound(nullptr),
|
_snapshotSound(nullptr),
|
||||||
_sampleSound(nullptr)
|
_sampleSound(nullptr),
|
||||||
|
_loginStateSound(nullptr)
|
||||||
{
|
{
|
||||||
|
|
||||||
auto steamClient = PluginManager::getInstance()->getSteamClientPlugin();
|
auto steamClient = PluginManager::getInstance()->getSteamClientPlugin();
|
||||||
|
@ -2286,6 +2286,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
});
|
});
|
||||||
|
|
||||||
_snapshotSound = DependencyManager::get<SoundCache>()->getSound(PathUtils::resourcesUrl("sounds/snapshot/snap.wav"));
|
_snapshotSound = DependencyManager::get<SoundCache>()->getSound(PathUtils::resourcesUrl("sounds/snapshot/snap.wav"));
|
||||||
|
_loginStateSound = DependencyManager::get<SoundCache>()->getSound(PathUtils::resourcesUrl("sounds/crystals_and_voices.mp3"));
|
||||||
|
|
||||||
// Monitor model assets (e.g., from Clara.io) added to the world that may need resizing.
|
// Monitor model assets (e.g., from Clara.io) added to the world that may need resizing.
|
||||||
static const int ADD_ASSET_TO_WORLD_TIMER_INTERVAL_MS = 1000;
|
static const int ADD_ASSET_TO_WORLD_TIMER_INTERVAL_MS = 1000;
|
||||||
|
@ -2634,6 +2635,10 @@ void Application::cleanupBeforeQuit() {
|
||||||
_snapshotSoundInjector->stop();
|
_snapshotSoundInjector->stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_loginStateSoundInjector != nullptr) {
|
||||||
|
_loginStateSoundInjector->stop();
|
||||||
|
}
|
||||||
|
|
||||||
// destroy Audio so it and its threads have a chance to go down safely
|
// destroy Audio so it and its threads have a chance to go down safely
|
||||||
// this must happen after QML, as there are unexplained audio crashes originating in qtwebengine
|
// this must happen after QML, as there are unexplained audio crashes originating in qtwebengine
|
||||||
DependencyManager::destroy<AudioClient>();
|
DependencyManager::destroy<AudioClient>();
|
||||||
|
@ -2945,6 +2950,12 @@ static void addDisplayPluginToMenu(const DisplayPluginPointer& displayPlugin, in
|
||||||
void Application::showLoginScreen() {
|
void Application::showLoginScreen() {
|
||||||
auto accountManager = DependencyManager::get<AccountManager>();
|
auto accountManager = DependencyManager::get<AccountManager>();
|
||||||
auto dialogsManager = DependencyManager::get<DialogsManager>();
|
auto dialogsManager = DependencyManager::get<DialogsManager>();
|
||||||
|
if (!_loginStateSound->isReady()) {
|
||||||
|
connect(_loginStateSound.data(), &Sound::ready, this, &Application::showLoginScreen);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
disconnect(_loginStateSound.data(), &Sound::ready, this, &Application::showLoginScreen);
|
||||||
|
}
|
||||||
if (!accountManager->isLoggedIn()) {
|
if (!accountManager->isLoggedIn()) {
|
||||||
if (!isHMDMode()) {
|
if (!isHMDMode()) {
|
||||||
auto toolbar = DependencyManager::get<ToolbarScriptingInterface>()->getToolbar("com.highfidelity.interface.toolbar.system");
|
auto toolbar = DependencyManager::get<ToolbarScriptingInterface>()->getToolbar("com.highfidelity.interface.toolbar.system");
|
||||||
|
@ -2956,6 +2967,15 @@ void Application::showLoginScreen() {
|
||||||
loginData["action"] = "login dialog shown";
|
loginData["action"] = "login dialog shown";
|
||||||
UserActivityLogger::getInstance().logAction("encourageLoginDialog", loginData);
|
UserActivityLogger::getInstance().logAction("encourageLoginDialog", loginData);
|
||||||
_window->setWindowTitle("High Fidelity Interface");
|
_window->setWindowTitle("High Fidelity Interface");
|
||||||
|
if (!_loginStateSoundInjector) {
|
||||||
|
AudioInjectorOptions options;
|
||||||
|
options.localOnly = true;
|
||||||
|
options.position = getMyAvatar()->getHeadPosition();
|
||||||
|
options.loop = true;
|
||||||
|
options.volume = 0.4f;
|
||||||
|
options.stereo = true;
|
||||||
|
_loginStateSoundInjector = AudioInjector::playSound(_loginStateSound, options);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
resumeAfterLoginDialogActionTaken();
|
resumeAfterLoginDialogActionTaken();
|
||||||
}
|
}
|
||||||
|
@ -5298,6 +5318,7 @@ void Application::pauseUntilLoginDetermined() {
|
||||||
|
|
||||||
// disconnect domain handler.
|
// disconnect domain handler.
|
||||||
nodeList->getDomainHandler().disconnect();
|
nodeList->getDomainHandler().disconnect();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::resumeAfterLoginDialogActionTaken() {
|
void Application::resumeAfterLoginDialogActionTaken() {
|
||||||
|
@ -8670,7 +8691,7 @@ void Application::updateLoginDialogOverlayPosition() {
|
||||||
auto newOverlayPositionVec = (cameraPositionVec + offset) + (upVec * -0.1f);
|
auto newOverlayPositionVec = (cameraPositionVec + offset) + (upVec * -0.1f);
|
||||||
auto newOverlayOrientation = glm::inverse(glm::quat_cast(glm::lookAt(newOverlayPositionVec, cameraPositionVec, upVec))) * Quaternions::Y_180;
|
auto newOverlayOrientation = glm::inverse(glm::quat_cast(glm::lookAt(newOverlayPositionVec, cameraPositionVec, upVec))) * Quaternions::Y_180;
|
||||||
|
|
||||||
if (pointAngle > 30.0f) {
|
if (pointAngle > 40.0f) {
|
||||||
QVariantMap properties {
|
QVariantMap properties {
|
||||||
{"position", vec3toVariant(newOverlayPositionVec)},
|
{"position", vec3toVariant(newOverlayPositionVec)},
|
||||||
{"orientation", quatToVariant(newOverlayOrientation)}
|
{"orientation", quatToVariant(newOverlayOrientation)}
|
||||||
|
@ -8695,6 +8716,9 @@ void Application::onDismissedLoginDialog() {
|
||||||
_loginDialogOverlayID = OverlayID();
|
_loginDialogOverlayID = OverlayID();
|
||||||
_loginStateManager.tearDown();
|
_loginStateManager.tearDown();
|
||||||
}
|
}
|
||||||
|
if (_loginStateSoundInjector != nullptr) {
|
||||||
|
_loginStateSoundInjector->stop();
|
||||||
|
}
|
||||||
resumeAfterLoginDialogActionTaken();
|
resumeAfterLoginDialogActionTaken();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -794,6 +794,8 @@ private:
|
||||||
AudioInjectorPointer _snapshotSoundInjector;
|
AudioInjectorPointer _snapshotSoundInjector;
|
||||||
SharedSoundPointer _snapshotSound;
|
SharedSoundPointer _snapshotSound;
|
||||||
SharedSoundPointer _sampleSound;
|
SharedSoundPointer _sampleSound;
|
||||||
|
AudioInjectorPointer _loginStateSoundInjector;
|
||||||
|
SharedSoundPointer _loginStateSound;
|
||||||
|
|
||||||
DisplayPluginPointer _autoSwitchDisplayModeSupportedHMDPlugin;
|
DisplayPluginPointer _autoSwitchDisplayModeSupportedHMDPlugin;
|
||||||
QString _autoSwitchDisplayModeSupportedHMDPluginName;
|
QString _autoSwitchDisplayModeSupportedHMDPluginName;
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
var TEXTURE_EPSILON = 0.01;
|
var TEXTURE_EPSILON = 0.01;
|
||||||
var isVisible = false;
|
var isVisible = false;
|
||||||
var VOLUME = 0.4;
|
var VOLUME = 0.4;
|
||||||
var tune = SoundCache.getSound(Script.resolvePath("/~/system/assets/sounds/crystals_and_voices.mp3"));
|
var tune = SoundCache.getSound(Script.resourcesPath() + "sounds/crystals_and_voices.mp3");
|
||||||
var sample = null;
|
var sample = null;
|
||||||
var MAX_LEFT_MARGIN = 1.9;
|
var MAX_LEFT_MARGIN = 1.9;
|
||||||
var INNER_CIRCLE_WIDTH = 4.7;
|
var INNER_CIRCLE_WIDTH = 4.7;
|
||||||
|
|
Loading…
Reference in a new issue