diff options
-rw-r--r-- | apps/lang/english.lang | 14 | ||||
-rw-r--r-- | apps/menus/settings_menu.c | 7 | ||||
-rw-r--r-- | apps/root_menu.c | 23 | ||||
-rw-r--r-- | apps/settings.h | 24 | ||||
-rw-r--r-- | apps/settings_list.c | 14 |
5 files changed, 75 insertions, 7 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 5452aba1e2..55838f2b39 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang | |||
@@ -10687,3 +10687,17 @@ | |||
10687 | *: "Previous Screen" | 10687 | *: "Previous Screen" |
10688 | </voice> | 10688 | </voice> |
10689 | </phrase> | 10689 | </phrase> |
10690 | <phrase> | ||
10691 | id: LANG_ALARM_WAKEUP_SCREEN | ||
10692 | desc: in alarm menu setting | ||
10693 | user: | ||
10694 | <source> | ||
10695 | *: "Alarm Wake up Screen" | ||
10696 | </source> | ||
10697 | <dest> | ||
10698 | *: "Alarm Wake up Screen" | ||
10699 | </dest> | ||
10700 | <voice> | ||
10701 | *: "Alarm Wake up Screen" | ||
10702 | </voice> | ||
10703 | </phrase> | ||
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c index 690f9e62e4..b962f1fb52 100644 --- a/apps/menus/settings_menu.c +++ b/apps/menus/settings_menu.c | |||
@@ -211,6 +211,10 @@ MENUITEM_SETTING(poweroff, &global_settings.poweroff, NULL); | |||
211 | #ifdef HAVE_RTC_ALARM | 211 | #ifdef HAVE_RTC_ALARM |
212 | MENUITEM_FUNCTION(alarm_screen_call, ID2P(LANG_ALARM_MOD_ALARM_MENU), | 212 | MENUITEM_FUNCTION(alarm_screen_call, ID2P(LANG_ALARM_MOD_ALARM_MENU), |
213 | (menu_function)alarm_screen, NULL, Icon_NOICON); | 213 | (menu_function)alarm_screen, NULL, Icon_NOICON); |
214 | #if defined(HAVE_RECORDING) || CONFIG_TUNER | ||
215 | MENUITEM_SETTING(alarm_wake_up_screen, | ||
216 | &global_settings.alarm_wake_up_screen, NULL); | ||
217 | #endif | ||
214 | #endif | 218 | #endif |
215 | 219 | ||
216 | /* Limits menu */ | 220 | /* Limits menu */ |
@@ -256,6 +260,9 @@ MAKE_MENU(system_menu, ID2P(LANG_SYSTEM), | |||
256 | &poweroff, | 260 | &poweroff, |
257 | #ifdef HAVE_RTC_ALARM | 261 | #ifdef HAVE_RTC_ALARM |
258 | &alarm_screen_call, | 262 | &alarm_screen_call, |
263 | #if defined(HAVE_RECORDING) || CONFIG_TUNER | ||
264 | &alarm_wake_up_screen, | ||
265 | #endif | ||
259 | #endif | 266 | #endif |
260 | &limits_menu, | 267 | &limits_menu, |
261 | #if CONFIG_CODEC == MAS3507D | 268 | #if CONFIG_CODEC == MAS3507D |
diff --git a/apps/root_menu.c b/apps/root_menu.c index b797d473a5..3b9f6eab36 100644 --- a/apps/root_menu.c +++ b/apps/root_menu.c | |||
@@ -152,13 +152,6 @@ static int wpsscrn(void* param) | |||
152 | DEBUGF("Resume index %X offset %X\n", | 152 | DEBUGF("Resume index %X offset %X\n", |
153 | global_status.resume_index, | 153 | global_status.resume_index, |
154 | global_status.resume_offset); | 154 | global_status.resume_offset); |
155 | |||
156 | #ifdef HAVE_RTC_ALARM | ||
157 | if ( rtc_check_alarm_started(true) ) { | ||
158 | rtc_enable_alarm(false); | ||
159 | } | ||
160 | #endif | ||
161 | |||
162 | if (playlist_resume() != -1) | 155 | if (playlist_resume() != -1) |
163 | { | 156 | { |
164 | playlist_start(global_status.resume_index, | 157 | playlist_start(global_status.resume_index, |
@@ -329,6 +322,22 @@ void root_menu(void) | |||
329 | ret_val = (int)global_status.last_screen; | 322 | ret_val = (int)global_status.last_screen; |
330 | else ret_val = global_settings.start_in_screen - 2; | 323 | else ret_val = global_settings.start_in_screen - 2; |
331 | 324 | ||
325 | #ifdef HAVE_RTC_ALARM | ||
326 | if ( rtc_check_alarm_started(true) ) | ||
327 | { | ||
328 | rtc_enable_alarm(false); | ||
329 | ret_val = GO_TO_WPS; | ||
330 | #if CONFIG_TUNER | ||
331 | if (global_settings.alarm_wake_up_screen == ALARM_START_FM) | ||
332 | ret_val = GO_TO_FM; | ||
333 | #endif | ||
334 | #ifdef HAVE_RECORDING | ||
335 | if (global_settings.alarm_wake_up_screen == ALARM_START_REC) | ||
336 | ret_val = GO_TO_RECSCREEN; | ||
337 | #endif | ||
338 | } | ||
339 | #endif /* HAVE_RTC_ALARM */ | ||
340 | |||
332 | while (true) | 341 | while (true) |
333 | { | 342 | { |
334 | switch (ret_val) | 343 | switch (ret_val) |
diff --git a/apps/settings.h b/apps/settings.h index 6e2db093d9..f9e08152af 100644 --- a/apps/settings.h +++ b/apps/settings.h | |||
@@ -166,7 +166,26 @@ enum { REPLAYGAIN_TRACK = 0, REPLAYGAIN_ALBUM, REPLAYGAIN_SHUFFLE }; | |||
166 | /* show path types */ | 166 | /* show path types */ |
167 | enum { SHOW_PATH_OFF = 0, SHOW_PATH_CURRENT, SHOW_PATH_FULL }; | 167 | enum { SHOW_PATH_OFF = 0, SHOW_PATH_CURRENT, SHOW_PATH_FULL }; |
168 | 168 | ||
169 | /* Alarm settings */ | ||
170 | #ifdef HAVE_RTC_ALARM | ||
171 | enum { ALARM_START_WPS = 0, | ||
172 | #if CONFIG_TUNER | ||
173 | ALARM_START_FM, | ||
174 | #endif | ||
175 | #ifdef HAVE_RECORDING | ||
176 | ALARM_START_REC, | ||
177 | #endif | ||
178 | ALARM_START_COUNT | ||
179 | }; | ||
180 | #if CONFIG_TUNER && defined(HAVE_RECORDING) | ||
181 | #define ALARM_SETTING_TEXT "wps,fm,rec" | ||
182 | #elif CONFIG_TUNER | ||
183 | #define ALARM_SETTING_TEXT "wps,fm" | ||
184 | #elif defined(HAVE_RECORDING) | ||
185 | #define ALARM_SETTING_TEXT "wps,rec" | ||
186 | #endif | ||
169 | 187 | ||
188 | #endif /* HAVE_RTC_ALARM */ | ||
170 | /** virtual pointer stuff.. move to another .h maybe? **/ | 189 | /** virtual pointer stuff.. move to another .h maybe? **/ |
171 | /* These define "virtual pointers", which could either be a literal string, | 190 | /* These define "virtual pointers", which could either be a literal string, |
172 | or a mean a string ID if the pointer is in a certain range. | 191 | or a mean a string ID if the pointer is in a certain range. |
@@ -681,6 +700,11 @@ struct user_settings | |||
681 | #endif /* CONFIG_CODEC == SWCODEC */ | 700 | #endif /* CONFIG_CODEC == SWCODEC */ |
682 | bool cuesheet; | 701 | bool cuesheet; |
683 | int start_in_screen; | 702 | int start_in_screen; |
703 | #if defined(HAVE_RTC_ALARM) && \ | ||
704 | (defined(HAVE_RECORDING) || CONFIG_TUNER) | ||
705 | int alarm_wake_up_screen; | ||
706 | #endif | ||
707 | |||
684 | }; | 708 | }; |
685 | 709 | ||
686 | /** global variables **/ | 710 | /** global variables **/ |
diff --git a/apps/settings_list.c b/apps/settings_list.c index c01584f8e2..ac410d57ca 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c | |||
@@ -1113,6 +1113,20 @@ const struct settings_list settings[] = { | |||
1113 | ID2P(LANG_BOOKMARK_MENU_RECENT_BOOKMARKS) | 1113 | ID2P(LANG_BOOKMARK_MENU_RECENT_BOOKMARKS) |
1114 | ), | 1114 | ), |
1115 | SYSTEM_SETTING(NVRAM(1),last_screen,-1), | 1115 | SYSTEM_SETTING(NVRAM(1),last_screen,-1), |
1116 | #if defined(HAVE_RTC_ALARM) && \ | ||
1117 | (defined(HAVE_RECORDING) || CONFIG_TUNER) | ||
1118 | CHOICE_SETTING(0, alarm_wake_up_screen, LANG_ALARM_WAKEUP_SCREEN, | ||
1119 | ALARM_START_WPS, | ||
1120 | "alarm wakeup screen", ALARM_SETTING_TEXT, | ||
1121 | NULL, ALARM_START_COUNT, ID2P(LANG_RESUME_PLAYBACK) | ||
1122 | #if CONFIG_TUNER | ||
1123 | ,ID2P(LANG_FM_RADIO) | ||
1124 | #endif | ||
1125 | #ifdef HAVE_RECORDING | ||
1126 | ,ID2P(LANG_RECORDING) | ||
1127 | #endif | ||
1128 | ), | ||
1129 | #endif /* HAVE_RTC_ALARM */ | ||
1116 | }; | 1130 | }; |
1117 | 1131 | ||
1118 | const int nb_settings = sizeof(settings)/sizeof(*settings); | 1132 | const int nb_settings = sizeof(settings)/sizeof(*settings); |