diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2002-07-22 16:39:17 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2002-07-22 16:39:17 +0000 |
commit | c132c486771cd72ef7aea70eeb8876a6481efbc6 (patch) | |
tree | 9d2b4a2030231d5d2b6842a0715443cb8395eaa8 /apps | |
parent | e0d88a11d9e0d8c29fc1cea507f7ebdf1e07bf7a (diff) |
Loudness, Superbass and sorting patch by Heikki Hannikainen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1401 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/debug_menu.c | 85 | ||||
-rw-r--r-- | apps/main.c | 4 | ||||
-rw-r--r-- | apps/settings.c | 5 | ||||
-rw-r--r-- | apps/settings.h | 5 | ||||
-rw-r--r-- | apps/settings_menu.c | 6 | ||||
-rw-r--r-- | apps/sound_menu.c | 18 | ||||
-rw-r--r-- | apps/tree.c | 5 |
7 files changed, 119 insertions, 9 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 59428f62dc..19a62251b9 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c @@ -341,18 +341,97 @@ void dbg_rtc(void) } #endif +/* Read MAS registers and display them */ +void dbg_mas(void) +{ + char buf[32]; + unsigned int addr = 0, r, i; + int button; + + lcd_clear_display(); + lcd_puts(0, 0, "MAS register read:"); + + while(1) + { + for (r = 0; r < 4; r++) { + i = mas_readreg(addr + r); + snprintf(buf, 30, "0x%02x: %08x", addr + r, i); + lcd_puts(1, r+1, buf); + } + + lcd_update(); + sleep(HZ/16); + + button = button_get(false); + + switch(button) + { + case BUTTON_DOWN: + addr += 4; + break; + case BUTTON_UP: + if (addr) { addr -= 4; } + break; + case BUTTON_LEFT: + return; + } + } +} + +#ifdef ARCHOS_RECORDER +void dbg_mas_codec(void) +{ + char buf[32]; + unsigned int addr = 0, r, i; + int button; + + lcd_clear_display(); + lcd_puts(0, 0, "MAS codec reg read:"); + + while(1) + { + for (r = 0; r < 4; r++) { + i = mas_codec_readreg(addr + r); + snprintf(buf, 30, "0x%02x: %08x", addr + r, i); + lcd_puts(1, r+1, buf); + } + + lcd_update(); + sleep(HZ/16); + + button = button_get(false); + + switch(button) + { + case BUTTON_DOWN: + addr += 4; + break; + case BUTTON_UP: + if (addr) { addr -= 4; } + break; + case BUTTON_LEFT: + return; + } + } +} +#endif + void debug_menu(void) { int m; struct menu_items items[] = { - { "Debug ports", dbg_ports }, + { "View I/O ports", dbg_ports }, #ifdef HAVE_LCD_BITMAP #ifdef HAVE_RTC - { "Debug RTC", dbg_rtc }, + { "View/clr RTC RAM", dbg_rtc }, #endif /* HAVE_RTC */ #endif /* HAVE_LCD_BITMAP */ - { "Debug OS", dbg_os }, + { "View OS stacks", dbg_os }, + { "View MAS regs", dbg_mas }, +#ifdef ARCHOS_RECORDER + { "View MAS codec", dbg_mas_codec }, +#endif }; m=menu_init( items, sizeof items / sizeof(struct menu_items) ); diff --git a/apps/main.c b/apps/main.c index 7e853556ac..417a18e733 100644 --- a/apps/main.c +++ b/apps/main.c @@ -147,7 +147,9 @@ void init(void) mpeg_init( global_settings.volume, global_settings.bass, - global_settings.treble ); + global_settings.treble, + global_settings.loudness, + global_settings.bass_boost ); usb_start_monitoring(); } diff --git a/apps/settings.c b/apps/settings.c index 060f88fbc0..56d176264d 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -209,7 +209,8 @@ int settings_save( void ) rtc_config_block[0xe] = (unsigned char) ((global_settings.playlist_shuffle & 1) | - ((global_settings.mp3filter & 1) << 1)); + ((global_settings.mp3filter & 1) << 1) | + ((global_settings.sort_case & 1) << 2)); rtc_config_block[0xf] = (unsigned char) ((global_settings.scroll_speed << 3) | @@ -266,6 +267,7 @@ void settings_load(void) if (rtc_config_block[0xe] != 0xFF) { global_settings.playlist_shuffle = rtc_config_block[0xe] & 1; global_settings.mp3filter = (rtc_config_block[0xe] >> 1) & 1; + global_settings.sort_case = (rtc_config_block[0xe] >> 2) & 1; } c = rtc_config_block[0xf] >> 3; @@ -303,6 +305,7 @@ void settings_reset(void) { global_settings.backlight = DEFAULT_BACKLIGHT_SETTING; global_settings.wps_display = DEFAULT_WPS_DISPLAY; global_settings.mp3filter = true; + global_settings.sort_case = false; global_settings.playlist_shuffle = false; global_settings.total_boots = 0; global_settings.total_uptime = 0; diff --git a/apps/settings.h b/apps/settings.h index d47c9b8a83..3921fb1f52 100644 --- a/apps/settings.h +++ b/apps/settings.h @@ -52,8 +52,9 @@ struct user_settings /* misc options */ - int loop_playlist; /* do we return to top of playlist at end? */ - bool mp3filter; + int loop_playlist; /* do we return to top of playlist at end? */ + bool mp3filter; /* only display mp3/m3u files and dirs in directory? */ + bool sort_case; /* dir sort order: 0=case insensitive, 1=sensitive */ int scroll_speed; /* long texts scrolling speed: 1-20 */ bool playlist_shuffle; diff --git a/apps/settings_menu.c b/apps/settings_menu.c index f910d52c1f..95fec0dd33 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c @@ -43,6 +43,11 @@ static void mp3_filter(void) set_bool( "[MP3/M3U filter]", &global_settings.mp3filter ); } +static void sort_case(void) +{ + set_bool( "[Sort case sensitive]", &global_settings.sort_case ); +} + static void backlight_timer(void) { set_int( "[Backlight]", "s", &global_settings.backlight, @@ -68,6 +73,7 @@ void settings_menu(void) struct menu_items items[] = { { "Shuffle", shuffle }, { "MP3/M3U filter", mp3_filter }, + { "Sort mode", sort_case }, { "Backlight Timer", backlight_timer }, { "Scroll speed", scroll_speed }, { "While Playing", wps_set }, diff --git a/apps/sound_menu.c b/apps/sound_menu.c index a9111bbaed..015e8d08a9 100644 --- a/apps/sound_menu.c +++ b/apps/sound_menu.c @@ -118,13 +118,29 @@ static void treble(void) set_sound("Treble", &global_settings.treble, SOUND_TREBLE); } +#ifdef ARCHOS_RECORDER +static void loudness(void) +{ + set_sound("Loudness", &global_settings.loudness, SOUND_LOUDNESS); +}; + +static void bass_boost(void) +{ + set_sound("Bass boost", &global_settings.bass_boost, SOUND_SUPERBASS); +}; +#endif /* ARCHOS_RECORDER */ + void sound_menu(void) { int m; struct menu_items items[] = { { "Volume", volume }, { "Bass", bass }, - { "Treble", treble } + { "Treble", treble }, +#ifdef ARCHOS_RECORDER + { "Loudness", loudness }, + { "Bass Boost", bass_boost } +#endif }; m=menu_init( items, sizeof items / sizeof(struct menu_items) ); diff --git a/apps/tree.c b/apps/tree.c index d15547d048..237246d41e 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -114,7 +114,10 @@ static int compare(const void* p1, const void* p2) struct entry* e2 = *(struct entry**)p2; if (( e1->attr & ATTR_DIRECTORY ) == ( e2->attr & ATTR_DIRECTORY )) - return strncasecmp(e1->name, e2->name, TREE_MAX_FILENAMELEN); + if (global_settings.sort_case) + return strncmp(e1->name, e2->name, TREE_MAX_FILENAMELEN); + else + return strncasecmp(e1->name, e2->name, TREE_MAX_FILENAMELEN); else return ( e2->attr & ATTR_DIRECTORY ) - ( e1->attr & ATTR_DIRECTORY ); } |