diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/debug_menu.c | 12 | ||||
-rw-r--r-- | apps/lang/english.lang | 2 | ||||
-rw-r--r-- | apps/main_menu.c | 152 | ||||
-rw-r--r-- | apps/settings.h | 3 |
4 files changed, 92 insertions, 77 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 3936594954..fac570d39a 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -1780,6 +1780,7 @@ static bool dbg_disk_info(void) | |||
1780 | /* Wait for a key to be pushed */ | 1780 | /* Wait for a key to be pushed */ |
1781 | key = button_get_w_tmo(HZ*5); | 1781 | key = button_get_w_tmo(HZ*5); |
1782 | switch(key) { | 1782 | switch(key) { |
1783 | case SETTINGS_OK: | ||
1783 | case SETTINGS_CANCEL: | 1784 | case SETTINGS_CANCEL: |
1784 | done = true; | 1785 | done = true; |
1785 | break; | 1786 | break; |
@@ -1793,17 +1794,6 @@ static bool dbg_disk_info(void) | |||
1793 | if (++page > max_page) | 1794 | if (++page > max_page) |
1794 | page = 0; | 1795 | page = 0; |
1795 | break; | 1796 | break; |
1796 | |||
1797 | case SETTINGS_OK: | ||
1798 | if (page == 3) { | ||
1799 | audio_stop(); /* stop playback, to avoid disk access */ | ||
1800 | lcd_clear_display(); | ||
1801 | lcd_puts(0,0,"Scanning"); | ||
1802 | lcd_puts(0,1,"disk..."); | ||
1803 | lcd_update(); | ||
1804 | fat_recalc_free(IF_MV(0)); | ||
1805 | } | ||
1806 | break; | ||
1807 | } | 1797 | } |
1808 | lcd_stop_scroll(); | 1798 | lcd_stop_scroll(); |
1809 | } | 1799 | } |
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 8c551b443d..ad9c82dfcf 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang | |||
@@ -8528,4 +8528,4 @@ | |||
8528 | <voice> | 8528 | <voice> |
8529 | *: "Remote Scrolling Options" | 8529 | *: "Remote Scrolling Options" |
8530 | </voice> | 8530 | </voice> |
8531 | </phrase> | 8531 | </phrase> |
diff --git a/apps/main_menu.c b/apps/main_menu.c index f903f60841..5a5607afe0 100644 --- a/apps/main_menu.c +++ b/apps/main_menu.c | |||
@@ -50,15 +50,12 @@ | |||
50 | #include "logfdisp.h" | 50 | #include "logfdisp.h" |
51 | #include "plugin.h" | 51 | #include "plugin.h" |
52 | #include "filetypes.h" | 52 | #include "filetypes.h" |
53 | #include "splash.h" | ||
53 | 54 | ||
54 | #ifdef HAVE_RECORDING | 55 | #ifdef HAVE_RECORDING |
55 | #include "recording.h" | 56 | #include "recording.h" |
56 | #endif | 57 | #endif |
57 | 58 | ||
58 | #ifdef HAVE_REMOTE_LCD | ||
59 | #include "lcd-remote.h" | ||
60 | #endif | ||
61 | |||
62 | bool show_credits(void) | 59 | bool show_credits(void) |
63 | { | 60 | { |
64 | plugin_load("/.rockbox/rocks/credits.rock",NULL); | 61 | plugin_load("/.rockbox/rocks/credits.rock",NULL); |
@@ -78,16 +75,17 @@ extern bool simulate_usb(void); | |||
78 | bool show_info(void) | 75 | bool show_info(void) |
79 | { | 76 | { |
80 | char s[64], s1[32]; | 77 | char s[64], s1[32]; |
78 | unsigned long size, free; | ||
81 | long buflen = ((audiobufend - audiobuf) * 2) / 2097; /* avoid overflow */ | 79 | long buflen = ((audiobufend - audiobuf) * 2) / 2097; /* avoid overflow */ |
82 | int integer, decimal; | ||
83 | bool done = false; | ||
84 | int key; | 80 | int key; |
85 | int state = 1; | 81 | bool done = false; |
86 | unsigned long size, free; | 82 | bool new_info = true; |
87 | #ifdef HAVE_MULTIVOLUME | 83 | #ifdef HAVE_MULTIVOLUME |
88 | char s2[32]; | 84 | char s2[32]; |
89 | unsigned long size2 = 0; | 85 | unsigned long size2, free2; |
90 | unsigned long free2 = 0; | 86 | #endif |
87 | #ifdef HAVE_LCD_CHARCELLS | ||
88 | int page = 0; | ||
91 | #endif | 89 | #endif |
92 | 90 | ||
93 | const unsigned char *kbyte_units[] = { | 91 | const unsigned char *kbyte_units[] = { |
@@ -95,63 +93,73 @@ bool show_info(void) | |||
95 | ID2P(LANG_MEGABYTE), | 93 | ID2P(LANG_MEGABYTE), |
96 | ID2P(LANG_GIGABYTE) | 94 | ID2P(LANG_GIGABYTE) |
97 | }; | 95 | }; |
96 | |||
97 | while (!done) | ||
98 | { | ||
99 | int y=0; | ||
98 | 100 | ||
99 | fat_size( IF_MV2(0,) &size, &free ); | 101 | if (new_info) |
102 | { | ||
103 | fat_size( IF_MV2(0,) &size, &free ); | ||
100 | #ifdef HAVE_MULTIVOLUME | 104 | #ifdef HAVE_MULTIVOLUME |
101 | if (fat_ismounted(1)) | 105 | if (fat_ismounted(1)) |
102 | fat_size( 1, &size2, &free2 ); | 106 | fat_size( 1, &size2, &free2 ); |
107 | else | ||
108 | size2 = 0; | ||
103 | #endif | 109 | #endif |
104 | 110 | ||
105 | if (global_settings.talk_menu) | 111 | if (global_settings.talk_menu) |
106 | { /* say whatever is reasonable, no real connection to the screen */ | 112 | { /* say whatever is reasonable, no real connection to the screen */ |
107 | bool enqueue = false; /* enqueue all but the first */ | 113 | bool enqueue = false; /* enqueue all but the first */ |
108 | if (battery_level() >= 0) | 114 | if (battery_level() >= 0) |
109 | { | 115 | { |
110 | talk_id(LANG_BATTERY_TIME, enqueue); | 116 | talk_id(LANG_BATTERY_TIME, enqueue); |
111 | enqueue = true; | 117 | enqueue = true; |
112 | talk_value(battery_level(), UNIT_PERCENT, true); | 118 | talk_value(battery_level(), UNIT_PERCENT, true); |
113 | } | 119 | } |
114 | 120 | ||
115 | talk_id(LANG_DISK_FREE_INFO, enqueue); | 121 | talk_id(LANG_DISK_FREE_INFO, enqueue); |
116 | #ifdef HAVE_MULTIVOLUME | 122 | #ifdef HAVE_MULTIVOLUME |
117 | talk_id(LANG_DISK_NAME_INTERNAL, true); | 123 | talk_id(LANG_DISK_NAME_INTERNAL, true); |
118 | output_dyn_value(NULL, 0, free, kbyte_units, true); | 124 | output_dyn_value(NULL, 0, free, kbyte_units, true); |
119 | if (size2) | 125 | if (size2) |
120 | { | 126 | { |
121 | talk_id(LANG_DISK_NAME_MMC, true); | 127 | talk_id(LANG_DISK_NAME_MMC, true); |
122 | output_dyn_value(NULL, 0, free2, kbyte_units, true); | 128 | output_dyn_value(NULL, 0, free2, kbyte_units, true); |
123 | } | 129 | } |
124 | #else | 130 | #else |
125 | output_dyn_value(NULL, 0, free, kbyte_units, true); /* NULL == talk */ | 131 | output_dyn_value(NULL, 0, free, kbyte_units, true); |
126 | #endif | 132 | #endif |
127 | 133 | ||
128 | #ifdef CONFIG_RTC | 134 | #ifdef CONFIG_RTC |
129 | { | 135 | { |
130 | struct tm* tm = get_time(); | 136 | struct tm* tm = get_time(); |
131 | talk_id(VOICE_CURRENT_TIME, true); | 137 | talk_id(VOICE_CURRENT_TIME, true); |
132 | talk_value(tm->tm_hour, UNIT_HOUR, true); | 138 | talk_value(tm->tm_hour, UNIT_HOUR, true); |
133 | talk_value(tm->tm_min, UNIT_MIN, true); | 139 | talk_value(tm->tm_min, UNIT_MIN, true); |
134 | talk_value(tm->tm_sec, UNIT_SEC, true); | 140 | talk_value(tm->tm_sec, UNIT_SEC, true); |
135 | talk_id(LANG_MONTH_JANUARY + tm->tm_mon, true); | 141 | talk_id(LANG_MONTH_JANUARY + tm->tm_mon, true); |
136 | talk_number(tm->tm_mday, true); | 142 | talk_number(tm->tm_mday, true); |
137 | talk_number(1900 + tm->tm_year, true); | 143 | talk_number(1900 + tm->tm_year, true); |
138 | } | 144 | } |
139 | #endif | 145 | #endif |
140 | } | 146 | } |
147 | new_info = false; | ||
148 | } | ||
141 | 149 | ||
142 | while(!done) | ||
143 | { | ||
144 | int y=0; | ||
145 | lcd_clear_display(); | 150 | lcd_clear_display(); |
146 | #ifdef HAVE_LCD_BITMAP | 151 | #ifdef HAVE_LCD_BITMAP |
147 | lcd_puts(0, y++, str(LANG_ROCKBOX_INFO)); | 152 | lcd_puts(0, y++, str(LANG_ROCKBOX_INFO)); |
148 | y++; | 153 | y++; |
149 | state = 3; | ||
150 | #endif | 154 | #endif |
151 | 155 | ||
152 | if (state & 1) { | 156 | #ifdef HAVE_LCD_CHARCELLS |
153 | integer = buflen / 1000; | 157 | if (page == 0) |
154 | decimal = buflen % 1000; | 158 | #endif |
159 | { | ||
160 | int integer = buflen / 1000; | ||
161 | int decimal = buflen % 1000; | ||
162 | |||
155 | #ifdef HAVE_LCD_CHARCELLS | 163 | #ifdef HAVE_LCD_CHARCELLS |
156 | snprintf(s, sizeof(s), (char *)str(LANG_BUFFER_STAT_PLAYER), | 164 | snprintf(s, sizeof(s), (char *)str(LANG_BUFFER_STAT_PLAYER), |
157 | integer, decimal); | 165 | integer, decimal); |
@@ -178,19 +186,17 @@ bool show_info(void) | |||
178 | lcd_puts_scroll(0, y++, (unsigned char *)s); | 186 | lcd_puts_scroll(0, y++, (unsigned char *)s); |
179 | } | 187 | } |
180 | 188 | ||
181 | if (state & 2) { | 189 | #ifdef HAVE_LCD_CHARCELLS |
190 | if (page == 1) | ||
191 | #endif | ||
192 | { | ||
182 | #ifdef HAVE_MULTIVOLUME | 193 | #ifdef HAVE_MULTIVOLUME |
183 | output_dyn_value(s1, sizeof s1, free, kbyte_units, true); | 194 | output_dyn_value(s1, sizeof s1, free, kbyte_units, true); |
184 | output_dyn_value(s2, sizeof s2, size, kbyte_units, true); | 195 | output_dyn_value(s2, sizeof s2, size, kbyte_units, true); |
185 | snprintf(s, sizeof s, "%s %s/%s", str(LANG_DISK_NAME_INTERNAL), | 196 | snprintf(s, sizeof s, "%s %s/%s", str(LANG_DISK_NAME_INTERNAL), |
186 | s1, s2); | 197 | s1, s2); |
187 | #else | ||
188 | output_dyn_value(s1, sizeof s1, size, kbyte_units, true); | ||
189 | snprintf(s, sizeof s, SIZE_FMT, str(LANG_DISK_SIZE_INFO), s1); | ||
190 | #endif | ||
191 | lcd_puts_scroll(0, y++, (unsigned char *)s); | 198 | lcd_puts_scroll(0, y++, (unsigned char *)s); |
192 | 199 | ||
193 | #ifdef HAVE_MULTIVOLUME | ||
194 | if (size2) { | 200 | if (size2) { |
195 | output_dyn_value(s1, sizeof s1, free2, kbyte_units, true); | 201 | output_dyn_value(s1, sizeof s1, free2, kbyte_units, true); |
196 | output_dyn_value(s2, sizeof s2, size2, kbyte_units, true); | 202 | output_dyn_value(s2, sizeof s2, size2, kbyte_units, true); |
@@ -199,11 +205,16 @@ bool show_info(void) | |||
199 | lcd_puts_scroll(0, y++, (unsigned char *)s); | 205 | lcd_puts_scroll(0, y++, (unsigned char *)s); |
200 | } | 206 | } |
201 | #else | 207 | #else |
208 | output_dyn_value(s1, sizeof s1, size, kbyte_units, true); | ||
209 | snprintf(s, sizeof s, SIZE_FMT, str(LANG_DISK_SIZE_INFO), s1); | ||
210 | lcd_puts_scroll(0, y++, (unsigned char *)s); | ||
211 | |||
202 | output_dyn_value(s1, sizeof s1, free, kbyte_units, true); | 212 | output_dyn_value(s1, sizeof s1, free, kbyte_units, true); |
203 | snprintf(s, sizeof s, SIZE_FMT, str(LANG_DISK_FREE_INFO), s1); | 213 | snprintf(s, sizeof s, SIZE_FMT, str(LANG_DISK_FREE_INFO), s1); |
204 | lcd_puts_scroll(0, y++, (unsigned char *)s); | 214 | lcd_puts_scroll(0, y++, (unsigned char *)s); |
205 | #endif | 215 | #endif |
206 | } | 216 | } |
217 | |||
207 | lcd_update(); | 218 | lcd_update(); |
208 | 219 | ||
209 | /* Wait for a key to be pushed */ | 220 | /* Wait for a key to be pushed */ |
@@ -218,18 +229,31 @@ bool show_info(void) | |||
218 | done = true; | 229 | done = true; |
219 | break; | 230 | break; |
220 | 231 | ||
232 | #ifdef HAVE_LCD_CHARCELLS | ||
221 | case SETTINGS_INC: | 233 | case SETTINGS_INC: |
222 | case SETTINGS_DEC: | 234 | case SETTINGS_DEC: |
223 | if (state == 1) | 235 | page = (page == 0) ? 1 : 0; |
224 | state = 2; | 236 | break; |
225 | else | 237 | #endif |
226 | state = 1; | 238 | |
239 | #ifdef SETTINGS_ACCEPT | ||
240 | case SETTINGS_ACCEPT: | ||
241 | #else | ||
242 | case SETTINGS_INC: /* Ondio */ | ||
243 | #endif | ||
244 | gui_syncsplash(0, true, str(LANG_DIRCACHE_BUILDING)); | ||
245 | fat_recalc_free(IF_MV(0)); | ||
246 | #ifdef HAVE_MULTIVOLUME | ||
247 | if (fat_ismounted(1)) | ||
248 | fat_recalc_free(1); | ||
249 | #endif | ||
250 | new_info = true; | ||
227 | break; | 251 | break; |
228 | 252 | ||
229 | default: | 253 | default: |
230 | if(default_event_handler(key) == SYS_USB_CONNECTED) | 254 | if (default_event_handler(key) == SYS_USB_CONNECTED) |
231 | return true; | 255 | return true; |
232 | break; | 256 | break; |
233 | } | 257 | } |
234 | } | 258 | } |
235 | 259 | ||
diff --git a/apps/settings.h b/apps/settings.h index ca8e88a75b..2d1dfccd2a 100644 --- a/apps/settings.h +++ b/apps/settings.h | |||
@@ -74,6 +74,7 @@ | |||
74 | #define SETTINGS_OK BUTTON_PLAY | 74 | #define SETTINGS_OK BUTTON_PLAY |
75 | #define SETTINGS_CANCEL BUTTON_STOP | 75 | #define SETTINGS_CANCEL BUTTON_STOP |
76 | #define SETTINGS_CANCEL2 BUTTON_MENU | 76 | #define SETTINGS_CANCEL2 BUTTON_MENU |
77 | #define SETTINGS_ACCEPT BUTTON_ON | ||
77 | 78 | ||
78 | #elif CONFIG_KEYPAD == ONDIO_PAD | 79 | #elif CONFIG_KEYPAD == ONDIO_PAD |
79 | #define SETTINGS_INC BUTTON_UP | 80 | #define SETTINGS_INC BUTTON_UP |
@@ -332,7 +333,7 @@ struct user_settings | |||
332 | 333 | ||
333 | int runtime; /* current runtime since last charge */ | 334 | int runtime; /* current runtime since last charge */ |
334 | int topruntime; /* top known runtime */ | 335 | int topruntime; /* top known runtime */ |
335 | 336 | ||
336 | int scroll_speed; /* long texts scrolling speed: 1-30 */ | 337 | int scroll_speed; /* long texts scrolling speed: 1-30 */ |
337 | int bidir_limit; /* bidir scroll length limit */ | 338 | int bidir_limit; /* bidir scroll length limit */ |
338 | int scroll_delay; /* delay (in 1/10s) before starting scroll */ | 339 | int scroll_delay; /* delay (in 1/10s) before starting scroll */ |