mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-21 11:02:45 -05:00
Almost there with the loadable eq. still not ready to use yet though.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2187 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
8ccbc766a4
commit
c4207f1e34
1 changed files with 31 additions and 10 deletions
|
|
@ -37,6 +37,7 @@
|
||||||
#include "backlight.h"
|
#include "backlight.h"
|
||||||
#include "powermgmt.h"
|
#include "powermgmt.h"
|
||||||
#include "status.h"
|
#include "status.h"
|
||||||
|
#include "atoi.h"
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
#include "icons.h"
|
#include "icons.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -395,20 +396,21 @@ void settings_load(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CUSTOM_EQ
|
#ifdef CUSTOM_EQ
|
||||||
/ *
|
/*
|
||||||
* Loads a .eq file
|
* Loads a .eq file
|
||||||
* /
|
*/
|
||||||
bool settings_load_eq(char* file)
|
bool settings_load_eq(char* file)
|
||||||
{
|
{
|
||||||
char buffer[128];
|
char buffer[128];
|
||||||
char buf_set[16];
|
char buf_set[16];
|
||||||
|
char buf_disp[16];
|
||||||
char buf_val[8];
|
char buf_val[8];
|
||||||
int fd;
|
int fd;
|
||||||
int i;
|
int i;
|
||||||
unsigned int j;
|
|
||||||
int d = 0;
|
int d = 0;
|
||||||
int vtype = 0;
|
int vtype = 0;
|
||||||
|
|
||||||
|
|
||||||
fd = open(file, O_RDONLY);
|
fd = open(file, O_RDONLY);
|
||||||
|
|
||||||
if (-1 != fd)
|
if (-1 != fd)
|
||||||
|
|
@ -443,12 +445,31 @@ bool settings_load_eq(char* file)
|
||||||
buf_val[d++] = buffer[i];
|
buf_val[d++] = buffer[i];
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if(strcasecmp(buf_set,"volume"))
|
lcd_clear_display();
|
||||||
{
|
snprintf(buf_disp,sizeof(buf_disp),"[%s]", buf_set);
|
||||||
global_settings.volume = 0;
|
lcd_puts(0,0,buf_disp);
|
||||||
for(j=0;j<strlen(buf_val);j++)
|
lcd_puts(0,1,buf_val);
|
||||||
global_settings.volume = global_settings.volume *
|
sleep(HZ/2);
|
||||||
10 + (buf_val[j] - '0');
|
if (!strcasecmp(buf_set,"volume")) {
|
||||||
|
global_settings.volume = (atoi(buf_val)/2);
|
||||||
|
} else
|
||||||
|
if (!strcasecmp(buf_set,"bass")) {
|
||||||
|
if (buf_val[0] == '-')
|
||||||
|
global_settings.bass = mpeg_val2phys(SOUND_BASS,(15-atoi(buf_val+1)));
|
||||||
|
else
|
||||||
|
global_settings.bass = mpeg_val2phys(SOUND_BASS,(atoi(buf_val)+15));
|
||||||
|
} else
|
||||||
|
if (!strcasecmp(buf_set,"treble")) {
|
||||||
|
if (buf_val[0] == '-')
|
||||||
|
global_settings.treble = (15-atoi(buf_val+1));
|
||||||
|
else
|
||||||
|
global_settings.treble = (atoi(buf_val)+15);
|
||||||
|
}
|
||||||
|
if (!strcasecmp(buf_set,"balance")) {
|
||||||
|
if (buf_val[0] == '-')
|
||||||
|
global_settings.balance = (25-(atoi(buf_val+1)/2));
|
||||||
|
else
|
||||||
|
global_settings.balance = ((atoi(buf_val)/2)+25);
|
||||||
}
|
}
|
||||||
vtype = 0;
|
vtype = 0;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue