'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim Timer1, ShakeHands, Timedelay, KampfZeit, PausenZeit As Timer
Dim LoadId0, PlayId0, LoadId2, PlayId2, LoadId3, PlayId3 As Int
Dim LoadId4, PlayId4, LoadId5, PlayId5, LoadId1, PlayId1 As Int
Dim LoadId7, PlayId7, LoadId8, PlayId8, LoadId6, PlayId6 As Int
Dim SP As SoundPool
End Sub
Sub Globals
Dim lblUeberschrift, lblCounter As Label
Dim btnBeenden As Button
Dim Zeit, Runden1, Counter, CounterSec, CounterMin As Int
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
SP.Initialize(6)
LoadId0 = SP.Load(File.DirAssets, "ShakeHands1.mp3")
LoadId1 = SP.Load(File.DirAssets, "Fight1.mp3")
LoadId2 = SP.Load(File.DirAssets, "Break1.mp3")
LoadId3 = SP.Load(File.DirAssets, "Glocke1.wav")
LoadId4 = SP.Load(File.DirAssets, "Glocke3.mp3")
LoadId5 = SP.Load(File.DirAssets, "Glocke7.wav")
LoadId6 = SP.Load(File.DirAssets, "Stop1.mp3")
End If
Activity.LoadLayout("Wettkampf")
If EinstellungenWettkampf.Timedelay < 5001 Then EinstellungenWettkampf.Timedelay = 6000
Zeit = EinstellungenWettkampf.Timedelay
Runden1 = EinstellungenWettkampf.Runden
Timer1.Initialize("Timer1", 1000 )' 1 sec
Timedelay.Initialize("Timedelay", EinstellungenWettkampf.Timedelay - 5000 ) '5000 = die abgezogene Shakehandzeit
KampfZeit.Initialize("Kampfzeit", EinstellungenWettkampf.Kampfzeit )
PausenZeit.Initialize("Pausenzeit", EinstellungenWettkampf.Pause )
ShakeHands.Initialize("ShakeHands", 5000)
End Sub
Sub Timer1_Tick
If CounterSec = 59 Then
'Timer1.Enabled= False
CounterSec = -1
CounterMin = CounterMin + 1
End If
CounterSec = CounterSec + 1
lblCounter.Text = CounterMin & ":"& CounterSec
End Sub
Sub Timedelay_Tick
ToastMessageShow("TimeDelay",False)
PlayId0 = SP.Play(LoadId0, 1, 1, 1, 0, 1) 'shake hands
Timedelay.Enabled = False
ShakeHands.Enabled = True
lblUeberschrift.Text = "Shake Hands"
End Sub
Sub ShakeHands_Tick
ToastMessageShow("Shakehands" & Runden1,False)
PlayId3 = SP.Play(LoadId3, 1, 1, 1, 0, 1) ' Glocke1
PlayId1 = SP.Play(LoadId1, 1, 1, 1, 0, 1) ' fight
ShakeHands.Enabled = False
KampfZeit.Enabled = True
CounterSec = 0
CounterMin = 0
lblUeberschrift.Text = "Noch " & Runden1 & " Runden"
End Sub
Sub Kampfzeit_Tick
PlayId6 = SP.Play(LoadId6, 1, 1, 1, 0, 1) ' Stop
PlayId4 = SP.Play(LoadId4, 1, 1, 1, 0, 1) ' Glocke3
CounterSec = 0
CounterMin = 0
If Runden1 > 1 Then
KampfZeit.Enabled = False
PausenZeit.Enabled = True
Runden1 = Runden1 -1
Else
PausenZeit.Enabled = False
KampfZeit.Enabled = False
PlayId5 = SP.Play(LoadId5, 1, 1, 1, 0, 1) ' Glocke7
lblCounter.Text = "Kampfende"
Timer1.Enabled = False
End If
lblUeberschrift.Text = "Pause " & Runden1
End Sub
Sub Pausenzeit_Tick
PlayId3 = SP.Play(LoadId3, 1, 1, 1, 0, 1) ' Glocke1
PlayId1 = SP.Play(LoadId1, 1, 1, 1, 0, 1) ' fight
PausenZeit.Enabled = False
KampfZeit.Enabled = True
CounterSec = 0
CounterMin = 0
lblUeberschrift.Text = "Noch " & Runden1 & " Runden"
End Sub
Sub lblUeberschrift_Click
End Sub
Sub lblCounter_Click
Timedelay.Enabled = True
Timer1.Enabled = True
End Sub
Sub btnBeenden_Click
Timer1.Enabled = False
PausenZeit.Enabled = False
KampfZeit.Enabled = False
ShakeHands.Enabled = False
Timedelay.Enabled = False
Activity.Finish
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
' Timer1.Enabled = False
' KampfZeit.Enabled = False
' PausenZeit.Enabled = False
' ShakeHands.Enabled = False
' Timedelay.Enabled = False
End Sub
Sub btnNeustart_Click
ToastMessageShow("NeuStarttaster",False)
CounterSec = 0
CounterMin = 0
Timer1.Enabled = True
End Sub