PebbleOS
Loading...
Searching...
No Matches
Enumerations | Functions
Alert preferences

Persistent user preferences for alerts, Do Not Disturb and the speaker. More...

Enumerations

enum  FirstUseSource { FirstUseSourceManualDNDActionMenu = 0 , FirstUseSourceManualDNDSettingsMenu , FirstUseSourceSmartDND , FirstUseSourceDismiss }
 "First use" dialogs whose completion is remembered. More...
 
enum  MuteBitfield { MuteBitfield_None = 0b00000000 , MuteBitfield_Always = 0b01111111 , MuteBitfield_Weekdays = 0b00111110 , MuteBitfield_Weekends = 0b01000001 }
 Days of the week on which an app is muted. More...
 
enum  DndNotificationMode { DndNotificationModeHide = 0 , DndNotificationModeShow = 1 }
 Whether notifications are displayed while Do Not Disturb is active. More...
 

Functions

void alerts_preferences_dnd_set_show_notifications (DndNotificationMode mode)
 Set whether notifications are displayed while DND is active.
 
DndNotificationMode alerts_preferences_dnd_get_show_notifications (void)
 Get whether notifications are displayed while DND is active.
 
void alerts_preferences_dnd_set_motion_backlight (bool enable)
 Set whether motion turns on the backlight while DND is active.
 
bool alerts_preferences_dnd_get_motion_backlight (void)
 Get whether motion turns on the backlight while DND is active.
 
void alerts_preferences_dnd_set_touch_backlight (bool enable)
 Set whether tap and double tap gestures turn on the backlight while DND is active.
 
bool alerts_preferences_dnd_get_touch_backlight (void)
 Get whether tap and double tap gestures turn on the backlight while DND is active.
 
void alerts_preferences_dnd_set_mute_speaker (bool enable)
 Set whether the speaker is muted while DND is active.
 
bool alerts_preferences_dnd_get_mute_speaker (void)
 Get whether the speaker is muted while DND is active.
 
void alerts_preferences_dnd_set_auto_dismiss (bool enable)
 Set whether notifications auto-dismiss while DND is active.
 
bool alerts_preferences_dnd_get_auto_dismiss (void)
 Get whether notifications auto-dismiss while DND is active.
 
void alerts_preferences_set_speaker_muted (bool muted)
 Set the always-on speaker mute, which silences the speaker regardless of DND.
 
bool alerts_preferences_get_speaker_muted (void)
 Get the always-on speaker mute.
 
void alerts_preferences_set_speaker_volume (uint8_t volume)
 Set the system-wide speaker volume cap.
 
uint8_t alerts_preferences_get_speaker_volume (void)
 Get the system-wide speaker volume cap.
 
bool alerts_preferences_check_and_set_first_use_complete (FirstUseSource source)
 Check whether a "first use" dialog has been shown, and mark it as shown.
 

Detailed Description

Persistent user preferences for alerts, Do Not Disturb and the speaker.

Preferences live in the notifpref settings file. Setters update the cached value and write it through to the file.

Enumeration Type Documentation

◆ DndNotificationMode

Whether notifications are displayed while Do Not Disturb is active.

Enumerator
DndNotificationModeHide 

Notifications are not shown.

DndNotificationModeShow 

Notifications are shown (default).

◆ FirstUseSource

"First use" dialogs whose completion is remembered.

Enumerator
FirstUseSourceManualDNDActionMenu 

Manual DND toggled from a notification action menu.

FirstUseSourceManualDNDSettingsMenu 

Manual DND toggled from the settings menu.

FirstUseSourceSmartDND 

Calendar-aware (smart) DND enabled.

FirstUseSourceDismiss 

Dismiss action used.

◆ MuteBitfield

Days of the week on which an app is muted.

Bit n is set to mute on tm_wday n (bit 0 is Sunday, bit 6 Saturday).

Enumerator
MuteBitfield_None 

Never muted.

MuteBitfield_Always 

Muted every day.

MuteBitfield_Weekdays 

Muted Monday to Friday.

MuteBitfield_Weekends 

Muted Saturday and Sunday.

Function Documentation

◆ alerts_preferences_check_and_set_first_use_complete()

bool alerts_preferences_check_and_set_first_use_complete ( FirstUseSource  source)

Check whether a "first use" dialog has been shown, and mark it as shown.

Parameters
sourceDialog to check.
Returns
true if the dialog had already been shown, false if this is the first time.

◆ alerts_preferences_dnd_get_auto_dismiss()

bool alerts_preferences_dnd_get_auto_dismiss ( void  )

Get whether notifications auto-dismiss while DND is active.

Returns
true if auto-dismiss is allowed during DND.

◆ alerts_preferences_dnd_get_motion_backlight()

bool alerts_preferences_dnd_get_motion_backlight ( void  )

Get whether motion turns on the backlight while DND is active.

Returns
true if the motion backlight is allowed.

◆ alerts_preferences_dnd_get_mute_speaker()

bool alerts_preferences_dnd_get_mute_speaker ( void  )

Get whether the speaker is muted while DND is active.

Returns
true if the speaker is muted during DND.

◆ alerts_preferences_dnd_get_show_notifications()

DndNotificationMode alerts_preferences_dnd_get_show_notifications ( void  )

Get whether notifications are displayed while DND is active.

Returns
Display mode.

◆ alerts_preferences_dnd_get_touch_backlight()

bool alerts_preferences_dnd_get_touch_backlight ( void  )

Get whether tap and double tap gestures turn on the backlight while DND is active.

Returns
true if the touch backlight is allowed.

◆ alerts_preferences_dnd_set_auto_dismiss()

void alerts_preferences_dnd_set_auto_dismiss ( bool  enable)

Set whether notifications auto-dismiss while DND is active.

Parameters
enabletrue to allow auto-dismiss during DND, false to keep notifications on screen (default).

◆ alerts_preferences_dnd_set_motion_backlight()

void alerts_preferences_dnd_set_motion_backlight ( bool  enable)

Set whether motion turns on the backlight while DND is active.

Parameters
enabletrue to allow the motion backlight (default), false to suppress it.

◆ alerts_preferences_dnd_set_mute_speaker()

void alerts_preferences_dnd_set_mute_speaker ( bool  enable)

Set whether the speaker is muted while DND is active.

Parameters
enabletrue to mute the speaker during DND, false to allow audio (default).

◆ alerts_preferences_dnd_set_show_notifications()

void alerts_preferences_dnd_set_show_notifications ( DndNotificationMode  mode)

Set whether notifications are displayed while DND is active.

Parameters
modeDisplay mode.

◆ alerts_preferences_dnd_set_touch_backlight()

void alerts_preferences_dnd_set_touch_backlight ( bool  enable)

Set whether tap and double tap gestures turn on the backlight while DND is active.

Parameters
enabletrue to allow the touch backlight (default), false to suppress it.

◆ alerts_preferences_get_speaker_muted()

bool alerts_preferences_get_speaker_muted ( void  )

Get the always-on speaker mute.

Returns
true if the speaker is muted.

◆ alerts_preferences_get_speaker_volume()

uint8_t alerts_preferences_get_speaker_volume ( void  )

Get the system-wide speaker volume cap.

Returns
Volume cap, 0 to 100. Defaults to 100.

◆ alerts_preferences_set_speaker_muted()

void alerts_preferences_set_speaker_muted ( bool  muted)

Set the always-on speaker mute, which silences the speaker regardless of DND.

Parameters
mutedtrue to mute the speaker, false to allow audio (default).

◆ alerts_preferences_set_speaker_volume()

void alerts_preferences_set_speaker_volume ( uint8_t  volume)

Set the system-wide speaker volume cap.

Per-playback volumes are scaled by this value before being applied to the audio hardware.

Parameters
volumeVolume cap, 0 to 100. Larger values are clamped to 100.