summaryrefslogtreecommitdiffstats
path: root/apps/recorder
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2009-02-02 03:14:51 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2009-02-02 03:14:51 +0000
commit701a593c5df9bbf88711781e1abdb09690076034 (patch)
treeb81c31a5f3718f3eb9fd18652571ee1c89aed994 /apps/recorder
parent1a00056f1f225ee0d1643d3e4e603de171f7ab9a (diff)
downloadrockbox-701a593c5df9bbf88711781e1abdb09690076034.tar.gz
rockbox-701a593c5df9bbf88711781e1abdb09690076034.zip
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
Diffstat (limited to 'apps/recorder')
-rw-r--r--apps/recorder/keyboard.c2
-rw-r--r--apps/recorder/peakmeter.c4
-rw-r--r--apps/recorder/peakmeter.h3
-rw-r--r--apps/recorder/radio.c15
-rw-r--r--apps/recorder/recording.c43
5 files changed, 32 insertions, 35 deletions
diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c
index 02b1759a8a..a30871015b 100644
--- a/apps/recorder/keyboard.c
+++ b/apps/recorder/keyboard.c
@@ -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 = &param[l];
diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c
index 422b138020..18026292ad 100644
--- a/apps/recorder/peakmeter.c
+++ b/apps/recorder/peakmeter.c
@@ -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],
diff --git a/apps/recorder/peakmeter.h b/apps/recorder/peakmeter.h
index 8d3e92939f..6fc2d6be58 100644
--- a/apps/recorder/peakmeter.h
+++ b/apps/recorder/peakmeter.h
@@ -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);
diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c
index d01d24ccf2..8c8c56cb34 100644
--- a/apps/recorder/radio.c
+++ b/apps/recorder/radio.c
@@ -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;
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index bdf30212f7..c660867f2f 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -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),
@@ -1096,6 +1091,9 @@ bool recording_screen(bool no_source)
/* 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;
/* top vp, 4 lines, force sys font if total screen < 6 lines
@@ -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;