Loudness, Superbass and sorting patch by Heikki Hannikainen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1401 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
e0d88a11d9
commit
c132c48677
|
@ -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) );
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 },
|
||||
|
|
|
@ -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) );
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user