From a4e53b16ee65f83185031823b8a41f9ec9fd1236 Mon Sep 17 00:00:00 2001 From: dorian Date: Sun, 13 Oct 2019 16:46:49 +0200 Subject: [PATCH] - changed sound engine to MediaPlayer --- android-sources/AndroidManifest.xml | 2 +- qml/main.qml | 24 +++++++++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/android-sources/AndroidManifest.xml b/android-sources/AndroidManifest.xml index 0413764..d4da551 100644 --- a/android-sources/AndroidManifest.xml +++ b/android-sources/AndroidManifest.xml @@ -1,5 +1,5 @@ - + diff --git a/qml/main.qml b/qml/main.qml index 7856f4d..4be7fb2 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -19,7 +19,7 @@ import QtQuick 2.9 import QtQuick.Window 2.2 import QtQuick.Controls 2.4 -import QtMultimedia 5.0 +import QtMultimedia 5.4 import QtGraphicalEffects 1.0 import QtQuick.Controls.Styles 1.4 @@ -58,29 +58,32 @@ Window { Item { id: soundsItm - SoundEffect { + MediaPlayer { id: readySe + property bool playing: readySe.status === 6 + source: "qrc:/sounds/ready_1.wav" muted: app.state === "WAITING" - onPlayingChanged: { - if(!playing && app.state === "RUNNING"){ + onStopped: { + if(app.state === "RUNNING"){ startSe.play() } } } - SoundEffect { + MediaPlayer { id: startSe + property bool playing: startSe.status === 6 + source: "qrc:/sounds/IFSC_STARTSIGNAL_SINE.wav" muted: app.state === "WAITING" - onPlayingChanged: { - if(!playing){ + onStopped: { app.startTime = new Date().getTime() console.log("offset: ", new Date().getTime() - app.startTime) @@ -89,11 +92,14 @@ Window { app.state = "STOPPED" } } - } + } - SoundEffect { + MediaPlayer { id: failedSe + + property bool playing: failedSe.status === 6 + source: "qrc:/sounds/IFSC frequenzy conform false start sound.wav" }