From d4fbdf58775e935d36251a6ce1bc298019b40196 Mon Sep 17 00:00:00 2001 From: Vasily Date: Fri, 11 Jan 2019 18:29:43 +0100 Subject: [PATCH] Prefix additional member variables in OverlayController with m_ --- src/overlaycontroller.cpp | 33 +++++++++++++++++---------------- src/overlaycontroller.h | 10 +++++----- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/overlaycontroller.cpp b/src/overlaycontroller.cpp index ab3c0c2..94e21f9 100644 --- a/src/overlaycontroller.cpp +++ b/src/overlaycontroller.cpp @@ -59,9 +59,9 @@ OverlayController::OverlayController( bool desktopMode, QFileInfo activationSoundFileInfo( activationSoundFile ); if ( activationSoundFileInfo.exists() && activationSoundFileInfo.isFile() ) { - activationSoundEffect.setSource( + m_activationSoundEffect.setSource( QUrl::fromLocalFile( activationSoundFile ) ); - activationSoundEffect.setVolume( 1.0 ); + m_activationSoundEffect.setVolume( 1.0 ); } else { @@ -75,9 +75,9 @@ OverlayController::OverlayController( bool desktopMode, if ( focusChangedSoundFileInfo.exists() && focusChangedSoundFileInfo.isFile() ) { - focusChangedSoundEffect.setSource( + m_focusChangedSoundEffect.setSource( QUrl::fromLocalFile( focusChangedSoundFile ) ); - focusChangedSoundEffect.setVolume( 1.0 ); + m_focusChangedSoundEffect.setVolume( 1.0 ); } else { @@ -90,8 +90,9 @@ OverlayController::OverlayController( bool desktopMode, QFileInfo alarm01SoundFileInfo( alarm01SoundFile ); if ( alarm01SoundFileInfo.exists() && alarm01SoundFileInfo.isFile() ) { - alarm01SoundEffect.setSource( QUrl::fromLocalFile( alarm01SoundFile ) ); - alarm01SoundEffect.setVolume( 1.0 ); + m_alarm01SoundEffect.setSource( + QUrl::fromLocalFile( alarm01SoundFile ) ); + m_alarm01SoundEffect.setVolume( 1.0 ); } else { @@ -675,14 +676,14 @@ void OverlayController::OnTimeoutPumpEvents() case vr::VREvent_DashboardActivated: { LOG( DEBUG ) << "Dashboard activated"; - dashboardVisible = true; + m_dashboardVisible = true; } break; case vr::VREvent_DashboardDeactivated: { LOG( DEBUG ) << "Dashboard deactivated"; - dashboardVisible = false; + m_dashboardVisible = false; } break; @@ -1052,7 +1053,7 @@ void OverlayController::playActivationSound() { if ( !m_noSound ) { - activationSoundEffect.play(); + m_activationSoundEffect.play(); } } @@ -1060,34 +1061,34 @@ void OverlayController::playFocusChangedSound() { if ( !m_noSound ) { - focusChangedSoundEffect.play(); + m_focusChangedSoundEffect.play(); } } void OverlayController::playAlarm01Sound( bool loop ) { - if ( !m_noSound && !alarm01SoundEffect.isPlaying() ) + if ( !m_noSound && !m_alarm01SoundEffect.isPlaying() ) { if ( loop ) { - alarm01SoundEffect.setLoopCount( QSoundEffect::Infinite ); + m_alarm01SoundEffect.setLoopCount( QSoundEffect::Infinite ); } else { - alarm01SoundEffect.setLoopCount( 1 ); + m_alarm01SoundEffect.setLoopCount( 1 ); } - alarm01SoundEffect.play(); + m_alarm01SoundEffect.play(); } } void OverlayController::setAlarm01SoundVolume( float vol ) { - alarm01SoundEffect.setVolume( vol ); + m_alarm01SoundEffect.setVolume( vol ); } void OverlayController::cancelAlarm01Sound() { - alarm01SoundEffect.stop(); + m_alarm01SoundEffect.stop(); } } // namespace advsettings diff --git a/src/overlaycontroller.h b/src/overlaycontroller.h index 1a9c7e4..c2649d0 100644 --- a/src/overlaycontroller.h +++ b/src/overlaycontroller.h @@ -64,7 +64,7 @@ private: std::unique_ptr m_pPumpEventsTimer; std::unique_ptr m_pRenderTimer; - bool dashboardVisible = false; + bool m_dashboardVisible = false; QPoint m_ptLastMouse; Qt::MouseButtons m_lastMouseButtons = 0; @@ -76,9 +76,9 @@ private: utils::ChaperoneUtils m_chaperoneUtils; - QSoundEffect activationSoundEffect; - QSoundEffect focusChangedSoundEffect; - QSoundEffect alarm01SoundEffect; + QSoundEffect m_activationSoundEffect; + QSoundEffect m_focusChangedSoundEffect; + QSoundEffect m_alarm01SoundEffect; public: // I know it's an ugly hack to make them public to enable external // access, but I am too lazy to implement getters. @@ -104,7 +104,7 @@ public: bool isDashboardVisible() { - return dashboardVisible; + return m_dashboardVisible; } void SetWidget( QQuickItem* quickItem,