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 | |
parent | e0d88a11d9e0d8c29fc1cea507f7ebdf1e07bf7a (diff) | |
download | rockbox-c132c486771cd72ef7aea70eeb8876a6481efbc6.tar.gz rockbox-c132c486771cd72ef7aea70eeb8876a6481efbc6.zip |
Loudness, Superbass and sorting patch by Heikki Hannikainen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1401 a1c6a512-1295-4272-9138-f99709370657
-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) | |||
341 | } | 341 | } |
342 | #endif | 342 | #endif |
343 | 343 | ||
344 | /* Read MAS registers and display them */ | ||
345 | void dbg_mas(void) | ||
346 | { | ||
347 | char buf[32]; | ||
348 | unsigned int addr = 0, r, i; | ||
349 | int button; | ||
350 | |||
351 | lcd_clear_display(); | ||
352 | lcd_puts(0, 0, "MAS register read:"); | ||
353 | |||
354 | while(1) | ||
355 | { | ||
356 | for (r = 0; r < 4; r++) { | ||
357 | i = mas_readreg(addr + r); | ||
358 | snprintf(buf, 30, "0x%02x: %08x", addr + r, i); | ||
359 | lcd_puts(1, r+1, buf); | ||
360 | } | ||
361 | |||
362 | lcd_update(); | ||
363 | sleep(HZ/16); | ||
364 | |||
365 | button = button_get(false); | ||
366 | |||
367 | switch(button) | ||
368 | { | ||
369 | case BUTTON_DOWN: | ||
370 | addr += 4; | ||
371 | break; | ||
372 | case BUTTON_UP: | ||
373 | if (addr) { addr -= 4; } | ||
374 | break; | ||
375 | case BUTTON_LEFT: | ||
376 | return; | ||
377 | } | ||
378 | } | ||
379 | } | ||
380 | |||
381 | #ifdef ARCHOS_RECORDER | ||
382 | void dbg_mas_codec(void) | ||
383 | { | ||
384 | char buf[32]; | ||
385 | unsigned int addr = 0, r, i; | ||
386 | int button; | ||
387 | |||
388 | lcd_clear_display(); | ||
389 | lcd_puts(0, 0, "MAS codec reg read:"); | ||
390 | |||
391 | while(1) | ||
392 | { | ||
393 | for (r = 0; r < 4; r++) { | ||
394 | i = mas_codec_readreg(addr + r); | ||
395 | snprintf(buf, 30, "0x%02x: %08x", addr + r, i); | ||
396 | lcd_puts(1, r+1, buf); | ||
397 | } | ||
398 | |||
399 | lcd_update(); | ||
400 | sleep(HZ/16); | ||
401 | |||
402 | button = button_get(false); | ||
403 | |||
404 | switch(button) | ||
405 | { | ||
406 | case BUTTON_DOWN: | ||
407 | addr += 4; | ||
408 | break; | ||
409 | case BUTTON_UP: | ||
410 | if (addr) { addr -= 4; } | ||
411 | break; | ||
412 | case BUTTON_LEFT: | ||
413 | return; | ||
414 | } | ||
415 | } | ||
416 | } | ||
417 | #endif | ||
418 | |||
344 | void debug_menu(void) | 419 | void debug_menu(void) |
345 | { | 420 | { |
346 | int m; | 421 | int m; |
347 | 422 | ||
348 | struct menu_items items[] = { | 423 | struct menu_items items[] = { |
349 | { "Debug ports", dbg_ports }, | 424 | { "View I/O ports", dbg_ports }, |
350 | #ifdef HAVE_LCD_BITMAP | 425 | #ifdef HAVE_LCD_BITMAP |
351 | #ifdef HAVE_RTC | 426 | #ifdef HAVE_RTC |
352 | { "Debug RTC", dbg_rtc }, | 427 | { "View/clr RTC RAM", dbg_rtc }, |
353 | #endif /* HAVE_RTC */ | 428 | #endif /* HAVE_RTC */ |
354 | #endif /* HAVE_LCD_BITMAP */ | 429 | #endif /* HAVE_LCD_BITMAP */ |
355 | { "Debug OS", dbg_os }, | 430 | { "View OS stacks", dbg_os }, |
431 | { "View MAS regs", dbg_mas }, | ||
432 | #ifdef ARCHOS_RECORDER | ||
433 | { "View MAS codec", dbg_mas_codec }, | ||
434 | #endif | ||
356 | }; | 435 | }; |
357 | 436 | ||
358 | m=menu_init( items, sizeof items / sizeof(struct menu_items) ); | 437 | 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) | |||
147 | 147 | ||
148 | mpeg_init( global_settings.volume, | 148 | mpeg_init( global_settings.volume, |
149 | global_settings.bass, | 149 | global_settings.bass, |
150 | global_settings.treble ); | 150 | global_settings.treble, |
151 | global_settings.loudness, | ||
152 | global_settings.bass_boost ); | ||
151 | 153 | ||
152 | usb_start_monitoring(); | 154 | usb_start_monitoring(); |
153 | } | 155 | } |
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 ) | |||
209 | 209 | ||
210 | rtc_config_block[0xe] = (unsigned char) | 210 | rtc_config_block[0xe] = (unsigned char) |
211 | ((global_settings.playlist_shuffle & 1) | | 211 | ((global_settings.playlist_shuffle & 1) | |
212 | ((global_settings.mp3filter & 1) << 1)); | 212 | ((global_settings.mp3filter & 1) << 1) | |
213 | ((global_settings.sort_case & 1) << 2)); | ||
213 | 214 | ||
214 | rtc_config_block[0xf] = (unsigned char) | 215 | rtc_config_block[0xf] = (unsigned char) |
215 | ((global_settings.scroll_speed << 3) | | 216 | ((global_settings.scroll_speed << 3) | |
@@ -266,6 +267,7 @@ void settings_load(void) | |||
266 | if (rtc_config_block[0xe] != 0xFF) { | 267 | if (rtc_config_block[0xe] != 0xFF) { |
267 | global_settings.playlist_shuffle = rtc_config_block[0xe] & 1; | 268 | global_settings.playlist_shuffle = rtc_config_block[0xe] & 1; |
268 | global_settings.mp3filter = (rtc_config_block[0xe] >> 1) & 1; | 269 | global_settings.mp3filter = (rtc_config_block[0xe] >> 1) & 1; |
270 | global_settings.sort_case = (rtc_config_block[0xe] >> 2) & 1; | ||
269 | } | 271 | } |
270 | 272 | ||
271 | c = rtc_config_block[0xf] >> 3; | 273 | c = rtc_config_block[0xf] >> 3; |
@@ -303,6 +305,7 @@ void settings_reset(void) { | |||
303 | global_settings.backlight = DEFAULT_BACKLIGHT_SETTING; | 305 | global_settings.backlight = DEFAULT_BACKLIGHT_SETTING; |
304 | global_settings.wps_display = DEFAULT_WPS_DISPLAY; | 306 | global_settings.wps_display = DEFAULT_WPS_DISPLAY; |
305 | global_settings.mp3filter = true; | 307 | global_settings.mp3filter = true; |
308 | global_settings.sort_case = false; | ||
306 | global_settings.playlist_shuffle = false; | 309 | global_settings.playlist_shuffle = false; |
307 | global_settings.total_boots = 0; | 310 | global_settings.total_boots = 0; |
308 | global_settings.total_uptime = 0; | 311 | 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 | |||
52 | 52 | ||
53 | /* misc options */ | 53 | /* misc options */ |
54 | 54 | ||
55 | int loop_playlist; /* do we return to top of playlist at end? */ | 55 | int loop_playlist; /* do we return to top of playlist at end? */ |
56 | bool mp3filter; | 56 | bool mp3filter; /* only display mp3/m3u files and dirs in directory? */ |
57 | bool sort_case; /* dir sort order: 0=case insensitive, 1=sensitive */ | ||
57 | int scroll_speed; /* long texts scrolling speed: 1-20 */ | 58 | int scroll_speed; /* long texts scrolling speed: 1-20 */ |
58 | bool playlist_shuffle; | 59 | bool playlist_shuffle; |
59 | 60 | ||
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) | |||
43 | set_bool( "[MP3/M3U filter]", &global_settings.mp3filter ); | 43 | set_bool( "[MP3/M3U filter]", &global_settings.mp3filter ); |
44 | } | 44 | } |
45 | 45 | ||
46 | static void sort_case(void) | ||
47 | { | ||
48 | set_bool( "[Sort case sensitive]", &global_settings.sort_case ); | ||
49 | } | ||
50 | |||
46 | static void backlight_timer(void) | 51 | static void backlight_timer(void) |
47 | { | 52 | { |
48 | set_int( "[Backlight]", "s", &global_settings.backlight, | 53 | set_int( "[Backlight]", "s", &global_settings.backlight, |
@@ -68,6 +73,7 @@ void settings_menu(void) | |||
68 | struct menu_items items[] = { | 73 | struct menu_items items[] = { |
69 | { "Shuffle", shuffle }, | 74 | { "Shuffle", shuffle }, |
70 | { "MP3/M3U filter", mp3_filter }, | 75 | { "MP3/M3U filter", mp3_filter }, |
76 | { "Sort mode", sort_case }, | ||
71 | { "Backlight Timer", backlight_timer }, | 77 | { "Backlight Timer", backlight_timer }, |
72 | { "Scroll speed", scroll_speed }, | 78 | { "Scroll speed", scroll_speed }, |
73 | { "While Playing", wps_set }, | 79 | { "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) | |||
118 | set_sound("Treble", &global_settings.treble, SOUND_TREBLE); | 118 | set_sound("Treble", &global_settings.treble, SOUND_TREBLE); |
119 | } | 119 | } |
120 | 120 | ||
121 | #ifdef ARCHOS_RECORDER | ||
122 | static void loudness(void) | ||
123 | { | ||
124 | set_sound("Loudness", &global_settings.loudness, SOUND_LOUDNESS); | ||
125 | }; | ||
126 | |||
127 | static void bass_boost(void) | ||
128 | { | ||
129 | set_sound("Bass boost", &global_settings.bass_boost, SOUND_SUPERBASS); | ||
130 | }; | ||
131 | #endif /* ARCHOS_RECORDER */ | ||
132 | |||
121 | void sound_menu(void) | 133 | void sound_menu(void) |
122 | { | 134 | { |
123 | int m; | 135 | int m; |
124 | struct menu_items items[] = { | 136 | struct menu_items items[] = { |
125 | { "Volume", volume }, | 137 | { "Volume", volume }, |
126 | { "Bass", bass }, | 138 | { "Bass", bass }, |
127 | { "Treble", treble } | 139 | { "Treble", treble }, |
140 | #ifdef ARCHOS_RECORDER | ||
141 | { "Loudness", loudness }, | ||
142 | { "Bass Boost", bass_boost } | ||
143 | #endif | ||
128 | }; | 144 | }; |
129 | 145 | ||
130 | m=menu_init( items, sizeof items / sizeof(struct menu_items) ); | 146 | 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) | |||
114 | struct entry* e2 = *(struct entry**)p2; | 114 | struct entry* e2 = *(struct entry**)p2; |
115 | 115 | ||
116 | if (( e1->attr & ATTR_DIRECTORY ) == ( e2->attr & ATTR_DIRECTORY )) | 116 | if (( e1->attr & ATTR_DIRECTORY ) == ( e2->attr & ATTR_DIRECTORY )) |
117 | return strncasecmp(e1->name, e2->name, TREE_MAX_FILENAMELEN); | 117 | if (global_settings.sort_case) |
118 | return strncmp(e1->name, e2->name, TREE_MAX_FILENAMELEN); | ||
119 | else | ||
120 | return strncasecmp(e1->name, e2->name, TREE_MAX_FILENAMELEN); | ||
118 | else | 121 | else |
119 | return ( e2->attr & ATTR_DIRECTORY ) - ( e1->attr & ATTR_DIRECTORY ); | 122 | return ( e2->attr & ATTR_DIRECTORY ) - ( e1->attr & ATTR_DIRECTORY ); |
120 | } | 123 | } |