Commit 60bb3c1a authored by Bruno Coudoin's avatar Bruno Coudoin
Browse files

core audio: removed autoplay property in our Audio item

This property is useless in our case and it create a bug on Android
with Qt5.4 only the first audio is played.
parent 9b90ccdb
......@@ -30,7 +30,6 @@ Item {
property alias errorString: audio.errorString
property var playbackState: (audio.error == Audio.NoError) ?
audio.playbackState : Audio.StoppedState;
property bool autoPlay
property var files: []
signal error
......@@ -53,6 +52,9 @@ Item {
}
function append(file) {
if(muted)
return
if(audio.playbackState !== Audio.PlayingState
|| audio.status === Audio.EndOfMedia
|| audio.status === Audio.NoMedia
......@@ -60,7 +62,7 @@ Item {
// Setting the source to "" on Linux fix a case where the sound is no more played
source = ""
source = file
play()
audio.play()
} else {
files.push(file)
}
......@@ -79,19 +81,19 @@ Item {
function _playNextFile() {
var nextFile = files.shift()
if(nextFile) {
if(!nextFile || 0 === nextFile.length) {
audio.source = ""
audio.source = nextFile
audio.play()
gcaudio.done()
} else {
audio.source = ""
gcaudio.done()
audio.source = nextFile
if(!muted)
audio.play()
}
}
Audio {
id: audio
autoPlay: gcaudio.autoPlay && !gcaudio.muted
onError: {
// This file cannot be played, remove it from the source asap
source = ""
......
......@@ -39,7 +39,6 @@ Window {
GCAudio {
id: audioVoices
muted: !ApplicationSettings.isAudioVoicesEnabled
autoPlay: true
Component.onCompleted: {
append("qrc:/gcompris/src/core/resource/intro.ogg")
......@@ -50,7 +49,6 @@ Window {
GCAudio {
id: audioEffects
muted: !ApplicationSettings.isAudioEffectsEnabled
autoPlay: false
}
function playIntroVoice(name) {
......
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