summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/recorder/peakmeter.c16
-rw-r--r--apps/recorder/recording.c128
2 files changed, 90 insertions, 54 deletions
diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c
index 2b85513cf3..cb5464f9af 100644
--- a/apps/recorder/peakmeter.c
+++ b/apps/recorder/peakmeter.c
@@ -1119,6 +1119,7 @@ void peak_meter_draw_trig(int xpos, int ypos)
1119{ 1119{
1120 int barstart, barend; 1120 int barstart, barend;
1121 int icon, ixpos; 1121 int icon, ixpos;
1122 int i;
1122 switch (trig_status) { 1123 switch (trig_status) {
1123 1124
1124 case TRIG_READY: 1125 case TRIG_READY:
@@ -1160,8 +1161,11 @@ void peak_meter_draw_trig(int xpos, int ypos)
1160 scrollbar(xpos + ICON_PLAY_STATE_WIDTH + 1, ypos + 1, 1161 scrollbar(xpos + ICON_PLAY_STATE_WIDTH + 1, ypos + 1,
1161 TRIGBAR_WIDTH, TRIG_HEIGHT - 2, 1162 TRIGBAR_WIDTH, TRIG_HEIGHT - 2,
1162 TRIGBAR_WIDTH, barstart, barend, HORIZONTAL); 1163 TRIGBAR_WIDTH, barstart, barend, HORIZONTAL);
1163 lcd_mono_bitmap(bitmap_icons_7x8[icon], ixpos, ypos, 1164 FOR_NB_SCREENS(i)
1164 ICON_PLAY_STATE_WIDTH, STATUSBAR_HEIGHT); 1165 {
1166 screens[i].mono_bitmap(bitmap_icons_7x8[icon], ixpos, ypos,
1167 ICON_PLAY_STATE_WIDTH, STATUSBAR_HEIGHT);
1168 }
1165} 1169}
1166#endif 1170#endif
1167 1171
@@ -1226,7 +1230,7 @@ bool peak_meter_histogram(void)
1226 unsigned int max = 0; 1230 unsigned int max = 0;
1227 int y = 0; 1231 int y = 0;
1228 int x = 0; 1232 int x = 0;
1229 lcd_clear_display(); 1233 screens[0].clear_display();
1230 1234
1231 for (i = 0; i < PEEKS_PER_DRAW_SIZE; i++) { 1235 for (i = 0; i < PEEKS_PER_DRAW_SIZE; i++) {
1232 max = MAX(max, peeks_per_redraw[i]); 1236 max = MAX(max, peeks_per_redraw[i]);
@@ -1234,7 +1238,7 @@ bool peak_meter_histogram(void)
1234 1238
1235 for (i = 0; i < PEEKS_PER_DRAW_SIZE; i++) { 1239 for (i = 0; i < PEEKS_PER_DRAW_SIZE; i++) {
1236 x = peeks_per_redraw[i] * (LCD_WIDTH - 1)/ max; 1240 x = peeks_per_redraw[i] * (LCD_WIDTH - 1)/ max;
1237 lcd_hline(0, x, y + i); 1241 screens[0].hline(0, x, y + i);
1238 } 1242 }
1239 1243
1240 y = PEEKS_PER_DRAW_SIZE + 1; 1244 y = PEEKS_PER_DRAW_SIZE + 1;
@@ -1246,9 +1250,9 @@ bool peak_meter_histogram(void)
1246 1250
1247 for (i = 0; i < TICKS_PER_DRAW_SIZE; i++) { 1251 for (i = 0; i < TICKS_PER_DRAW_SIZE; i++) {
1248 x = ticks_per_redraw[i] * (LCD_WIDTH - 1)/ max; 1252 x = ticks_per_redraw[i] * (LCD_WIDTH - 1)/ max;
1249 lcd_hline(0, x, y + i); 1253 screens[0].hline(0, x, y + i);
1250 } 1254 }
1251 lcd_update(); 1255 screens[0].update();
1252 1256
1253 btn = button_get(true); 1257 btn = button_get(true);
1254 if (btn == BUTTON_PLAY) { 1258 if (btn == BUTTON_PLAY) {
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index bfe4c2e099..458861c591 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -975,8 +975,10 @@ bool recording_screen(void)
975 if (peak_meter_trigger_status() != TRIG_OFF) 975 if (peak_meter_trigger_status() != TRIG_OFF)
976 { 976 {
977 peak_meter_draw_trig(LCD_WIDTH - TRIG_WIDTH, 4 * h); 977 peak_meter_draw_trig(LCD_WIDTH - TRIG_WIDTH, 4 * h);
978 lcd_update_rect(LCD_WIDTH - (TRIG_WIDTH + 2), 4 * h, 978 FOR_NB_SCREENS(i){
979 TRIG_WIDTH + 2, TRIG_HEIGHT); 979 screens[i].update_rect(LCD_WIDTH - (TRIG_WIDTH + 2), 4 * h,
980 TRIG_WIDTH + 2, TRIG_HEIGHT);
981 }
980 } 982 }
981 } 983 }
982 984
@@ -996,7 +998,10 @@ bool recording_screen(void)
996 { 998 {
997 gui_syncsplash(0, true, str(LANG_DISK_FULL)); 999 gui_syncsplash(0, true, str(LANG_DISK_FULL));
998 gui_syncstatusbar_draw(&statusbars, true); 1000 gui_syncstatusbar_draw(&statusbars, true);
999 lcd_update(); 1001
1002 FOR_NB_SCREENS(i)
1003 screens[i].update();
1004
1000 audio_error_clear(); 1005 audio_error_clear();
1001 1006
1002 while(1) 1007 while(1)
@@ -1026,7 +1031,8 @@ bool recording_screen(void)
1026 1031
1027 sound_settings_apply(); 1032 sound_settings_apply();
1028 1033
1029 lcd_setfont(FONT_UI); 1034 FOR_NB_SCREENS(i)
1035 screens[i].setfont(FONT_UI);
1030 1036
1031 if (have_recorded) 1037 if (have_recorded)
1032 reload_directory(); 1038 reload_directory();
@@ -1042,34 +1048,47 @@ bool f2_rec_screen(void)
1042{ 1048{
1043 bool exit = false; 1049 bool exit = false;
1044 bool used = false; 1050 bool used = false;
1045 int w, h; 1051 int w, h, i;
1046 char buf[32]; 1052 char buf[32];
1047 int button; 1053 int button;
1048 1054
1049 lcd_setfont(FONT_SYSFIXED); 1055 FOR_NB_SCREENS(i)
1050 lcd_getstringsize("A",&w,&h); 1056 {
1057 screens[i].setfont(FONT_SYSFIXED);
1058 screens[i].getstringsize("A",&w,&h);
1059 }
1051 1060
1052 while (!exit) { 1061 while (!exit) {
1053 const char* ptr=NULL; 1062 const char* ptr=NULL;
1054 1063
1055 lcd_clear_display(); 1064 FOR_NB_SCREENS(i)
1065 {
1066 screens[i].clear_display();
1056 1067
1057 /* Recording quality */ 1068 /* Recording quality */
1058 lcd_putsxy(0, LCD_HEIGHT/2 - h*2, str(LANG_RECORDING_QUALITY)); 1069 screens[i].putsxy(0, LCD_HEIGHT/2 - h*2, str(LANG_RECORDING_QUALITY));
1059 snprintf(buf, 32, "%d", global_settings.rec_quality); 1070 }
1060 lcd_putsxy(0, LCD_HEIGHT/2-h, buf); 1071
1061 lcd_mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], 1072 snprintf(buf, 32, "%d", global_settings.rec_quality);
1073 FOR_NB_SCREENS(i)
1074 {
1075 screens[i].putsxy(0, LCD_HEIGHT/2-h, buf);
1076 screens[i].mono_bitmap(bitmap_icons_7x8[Icon_FastBackward],
1062 LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8); 1077 LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8);
1078 }
1063 1079
1064 /* Frequency */ 1080 /* Frequency */
1065 snprintf(buf, sizeof buf, "%s:", str(LANG_RECORDING_FREQUENCY)); 1081 snprintf(buf, sizeof buf, "%s:", str(LANG_RECORDING_FREQUENCY));
1066 lcd_getstringsize(buf,&w,&h);
1067 lcd_putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h*2, buf);
1068 ptr = freq_str[global_settings.rec_frequency]; 1082 ptr = freq_str[global_settings.rec_frequency];
1069 lcd_getstringsize(ptr, &w, &h); 1083 FOR_NB_SCREENS(i)
1070 lcd_putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h, ptr); 1084 {
1071 lcd_mono_bitmap(bitmap_icons_7x8[Icon_DownArrow], 1085 screens[i].getstringsize(buf,&w,&h);
1072 LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8); 1086 screens[i].putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h*2, buf);
1087 screens[i].getstringsize(ptr, &w, &h);
1088 screens[i].putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h, ptr);
1089 screens[i].mono_bitmap(bitmap_icons_7x8[Icon_DownArrow],
1090 LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8);
1091 }
1073 1092
1074 /* Channel mode */ 1093 /* Channel mode */
1075 switch ( global_settings.rec_channels ) { 1094 switch ( global_settings.rec_channels ) {
@@ -1082,17 +1101,20 @@ bool f2_rec_screen(void)
1082 break; 1101 break;
1083 } 1102 }
1084 1103
1085 lcd_getstringsize(str(LANG_RECORDING_CHANNELS), &w, &h); 1104 FOR_NB_SCREENS(i)
1086 lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h*2, 1105 {
1087 str(LANG_RECORDING_CHANNELS)); 1106 screens[i].getstringsize(str(LANG_RECORDING_CHANNELS), &w, &h);
1088 lcd_getstringsize(str(LANG_F2_MODE), &w, &h); 1107 screens[i].putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h*2,
1089 lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h, str(LANG_F2_MODE)); 1108 str(LANG_RECORDING_CHANNELS));
1090 lcd_getstringsize(ptr, &w, &h); 1109 screens[i].getstringsize(str(LANG_F2_MODE), &w, &h);
1091 lcd_putsxy(LCD_WIDTH - w, LCD_HEIGHT/2, ptr); 1110 screens[i].putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h, str(LANG_F2_MODE));
1092 lcd_mono_bitmap(bitmap_icons_7x8[Icon_FastForward], 1111 screens[i].getstringsize(ptr, &w, &h);
1112 screens[i].putsxy(LCD_WIDTH - w, LCD_HEIGHT/2, ptr);
1113 screens[i].mono_bitmap(bitmap_icons_7x8[Icon_FastForward],
1093 LCD_WIDTH/2 + 8, LCD_HEIGHT/2 - 4, 7, 8); 1114 LCD_WIDTH/2 + 8, LCD_HEIGHT/2 - 4, 7, 8);
1094 1115
1095 lcd_update(); 1116 screens[i].update();
1117 }
1096 1118
1097 button = button_get(true); 1119 button = button_get(true);
1098 switch (button) { 1120 switch (button) {
@@ -1150,7 +1172,8 @@ bool f2_rec_screen(void)
1150 set_gain(); 1172 set_gain();
1151 1173
1152 settings_save(); 1174 settings_save();
1153 lcd_setfont(FONT_UI); 1175 FOR_NB_SCREENS(i)
1176 screens[i].setfont(FONT_UI);
1154 1177
1155 return false; 1178 return false;
1156} 1179}
@@ -1161,7 +1184,7 @@ bool f3_rec_screen(void)
1161{ 1184{
1162 bool exit = false; 1185 bool exit = false;
1163 bool used = false; 1186 bool used = false;
1164 int w, h; 1187 int w, h, i;
1165 int button; 1188 int button;
1166 char *src_str[] = 1189 char *src_str[] =
1167 { 1190 {
@@ -1169,31 +1192,39 @@ bool f3_rec_screen(void)
1169 str(LANG_RECORDING_SRC_LINE), 1192 str(LANG_RECORDING_SRC_LINE),
1170 str(LANG_RECORDING_SRC_DIGITAL) 1193 str(LANG_RECORDING_SRC_DIGITAL)
1171 }; 1194 };
1172 1195 FOR_NB_SCREENS(i)
1173 lcd_setfont(FONT_SYSFIXED); 1196 {
1174 lcd_getstringsize("A",&w,&h); 1197 screens[i].setfont(FONT_SYSFIXED);
1175 1198 screens[i].getstringsize("A",&w,&h);
1199 }
1200
1176 while (!exit) { 1201 while (!exit) {
1177 char* ptr=NULL; 1202 char* ptr=NULL;
1178
1179 lcd_clear_display();
1180
1181 /* Recording source */
1182 lcd_putsxy(0, LCD_HEIGHT/2 - h*2, str(LANG_RECORDING_SOURCE));
1183 ptr = src_str[global_settings.rec_source]; 1203 ptr = src_str[global_settings.rec_source];
1184 lcd_getstringsize(ptr, &w, &h); 1204 FOR_NB_SCREENS(i)
1185 lcd_putsxy(0, LCD_HEIGHT/2-h, ptr); 1205 {
1186 lcd_mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], 1206 screens[i].clear_display();
1187 LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8); 1207
1208 /* Recording source */
1209 screens[i].putsxy(0, LCD_HEIGHT/2 - h*2, str(LANG_RECORDING_SOURCE));
1210
1211 screens[i].getstringsize(ptr, &w, &h);
1212 screens[i].putsxy(0, LCD_HEIGHT/2-h, ptr);
1213 screens[i].mono_bitmap(bitmap_icons_7x8[Icon_FastBackward],
1214 LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8);
1215 }
1188 1216
1189 /* trigger setup */ 1217 /* trigger setup */
1190 ptr = str(LANG_RECORD_TRIGGER); 1218 ptr = str(LANG_RECORD_TRIGGER);
1191 lcd_getstringsize(ptr,&w,&h); 1219 FOR_NB_SCREENS(i)
1192 lcd_putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h*2, ptr); 1220 {
1193 lcd_mono_bitmap(bitmap_icons_7x8[Icon_DownArrow], 1221 screens[i].getstringsize(ptr,&w,&h);
1222 screens[i].putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h*2, ptr);
1223 screens[i].mono_bitmap(bitmap_icons_7x8[Icon_DownArrow],
1194 LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8); 1224 LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8);
1195 1225
1196 lcd_update(); 1226 screens[i].update();
1227 }
1197 1228
1198 button = button_get(true); 1229 button = button_get(true);
1199 switch (button) { 1230 switch (button) {
@@ -1245,7 +1276,8 @@ bool f3_rec_screen(void)
1245 set_gain(); 1276 set_gain();
1246 1277
1247 settings_save(); 1278 settings_save();
1248 lcd_setfont(FONT_UI); 1279 FOR_NB_SCREENS(i)
1280 screens[i].setfont(FONT_UI);
1249 1281
1250 return false; 1282 return false;
1251} 1283}