mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-05 04:10:23 +02:00
Snapshot notification sound settings
This commit is contained in:
parent
14dfafa815
commit
9e5dbf9a99
3 changed files with 11 additions and 9 deletions
|
@ -3601,13 +3601,14 @@ void Application::keyPressEvent(QKeyEvent* event) {
|
|||
AudioInjectorOptions options;
|
||||
options.localOnly = true;
|
||||
options.stereo = true;
|
||||
|
||||
if (_snapshotSoundInjector) {
|
||||
_snapshotSoundInjector->setOptions(options);
|
||||
_snapshotSoundInjector->restart();
|
||||
} else {
|
||||
QByteArray samples = _snapshotSound->getByteArray();
|
||||
_snapshotSoundInjector = AudioInjector::playSound(samples, options);
|
||||
if (SettingsScriptingInterface::getInstance()->getValue(MenuOption::NotificationSoundsSnapshot).toBool()) {
|
||||
if (_snapshotSoundInjector) {
|
||||
_snapshotSoundInjector->setOptions(options);
|
||||
_snapshotSoundInjector->restart();
|
||||
} else {
|
||||
QByteArray samples = _snapshotSound->getByteArray();
|
||||
_snapshotSoundInjector = AudioInjector::playSound(samples, options);
|
||||
}
|
||||
}
|
||||
takeSnapshot(true);
|
||||
break;
|
||||
|
|
|
@ -282,9 +282,9 @@ Menu::Menu() {
|
|||
|
||||
// Settings > Notifications > Snapshot
|
||||
action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Snapshot", 0,
|
||||
settings->getValue("play_notification_sounds_type_0").toBool());
|
||||
settings->getValue(MenuOption::NotificationSoundsSnapshot).toBool());
|
||||
connect(action, &QAction::triggered, [action, settings] {
|
||||
settings->setValue("play_notification_sounds_type_0", action->isChecked());
|
||||
settings->setValue(MenuOption::NotificationSoundsSnapshot, action->isChecked());
|
||||
});
|
||||
// Settings > Notifications > Level of Detail
|
||||
action = addCheckableActionToQMenuAndActionHash(notificationsMenu, "Level of Detail", 0,
|
||||
|
|
|
@ -212,6 +212,7 @@ namespace MenuOption {
|
|||
const QString HMDTabletToToolbar = "HMD Tablet Becomes Toolbar";
|
||||
const QString Shadows = "Shadows";
|
||||
const QString AmbientOcclusion = "Ambient Occlusion";
|
||||
const QString NotificationSoundsSnapshot = "play_notification_sounds_snapshot";
|
||||
}
|
||||
|
||||
#endif // hifi_Menu_h
|
||||
|
|
Loading…
Reference in a new issue