diff options
author | Martin Scarratt <mmmm@rockbox.org> | 2006-07-31 12:55:27 +0000 |
---|---|---|
committer | Martin Scarratt <mmmm@rockbox.org> | 2006-07-31 12:55:27 +0000 |
commit | 1ae0cdbc468d929ce1b8d9b8e1e95609feff5427 (patch) | |
tree | 9e7f702b829de6ef30d498b4bc027a5208413553 /apps/recorder | |
parent | 7a47313a21c23b7e3e3ce69c6e799beb6bbf3548 (diff) | |
download | rockbox-1ae0cdbc468d929ce1b8d9b8e1e95609feff5427.tar.gz rockbox-1ae0cdbc468d929ce1b8d9b8e1e95609feff5427.zip |
I-River targets: A workaround for the recording interference hardware issue when recording with a remote. Disable remote LCD while recording by pressing vol- on the remote. All remote buttons and cliplight are still operational while lcd is disabled.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10376 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/recorder')
-rw-r--r-- | apps/recorder/peakmeter.c | 4 | ||||
-rw-r--r-- | apps/recorder/peakmeter.h | 2 | ||||
-rw-r--r-- | apps/recorder/recording.c | 42 |
3 files changed, 40 insertions, 8 deletions
diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c index 4b8843cff3..0f8da98308 100644 --- a/apps/recorder/peakmeter.c +++ b/apps/recorder/peakmeter.c | |||
@@ -1169,7 +1169,7 @@ void peak_meter_draw_trig(int xpos, int ypos) | |||
1169 | } | 1169 | } |
1170 | #endif | 1170 | #endif |
1171 | 1171 | ||
1172 | int peak_meter_draw_get_btn(int x, int y[], int height) | 1172 | int peak_meter_draw_get_btn(int x, int y[], int height, int nb_screens) |
1173 | { | 1173 | { |
1174 | int button = BUTTON_NONE; | 1174 | int button = BUTTON_NONE; |
1175 | long next_refresh = current_tick; | 1175 | long next_refresh = current_tick; |
@@ -1195,7 +1195,7 @@ int peak_meter_draw_get_btn(int x, int y[], int height) | |||
1195 | sleep(0); /* Sleep until end of current tick. */ | 1195 | sleep(0); /* Sleep until end of current tick. */ |
1196 | } | 1196 | } |
1197 | if (TIME_AFTER(current_tick, next_refresh)) { | 1197 | if (TIME_AFTER(current_tick, next_refresh)) { |
1198 | FOR_NB_SCREENS(i) | 1198 | for(i = 0; i < nb_screens; i++) |
1199 | { | 1199 | { |
1200 | peak_meter_screen(&screens[i], x, y[i], height); | 1200 | peak_meter_screen(&screens[i], x, y[i], height); |
1201 | screens[i].update_rect(x, y[i], screens[i].width, height); | 1201 | screens[i].update_rect(x, y[i], screens[i].width, height); |
diff --git a/apps/recorder/peakmeter.h b/apps/recorder/peakmeter.h index 4f92b14907..5456419181 100644 --- a/apps/recorder/peakmeter.h +++ b/apps/recorder/peakmeter.h | |||
@@ -29,7 +29,7 @@ extern bool peak_meter_histogram(void); | |||
29 | extern bool peak_meter_enabled; | 29 | extern bool peak_meter_enabled; |
30 | 30 | ||
31 | extern void peak_meter_playback(bool playback); | 31 | extern void peak_meter_playback(bool playback); |
32 | extern int peak_meter_draw_get_btn(int x, int y[], int height); | 32 | extern int peak_meter_draw_get_btn(int x, int y[], int height, int nb_screens); |
33 | extern void peak_meter_set_clip_hold(int time); | 33 | extern void peak_meter_set_clip_hold(int time); |
34 | extern void peak_meter_peek(void); | 34 | extern void peak_meter_peek(void); |
35 | extern void peak_meter_init_range( bool dbfs, int range_min, int range_max); | 35 | extern void peak_meter_init_range( bool dbfs, int range_min, int range_max); |
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index 06a6fd9b94..b45fc13345 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c | |||
@@ -111,6 +111,7 @@ | |||
111 | #define REC_RC_NEXT BUTTON_RC_FF | 111 | #define REC_RC_NEXT BUTTON_RC_FF |
112 | #define REC_RC_PREV BUTTON_RC_REW | 112 | #define REC_RC_PREV BUTTON_RC_REW |
113 | #define REC_RC_SETTINGS BUTTON_RC_MODE | 113 | #define REC_RC_SETTINGS BUTTON_RC_MODE |
114 | #define BUTTON_RC_DISPLAY BUTTON_RC_VOL_DOWN | ||
114 | 115 | ||
115 | #elif (CONFIG_KEYPAD == IAUDIO_X5_PAD) | 116 | #elif (CONFIG_KEYPAD == IAUDIO_X5_PAD) |
116 | #define REC_SHUTDOWN (BUTTON_POWER | BUTTON_REPEAT) | 117 | #define REC_SHUTDOWN (BUTTON_POWER | BUTTON_REPEAT) |
@@ -155,6 +156,8 @@ bool f3_rec_screen(void); | |||
155 | 156 | ||
156 | #define MAX_FILE_SIZE 0x7F800000 /* 2 GB - 4 MB */ | 157 | #define MAX_FILE_SIZE 0x7F800000 /* 2 GB - 4 MB */ |
157 | 158 | ||
159 | int screen_update = NB_SCREENS; | ||
160 | bool remote_display_on = true; | ||
158 | const char* const freq_str[6] = | 161 | const char* const freq_str[6] = |
159 | { | 162 | { |
160 | "44.1kHz", | 163 | "44.1kHz", |
@@ -422,6 +425,16 @@ bool recording_screen(void) | |||
422 | 425 | ||
423 | if(rec_create_directory() > 0) | 426 | if(rec_create_directory() > 0) |
424 | have_recorded = true; | 427 | have_recorded = true; |
428 | |||
429 | if (!remote_display_on) | ||
430 | { | ||
431 | screens[1].clear_display(); | ||
432 | snprintf(buf, 32, str(LANG_REMOTE_LCD_ON)); | ||
433 | screens[1].puts((screens[1].width/w - strlen(buf))/2, | ||
434 | screens[1].height/(h*2) + 1, buf); | ||
435 | screens[1].update(); | ||
436 | gui_syncsplash(0, true, str(LANG_REMOTE_LCD_OFF)); | ||
437 | } | ||
425 | 438 | ||
426 | while(!done) | 439 | while(!done) |
427 | { | 440 | { |
@@ -479,7 +492,7 @@ bool recording_screen(void) | |||
479 | #endif /* CONFIG_LED */ | 492 | #endif /* CONFIG_LED */ |
480 | 493 | ||
481 | /* Wait for a button a while (HZ/10) drawing the peak meter */ | 494 | /* Wait for a button a while (HZ/10) drawing the peak meter */ |
482 | button = peak_meter_draw_get_btn(0, pm_y, h * PM_HEIGHT); | 495 | button = peak_meter_draw_get_btn(0, pm_y, h * PM_HEIGHT, screen_update); |
483 | 496 | ||
484 | if (last_audio_stat != audio_stat) | 497 | if (last_audio_stat != audio_stat) |
485 | { | 498 | { |
@@ -492,6 +505,26 @@ bool recording_screen(void) | |||
492 | 505 | ||
493 | switch(button) | 506 | switch(button) |
494 | { | 507 | { |
508 | #ifdef BUTTON_RC_DISPLAY | ||
509 | case BUTTON_RC_DISPLAY: | ||
510 | if (remote_display_on) | ||
511 | { | ||
512 | remote_display_on = false; | ||
513 | screen_update = 1; | ||
514 | screens[1].clear_display(); | ||
515 | snprintf(buf, 32, str(LANG_REMOTE_LCD_ON)); | ||
516 | screens[1].puts((screens[1].width/w - strlen(buf))/2, | ||
517 | screens[1].height/(h*2) + 1, buf); | ||
518 | screens[1].update(); | ||
519 | gui_syncsplash(0, true, str(LANG_REMOTE_LCD_OFF)); | ||
520 | } | ||
521 | else | ||
522 | { | ||
523 | remote_display_on = true; | ||
524 | screen_update = NB_SCREENS; | ||
525 | } | ||
526 | break; | ||
527 | #endif | ||
495 | case REC_STOPEXIT: | 528 | case REC_STOPEXIT: |
496 | case REC_SHUTDOWN: | 529 | case REC_SHUTDOWN: |
497 | #ifdef REC_RC_STOPEXIT | 530 | #ifdef REC_RC_STOPEXIT |
@@ -1065,10 +1098,9 @@ bool recording_screen(void) | |||
1065 | FOR_NB_SCREENS(i) | 1098 | FOR_NB_SCREENS(i) |
1066 | screens[i].puts(0, filename_offset[i] + PM_HEIGHT + 5, buf); | 1099 | screens[i].puts(0, filename_offset[i] + PM_HEIGHT + 5, buf); |
1067 | 1100 | ||
1068 | gui_syncstatusbar_draw(&statusbars, true); | 1101 | for(i = 0; i < screen_update; i++) |
1069 | |||
1070 | FOR_NB_SCREENS(i) | ||
1071 | { | 1102 | { |
1103 | gui_statusbar_draw(&(statusbars.statusbars[i]), true); | ||
1072 | peak_meter_screen(&screens[i], 0, pm_y[i], h*PM_HEIGHT); | 1104 | peak_meter_screen(&screens[i], 0, pm_y[i], h*PM_HEIGHT); |
1073 | screens[i].update(); | 1105 | screens[i].update(); |
1074 | } | 1106 | } |
@@ -1077,7 +1109,7 @@ bool recording_screen(void) | |||
1077 | if (peak_meter_trigger_status() != TRIG_OFF) | 1109 | if (peak_meter_trigger_status() != TRIG_OFF) |
1078 | { | 1110 | { |
1079 | peak_meter_draw_trig(LCD_WIDTH - TRIG_WIDTH, 4 * h); | 1111 | peak_meter_draw_trig(LCD_WIDTH - TRIG_WIDTH, 4 * h); |
1080 | FOR_NB_SCREENS(i){ | 1112 | for(i = 0; i < screen_update; i++){ |
1081 | screens[i].update_rect(LCD_WIDTH - (TRIG_WIDTH + 2), 4 * h, | 1113 | screens[i].update_rect(LCD_WIDTH - (TRIG_WIDTH + 2), 4 * h, |
1082 | TRIG_WIDTH + 2, TRIG_HEIGHT); | 1114 | TRIG_WIDTH + 2, TRIG_HEIGHT); |
1083 | } | 1115 | } |