From 1ae0cdbc468d929ce1b8d9b8e1e95609feff5427 Mon Sep 17 00:00:00 2001 From: Martin Scarratt Date: Mon, 31 Jul 2006 12:55:27 +0000 Subject: 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 --- apps/recorder/peakmeter.c | 4 ++-- apps/recorder/peakmeter.h | 2 +- apps/recorder/recording.c | 42 +++++++++++++++++++++++++++++++++++++----- 3 files changed, 40 insertions(+), 8 deletions(-) (limited to 'apps/recorder') 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) } #endif -int peak_meter_draw_get_btn(int x, int y[], int height) +int peak_meter_draw_get_btn(int x, int y[], int height, int nb_screens) { int button = BUTTON_NONE; long next_refresh = current_tick; @@ -1195,7 +1195,7 @@ int peak_meter_draw_get_btn(int x, int y[], int height) sleep(0); /* Sleep until end of current tick. */ } if (TIME_AFTER(current_tick, next_refresh)) { - FOR_NB_SCREENS(i) + for(i = 0; i < nb_screens; i++) { peak_meter_screen(&screens[i], x, y[i], height); 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); extern bool peak_meter_enabled; extern void peak_meter_playback(bool playback); -extern int peak_meter_draw_get_btn(int x, int y[], int height); +extern int peak_meter_draw_get_btn(int x, int y[], int height, int nb_screens); extern void peak_meter_set_clip_hold(int time); extern void peak_meter_peek(void); 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 @@ #define REC_RC_NEXT BUTTON_RC_FF #define REC_RC_PREV BUTTON_RC_REW #define REC_RC_SETTINGS BUTTON_RC_MODE +#define BUTTON_RC_DISPLAY BUTTON_RC_VOL_DOWN #elif (CONFIG_KEYPAD == IAUDIO_X5_PAD) #define REC_SHUTDOWN (BUTTON_POWER | BUTTON_REPEAT) @@ -155,6 +156,8 @@ bool f3_rec_screen(void); #define MAX_FILE_SIZE 0x7F800000 /* 2 GB - 4 MB */ +int screen_update = NB_SCREENS; +bool remote_display_on = true; const char* const freq_str[6] = { "44.1kHz", @@ -422,6 +425,16 @@ bool recording_screen(void) if(rec_create_directory() > 0) have_recorded = true; + + if (!remote_display_on) + { + screens[1].clear_display(); + snprintf(buf, 32, str(LANG_REMOTE_LCD_ON)); + screens[1].puts((screens[1].width/w - strlen(buf))/2, + screens[1].height/(h*2) + 1, buf); + screens[1].update(); + gui_syncsplash(0, true, str(LANG_REMOTE_LCD_OFF)); + } while(!done) { @@ -479,7 +492,7 @@ bool recording_screen(void) #endif /* CONFIG_LED */ /* Wait for a button a while (HZ/10) drawing the peak meter */ - button = peak_meter_draw_get_btn(0, pm_y, h * PM_HEIGHT); + button = peak_meter_draw_get_btn(0, pm_y, h * PM_HEIGHT, screen_update); if (last_audio_stat != audio_stat) { @@ -492,6 +505,26 @@ bool recording_screen(void) switch(button) { +#ifdef BUTTON_RC_DISPLAY + case BUTTON_RC_DISPLAY: + if (remote_display_on) + { + remote_display_on = false; + screen_update = 1; + screens[1].clear_display(); + snprintf(buf, 32, str(LANG_REMOTE_LCD_ON)); + screens[1].puts((screens[1].width/w - strlen(buf))/2, + screens[1].height/(h*2) + 1, buf); + screens[1].update(); + gui_syncsplash(0, true, str(LANG_REMOTE_LCD_OFF)); + } + else + { + remote_display_on = true; + screen_update = NB_SCREENS; + } + break; +#endif case REC_STOPEXIT: case REC_SHUTDOWN: #ifdef REC_RC_STOPEXIT @@ -1065,10 +1098,9 @@ bool recording_screen(void) FOR_NB_SCREENS(i) screens[i].puts(0, filename_offset[i] + PM_HEIGHT + 5, buf); - gui_syncstatusbar_draw(&statusbars, true); - - FOR_NB_SCREENS(i) + for(i = 0; i < screen_update; i++) { + gui_statusbar_draw(&(statusbars.statusbars[i]), true); peak_meter_screen(&screens[i], 0, pm_y[i], h*PM_HEIGHT); screens[i].update(); } @@ -1077,7 +1109,7 @@ bool recording_screen(void) if (peak_meter_trigger_status() != TRIG_OFF) { peak_meter_draw_trig(LCD_WIDTH - TRIG_WIDTH, 4 * h); - FOR_NB_SCREENS(i){ + for(i = 0; i < screen_update; i++){ screens[i].update_rect(LCD_WIDTH - (TRIG_WIDTH + 2), 4 * h, TRIG_WIDTH + 2, TRIG_HEIGHT); } -- cgit v1.2.3