continuation of last nights statusbar cleanup.
accept FS#9858 and FS#9859 make the rec and fm screens force the statusbar the correct way now which doesnt need extra status variables git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19904 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
1a00056f1f
commit
701a593c5d
11 changed files with 42 additions and 62 deletions
|
@ -813,11 +813,6 @@ void gui_syncstatusbar_draw(struct gui_syncstatusbar * bars,
|
|||
}
|
||||
}
|
||||
|
||||
int gui_statusbar_height(void)
|
||||
{
|
||||
return global_settings.statusbar ? STATUSBAR_HEIGHT : 0;
|
||||
}
|
||||
|
||||
void gui_statusbar_changed(bool enabled)
|
||||
{
|
||||
(void)enabled;
|
||||
|
|
|
@ -98,7 +98,6 @@ struct gui_syncstatusbar
|
|||
|
||||
extern void gui_syncstatusbar_init(struct gui_syncstatusbar * bars);
|
||||
extern void gui_syncstatusbar_draw(struct gui_syncstatusbar * bars, bool force_redraw);
|
||||
extern int gui_statusbar_height(void);
|
||||
void gui_statusbar_changed(bool enabled);
|
||||
|
||||
#endif /*_GUI_STATUSBAR_H_*/
|
||||
|
|
|
@ -458,7 +458,7 @@ static void trigger_speak_item(const struct settings_list **settings,
|
|||
}
|
||||
int rectrigger(void)
|
||||
{
|
||||
struct viewport vp[NB_SCREENS];
|
||||
struct viewport vp[NB_SCREENS], triggervp[NB_SCREENS];
|
||||
struct gui_synclist lists;
|
||||
int i, action = ACTION_REDRAW;
|
||||
bool done = false, changed = true;
|
||||
|
@ -488,12 +488,15 @@ int rectrigger(void)
|
|||
screens[i].update();
|
||||
viewport_set_defaults(&vp[i], i);
|
||||
vp[i].height -= SYSFONT_HEIGHT*2;
|
||||
triggervp[i] = vp[i];
|
||||
triggervp[i].y = vp[i].y + vp[i].height;
|
||||
triggervp[i].height = SYSFONT_HEIGHT*2;
|
||||
trig_xpos[i] = 0;
|
||||
trig_ypos[i] = vp[i].y + vp[i].height;
|
||||
trig_ypos[i] = 0;
|
||||
pm_x[i] = 0;
|
||||
pm_y[i] = screens[i].getheight() - SYSFONT_HEIGHT;
|
||||
pm_y[i] = SYSFONT_HEIGHT;
|
||||
pm_h[i] = SYSFONT_HEIGHT;
|
||||
trig_width[i] = screens[i].getwidth();
|
||||
trig_width[i] = triggervp[i].width;
|
||||
}
|
||||
/* TODO: what to do if there is < 4 lines on the screen? */
|
||||
|
||||
|
@ -542,9 +545,11 @@ int rectrigger(void)
|
|||
changed = false;
|
||||
}
|
||||
|
||||
FOR_NB_SCREENS(i)
|
||||
screens[i].set_viewport(&triggervp[i]);
|
||||
peak_meter_draw_trig(trig_xpos, trig_ypos, trig_width, NB_SCREENS);
|
||||
action = peak_meter_draw_get_btn(CONTEXT_SETTINGS_RECTRIGGER,
|
||||
pm_x, pm_y, pm_h, NB_SCREENS);
|
||||
pm_x, pm_y, pm_h, NB_SCREENS, triggervp);
|
||||
FOR_NB_SCREENS(i)
|
||||
screens[i].update();
|
||||
i = gui_synclist_get_sel_pos(&lists);
|
||||
|
|
|
@ -298,7 +298,7 @@ int kbd_input(char* text, int buflen)
|
|||
int morse_tick = 0;
|
||||
char buf[2];
|
||||
#endif
|
||||
char oldbars = viewportmanager_set_statusbar(VP_SB_HIDE_ALL);
|
||||
int oldbars = viewportmanager_set_statusbar(VP_SB_HIDE_ALL);
|
||||
FOR_NB_SCREENS(l)
|
||||
{
|
||||
struct keyboard_parameters *pm = ¶m[l];
|
||||
|
|
|
@ -1329,7 +1329,8 @@ void peak_meter_draw_trig(int xpos[], int ypos[],
|
|||
#endif
|
||||
|
||||
int peak_meter_draw_get_btn(int action_context, int x[], int y[],
|
||||
int height[], int nb_screens)
|
||||
int height[], int nb_screens,
|
||||
struct viewport vps[])
|
||||
{
|
||||
int button = BUTTON_NONE;
|
||||
long next_refresh = current_tick;
|
||||
|
@ -1362,6 +1363,7 @@ int peak_meter_draw_get_btn(int action_context, int x[], int y[],
|
|||
if (TIME_AFTER(current_tick, next_refresh)) {
|
||||
for(i = 0; i < nb_screens; i++)
|
||||
{
|
||||
screens[i].set_viewport(&vps[i]);
|
||||
peak_meter_screen(&screens[i], x[i], y[i], height[i]);
|
||||
screens[i].update_viewport_rect(x[i], y[i],
|
||||
screens[i].getwidth() - x[i],
|
||||
|
|
|
@ -36,7 +36,8 @@ extern bool peak_meter_enabled;
|
|||
|
||||
extern void peak_meter_playback(bool playback);
|
||||
extern int peak_meter_draw_get_btn(int action_context, int x[], int y[],
|
||||
int height[], int nb_screens);
|
||||
int height[], int nb_screens,
|
||||
struct viewport vps[]);
|
||||
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);
|
||||
|
|
|
@ -459,7 +459,6 @@ int radio_screen(void)
|
|||
bool update_screen = true;
|
||||
bool screen_freeze = false;
|
||||
bool keep_playing = false;
|
||||
bool statusbar = global_settings.statusbar;
|
||||
bool talk = false;
|
||||
#ifdef FM_RECORD_DBLPRE
|
||||
int lastbutton = BUTTON_NONE;
|
||||
|
@ -477,6 +476,7 @@ int radio_screen(void)
|
|||
int button_timeout = current_tick + (2*HZ);
|
||||
#endif
|
||||
struct viewport vp[NB_SCREENS];
|
||||
int oldbars = 0, fmbars = VP_SB_ALLSCREENS;
|
||||
#ifdef HAVE_BUTTONBAR
|
||||
struct gui_buttonbar buttonbar;
|
||||
gui_buttonbar_init(&buttonbar);
|
||||
|
@ -487,8 +487,9 @@ int radio_screen(void)
|
|||
in_screen = true;
|
||||
|
||||
/* always display status bar in radio screen for now */
|
||||
global_status.statusbar_forced = statusbar?0:1;
|
||||
global_settings.statusbar = true;
|
||||
FOR_NB_SCREENS(i)
|
||||
fmbars |= VP_SB_IGNORE_SETTING(i);
|
||||
oldbars = viewportmanager_set_statusbar(fmbars);
|
||||
FOR_NB_SCREENS(i)
|
||||
{
|
||||
viewport_set_defaults(&vp[i], i);
|
||||
|
@ -744,8 +745,10 @@ int radio_screen(void)
|
|||
break;
|
||||
|
||||
case ACTION_FM_MENU:
|
||||
viewportmanager_set_statusbar(oldbars);
|
||||
radio_menu();
|
||||
curr_preset = find_preset(curr_freq);
|
||||
viewportmanager_set_statusbar(fmbars);
|
||||
FOR_NB_SCREENS(i)
|
||||
{
|
||||
screens[i].set_viewport(&vp[i]);
|
||||
|
@ -777,7 +780,9 @@ int radio_screen(void)
|
|||
|
||||
break;
|
||||
}
|
||||
viewportmanager_set_statusbar(oldbars);
|
||||
handle_radio_presets();
|
||||
viewportmanager_set_statusbar(fmbars);
|
||||
FOR_NB_SCREENS(i)
|
||||
{
|
||||
screens[i].set_viewport(&vp[i]);
|
||||
|
@ -1073,9 +1078,7 @@ int radio_screen(void)
|
|||
cpu_idle_mode(false);
|
||||
#endif
|
||||
|
||||
/* restore status bar settings */
|
||||
global_settings.statusbar = statusbar;
|
||||
global_status.statusbar_forced = 0;
|
||||
viewportmanager_set_statusbar(oldbars);
|
||||
in_screen = false;
|
||||
#if CONFIG_CODEC != SWCODEC
|
||||
return have_recorded;
|
||||
|
|
|
@ -1021,6 +1021,7 @@ bool recording_screen(bool no_source)
|
|||
int peak_l, peak_r;
|
||||
int balance = 0;
|
||||
#endif
|
||||
int oldbars, recbars = VP_SB_ALLSCREENS;
|
||||
int i;
|
||||
int pm_x[NB_SCREENS]; /* peakmeter (and trigger bar) x pos */
|
||||
int pm_y[NB_SCREENS]; /* peakmeter y pos */
|
||||
|
@ -1034,12 +1035,6 @@ bool recording_screen(bool no_source)
|
|||
int prev_rec_source = global_settings.rec_source; /* detect source change */
|
||||
#endif
|
||||
|
||||
#if CONFIG_TUNER
|
||||
bool statusbar = global_settings.statusbar;
|
||||
global_status.statusbar_forced = statusbar?0:1;
|
||||
global_settings.statusbar = true;
|
||||
#endif
|
||||
|
||||
static const unsigned char *byte_units[] = {
|
||||
ID2P(LANG_BYTE),
|
||||
ID2P(LANG_KILOBYTE),
|
||||
|
@ -1095,6 +1090,9 @@ bool recording_screen(bool no_source)
|
|||
#endif
|
||||
|
||||
/* viewport init and calculations that only needs to be done once */
|
||||
FOR_NB_SCREENS(i)
|
||||
recbars |= VP_SB_IGNORE_SETTING(i);
|
||||
oldbars = viewportmanager_set_statusbar(recbars);
|
||||
FOR_NB_SCREENS(i)
|
||||
{
|
||||
struct viewport *v;
|
||||
|
@ -1169,8 +1167,6 @@ bool recording_screen(bool no_source)
|
|||
if(compact_view[i])
|
||||
pm_h[i] /= 2;
|
||||
trig_width[i] = vp_top[i].width - pm_x[i];
|
||||
screens[i].clear_display();
|
||||
screens[i].update();
|
||||
}
|
||||
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
|
@ -1307,15 +1303,10 @@ bool recording_screen(bool no_source)
|
|||
}
|
||||
#endif /* CONFIG_LED */
|
||||
|
||||
/* first set current vp - stays like this for drawing that follows */
|
||||
FOR_NB_SCREENS(i)
|
||||
screens[i].set_viewport(&vp_top[i]);
|
||||
|
||||
/* Wait for a button a while (HZ/10) drawing the peak meter */
|
||||
button = peak_meter_draw_get_btn(CONTEXT_RECSCREEN,
|
||||
pm_x, pm_y, pm_h,
|
||||
screen_update);
|
||||
|
||||
screen_update, vp_top);
|
||||
if (last_audio_stat != audio_stat)
|
||||
{
|
||||
if (audio_stat & AUDIO_STATUS_RECORD)
|
||||
|
@ -1336,9 +1327,6 @@ bool recording_screen(bool no_source)
|
|||
/* let list handle the button */
|
||||
gui_synclist_do_button(&lists, &button, LIST_WRAP_UNLESS_HELD);
|
||||
|
||||
/* list code changes active viewport - change it back */
|
||||
FOR_NB_SCREENS(i)
|
||||
screens[i].set_viewport(&vp_top[i]);
|
||||
|
||||
switch(button)
|
||||
{
|
||||
|
@ -1599,6 +1587,7 @@ bool recording_screen(bool no_source)
|
|||
/* led is restored at begin of loop / end of function */
|
||||
led(false);
|
||||
#endif
|
||||
viewportmanager_set_statusbar(oldbars);
|
||||
if (recording_menu(no_source))
|
||||
{
|
||||
done = 1;
|
||||
|
@ -1612,6 +1601,7 @@ bool recording_screen(bool no_source)
|
|||
done = -1;
|
||||
/* the init is now done at the beginning of the loop */
|
||||
}
|
||||
viewportmanager_set_statusbar(recbars);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1623,6 +1613,7 @@ bool recording_screen(bool no_source)
|
|||
/* led is restored at begin of loop / end of function */
|
||||
led(false);
|
||||
#endif
|
||||
viewportmanager_set_statusbar(oldbars);
|
||||
if (f2_rec_screen())
|
||||
{
|
||||
rec_status |= RCSTAT_HAVE_RECORDED;
|
||||
|
@ -1630,6 +1621,7 @@ bool recording_screen(bool no_source)
|
|||
}
|
||||
else
|
||||
update_countdown = 0; /* Update immediately */
|
||||
viewportmanager_set_statusbar(recbars);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1645,6 +1637,7 @@ bool recording_screen(bool no_source)
|
|||
/* led is restored at begin of loop / end of function */
|
||||
led(false);
|
||||
#endif
|
||||
viewportmanager_set_statusbar(oldbars);
|
||||
if (f3_rec_screen())
|
||||
{
|
||||
rec_status |= RCSTAT_HAVE_RECORDED;
|
||||
|
@ -1652,6 +1645,7 @@ bool recording_screen(bool no_source)
|
|||
}
|
||||
else
|
||||
update_countdown = 0; /* Update immediately */
|
||||
viewportmanager_set_statusbar(recbars);
|
||||
}
|
||||
break;
|
||||
#endif /* CONFIG_KEYPAD == RECORDER_PAD */
|
||||
|
@ -1692,10 +1686,12 @@ bool recording_screen(bool no_source)
|
|||
unsigned int dseconds, dhours, dminutes;
|
||||
unsigned long num_recorded_bytes, dsize, dmb;
|
||||
|
||||
/* we assume vp_top is the current viewport! */
|
||||
FOR_NB_ACTIVE_SCREENS(i)
|
||||
|
||||
FOR_NB_SCREENS(i)
|
||||
{
|
||||
screens[i].set_viewport(&vp_top[i]);
|
||||
screens[i].clear_viewport();
|
||||
|
||||
}
|
||||
update_countdown = 5;
|
||||
last_seconds = seconds;
|
||||
|
||||
|
@ -1863,7 +1859,6 @@ bool recording_screen(bool no_source)
|
|||
/* draw peakmeter again (check if this can be removed) */
|
||||
FOR_NB_ACTIVE_SCREENS(i)
|
||||
{
|
||||
gui_statusbar_draw(&(statusbars.statusbars[i]), true);
|
||||
screens[i].set_viewport(&vp_top[i]);
|
||||
peak_meter_screen(&screens[i], pm_x[i], pm_y[i], pm_h[i]);
|
||||
screens[i].update();
|
||||
|
@ -1930,6 +1925,7 @@ rec_abort:
|
|||
rec_status &= ~RCSTAT_IN_RECSCREEN;
|
||||
sound_settings_apply();
|
||||
|
||||
viewportmanager_set_statusbar(oldbars);
|
||||
FOR_NB_SCREENS(i)
|
||||
screens[i].setfont(FONT_UI);
|
||||
|
||||
|
@ -1943,11 +1939,6 @@ rec_abort:
|
|||
ata_set_led_enabled(true);
|
||||
#endif
|
||||
|
||||
#if CONFIG_TUNER
|
||||
global_settings.statusbar = statusbar;
|
||||
global_status.statusbar_forced = 0;
|
||||
#endif
|
||||
|
||||
settings_save();
|
||||
|
||||
return (rec_status & RCSTAT_BEEN_IN_USB_MODE) != 0;
|
||||
|
|
|
@ -522,11 +522,6 @@ static bool settings_write_config(const char* filename, int options)
|
|||
fd = open(filename,O_CREAT|O_TRUNC|O_WRONLY);
|
||||
if (fd < 0)
|
||||
return false;
|
||||
#if CONFIG_TUNER
|
||||
bool statusbar = global_settings.statusbar;
|
||||
if (global_status.statusbar_forced != 0 && statusbar)
|
||||
global_settings.statusbar = false;
|
||||
#endif
|
||||
fdprintf(fd, "# .cfg file created by rockbox %s - "
|
||||
"http://www.rockbox.org\r\n\r\n", appsversion);
|
||||
for(i=0; i<nb_settings; i++)
|
||||
|
@ -567,9 +562,6 @@ static bool settings_write_config(const char* filename, int options)
|
|||
fdprintf(fd,"%s: %s\r\n",settings[i].cfg_name,value);
|
||||
} /* for(...) */
|
||||
close(fd);
|
||||
#if CONFIG_TUNER
|
||||
global_settings.statusbar = statusbar;
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
#ifndef HAVE_RTC_RAM
|
||||
|
|
|
@ -294,11 +294,6 @@ struct system_status
|
|||
#if CONFIG_TUNER
|
||||
int last_frequency; /* Last frequency for resuming, in FREQ_STEP units,
|
||||
relative to MIN_FREQ */
|
||||
int statusbar_forced; /* fix the bug where the statusbar would stay shown
|
||||
if powered off inside the fm screen...
|
||||
for some reason the screen doesnt use global_settings.statusbar
|
||||
obviously a better fix is to fix the screen... so remove this
|
||||
when that happens */
|
||||
#endif
|
||||
signed char last_screen;
|
||||
int viewer_icon_count;
|
||||
|
|
|
@ -1425,9 +1425,6 @@ const struct settings_list settings[] = {
|
|||
3, "list_accel_wait", UNIT_SEC, 1, 10, 1,
|
||||
scanaccel_formatter, getlang_unit_0_is_off, NULL),
|
||||
#endif /* HAVE_SCROLLWHEEL */
|
||||
#if CONFIG_TUNER
|
||||
SYSTEM_SETTING(0, statusbar_forced, 0),
|
||||
#endif
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
/* keyclick */
|
||||
CHOICE_SETTING(0, keyclick, LANG_KEYCLICK, 0,
|
||||
|
|
Loading…
Reference in a new issue