1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Martin Scarratt 2006-07-31 12:55:27 +00:00
parent 7a47313a21
commit 1ae0cdbc46
5 changed files with 69 additions and 9 deletions

View file

@ -8779,3 +8779,31 @@
*: "Stop recording" *: "Stop recording"
</voice> </voice>
</phrase> </phrase>
<phrase>
id: LANG_REMOTE_LCD_OFF
desc: Remote lcd off splash
user:
<source>
*: "Remote Display OFF"
</source>
<dest>
*: "Remote Display OFF"
</dest>
<voice>
*: "Remote Display OFF"
</voice>
</phrase>
<phrase>
id: LANG_REMOTE_LCD_ON
desc: Remote lcd off splash
user:
<source>
*: "(Vol- : Re-enable)"
</source>
<dest>
*: "(Vol- : Re-enable)"
</dest>
<voice>
*: "(Vol- : Re-enable)"
</voice>
</phrase>

View file

@ -1169,7 +1169,7 @@ void peak_meter_draw_trig(int xpos, int ypos)
} }
#endif #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; int button = BUTTON_NONE;
long next_refresh = current_tick; 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. */ sleep(0); /* Sleep until end of current tick. */
} }
if (TIME_AFTER(current_tick, next_refresh)) { 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); peak_meter_screen(&screens[i], x, y[i], height);
screens[i].update_rect(x, y[i], screens[i].width, height); screens[i].update_rect(x, y[i], screens[i].width, height);

View file

@ -29,7 +29,7 @@ extern bool peak_meter_histogram(void);
extern bool peak_meter_enabled; extern bool peak_meter_enabled;
extern void peak_meter_playback(bool playback); 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_set_clip_hold(int time);
extern void peak_meter_peek(void); extern void peak_meter_peek(void);
extern void peak_meter_init_range( bool dbfs, int range_min, int range_max); extern void peak_meter_init_range( bool dbfs, int range_min, int range_max);

View file

@ -111,6 +111,7 @@
#define REC_RC_NEXT BUTTON_RC_FF #define REC_RC_NEXT BUTTON_RC_FF
#define REC_RC_PREV BUTTON_RC_REW #define REC_RC_PREV BUTTON_RC_REW
#define REC_RC_SETTINGS BUTTON_RC_MODE #define REC_RC_SETTINGS BUTTON_RC_MODE
#define BUTTON_RC_DISPLAY BUTTON_RC_VOL_DOWN
#elif (CONFIG_KEYPAD == IAUDIO_X5_PAD) #elif (CONFIG_KEYPAD == IAUDIO_X5_PAD)
#define REC_SHUTDOWN (BUTTON_POWER | BUTTON_REPEAT) #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 */ #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] = const char* const freq_str[6] =
{ {
"44.1kHz", "44.1kHz",
@ -422,6 +425,16 @@ bool recording_screen(void)
if(rec_create_directory() > 0) if(rec_create_directory() > 0)
have_recorded = true; 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) while(!done)
{ {
@ -479,7 +492,7 @@ bool recording_screen(void)
#endif /* CONFIG_LED */ #endif /* CONFIG_LED */
/* Wait for a button a while (HZ/10) drawing the peak meter */ /* 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) if (last_audio_stat != audio_stat)
{ {
@ -492,6 +505,26 @@ bool recording_screen(void)
switch(button) 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_STOPEXIT:
case REC_SHUTDOWN: case REC_SHUTDOWN:
#ifdef REC_RC_STOPEXIT #ifdef REC_RC_STOPEXIT
@ -1065,10 +1098,9 @@ bool recording_screen(void)
FOR_NB_SCREENS(i) FOR_NB_SCREENS(i)
screens[i].puts(0, filename_offset[i] + PM_HEIGHT + 5, buf); screens[i].puts(0, filename_offset[i] + PM_HEIGHT + 5, buf);
gui_syncstatusbar_draw(&statusbars, true); for(i = 0; i < screen_update; i++)
FOR_NB_SCREENS(i)
{ {
gui_statusbar_draw(&(statusbars.statusbars[i]), true);
peak_meter_screen(&screens[i], 0, pm_y[i], h*PM_HEIGHT); peak_meter_screen(&screens[i], 0, pm_y[i], h*PM_HEIGHT);
screens[i].update(); screens[i].update();
} }
@ -1077,7 +1109,7 @@ bool recording_screen(void)
if (peak_meter_trigger_status() != TRIG_OFF) if (peak_meter_trigger_status() != TRIG_OFF)
{ {
peak_meter_draw_trig(LCD_WIDTH - TRIG_WIDTH, 4 * h); 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, screens[i].update_rect(LCD_WIDTH - (TRIG_WIDTH + 2), 4 * h,
TRIG_WIDTH + 2, TRIG_HEIGHT); TRIG_WIDTH + 2, TRIG_HEIGHT);
} }

View file

@ -818,7 +818,7 @@ bool rectrigger(void)
FOR_NB_SCREENS(i) FOR_NB_SCREENS(i)
pm_y[i] = screens[i].height - 8; pm_y[i] = screens[i].height - 8;
button = peak_meter_draw_get_btn(0, pm_y, 8); button = peak_meter_draw_get_btn(0, pm_y, 8, NB_SCREENS);
lcd_update(); lcd_update();