2002-04-27 23:41:18 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
2002-04-28 20:35:33 +00:00
|
|
|
* Copyright (C) 2002 Daniel Stenberg
|
2002-04-27 23:41:18 +00:00
|
|
|
*
|
|
|
|
* All files in this archive are subject to the GNU General Public License.
|
|
|
|
* See the file COPYING in the source tree root for full license agreement.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
#include "lcd.h"
|
|
|
|
#include "button.h"
|
2002-04-28 08:37:15 +00:00
|
|
|
#include "kernel.h"
|
2002-05-06 08:42:20 +00:00
|
|
|
#include "menu.h"
|
2002-04-27 23:41:18 +00:00
|
|
|
|
2002-05-04 10:03:41 +00:00
|
|
|
/* Apps to include */
|
2002-04-30 13:17:11 +00:00
|
|
|
#include "tree.h"
|
|
|
|
|
2002-05-04 12:27:18 +00:00
|
|
|
#ifdef HAVE_LCD_BITMAP
|
|
|
|
|
2002-05-06 08:42:20 +00:00
|
|
|
/*#include "screensaver.h"*/
|
2002-04-27 23:41:18 +00:00
|
|
|
|
2002-05-06 08:42:20 +00:00
|
|
|
/*extern void tetris(void);*/
|
2002-04-28 00:11:50 +00:00
|
|
|
|
|
|
|
void app_main(void)
|
|
|
|
{
|
2002-05-03 05:21:58 +00:00
|
|
|
int key;
|
2002-05-06 08:42:20 +00:00
|
|
|
|
2002-05-03 05:21:58 +00:00
|
|
|
menu_init();
|
2002-05-06 08:42:20 +00:00
|
|
|
put_cursor_menu_top();
|
|
|
|
|
2002-05-03 05:21:58 +00:00
|
|
|
while(1) {
|
|
|
|
key = button_get();
|
2002-05-06 08:42:20 +00:00
|
|
|
|
2002-05-03 05:21:58 +00:00
|
|
|
if(!key) {
|
|
|
|
sleep(1);
|
|
|
|
continue;
|
|
|
|
}
|
2002-05-06 08:42:20 +00:00
|
|
|
|
2002-05-03 05:21:58 +00:00
|
|
|
switch(key) {
|
|
|
|
case BUTTON_UP:
|
2002-05-06 08:42:20 +00:00
|
|
|
if(is_cursor_menu_top()){
|
2002-05-03 05:21:58 +00:00
|
|
|
/* wrap around to menu bottom */
|
2002-05-06 08:42:20 +00:00
|
|
|
put_cursor_menu_bottom();
|
2002-05-03 05:21:58 +00:00
|
|
|
} else {
|
|
|
|
/* move up */
|
2002-05-06 08:42:20 +00:00
|
|
|
move_cursor_up();
|
2002-05-03 05:21:58 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case BUTTON_DOWN:
|
2002-05-06 08:42:20 +00:00
|
|
|
if(is_cursor_menu_bottom() ){
|
2002-05-03 05:21:58 +00:00
|
|
|
/* wrap around to menu top */
|
2002-05-06 08:42:20 +00:00
|
|
|
put_cursor_menu_top();
|
2002-05-03 05:21:58 +00:00
|
|
|
} else {
|
|
|
|
/* move down */
|
2002-05-06 08:42:20 +00:00
|
|
|
move_cursor_down();
|
2002-05-03 05:21:58 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case BUTTON_RIGHT:
|
|
|
|
case BUTTON_PLAY:
|
|
|
|
/* Erase current display state */
|
|
|
|
lcd_clear_display();
|
2002-05-06 08:42:20 +00:00
|
|
|
|
|
|
|
execute_menu_item();
|
2002-05-05 10:30:41 +00:00
|
|
|
|
2002-05-03 05:21:58 +00:00
|
|
|
/* Return to previous display state */
|
|
|
|
lcd_clear_display();
|
|
|
|
menu_init();
|
2002-05-03 06:00:54 +00:00
|
|
|
break;
|
|
|
|
case BUTTON_OFF:
|
|
|
|
return;
|
|
|
|
default:
|
2002-05-03 05:21:58 +00:00
|
|
|
break;
|
|
|
|
}
|
2002-05-06 08:42:20 +00:00
|
|
|
|
2002-05-03 05:21:58 +00:00
|
|
|
lcd_update();
|
2002-04-27 23:41:18 +00:00
|
|
|
}
|
|
|
|
}
|
2002-05-03 06:00:54 +00:00
|
|
|
|
2002-05-04 12:27:18 +00:00
|
|
|
#else
|
|
|
|
|
|
|
|
void app_main(void)
|
|
|
|
{
|
|
|
|
int key;
|
|
|
|
int cursor = 0;
|
|
|
|
|
|
|
|
lcd_puts(0,0, "Mooo!");
|
|
|
|
lcd_puts(1,1, " Rockbox!");
|
|
|
|
|
2002-05-10 14:56:52 +00:00
|
|
|
browse_root();
|
2002-05-04 12:27:18 +00:00
|
|
|
|
|
|
|
}
|
2002-05-03 06:00:54 +00:00
|
|
|
|
2002-05-04 12:27:18 +00:00
|
|
|
#endif
|