Convert m_isOverlayMethodActive to new settings API
This commit is contained in:
@@ -224,8 +224,7 @@ void VideoTabController::reloadVideoConfig()
|
|||||||
settings->beginGroup( getSettingsName() );
|
settings->beginGroup( getSettingsName() );
|
||||||
setBrightnessEnabled( brightnessEnabled(), true );
|
setBrightnessEnabled( brightnessEnabled(), true );
|
||||||
setColorOverlayEnabled( colorOverlayEnabled(), true );
|
setColorOverlayEnabled( colorOverlayEnabled(), true );
|
||||||
setIsOverlayMethodActive(
|
setIsOverlayMethodActive( isOverlayMethodActive(), true );
|
||||||
settings->value( "isOverlayMethodActive", false ).toBool(), true );
|
|
||||||
setColorRed( colorRed() );
|
setColorRed( colorRed() );
|
||||||
setColorGreen( colorGreen() );
|
setColorGreen( colorGreen() );
|
||||||
setColorBlue( colorBlue() );
|
setColorBlue( colorBlue() );
|
||||||
@@ -236,16 +235,6 @@ void VideoTabController::reloadVideoConfig()
|
|||||||
settings->sync();
|
settings->sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoTabController::saveVideoConfig()
|
|
||||||
{
|
|
||||||
auto settings = OverlayController::appSettings();
|
|
||||||
settings->beginGroup( getSettingsName() );
|
|
||||||
settings->setValue( "isOverlayMethodActive", isOverlayMethodActive() );
|
|
||||||
|
|
||||||
settings->endGroup();
|
|
||||||
settings->sync();
|
|
||||||
}
|
|
||||||
|
|
||||||
float VideoTabController::brightnessOpacityValue() const
|
float VideoTabController::brightnessOpacityValue() const
|
||||||
{
|
{
|
||||||
return static_cast<float>( settings::getSetting(
|
return static_cast<float>( settings::getSetting(
|
||||||
@@ -328,8 +317,6 @@ void VideoTabController::setBrightnessValue( float percvalue, bool notify )
|
|||||||
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
|
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
|
||||||
overlayError );
|
overlayError );
|
||||||
}
|
}
|
||||||
// only saves if opacity Value is valid. [1-0]
|
|
||||||
saveVideoConfig();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -398,7 +385,8 @@ float VideoTabController::colorBlue() const
|
|||||||
|
|
||||||
bool VideoTabController::isOverlayMethodActive() const
|
bool VideoTabController::isOverlayMethodActive() const
|
||||||
{
|
{
|
||||||
return m_isOverlayMethodActive;
|
return settings::getSetting(
|
||||||
|
settings::BoolSetting::VIDEO_isOverlayMethodActive );
|
||||||
}
|
}
|
||||||
|
|
||||||
// setters
|
// setters
|
||||||
@@ -406,7 +394,9 @@ bool VideoTabController::isOverlayMethodActive() const
|
|||||||
void VideoTabController::setIsOverlayMethodActive( bool value, bool notify )
|
void VideoTabController::setIsOverlayMethodActive( bool value, bool notify )
|
||||||
{
|
{
|
||||||
resetGain();
|
resetGain();
|
||||||
m_isOverlayMethodActive = value;
|
settings::setSetting( settings::BoolSetting::VIDEO_isOverlayMethodActive,
|
||||||
|
value );
|
||||||
|
|
||||||
if ( value )
|
if ( value )
|
||||||
{
|
{
|
||||||
setColorOverlayEnabled( colorOverlayEnabled(), true, false );
|
setColorOverlayEnabled( colorOverlayEnabled(), true, false );
|
||||||
@@ -417,7 +407,6 @@ void VideoTabController::setIsOverlayMethodActive( bool value, bool notify )
|
|||||||
}
|
}
|
||||||
setColor( colorRed(), colorGreen(), colorBlue(), true, true );
|
setColor( colorRed(), colorGreen(), colorBlue(), true, true );
|
||||||
|
|
||||||
saveVideoConfig();
|
|
||||||
if ( notify )
|
if ( notify )
|
||||||
{
|
{
|
||||||
emit isOverlayMethodActiveChanged( value );
|
emit isOverlayMethodActiveChanged( value );
|
||||||
@@ -879,7 +868,7 @@ void VideoTabController::addVideoProfile( const QString name )
|
|||||||
profile->brightnessToggle = brightnessEnabled();
|
profile->brightnessToggle = brightnessEnabled();
|
||||||
profile->brightnessValue = brightnessValue();
|
profile->brightnessValue = brightnessValue();
|
||||||
profile->opacity = colorOverlayOpacity();
|
profile->opacity = colorOverlayOpacity();
|
||||||
profile->overlayMethodState = m_isOverlayMethodActive;
|
profile->overlayMethodState = isOverlayMethodActive();
|
||||||
|
|
||||||
saveVideoProfiles();
|
saveVideoProfiles();
|
||||||
OverlayController::appSettings()->sync();
|
OverlayController::appSettings()->sync();
|
||||||
|
|||||||
@@ -83,7 +83,6 @@ private:
|
|||||||
vr::VROverlayHandle_t m_colorOverlayHandle = vr::k_ulOverlayHandleInvalid;
|
vr::VROverlayHandle_t m_colorOverlayHandle = vr::k_ulOverlayHandleInvalid;
|
||||||
|
|
||||||
bool m_overlayInit = false;
|
bool m_overlayInit = false;
|
||||||
bool m_isOverlayMethodActive = false;
|
|
||||||
|
|
||||||
float m_superSampling = 1.0;
|
float m_superSampling = 1.0;
|
||||||
bool m_allowSupersampleOverride = false;
|
bool m_allowSupersampleOverride = false;
|
||||||
@@ -104,7 +103,6 @@ private:
|
|||||||
void loadColorOverlay();
|
void loadColorOverlay();
|
||||||
|
|
||||||
void reloadVideoConfig();
|
void reloadVideoConfig();
|
||||||
void saveVideoConfig();
|
|
||||||
void setBrightnessOpacityValue();
|
void setBrightnessOpacityValue();
|
||||||
|
|
||||||
void initBrightnessOverlay();
|
void initBrightnessOverlay();
|
||||||
|
|||||||
Reference in New Issue
Block a user