diff options
author | Justin Heiner <jheiner@rockbox.org> | 2002-09-05 16:30:07 +0000 |
---|---|---|
committer | Justin Heiner <jheiner@rockbox.org> | 2002-09-05 16:30:07 +0000 |
commit | c4207f1e341928df84593c9c68f9c2fd9b9bac8b (patch) | |
tree | 2a6b0f6c73ec04cc5da4cd3e254cf61a2e926507 /apps/settings.c | |
parent | 8ccbc766a451f875289559a0cf530bbbb1223ec1 (diff) | |
download | rockbox-c4207f1e341928df84593c9c68f9c2fd9b9bac8b.tar.gz rockbox-c4207f1e341928df84593c9c68f9c2fd9b9bac8b.zip |
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
Diffstat (limited to 'apps/settings.c')
-rw-r--r-- | apps/settings.c | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/apps/settings.c b/apps/settings.c index 7ebe612ce7..58f393d75a 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include "backlight.h" | 37 | #include "backlight.h" |
38 | #include "powermgmt.h" | 38 | #include "powermgmt.h" |
39 | #include "status.h" | 39 | #include "status.h" |
40 | #include "atoi.h" | ||
40 | #ifdef HAVE_LCD_BITMAP | 41 | #ifdef HAVE_LCD_BITMAP |
41 | #include "icons.h" | 42 | #include "icons.h" |
42 | #endif | 43 | #endif |
@@ -395,20 +396,21 @@ void settings_load(void) | |||
395 | } | 396 | } |
396 | 397 | ||
397 | #ifdef CUSTOM_EQ | 398 | #ifdef CUSTOM_EQ |
398 | / * | 399 | /* |
399 | * Loads a .eq file | 400 | * Loads a .eq file |
400 | * / | 401 | */ |
401 | bool settings_load_eq(char* file) | 402 | bool settings_load_eq(char* file) |
402 | { | 403 | { |
403 | char buffer[128]; | 404 | char buffer[128]; |
404 | char buf_set[16]; | 405 | char buf_set[16]; |
406 | char buf_disp[16]; | ||
405 | char buf_val[8]; | 407 | char buf_val[8]; |
406 | int fd; | 408 | int fd; |
407 | int i; | 409 | int i; |
408 | unsigned int j; | ||
409 | int d = 0; | 410 | int d = 0; |
410 | int vtype = 0; | 411 | int vtype = 0; |
411 | 412 | ||
413 | |||
412 | fd = open(file, O_RDONLY); | 414 | fd = open(file, O_RDONLY); |
413 | 415 | ||
414 | if (-1 != fd) | 416 | if (-1 != fd) |
@@ -443,12 +445,31 @@ bool settings_load_eq(char* file) | |||
443 | buf_val[d++] = buffer[i]; | 445 | buf_val[d++] = buffer[i]; |
444 | break; | 446 | break; |
445 | case 3: | 447 | case 3: |
446 | if(strcasecmp(buf_set,"volume")) | 448 | lcd_clear_display(); |
447 | { | 449 | snprintf(buf_disp,sizeof(buf_disp),"[%s]", buf_set); |
448 | global_settings.volume = 0; | 450 | lcd_puts(0,0,buf_disp); |
449 | for(j=0;j<strlen(buf_val);j++) | 451 | lcd_puts(0,1,buf_val); |
450 | global_settings.volume = global_settings.volume * | 452 | sleep(HZ/2); |
451 | 10 + (buf_val[j] - '0'); | 453 | if (!strcasecmp(buf_set,"volume")) { |
454 | global_settings.volume = (atoi(buf_val)/2); | ||
455 | } else | ||
456 | if (!strcasecmp(buf_set,"bass")) { | ||
457 | if (buf_val[0] == '-') | ||
458 | global_settings.bass = mpeg_val2phys(SOUND_BASS,(15-atoi(buf_val+1))); | ||
459 | else | ||
460 | global_settings.bass = mpeg_val2phys(SOUND_BASS,(atoi(buf_val)+15)); | ||
461 | } else | ||
462 | if (!strcasecmp(buf_set,"treble")) { | ||
463 | if (buf_val[0] == '-') | ||
464 | global_settings.treble = (15-atoi(buf_val+1)); | ||
465 | else | ||
466 | global_settings.treble = (atoi(buf_val)+15); | ||
467 | } | ||
468 | if (!strcasecmp(buf_set,"balance")) { | ||
469 | if (buf_val[0] == '-') | ||
470 | global_settings.balance = (25-(atoi(buf_val+1)/2)); | ||
471 | else | ||
472 | global_settings.balance = ((atoi(buf_val)/2)+25); | ||
452 | } | 473 | } |
453 | vtype = 0; | 474 | vtype = 0; |
454 | break; | 475 | break; |