Refactor alarm system and replace notification method

The old OpenVR overlays did not function for unknown reasons, and it was
not possible to get them to work.

With this a white overlay with ALARM ACTIVATED will be shown for 3 seconds.
It's not pretty, but it effectively communicates that an alarm has been
activated.

This fixes
https://github.com/OpenVR-Advanced-Settings/OpenVR-AdvancedSettings/issues/417
This commit is contained in:
Vasily
2020-06-05 20:52:13 +02:00
committed by username223
parent 8c2af7477c
commit 4757756d32
16 changed files with 531 additions and 457 deletions
+9 -1
View File
@@ -46,7 +46,7 @@ OverlayController::OverlayController( bool desktopMode,
: QObject(), m_desktopMode( desktopMode ), m_noSound( noSound ),
m_verifiedCustomTickRateMs( verifyCustomTickRate( settings::getSetting(
settings::IntSetting::APPLICATION_customTickRateMs ) ) ),
m_actions()
m_actions(), m_alarm()
{
// Arbitrarily chosen Max Length of Directory path, should be sufficient for
// Any set-up
@@ -292,6 +292,12 @@ OverlayController::OverlayController( bool desktopMode,
QQmlEngine::setObjectOwnership( obj, QQmlEngine::CppOwnership );
return obj;
} );
qmlRegisterSingletonType<alarm_clock::VrAlarm>(
qmlSingletonImportName, 1, 0, "VrAlarm", []( QQmlEngine*, QJSEngine* ) {
QObject* obj = &( objectAddress->m_alarm );
QQmlEngine::setObjectOwnership( obj, QQmlEngine::CppOwnership );
return obj;
} );
// Grab local version number
QStringList verNumericalString
@@ -1185,6 +1191,8 @@ void OverlayController::mainEventLoop()
m_audioTabController.eventLoopTick();
m_rotationTabController.eventLoopTick( devicePoses );
m_alarm.eventLoopTick();
if ( vr::VROverlay()->IsDashboardVisible() )
{
m_settingsTabController.dashboardLoopTick();