Code: Select all
#Sound = 0
#Timer = 0
Global flgAlarm = 1, flgSound
Procedure Loading(Type, Filename$, ObjectId)
; Debug Filename$ + " loaded (id = " + ObjectId + ")"
flgSound = 1
EndProcedure
Procedure LoadingError(Type, Filename$)
flgSound = 0
MessageRequester(Filename$ + ": loading error")
EndProcedure
Procedure TimerEvents()
Select EventTimer()
Case #Timer
If flgSound
LoadSound(#Sound, "/strogate/emulated/0/Alarms/1.wav")
PlaySound(#Sound)
EndIf
MessageRequester("alarm")
FreeSound(#Sound)
; GetNextAlarm()
EndSelect
EndProcedure
; GUI
If flgAlarm
InitSound()
EndIf
If flgAlarm
BindEvent(#PB_Event_Timer, @TimerEvents())
BindEvent(#PB_Event_Loading, @Loading())
BindEvent(#PB_Event_LoadingError, @LoadingError())
EndIf