Home2L - C/C++ API v1.4-0-g38cc (2024-05-25)
Smart Tools for a Private Home
Alarm Clock

Description

Interacting with the integrated alarm clock.

Collaboration diagram for Alarm Clock:

Alarm clock state ...

enum  TAlarmClockState {
  acsDisabled = 0 , acsStandby , acsSnooze , acsAlarmPreRinging ,
  acsAlarmMusicTrying , acsAlarmMusicOk , acsAlarmRinging
}
 
static bool AlarmClockStateIsAlarm (TAlarmClockState state)
 
TAlarmClockState AlarmClockGetState ()
 Get the current alarm clock state.
 

Init/done ...

void AlarmClockInit ()
 Initialize the alarm clock.
 
void AlarmClockDone ()
 Shutdown the alarm clock.
 

Direct actions ...

void AlarmClockEnableDisable (bool enable)
 Enable/disable alarm clock as a whole.
 
void AlarmClockOff ()
 "Off" button of the alarm clock => go to standby state.
 
void AlarmClockSnooze ()
 "Snooze" button of the alarm clock.
 

High-level actions / UI integration ...

void AlarmClockSetButton (class CButton *btn)
 Define a main button. Its surface is set to indicate the alarm state. More...
 
void AlarmClockHandlePushed (bool enableOff, bool longPush)
 Handle a push on (one of) the alarm clock button(s) in the interface. More...
 

Setup dialog ...

void AlarmClockRunSetDialog ()
 Run the setup screen to edit alarm times.
 

Enumeration Type Documentation

◆ TAlarmClockState

Enumerator
acsDisabled 

completely off

acsStandby 

in standby state (wakeup time may be set, but is in the future)

acsSnooze 

in snooze state

acsAlarmPreRinging 

ringing internally initially, before starting the music player

acsAlarmMusicTrying 

alarm with music player on (hopefully soon [again])

acsAlarmMusicOk 

alarm with music player on (for sure)

acsAlarmRinging 

alarm with internal bell (music player failed)

Definition at line 41 of file alarmclock.H.

Function Documentation

◆ AlarmClockSetButton()

void AlarmClockSetButton ( class CButton btn)

Define a main button. Its surface is set to indicate the alarm state.

When pushed in a non-alarm state, the setup dialog is run. When pushed during an alarm, the alarm is snoozed on a short pushed and switched off on a long push. The push behaviour is identical to calling 'AlarmClockHandlePushed' with 'enableOff = true'.

◆ AlarmClockHandlePushed()

void AlarmClockHandlePushed ( bool  enableOff,
bool  longPush 
)

Handle a push on (one of) the alarm clock button(s) in the interface.

In off/standby state, a push opens the setup dialog. If allowed ('enableOff == true'), a long push switches off alarm during alarm. Any other push during alarm will put the alarm into snooze mode.