- changed sound engine to MediaPlayer
This commit is contained in:
parent
b6e7abbd54
commit
a4e53b16ee
2 changed files with 16 additions and 10 deletions
|
@ -1,5 +1,5 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<manifest package="com.itsblue.SpeedClimbingReactionTrainer" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto">
|
<manifest package="com.itsblue.SpeedClimbingReactionTrainer" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.1" android:versionCode="3" android:installLocation="auto">
|
||||||
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="SpeedClimbingReactionTrainer" android:icon="@drawable/icon">
|
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="SpeedClimbingReactionTrainer" android:icon="@drawable/icon">
|
||||||
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="SpeedClimbingReactionTrainer" android:screenOrientation="unspecified" android:launchMode="singleTop">
|
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="SpeedClimbingReactionTrainer" android:screenOrientation="unspecified" android:launchMode="singleTop">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|
24
qml/main.qml
24
qml/main.qml
|
@ -19,7 +19,7 @@
|
||||||
import QtQuick 2.9
|
import QtQuick 2.9
|
||||||
import QtQuick.Window 2.2
|
import QtQuick.Window 2.2
|
||||||
import QtQuick.Controls 2.4
|
import QtQuick.Controls 2.4
|
||||||
import QtMultimedia 5.0
|
import QtMultimedia 5.4
|
||||||
import QtGraphicalEffects 1.0
|
import QtGraphicalEffects 1.0
|
||||||
import QtQuick.Controls.Styles 1.4
|
import QtQuick.Controls.Styles 1.4
|
||||||
|
|
||||||
|
@ -58,29 +58,32 @@ Window {
|
||||||
Item {
|
Item {
|
||||||
id: soundsItm
|
id: soundsItm
|
||||||
|
|
||||||
SoundEffect {
|
MediaPlayer {
|
||||||
id: readySe
|
id: readySe
|
||||||
|
|
||||||
|
property bool playing: readySe.status === 6
|
||||||
|
|
||||||
source: "qrc:/sounds/ready_1.wav"
|
source: "qrc:/sounds/ready_1.wav"
|
||||||
|
|
||||||
muted: app.state === "WAITING"
|
muted: app.state === "WAITING"
|
||||||
|
|
||||||
onPlayingChanged: {
|
onStopped: {
|
||||||
if(!playing && app.state === "RUNNING"){
|
if(app.state === "RUNNING"){
|
||||||
startSe.play()
|
startSe.play()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SoundEffect {
|
MediaPlayer {
|
||||||
id: startSe
|
id: startSe
|
||||||
|
|
||||||
|
property bool playing: startSe.status === 6
|
||||||
|
|
||||||
source: "qrc:/sounds/IFSC_STARTSIGNAL_SINE.wav"
|
source: "qrc:/sounds/IFSC_STARTSIGNAL_SINE.wav"
|
||||||
|
|
||||||
muted: app.state === "WAITING"
|
muted: app.state === "WAITING"
|
||||||
|
|
||||||
onPlayingChanged: {
|
onStopped: {
|
||||||
if(!playing){
|
|
||||||
app.startTime = new Date().getTime()
|
app.startTime = new Date().getTime()
|
||||||
console.log("offset: ", new Date().getTime() - app.startTime)
|
console.log("offset: ", new Date().getTime() - app.startTime)
|
||||||
|
|
||||||
|
@ -89,11 +92,14 @@ Window {
|
||||||
app.state = "STOPPED"
|
app.state = "STOPPED"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SoundEffect {
|
MediaPlayer {
|
||||||
id: failedSe
|
id: failedSe
|
||||||
|
|
||||||
|
property bool playing: failedSe.status === 6
|
||||||
|
|
||||||
source: "qrc:/sounds/IFSC frequenzy conform false start sound.wav"
|
source: "qrc:/sounds/IFSC frequenzy conform false start sound.wav"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue