Commit 32e135c1 authored by Aman Kumar Gupta's avatar Aman Kumar Gupta
Browse files

Unmute audioEffects when playing musical activities

parent 6af2ed48
......@@ -29,6 +29,7 @@ ActivityBase {
onStart: focus = true
onStop: {}
isMusicalActivity: true
pageComponent: Image {
id: background
......
......@@ -122,6 +122,14 @@ Item {
*/
property Loading loading
/**
* type: bool
* This variable stores if the activity is a musical activity.
*
* If it is a musical activity and the audioEffects is disabled, we temporarily unmute the GCSfx audioEffects for that activity and mute again on exiting it in main.qml.
*/
property bool isMusicalActivity: false
/**
* Emitted when the user wants to return to the Home/Menu screen.
*/
......
......@@ -53,6 +53,7 @@ Window {
/// @cond INTERNAL_DOCS
property var applicationState: Qt.application.state
property bool isMusicalActivityRunning: false
onApplicationStateChanged: {
if (ApplicationInfo.isMobile && applicationState != Qt.ApplicationActive) {
......@@ -99,7 +100,7 @@ Window {
GCSfx {
id: audioEffects
muted: !ApplicationSettings.isAudioEffectsEnabled
muted: !ApplicationSettings.isAudioEffectsEnabled && !main.isMusicalActivityRunning
}
function playIntroVoice(name) {
......@@ -244,12 +245,15 @@ Window {
if(properties.enterItem.isDialog) {
return pushVTransition
} else {
if(properties.enterItem.isMusicalActivity)
main.isMusicalActivityRunning = true
return pushHTransition
}
} else {
if(properties.exitItem.isDialog) {
return popVTransition
} else {
main.isMusicalActivityRunning = false
return popHTransition
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment