diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2009-02-02 03:14:51 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2009-02-02 03:14:51 +0000 |
commit | 701a593c5df9bbf88711781e1abdb09690076034 (patch) | |
tree | b81c31a5f3718f3eb9fd18652571ee1c89aed994 /apps/recorder/recording.c | |
parent | 1a00056f1f225ee0d1643d3e4e603de171f7ab9a (diff) | |
download | rockbox-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/recording.c')
-rw-r--r-- | apps/recorder/recording.c | 43 |
1 files changed, 17 insertions, 26 deletions
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) | |||
1021 | int peak_l, peak_r; | 1021 | int peak_l, peak_r; |
1022 | int balance = 0; | 1022 | int balance = 0; |
1023 | #endif | 1023 | #endif |
1024 | int oldbars, recbars = VP_SB_ALLSCREENS; | ||
1024 | int i; | 1025 | int i; |
1025 | int pm_x[NB_SCREENS]; /* peakmeter (and trigger bar) x pos */ | 1026 | int pm_x[NB_SCREENS]; /* peakmeter (and trigger bar) x pos */ |
1026 | int pm_y[NB_SCREENS]; /* peakmeter y pos */ | 1027 | int pm_y[NB_SCREENS]; /* peakmeter y pos */ |
@@ -1034,12 +1035,6 @@ bool recording_screen(bool no_source) | |||
1034 | int prev_rec_source = global_settings.rec_source; /* detect source change */ | 1035 | int prev_rec_source = global_settings.rec_source; /* detect source change */ |
1035 | #endif | 1036 | #endif |
1036 | 1037 | ||
1037 | #if CONFIG_TUNER | ||
1038 | bool statusbar = global_settings.statusbar; | ||
1039 | global_status.statusbar_forced = statusbar?0:1; | ||
1040 | global_settings.statusbar = true; | ||
1041 | #endif | ||
1042 | |||
1043 | static const unsigned char *byte_units[] = { | 1038 | static const unsigned char *byte_units[] = { |
1044 | ID2P(LANG_BYTE), | 1039 | ID2P(LANG_BYTE), |
1045 | ID2P(LANG_KILOBYTE), | 1040 | ID2P(LANG_KILOBYTE), |
@@ -1096,6 +1091,9 @@ bool recording_screen(bool no_source) | |||
1096 | 1091 | ||
1097 | /* viewport init and calculations that only needs to be done once */ | 1092 | /* viewport init and calculations that only needs to be done once */ |
1098 | FOR_NB_SCREENS(i) | 1093 | FOR_NB_SCREENS(i) |
1094 | recbars |= VP_SB_IGNORE_SETTING(i); | ||
1095 | oldbars = viewportmanager_set_statusbar(recbars); | ||
1096 | FOR_NB_SCREENS(i) | ||
1099 | { | 1097 | { |
1100 | struct viewport *v; | 1098 | struct viewport *v; |
1101 | /* top vp, 4 lines, force sys font if total screen < 6 lines | 1099 | /* top vp, 4 lines, force sys font if total screen < 6 lines |
@@ -1169,8 +1167,6 @@ bool recording_screen(bool no_source) | |||
1169 | if(compact_view[i]) | 1167 | if(compact_view[i]) |
1170 | pm_h[i] /= 2; | 1168 | pm_h[i] /= 2; |
1171 | trig_width[i] = vp_top[i].width - pm_x[i]; | 1169 | trig_width[i] = vp_top[i].width - pm_x[i]; |
1172 | screens[i].clear_display(); | ||
1173 | screens[i].update(); | ||
1174 | } | 1170 | } |
1175 | 1171 | ||
1176 | #if CONFIG_CODEC == SWCODEC | 1172 | #if CONFIG_CODEC == SWCODEC |
@@ -1307,15 +1303,10 @@ bool recording_screen(bool no_source) | |||
1307 | } | 1303 | } |
1308 | #endif /* CONFIG_LED */ | 1304 | #endif /* CONFIG_LED */ |
1309 | 1305 | ||
1310 | /* first set current vp - stays like this for drawing that follows */ | ||
1311 | FOR_NB_SCREENS(i) | ||
1312 | screens[i].set_viewport(&vp_top[i]); | ||
1313 | |||
1314 | /* Wait for a button a while (HZ/10) drawing the peak meter */ | 1306 | /* Wait for a button a while (HZ/10) drawing the peak meter */ |
1315 | button = peak_meter_draw_get_btn(CONTEXT_RECSCREEN, | 1307 | button = peak_meter_draw_get_btn(CONTEXT_RECSCREEN, |
1316 | pm_x, pm_y, pm_h, | 1308 | pm_x, pm_y, pm_h, |
1317 | screen_update); | 1309 | screen_update, vp_top); |
1318 | |||
1319 | if (last_audio_stat != audio_stat) | 1310 | if (last_audio_stat != audio_stat) |
1320 | { | 1311 | { |
1321 | if (audio_stat & AUDIO_STATUS_RECORD) | 1312 | if (audio_stat & AUDIO_STATUS_RECORD) |
@@ -1336,9 +1327,6 @@ bool recording_screen(bool no_source) | |||
1336 | /* let list handle the button */ | 1327 | /* let list handle the button */ |
1337 | gui_synclist_do_button(&lists, &button, LIST_WRAP_UNLESS_HELD); | 1328 | gui_synclist_do_button(&lists, &button, LIST_WRAP_UNLESS_HELD); |
1338 | 1329 | ||
1339 | /* list code changes active viewport - change it back */ | ||
1340 | FOR_NB_SCREENS(i) | ||
1341 | screens[i].set_viewport(&vp_top[i]); | ||
1342 | 1330 | ||
1343 | switch(button) | 1331 | switch(button) |
1344 | { | 1332 | { |
@@ -1599,6 +1587,7 @@ bool recording_screen(bool no_source) | |||
1599 | /* led is restored at begin of loop / end of function */ | 1587 | /* led is restored at begin of loop / end of function */ |
1600 | led(false); | 1588 | led(false); |
1601 | #endif | 1589 | #endif |
1590 | viewportmanager_set_statusbar(oldbars); | ||
1602 | if (recording_menu(no_source)) | 1591 | if (recording_menu(no_source)) |
1603 | { | 1592 | { |
1604 | done = 1; | 1593 | done = 1; |
@@ -1612,6 +1601,7 @@ bool recording_screen(bool no_source) | |||
1612 | done = -1; | 1601 | done = -1; |
1613 | /* the init is now done at the beginning of the loop */ | 1602 | /* the init is now done at the beginning of the loop */ |
1614 | } | 1603 | } |
1604 | viewportmanager_set_statusbar(recbars); | ||
1615 | } | 1605 | } |
1616 | break; | 1606 | break; |
1617 | 1607 | ||
@@ -1623,6 +1613,7 @@ bool recording_screen(bool no_source) | |||
1623 | /* led is restored at begin of loop / end of function */ | 1613 | /* led is restored at begin of loop / end of function */ |
1624 | led(false); | 1614 | led(false); |
1625 | #endif | 1615 | #endif |
1616 | viewportmanager_set_statusbar(oldbars); | ||
1626 | if (f2_rec_screen()) | 1617 | if (f2_rec_screen()) |
1627 | { | 1618 | { |
1628 | rec_status |= RCSTAT_HAVE_RECORDED; | 1619 | rec_status |= RCSTAT_HAVE_RECORDED; |
@@ -1630,6 +1621,7 @@ bool recording_screen(bool no_source) | |||
1630 | } | 1621 | } |
1631 | else | 1622 | else |
1632 | update_countdown = 0; /* Update immediately */ | 1623 | update_countdown = 0; /* Update immediately */ |
1624 | viewportmanager_set_statusbar(recbars); | ||
1633 | } | 1625 | } |
1634 | break; | 1626 | break; |
1635 | 1627 | ||
@@ -1645,6 +1637,7 @@ bool recording_screen(bool no_source) | |||
1645 | /* led is restored at begin of loop / end of function */ | 1637 | /* led is restored at begin of loop / end of function */ |
1646 | led(false); | 1638 | led(false); |
1647 | #endif | 1639 | #endif |
1640 | viewportmanager_set_statusbar(oldbars); | ||
1648 | if (f3_rec_screen()) | 1641 | if (f3_rec_screen()) |
1649 | { | 1642 | { |
1650 | rec_status |= RCSTAT_HAVE_RECORDED; | 1643 | rec_status |= RCSTAT_HAVE_RECORDED; |
@@ -1652,6 +1645,7 @@ bool recording_screen(bool no_source) | |||
1652 | } | 1645 | } |
1653 | else | 1646 | else |
1654 | update_countdown = 0; /* Update immediately */ | 1647 | update_countdown = 0; /* Update immediately */ |
1648 | viewportmanager_set_statusbar(recbars); | ||
1655 | } | 1649 | } |
1656 | break; | 1650 | break; |
1657 | #endif /* CONFIG_KEYPAD == RECORDER_PAD */ | 1651 | #endif /* CONFIG_KEYPAD == RECORDER_PAD */ |
@@ -1692,10 +1686,12 @@ bool recording_screen(bool no_source) | |||
1692 | unsigned int dseconds, dhours, dminutes; | 1686 | unsigned int dseconds, dhours, dminutes; |
1693 | unsigned long num_recorded_bytes, dsize, dmb; | 1687 | unsigned long num_recorded_bytes, dsize, dmb; |
1694 | 1688 | ||
1695 | /* we assume vp_top is the current viewport! */ | 1689 | |
1696 | FOR_NB_ACTIVE_SCREENS(i) | 1690 | FOR_NB_SCREENS(i) |
1691 | { | ||
1692 | screens[i].set_viewport(&vp_top[i]); | ||
1697 | screens[i].clear_viewport(); | 1693 | screens[i].clear_viewport(); |
1698 | 1694 | } | |
1699 | update_countdown = 5; | 1695 | update_countdown = 5; |
1700 | last_seconds = seconds; | 1696 | last_seconds = seconds; |
1701 | 1697 | ||
@@ -1863,7 +1859,6 @@ bool recording_screen(bool no_source) | |||
1863 | /* draw peakmeter again (check if this can be removed) */ | 1859 | /* draw peakmeter again (check if this can be removed) */ |
1864 | FOR_NB_ACTIVE_SCREENS(i) | 1860 | FOR_NB_ACTIVE_SCREENS(i) |
1865 | { | 1861 | { |
1866 | gui_statusbar_draw(&(statusbars.statusbars[i]), true); | ||
1867 | screens[i].set_viewport(&vp_top[i]); | 1862 | screens[i].set_viewport(&vp_top[i]); |
1868 | peak_meter_screen(&screens[i], pm_x[i], pm_y[i], pm_h[i]); | 1863 | peak_meter_screen(&screens[i], pm_x[i], pm_y[i], pm_h[i]); |
1869 | screens[i].update(); | 1864 | screens[i].update(); |
@@ -1930,6 +1925,7 @@ rec_abort: | |||
1930 | rec_status &= ~RCSTAT_IN_RECSCREEN; | 1925 | rec_status &= ~RCSTAT_IN_RECSCREEN; |
1931 | sound_settings_apply(); | 1926 | sound_settings_apply(); |
1932 | 1927 | ||
1928 | viewportmanager_set_statusbar(oldbars); | ||
1933 | FOR_NB_SCREENS(i) | 1929 | FOR_NB_SCREENS(i) |
1934 | screens[i].setfont(FONT_UI); | 1930 | screens[i].setfont(FONT_UI); |
1935 | 1931 | ||
@@ -1943,11 +1939,6 @@ rec_abort: | |||
1943 | ata_set_led_enabled(true); | 1939 | ata_set_led_enabled(true); |
1944 | #endif | 1940 | #endif |
1945 | 1941 | ||
1946 | #if CONFIG_TUNER | ||
1947 | global_settings.statusbar = statusbar; | ||
1948 | global_status.statusbar_forced = 0; | ||
1949 | #endif | ||
1950 | |||
1951 | settings_save(); | 1942 | settings_save(); |
1952 | 1943 | ||
1953 | return (rec_status & RCSTAT_BEEN_IN_USB_MODE) != 0; | 1944 | return (rec_status & RCSTAT_BEEN_IN_USB_MODE) != 0; |