diff -Naur apps/settings.c apps.patched/settings.c --- apps/settings.c Mon Jul 15 20:55:15 2002 +++ apps.patched/settings.c Thu Jul 18 16:38:56 2002 @@ -54,6 +54,7 @@ 0x0e 0x22 0x0f 0x23 0x10 0x24 +0x11 0x25 @@ -214,6 +215,8 @@ rtc_config_block[0xf] = (unsigned char) ((global_settings.scroll_speed << 3) | (global_settings.wps_display & 7)); + + rtc_config_block[0x10] = (unsigned char)global_settings.autoplay; memcpy(&rtc_config_block[0x24], &global_settings.total_uptime, 4); memcpy(&rtc_config_block[0x28], &global_settings.total_boots, 2); @@ -275,6 +278,8 @@ c = rtc_config_block[0xf] & 7; if (c != 7) global_settings.wps_display = c; + if (rtc_config_block[0x10] != 0xFF) + global_settings.autoplay = rtc_config_block[0x10]; if (rtc_config_block[0x24] != 0xFF) memcpy(&global_settings.total_uptime, &rtc_config_block[0x24], 4); @@ -303,10 +308,11 @@ global_settings.backlight = DEFAULT_BACKLIGHT_SETTING; global_settings.wps_display = DEFAULT_WPS_DISPLAY; global_settings.mp3filter = true; - global_settings.playlist_shuffle = false; + global_settings.playlist_shuffle = true; global_settings.total_boots = 0; global_settings.total_uptime = 0; global_settings.scroll_speed = 8; + global_settings.autoplay = true; } @@ -326,10 +332,11 @@ global_settings.loudness, global_settings.bass_boost ); - DEBUGF( "contrast:\t%d\npoweroff:\t%d\nbacklight:\t%d\n", + DEBUGF( "contrast:\t%d\npoweroff:\t%d\nbacklight:\t%d\nautoplay:\t%d\n", global_settings.contrast, global_settings.poweroff, - global_settings.backlight ); + global_settings.backlight, + global_settings.autoplay ); #endif } diff -Naur apps/settings.h apps.patched/settings.h --- apps/settings.h Mon Jul 15 13:02:12 2002 +++ apps.patched/settings.h Thu Jul 18 15:41:26 2002 @@ -56,6 +56,7 @@ bool mp3filter; int scroll_speed; /* long texts scrolling speed: 1-20 */ bool playlist_shuffle; + bool autoplay; /* while playing screen settings */ int wps_display; /* 0=id3, 1=file, 2=parse */ diff -Naur apps/settings_menu.c apps.patched/settings_menu.c --- apps/settings_menu.c Mon Jul 15 13:02:12 2002 +++ apps.patched/settings_menu.c Thu Jul 18 16:05:53 2002 @@ -62,6 +62,11 @@ set_option("[WPS display]", &global_settings.wps_display, names, 3 ); } +static void autoplay(void) +{ + set_bool( "[Autoplay]", &global_settings.autoplay ); +} + void settings_menu(void) { int m; @@ -71,6 +76,7 @@ { "Backlight Timer", backlight_timer }, { "Scroll speed", scroll_speed }, { "While Playing", wps_set }, + { "Autoplay", autoplay }, }; m=menu_init( items, sizeof items / sizeof(struct menu_items) ); diff -Naur apps/tree.c apps.patched/tree.c --- apps/tree.c Wed Jul 17 13:25:04 2002 +++ apps.patched/tree.c Thu Jul 18 16:51:34 2002 @@ -291,6 +291,21 @@ if (numentries == -1) return -1; /* root is not a directory */ + if (global_settings.autoplay) { + + play_mode = 2; + play_list("/","all.m3u"); + rc = wps_show(); + if (rc == SYS_USB_CONNECTED) + { + /* Force a re-read of the root directory */ + strcpy(currdir,"/"); + lastdir[0] = 0; + } + + } + lcd_clear_display(); + lcd_stop_scroll(); put_cursorxy(0, CURSOR_Y + dircursor, true); while(1) {