added start sounds
completed start sequence
This commit is contained in:
parent
a1077fb341
commit
ac65bc6ed1
15 changed files with 197 additions and 1 deletions
109
main.qml
109
main.qml
|
@ -74,6 +74,74 @@ Window {
|
|||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: next_actionTimer
|
||||
|
||||
property string action
|
||||
property double started_at
|
||||
|
||||
running: false
|
||||
repeat: false
|
||||
onRunningChanged: {
|
||||
if(!running){
|
||||
started_at = 0
|
||||
if(action == "NONE"){
|
||||
time.text = "0.000 sec"
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if(action === "at_marks"){
|
||||
started_at = new Date().getTime()
|
||||
time.text = "at your\nmarks"
|
||||
}
|
||||
else if(action === "ready"){
|
||||
started_at = new Date().getTime()
|
||||
time.text = "ready"
|
||||
}
|
||||
}
|
||||
|
||||
onTriggered: {
|
||||
if(action === "at_marks"){
|
||||
at_marksSound.play()
|
||||
}
|
||||
else if(action === "ready"){
|
||||
action = "NONE"
|
||||
readySound.play()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
SoundEffect {
|
||||
id: at_marksSound
|
||||
source: "qrc:/sounds/at_marks_1.wav"
|
||||
|
||||
onPlayingChanged: {
|
||||
if(!playing){
|
||||
if(_cppAppSettings.loadSetting("ready_en") === "true"){
|
||||
next_actionTimer.action = "ready"
|
||||
next_actionTimer.interval = _cppAppSettings.loadSetting("ready_delay")
|
||||
next_actionTimer.start()
|
||||
//readySound.play()
|
||||
}
|
||||
else{
|
||||
startSound.play()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SoundEffect {
|
||||
id: readySound
|
||||
source: "qrc:/sounds/ready_1.wav"
|
||||
onPlayingChanged: {
|
||||
if(!playing){
|
||||
startSound.play()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SoundEffect {
|
||||
//start sound
|
||||
id: startSound
|
||||
|
@ -172,6 +240,19 @@ Window {
|
|||
root.state = "IDLE"
|
||||
case "IDLE":
|
||||
root.state = "STARTING"
|
||||
if(_cppAppSettings.loadSetting("at_marks_en") === "true"){
|
||||
next_actionTimer.action = "at_marks"
|
||||
next_actionTimer.interval = _cppAppSettings.loadSetting("at_marks_delay")
|
||||
next_actionTimer.start()
|
||||
return
|
||||
}
|
||||
if(_cppAppSettings.loadSetting("ready_en") === "true"){
|
||||
next_actionTimer.action = "ready"
|
||||
next_actionTimer.interval = _cppAppSettings.loadSetting("ready_delay")
|
||||
next_actionTimer.start()
|
||||
return
|
||||
}
|
||||
|
||||
startSound.play()
|
||||
break
|
||||
case "RUNNING":
|
||||
|
@ -184,7 +265,30 @@ Window {
|
|||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ProgressCircle {
|
||||
id: prog
|
||||
anchors.fill: startButt
|
||||
opacity: next_actionTimer.started_at > 0 ? 1:0
|
||||
lineWidth: 5
|
||||
|
||||
arcBegin: 0
|
||||
arcEnd: 360 * (( next_actionTimer.interval - ( new Date().getTime() - next_actionTimer.started_at ) ) / next_actionTimer.interval)
|
||||
|
||||
colorCircle: "grey"
|
||||
|
||||
animationDuration: 0
|
||||
|
||||
Timer {
|
||||
id: prog_refresh
|
||||
running: parent.opacity === 1
|
||||
interval: 1
|
||||
repeat: true
|
||||
onTriggered: {
|
||||
prog.arcEnd = 360 * (( next_actionTimer.interval - ( new Date().getTime() - next_actionTimer.started_at ) ) / next_actionTimer.interval)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------
|
||||
|
@ -205,7 +309,7 @@ Window {
|
|||
scale: 0
|
||||
width: height
|
||||
|
||||
enabled: startSound.playing
|
||||
enabled: root.state === "STARTING"
|
||||
onPressedChanged: {
|
||||
if(pressed){
|
||||
background.color = "lightgrey"
|
||||
|
@ -216,6 +320,9 @@ Window {
|
|||
}
|
||||
|
||||
onClicked: {
|
||||
next_actionTimer.stop()
|
||||
at_marksSound.stop()
|
||||
readySound.stop()
|
||||
startSound.stop()
|
||||
root.stoppedTime = 0
|
||||
time.text = "false start"
|
||||
|
|
|
@ -9,5 +9,9 @@
|
|||
<file>graphics/icons/menu.png</file>
|
||||
<file>graphics/icons/drawer.png</file>
|
||||
<file>graphics/icons/back.png</file>
|
||||
<file>sounds/ready_1.wav</file>
|
||||
<file>sounds/at_marks_1.wav</file>
|
||||
<file>sounds/ready_2.wav</file>
|
||||
<file>sounds/at_marks_2.wav</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
BIN
sounds/at_marks_1.wav
Normal file
BIN
sounds/at_marks_1.wav
Normal file
Binary file not shown.
BIN
sounds/at_marks_2.wav
Normal file
BIN
sounds/at_marks_2.wav
Normal file
Binary file not shown.
BIN
sounds/ready_1.wav
Normal file
BIN
sounds/ready_1.wav
Normal file
Binary file not shown.
BIN
sounds/ready_2.wav
Normal file
BIN
sounds/ready_2.wav
Normal file
Binary file not shown.
85
sounds/sounds.aup
Normal file
85
sounds/sounds.aup
Normal file
|
@ -0,0 +1,85 @@
|
|||
<?xml version="1.0" standalone="no" ?>
|
||||
<!DOCTYPE project PUBLIC "-//audacityproject-1.3.0//DTD//EN" "http://audacity.sourceforge.net/xml/audacityproject-1.3.0.dtd" >
|
||||
<project xmlns="http://audacity.sourceforge.net/xml/" projname="sounds_data" version="1.3.0" audacityversion="2.2.1" sel0="1.6652188165" sel1="1.6652188165" vpos="384" h="0.0000000000" zoom="165.7439834770" rate="44100.0" snapto="off" selectionformat="hh:mm:ss + milliseconds" frequencyformat="Hz" bandwidthformat="octaves">
|
||||
<tags/>
|
||||
<wavetrack name="Audio Track" channel="0" linked="1" mute="1" solo="0" height="150" minimized="0" isSelected="0" rate="44100" gain="1.0" pan="0.0" colorindex="0">
|
||||
<waveclip offset="0.00000000" colorindex="0">
|
||||
<sequence maxsamples="262144" sampleformat="262159" numsamples="25509">
|
||||
<waveblock start="0">
|
||||
<simpleblockfile filename="e0000996.au" len="25509" min="-1.0" max="0.845978" rms="0.228999"/>
|
||||
</waveblock>
|
||||
</sequence>
|
||||
<envelope numpoints="0"/>
|
||||
</waveclip>
|
||||
</wavetrack>
|
||||
<wavetrack name="Audio Track" channel="1" linked="0" mute="1" solo="0" height="150" minimized="0" isSelected="0" rate="44100" gain="1.0" pan="0.0" colorindex="0">
|
||||
<waveclip offset="0.00000000" colorindex="0">
|
||||
<sequence maxsamples="262144" sampleformat="262159" numsamples="25509">
|
||||
<waveblock start="0">
|
||||
<simpleblockfile filename="e0000290.au" len="25509" min="-1.0" max="0.845978" rms="0.228999"/>
|
||||
</waveblock>
|
||||
</sequence>
|
||||
<envelope numpoints="0"/>
|
||||
</waveclip>
|
||||
</wavetrack>
|
||||
<wavetrack name="Audio Track" channel="0" linked="1" mute="1" solo="0" height="150" minimized="0" isSelected="1" rate="44100" gain="1.0" pan="0.0" colorindex="0">
|
||||
<waveclip offset="0.00000000" colorindex="0">
|
||||
<sequence maxsamples="262144" sampleformat="262159" numsamples="46064">
|
||||
<waveblock start="0">
|
||||
<simpleblockfile filename="e0000714.au" len="46064" min="-0.974762" max="0.999969" rms="0.222203"/>
|
||||
</waveblock>
|
||||
</sequence>
|
||||
<envelope numpoints="0"/>
|
||||
</waveclip>
|
||||
</wavetrack>
|
||||
<wavetrack name="Audio Track" channel="1" linked="0" mute="1" solo="0" height="150" minimized="0" isSelected="1" rate="44100" gain="1.0" pan="0.0" colorindex="0">
|
||||
<waveclip offset="0.00000000" colorindex="0">
|
||||
<sequence maxsamples="262144" sampleformat="262159" numsamples="46064">
|
||||
<waveblock start="0">
|
||||
<simpleblockfile filename="e00009d0.au" len="46064" min="-0.974762" max="0.999969" rms="0.222203"/>
|
||||
</waveblock>
|
||||
</sequence>
|
||||
<envelope numpoints="0"/>
|
||||
</waveclip>
|
||||
</wavetrack>
|
||||
<wavetrack name="Audio Track" channel="0" linked="1" mute="1" solo="0" height="124" minimized="0" isSelected="0" rate="44100" gain="1.0" pan="0.0" colorindex="0">
|
||||
<waveclip offset="0.00000000" colorindex="0">
|
||||
<sequence maxsamples="262144" sampleformat="262159" numsamples="27938">
|
||||
<waveblock start="0">
|
||||
<simpleblockfile filename="e0000457.au" len="27938" min="-0.312408" max="0.22757" rms="0.051882"/>
|
||||
</waveblock>
|
||||
</sequence>
|
||||
<envelope numpoints="0"/>
|
||||
</waveclip>
|
||||
</wavetrack>
|
||||
<wavetrack name="Audio Track" channel="1" linked="0" mute="1" solo="0" height="124" minimized="0" isSelected="0" rate="44100" gain="1.0" pan="0.0" colorindex="0">
|
||||
<waveclip offset="0.00000000" colorindex="0">
|
||||
<sequence maxsamples="262144" sampleformat="262159" numsamples="27938">
|
||||
<waveblock start="0">
|
||||
<simpleblockfile filename="e0000260.au" len="27938" min="-0.312408" max="0.22757" rms="0.051882"/>
|
||||
</waveblock>
|
||||
</sequence>
|
||||
<envelope numpoints="0"/>
|
||||
</waveclip>
|
||||
</wavetrack>
|
||||
<wavetrack name="Audio Track" channel="0" linked="1" mute="0" solo="1" height="150" minimized="0" isSelected="0" rate="44100" gain="1.0" pan="0.0" colorindex="0">
|
||||
<waveclip offset="0.00000000" colorindex="0">
|
||||
<sequence maxsamples="262144" sampleformat="262159" numsamples="48159">
|
||||
<waveblock start="0">
|
||||
<simpleblockfile filename="e0000542.au" len="48159" min="-0.284546" max="0.251984" rms="0.06137"/>
|
||||
</waveblock>
|
||||
</sequence>
|
||||
<envelope numpoints="0"/>
|
||||
</waveclip>
|
||||
</wavetrack>
|
||||
<wavetrack name="Audio Track" channel="1" linked="0" mute="0" solo="1" height="150" minimized="0" isSelected="0" rate="44100" gain="1.0" pan="0.0" colorindex="0">
|
||||
<waveclip offset="0.00000000" colorindex="0">
|
||||
<sequence maxsamples="262144" sampleformat="262159" numsamples="48159">
|
||||
<waveblock start="0">
|
||||
<simpleblockfile filename="e0000ce4.au" len="48159" min="-0.284546" max="0.251984" rms="0.06137"/>
|
||||
</waveblock>
|
||||
</sequence>
|
||||
<envelope numpoints="0"/>
|
||||
</waveclip>
|
||||
</wavetrack>
|
||||
</project>
|
BIN
sounds/sounds_data/e00/d00/e0000260.au
Normal file
BIN
sounds/sounds_data/e00/d00/e0000260.au
Normal file
Binary file not shown.
BIN
sounds/sounds_data/e00/d00/e0000290.au
Normal file
BIN
sounds/sounds_data/e00/d00/e0000290.au
Normal file
Binary file not shown.
BIN
sounds/sounds_data/e00/d00/e0000457.au
Normal file
BIN
sounds/sounds_data/e00/d00/e0000457.au
Normal file
Binary file not shown.
BIN
sounds/sounds_data/e00/d00/e0000542.au
Normal file
BIN
sounds/sounds_data/e00/d00/e0000542.au
Normal file
Binary file not shown.
BIN
sounds/sounds_data/e00/d00/e0000714.au
Normal file
BIN
sounds/sounds_data/e00/d00/e0000714.au
Normal file
Binary file not shown.
BIN
sounds/sounds_data/e00/d00/e0000996.au
Normal file
BIN
sounds/sounds_data/e00/d00/e0000996.au
Normal file
Binary file not shown.
BIN
sounds/sounds_data/e00/d00/e00009d0.au
Normal file
BIN
sounds/sounds_data/e00/d00/e00009d0.au
Normal file
Binary file not shown.
BIN
sounds/sounds_data/e00/d00/e0000ce4.au
Normal file
BIN
sounds/sounds_data/e00/d00/e0000ce4.au
Normal file
Binary file not shown.
Reference in a new issue