summaryrefslogtreecommitdiff
path: root/apps/recorder/recording.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2008-06-23 13:20:35 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2008-06-23 13:20:35 +0000
commitbdbdb97f19655a635a2d37f81f9fe1e31f9162b2 (patch)
treeea5672478b70e550910bc179a7644afa70c0d057 /apps/recorder/recording.c
parentc1b8df05e1def3096ff6d2ea55f23b2e72936fce (diff)
downloadrockbox-bdbdb97f19655a635a2d37f81f9fe1e31f9162b2.tar.gz
rockbox-bdbdb97f19655a635a2d37f81f9fe1e31f9162b2.zip
FS#9051 - remove LCD margins... use viewports if you need them...
NOTE to WPS people.... %m has been removed, but (i think) because of the other %m tags it wont fail if you try loading a wps with %m|..|, it will just be ignored. Also note that if the statusbar is enabled the default viewport is 8 pixels shorter than when its not, i.e (0,0) is really (0,8) if the statusbar is shown... I dont think this will be a major issue because almost no WPS show the bar and use bitmaps... text only WPS shouldnt be affected. Please report problem screens in http://forums.rockbox.org/index.php?topic=17358.0 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17763 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/recorder/recording.c')
-rw-r--r--apps/recorder/recording.c53
1 files changed, 32 insertions, 21 deletions
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index 28b3a44b3a..ae2decf3d5 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -68,6 +68,7 @@
68#include "action.h" 68#include "action.h"
69#include "radio.h" 69#include "radio.h"
70#include "sound_menu.h" 70#include "sound_menu.h"
71#include "viewport.h"
71 72
72#ifdef HAVE_RECORDING 73#ifdef HAVE_RECORDING
73/* This array holds the record timer interval lengths, in seconds */ 74/* This array holds the record timer interval lengths, in seconds */
@@ -882,6 +883,8 @@ bool recording_screen(bool no_source)
882 883
883 int base_style = STYLE_INVERT; 884 int base_style = STYLE_INVERT;
884 int style; 885 int style;
886 struct viewport vp[NB_SCREENS];
887 int ymargin = global_settings.cursor_style?0:10;
885#ifdef HAVE_LCD_COLOR 888#ifdef HAVE_LCD_COLOR
886 if (global_settings.cursor_style == 2) { 889 if (global_settings.cursor_style == 2) {
887 base_style |= STYLE_COLORBAR; 890 base_style |= STYLE_COLORBAR;
@@ -956,11 +959,12 @@ bool recording_screen(bool no_source)
956 959
957 FOR_NB_SCREENS(i) 960 FOR_NB_SCREENS(i)
958 { 961 {
959 screens[i].setfont(FONT_SYSFIXED); 962 viewport_set_defaults(&vp[i], i);
963 vp[i].font = FONT_SYSFIXED;
964 screens[i].set_viewport(&vp[i]);
960 screens[i].getstringsize("M", &w, &h); 965 screens[i].getstringsize("M", &w, &h);
961 screens[i].setmargins(global_settings.cursor_style ? 0 : w, 8); 966 filename_offset[i] = ((vp[i].height >= 80) ? 1 : 0);
962 filename_offset[i] = ((screens[i].height >= 80) ? 1 : 0); 967 pm_y[i] = h * (2 + filename_offset[i]);
963 pm_y[i] = 8 + h * (2 + filename_offset[i]);
964 } 968 }
965 969
966#ifdef HAVE_REMOTE_LCD 970#ifdef HAVE_REMOTE_LCD
@@ -968,8 +972,8 @@ bool recording_screen(bool no_source)
968 { 972 {
969 screens[1].clear_display(); 973 screens[1].clear_display();
970 snprintf(buf, sizeof(buf), str(LANG_REMOTE_LCD_ON)); 974 snprintf(buf, sizeof(buf), str(LANG_REMOTE_LCD_ON));
971 screens[1].puts((screens[1].width/w - strlen(buf))/2 + 1, 975 screens[1].puts((vp[1].width/w - strlen(buf))/2 + 1,
972 screens[1].height/(h*2) + 1, buf); 976 vp[1].height/(h*2) + 1, buf);
973 screens[1].update(); 977 screens[1].update();
974 gui_syncsplash(0, str(LANG_REMOTE_LCD_OFF)); 978 gui_syncsplash(0, str(LANG_REMOTE_LCD_OFF));
975 } 979 }
@@ -1363,9 +1367,8 @@ bool recording_screen(bool no_source)
1363 1367
1364 FOR_NB_SCREENS(i) 1368 FOR_NB_SCREENS(i)
1365 { 1369 {
1370 screens[i].set_viewport(&vp[i]);
1366 screens[i].setfont(FONT_SYSFIXED); 1371 screens[i].setfont(FONT_SYSFIXED);
1367 screens[i].setmargins(
1368 global_settings.cursor_style ? 0 : w, 8);
1369 } 1372 }
1370 } 1373 }
1371 } 1374 }
@@ -1613,7 +1616,9 @@ bool recording_screen(bool no_source)
1613 else 1616 else
1614 { 1617 {
1615 for(i = 0; i < screen_update; i++) 1618 for(i = 0; i < screen_update; i++)
1616 screens[i].puts(0, filename_offset[i] + PM_HEIGHT + 2, buf); 1619 screens[i].putsxy(ymargin,
1620 SYSFONT_HEIGHT*(filename_offset[i]+
1621 PM_HEIGHT + 2), buf);
1617 } 1622 }
1618 1623
1619 if(global_settings.rec_source == AUDIO_SRC_MIC) 1624 if(global_settings.rec_source == AUDIO_SRC_MIC)
@@ -1632,8 +1637,9 @@ bool recording_screen(bool no_source)
1632 else 1637 else
1633 { 1638 {
1634 for(i = 0; i < screen_update; i++) 1639 for(i = 0; i < screen_update; i++)
1635 screens[i].puts(0, filename_offset[i] + 1640 screens[i].putsxy(ymargin,
1636 PM_HEIGHT + 3, buf); 1641 SYSFONT_HEIGHT*(filename_offset[i] +
1642 PM_HEIGHT + 3), buf);
1637 } 1643 }
1638 } 1644 }
1639 else if(0 1645 else if(0
@@ -1664,8 +1670,9 @@ bool recording_screen(bool no_source)
1664 else 1670 else
1665 { 1671 {
1666 for(i = 0; i < screen_update; i++) 1672 for(i = 0; i < screen_update; i++)
1667 screens[i].puts(0, filename_offset[i] + 1673 screens[i].putsxy(ymargin,
1668 PM_HEIGHT + 3, buf); 1674 SYSFONT_HEIGHT*(filename_offset[i] +
1675 PM_HEIGHT + 3), buf);
1669 } 1676 }
1670 1677
1671 snprintf(buf, sizeof(buf), "%s:%s", 1678 snprintf(buf, sizeof(buf), "%s:%s",
@@ -1688,8 +1695,9 @@ bool recording_screen(bool no_source)
1688 else 1695 else
1689 { 1696 {
1690 for(i = 0; i < screen_update; i++) 1697 for(i = 0; i < screen_update; i++)
1691 screens[i].puts(0, filename_offset[i] + 1698 screens[i].putsxy(ymargin,
1692 PM_HEIGHT + 4, buf); 1699 SYSFONT_HEIGHT*(filename_offset[i] +
1700 PM_HEIGHT + 4), buf);
1693 } 1701 }
1694 } 1702 }
1695#ifdef HAVE_LCD_COLOR 1703#ifdef HAVE_LCD_COLOR
@@ -1721,7 +1729,7 @@ bool recording_screen(bool no_source)
1721 break; 1729 break;
1722 } /* end switch */ 1730 } /* end switch */
1723#ifdef HAVE_AGC 1731#ifdef HAVE_AGC
1724 if (screens[i].height < h * (2 + filename_offset[i] + 1732 if (vp[i].height < h * (2 + filename_offset[i] +
1725 PM_HEIGHT + line[i])) 1733 PM_HEIGHT + line[i]))
1726 { 1734 {
1727 line[i] -= 1; 1735 line[i] -= 1;
@@ -1785,8 +1793,9 @@ bool recording_screen(bool no_source)
1785 { 1793 {
1786 for(i = 0; i < screen_update; i++) { 1794 for(i = 0; i < screen_update; i++) {
1787 if (display_agc[i]) { 1795 if (display_agc[i]) {
1788 screens[i].puts(0, filename_offset[i] + 1796 screens[i].putsxy(ymargin,
1789 PM_HEIGHT + line[i], buf); 1797 SYSFONT_HEIGHT*(filename_offset[i] +
1798 PM_HEIGHT + line[i]), buf);
1790 } 1799 }
1791 } 1800 }
1792 } 1801 }
@@ -1859,7 +1868,9 @@ bool recording_screen(bool no_source)
1859 1868
1860 for(i = 0; i < screen_update; i++) 1869 for(i = 0; i < screen_update; i++)
1861 { 1870 {
1871 screens[i].set_viewport(NULL);
1862 gui_statusbar_draw(&(statusbars.statusbars[i]), true); 1872 gui_statusbar_draw(&(statusbars.statusbars[i]), true);
1873 screens[i].set_viewport(&vp[i]);
1863 peak_meter_screen(&screens[i], pm_x, pm_y[i], h*PM_HEIGHT); 1874 peak_meter_screen(&screens[i], pm_x, pm_y[i], h*PM_HEIGHT);
1864 screens[i].update(); 1875 screens[i].update();
1865 } 1876 }
@@ -1867,11 +1878,11 @@ bool recording_screen(bool no_source)
1867 /* draw the trigger status */ 1878 /* draw the trigger status */
1868 FOR_NB_SCREENS(i) 1879 FOR_NB_SCREENS(i)
1869 { 1880 {
1870 trig_width[i] = ((screens[i].height < 64) || 1881 trig_width[i] = ((vp[i].height < 64) ||
1871 ((screens[i].height < 72) && (PM_HEIGHT > 1))) ? 1882 ((vp[i].height < 72) && (PM_HEIGHT > 1))) ?
1872 screens[i].width - 14 * w : screens[i].width; 1883 screens[i].width - 14 * w : screens[i].width;
1873 trig_xpos[i] = screens[i].width - trig_width[i]; 1884 trig_xpos[i] = screens[i].width - trig_width[i];
1874 trig_ypos[i] = ((screens[i].height < 72) && (PM_HEIGHT > 1)) ? 1885 trig_ypos[i] = ((vp[i].height < 72) && (PM_HEIGHT > 1)) ?
1875 h*2 : 1886 h*2 :
1876 h*(1 + filename_offset[i] + PM_HEIGHT + 1887 h*(1 + filename_offset[i] + PM_HEIGHT +
1877 line[i] 1888 line[i]