History

adding experimental login state sound

Wayne Chen committed 7 years ago

Commit bf285b31 parent 51f59421 file · +19 −9Browse files

Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all

Unified · Split

interface/src/Application.cpp+19−9
@@ -1317,6 +1317,16 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 1316 unmodified lines
13171317 connect(this, &Application::activeDisplayPluginChanged, this, [&](){
13181318 auto dialogsManager = DependencyManager::get<DialogsManager>();
13191319 auto keyboard = DependencyManager::get<Keyboard>();
1320+ if (_loginStateSoundInjector != nullptr) {
1321+ AudioInjectorOptions options;
1322+ options.localOnly = true;
1323+ options.position = getMyAvatar()->getHeadPosition();
1324+ options.loop = true;
1325+ options.volume = 0.4f;
1326+ options.stereo = true;
1327+ _loginStateSoundInjector->setOptions(options);
1328+ _loginStateSoundInjector->restart();
1329+ }
13201330 if (getLoginDialogPoppedUp()) {
13211331 if (_firstRun.get()) {
13221332 // display mode changed. Don't allow auto-switch to work after this session.
@@ -2967,15 +2977,15 @@ void Application::showLoginScreen() { · 1644 unmodified lines
29672977 loginData["action"] = "login dialog shown";
29682978 UserActivityLogger::getInstance().logAction("encourageLoginDialog", loginData);
29692979 _window->setWindowTitle("High Fidelity Interface");
2970− if (!_loginStateSoundInjector) {
2971− AudioInjectorOptions options;
2972− options.localOnly = true;
2973− options.position = getMyAvatar()->getHeadPosition();
2974− options.loop = true;
2975− options.volume = 0.4f;
2976− options.stereo = true;
2977− _loginStateSoundInjector = AudioInjector::playSound(_loginStateSound, options);
2978− }
2980+ //if (!_loginStateSoundInjector) {
2981+ // AudioInjectorOptions options;
2982+ // options.localOnly = true;
2983+ // options.position = getMyAvatar()->getHeadPosition();
2984+ // options.loop = true;
2985+ // options.volume = 0.4f;
2986+ // options.stereo = true;
2987+ // _loginStateSoundInjector = AudioInjector::playSound(_loginStateSound, options);
2988+ //}
29792989 } else {
29802990 resumeAfterLoginDialogActionTaken();
29812991 }