summaryrefslogtreecommitdiff
path: root/apps/main_menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/main_menu.c')
-rw-r--r--apps/main_menu.c140
1 files changed, 9 insertions, 131 deletions
diff --git a/apps/main_menu.c b/apps/main_menu.c
index 80bbe26e4a..9665ce8896 100644
--- a/apps/main_menu.c
+++ b/apps/main_menu.c
@@ -24,14 +24,15 @@
24#include "button.h" 24#include "button.h"
25#include "kernel.h" 25#include "kernel.h"
26#include "main_menu.h" 26#include "main_menu.h"
27#include "sound_menu.h" 27/*#include "sound_menu.h"*/
28#include "version.h" 28#include "version.h"
29#include "debug.h" 29#include "debug.h"
30#include "sprintf.h" 30#include "sprintf.h"
31#include <string.h> 31#include <string.h>
32#include "playlist.h" 32#include "playlist.h"
33#include "settings.h" 33#include "settings.h"
34#include "backlight.h" 34#include "settings_menu.h"
35#include "sound_menu.h"
35 36
36#ifdef HAVE_LCD_BITMAP 37#ifdef HAVE_LCD_BITMAP
37#include "games_menu.h" 38#include "games_menu.h"
@@ -121,145 +122,22 @@ void show_credits(void)
121 roll_credits(); 122 roll_credits();
122} 123}
123 124
124void scroll_speed(void)
125{
126 bool done=false;
127 int speed=10;
128 char str[16];
129
130 lcd_clear_display();
131 lcd_puts_scroll(0,0,"Scroll speed indicator");
132
133 while (!done) {
134 snprintf(str,sizeof str,"Speed: %d ",speed);
135 lcd_puts(0,1,str);
136 lcd_update();
137 lcd_scroll_speed(speed);
138 switch( button_get(true) ) {
139#ifdef HAVE_RECORDER_KEYPAD
140 case BUTTON_UP:
141#else
142 case BUTTON_RIGHT:
143#endif
144 speed++;
145 break;
146
147#ifdef HAVE_RECORDER_KEYPAD
148 case BUTTON_DOWN:
149#else
150 case BUTTON_LEFT:
151#endif
152 speed--;
153 if ( speed < 1 )
154 speed = 1;
155 break;
156
157#ifdef HAVE_RECORDER_KEYPAD
158 case BUTTON_LEFT:
159#else
160 case BUTTON_STOP:
161 case BUTTON_MENU:
162#endif
163 done = true;
164 lcd_stop_scroll();
165 break;
166 }
167 }
168}
169
170void backlight_timer(void)
171{
172 bool done = false;
173 int timer = global_settings.backlight;
174 char str[16];
175
176 lcd_clear_display();
177 lcd_puts_scroll(0,0,"Backlight");
178
179 while (!done) {
180 snprintf(str,sizeof str,"Timeout: %d s ", timer);
181 lcd_puts(0,1,str);
182 lcd_update();
183 switch( button_get(true) ) {
184#ifdef HAVE_RECORDER_KEYPAD
185 case BUTTON_UP:
186#else
187 case BUTTON_RIGHT:
188#endif
189 timer++;
190 if(timer > 60)
191 timer = 60;
192 break;
193
194#ifdef HAVE_RECORDER_KEYPAD
195 case BUTTON_DOWN:
196#else
197 case BUTTON_LEFT:
198#endif
199 timer--;
200 if ( timer < 0 )
201 timer = 0;
202 break;
203
204#ifdef HAVE_RECORDER_KEYPAD
205 case BUTTON_LEFT:
206#else
207 case BUTTON_STOP:
208 case BUTTON_MENU:
209#endif
210 done = true;
211 global_settings.backlight = timer;
212 backlight_on();
213 break;
214 }
215 }
216}
217
218void shuffle(void)
219{
220 bool done = false;
221
222 lcd_clear_display();
223 lcd_puts(0,0,"[Shuffle]");
224
225 while ( !done ) {
226 lcd_puts(0,1,playlist_shuffle ? "on " : "off");
227 lcd_update();
228
229 switch ( button_get(true) ) {
230#ifdef HAVE_RECORDER_KEYPAD
231 case BUTTON_LEFT:
232#else
233 case BUTTON_STOP:
234#endif
235 done = true;
236 break;
237
238 default:
239 playlist_shuffle = !playlist_shuffle;
240 break;
241 }
242 }
243}
244
245void main_menu(void) 125void main_menu(void)
246{ 126{
247 int m; 127 int m;
248 enum { 128 enum {
249 Games, Screensavers, Version, Sound, Scroll, Shuffle, Backlight 129 Games, Screensavers, Version, Gen_Settings, Sound_Settings,
250 }; 130 };
251 131
252 /* main menu */ 132 /* main menu */
253 struct menu_items items[] = { 133 struct menu_items items[] = {
254 { Shuffle, "Shuffle", shuffle }, 134 { Sound_Settings, "Sound Settings", sound_menu },
255 { Sound, "Sound", sound_menu }, 135 { Gen_Settings, "General Settings", settings_menu },
256 { Backlight, "Backlight", backlight_timer },
257 { Scroll, "Scroll speed", scroll_speed },
258#ifdef HAVE_LCD_BITMAP 136#ifdef HAVE_LCD_BITMAP
259 { Games, "Games", games_menu }, 137 { Games, "Games", games_menu },
260 { Screensavers, "Screensavers", screensavers_menu }, 138 { Screensavers, "Screensavers", screensavers_menu },
261#endif 139#endif
262 { Version, "Version", show_credits }, 140 { Version, "Version", show_credits },
263 }; 141 };
264 142
265 m=menu_init( items, sizeof items / sizeof(struct menu_items) ); 143 m=menu_init( items, sizeof items / sizeof(struct menu_items) );