summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/lang/english.lang299
-rw-r--r--apps/menus/recording_menu.c22
-rw-r--r--apps/recorder/peakmeter.c33
-rw-r--r--apps/recorder/peakmeter.h4
-rw-r--r--apps/recorder/recording.c1173
-rw-r--r--apps/settings_list.c16
6 files changed, 781 insertions, 766 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index b81d2343a6..5575db9d9f 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -6470,15 +6470,15 @@
6470</phrase> 6470</phrase>
6471<phrase> 6471<phrase>
6472 id: LANG_RECORDING_LEFT 6472 id: LANG_RECORDING_LEFT
6473 desc: in the recording screen 6473 desc: deprecated
6474 user: 6474 user:
6475 <source> 6475 <source>
6476 *: none 6476 *: none
6477 recording: "Gain Left" 6477 recording: ""
6478 </source> 6478 </source>
6479 <dest> 6479 <dest>
6480 *: none 6480 *: none
6481 recording: "Gain Left" 6481 recording: ""
6482 </dest> 6482 </dest>
6483 <voice> 6483 <voice>
6484 *: none 6484 *: none
@@ -6487,15 +6487,15 @@
6487</phrase> 6487</phrase>
6488<phrase> 6488<phrase>
6489 id: LANG_RECORDING_RIGHT 6489 id: LANG_RECORDING_RIGHT
6490 desc: in the recording screen 6490 desc: deprecated
6491 user: 6491 user:
6492 <source> 6492 <source>
6493 *: none 6493 *: none
6494 recording: "Gain Right" 6494 recording: ""
6495 </source> 6495 </source>
6496 <dest> 6496 <dest>
6497 *: none 6497 *: none
6498 recording: "Gain Right" 6498 recording: ""
6499 </dest> 6499 </dest>
6500 <voice> 6500 <voice>
6501 *: none 6501 *: none
@@ -6504,18 +6504,18 @@
6504</phrase> 6504</phrase>
6505<phrase> 6505<phrase>
6506 id: LANG_RECORD_AGC_PRESET 6506 id: LANG_RECORD_AGC_PRESET
6507 desc: automatic gain control in record settings 6507 desc: deprecated
6508 <source> 6508 <source>
6509 *: none 6509 *: none
6510 agc: "Automatic Gain Control" 6510 recording: ""
6511 </source> 6511 </source>
6512 <dest> 6512 <dest>
6513 *: none 6513 *: none
6514 agc: "Automatic Gain Control" 6514 recording: ""
6515 </dest> 6515 </dest>
6516 <voice> 6516 <voice>
6517 *: none 6517 *: none
6518 agc: "Automatic gain control" 6518 recording: ""
6519 </voice> 6519 </voice>
6520</phrase> 6520</phrase>
6521<phrase> 6521<phrase>
@@ -6600,18 +6600,18 @@
6600</phrase> 6600</phrase>
6601<phrase> 6601<phrase>
6602 id: LANG_RECORD_AGC_CLIPTIME 6602 id: LANG_RECORD_AGC_CLIPTIME
6603 desc: in record settings 6603 desc: deprecated
6604 <source> 6604 <source>
6605 *: none 6605 *: none
6606 agc: "AGC clip time" 6606 agc: ""
6607 </source> 6607 </source>
6608 <dest> 6608 <dest>
6609 *: none 6609 *: none
6610 agc: "AGC clip time" 6610 agc: ""
6611 </dest> 6611 </dest>
6612 <voice> 6612 <voice>
6613 *: none 6613 *: none
6614 agc: "AGC clip time" 6614 agc: ""
6615 </voice> 6615 </voice>
6616</phrase> 6616</phrase>
6617<phrase> 6617<phrase>
@@ -10156,19 +10156,19 @@
10156</phrase> 10156</phrase>
10157<phrase> 10157<phrase>
10158 id: LANG_SYSFONT_OFF 10158 id: LANG_SYSFONT_OFF
10159 desc: Used in a lot of places 10159 desc: deprecated
10160 user: 10160 user:
10161 <source> 10161 <source>
10162 *: none 10162 *: none
10163 lcd_bitmap: "Off" 10163 lcd_bitmap: ""
10164 </source> 10164 </source>
10165 <dest> 10165 <dest>
10166 *: none 10166 *: none
10167 lcd_bitmap: "Off" 10167 lcd_bitmap: ""
10168 </dest> 10168 </dest>
10169 <voice> 10169 <voice>
10170 *: none 10170 *: none
10171 lcd_bitmap: "Off" 10171 lcd_bitmap: ""
10172 </voice> 10172 </voice>
10173</phrase> 10173</phrase>
10174<phrase> 10174<phrase>
@@ -10496,19 +10496,15 @@
10496</phrase> 10496</phrase>
10497<phrase> 10497<phrase>
10498 id: LANG_SYSFONT_DISK_FULL 10498 id: LANG_SYSFONT_DISK_FULL
10499 desc: in recording screen 10499 desc: deprecated
10500 user: 10500 user:
10501 <source> 10501 <source>
10502 *: none 10502 *: none
10503 recording: "The disk is full. Press OFF to continue." 10503 recording: ""
10504 h100,h120,h300: "The disk is full. Press STOP to continue."
10505 m5,x5,ipod4g,ipodcolor,ipodnano,ipodvideo,e200,c200: "The disk is full. Press LEFT to continue."
10506 </source> 10504 </source>
10507 <dest> 10505 <dest>
10508 *: none 10506 *: none
10509 recording: "The disk is full. Press OFF to continue." 10507 recording: ""
10510 h100,h120,h300: "The disk is full. Press STOP to continue."
10511 m5,x5,ipod4g,ipodcolor,ipodnano,ipodvideo,e200,c200: "The disk is full. Press LEFT to continue."
10512 </dest> 10508 </dest>
10513 <voice> 10509 <voice>
10514 *: none 10510 *: none
@@ -10517,19 +10513,19 @@
10517</phrase> 10513</phrase>
10518<phrase> 10514<phrase>
10519 id: LANG_SYSFONT_VOLUME 10515 id: LANG_SYSFONT_VOLUME
10520 desc: in sound_settings 10516 desc: deprecated
10521 user: 10517 user:
10522 <source> 10518 <source>
10523 *: none 10519 *: none
10524 recording: "Volume" 10520 recording: ""
10525 </source> 10521 </source>
10526 <dest> 10522 <dest>
10527 *: none 10523 *: none
10528 recording: "Volume" 10524 recording: ""
10529 </dest> 10525 </dest>
10530 <voice> 10526 <voice>
10531 *: none 10527 *: none
10532 recording: "Volume" 10528 recording: ""
10533 </voice> 10529 </voice>
10534</phrase> 10530</phrase>
10535<phrase> 10531<phrase>
@@ -10704,15 +10700,15 @@
10704</phrase> 10700</phrase>
10705<phrase> 10701<phrase>
10706 id: LANG_SYSFONT_RECORDING_TIME 10702 id: LANG_SYSFONT_RECORDING_TIME
10707 desc: Display of recorded time 10703 desc: deprecated
10708 user: 10704 user:
10709 <source> 10705 <source>
10710 *: none 10706 *: none
10711 recording: "Time:" 10707 recording: ""
10712 </source> 10708 </source>
10713 <dest> 10709 <dest>
10714 *: none 10710 *: none
10715 recording: "Time:" 10711 recording: ""
10716 </dest> 10712 </dest>
10717 <voice> 10713 <voice>
10718 *: none 10714 *: none
@@ -10721,15 +10717,15 @@
10721</phrase> 10717</phrase>
10722<phrase> 10718<phrase>
10723 id: LANG_SYSFONT_RECORD_TIMESPLIT_REC 10719 id: LANG_SYSFONT_RECORD_TIMESPLIT_REC
10724 desc: Display of record timer interval setting, on the record screen 10720 desc: deprecated
10725 user: 10721 user:
10726 <source> 10722 <source>
10727 *: none 10723 *: none
10728 recording: "Split Time:" 10724 recording: ""
10729 </source> 10725 </source>
10730 <dest> 10726 <dest>
10731 *: none 10727 *: none
10732 recording: "Split Time:" 10728 recording: ""
10733 </dest> 10729 </dest>
10734 <voice> 10730 <voice>
10735 *: none 10731 *: none
@@ -10755,15 +10751,15 @@
10755</phrase> 10751</phrase>
10756<phrase> 10752<phrase>
10757 id: LANG_SYSFONT_RECORD_PRERECORD 10753 id: LANG_SYSFONT_RECORD_PRERECORD
10758 desc: in recording and radio screen 10754 desc: deprecated
10759 user: 10755 user:
10760 <source> 10756 <source>
10761 *: none 10757 *: none
10762 recording: "Pre-Recording" 10758 recording: ""
10763 </source> 10759 </source>
10764 <dest> 10760 <dest>
10765 *: none 10761 *: none
10766 recording: "Pre-Recording" 10762 recording: ""
10767 </dest> 10763 </dest>
10768 <voice> 10764 <voice>
10769 *: none 10765 *: none
@@ -10806,31 +10802,32 @@
10806</phrase> 10802</phrase>
10807<phrase> 10803<phrase>
10808 id: LANG_SYSFONT_SPLIT_SIZE 10804 id: LANG_SYSFONT_SPLIT_SIZE
10809 desc: in record timesplit options 10805 desc: deprecated
10806 user:
10810 <source> 10807 <source>
10811 *: none 10808 *: none
10812 recording: "Split Filesize" 10809 recording: ""
10813 </source> 10810 </source>
10814 <dest> 10811 <dest>
10815 *: none 10812 *: none
10816 recording: "Split Filesize" 10813 recording: ""
10817 </dest> 10814 </dest>
10818 <voice> 10815 <voice>
10819 *: none 10816 *: none
10820 recording: "Split Filesize" 10817 recording: ""
10821 </voice> 10818 </voice>
10822</phrase> 10819</phrase>
10823<phrase> 10820<phrase>
10824 id: LANG_SYSFONT_RECORDING_FILENAME 10821 id: LANG_SYSFONT_RECORDING_FILENAME
10825 desc: Filename header in recording screen 10822 desc: deprecated
10826 user: 10823 user:
10827 <source> 10824 <source>
10828 *: none 10825 *: none
10829 recording: "Filename:" 10826 recording: ""
10830 </source> 10827 </source>
10831 <dest> 10828 <dest>
10832 *: none 10829 *: none
10833 recording: "Filename:" 10830 recording: ""
10834 </dest> 10831 </dest>
10835 <voice> 10832 <voice>
10836 *: none 10833 *: none
@@ -10839,114 +10836,114 @@
10839</phrase> 10836</phrase>
10840<phrase> 10837<phrase>
10841 id: LANG_SYSFONT_RECORDING_AGC_PRESET 10838 id: LANG_SYSFONT_RECORDING_AGC_PRESET
10842 desc: automatic gain control in recording screen 10839 desc: deprecated
10843 <source> 10840 <source>
10844 *: none 10841 *: none
10845 agc: "AGC" 10842 agc: ""
10846 </source> 10843 </source>
10847 <dest> 10844 <dest>
10848 *: none 10845 *: none
10849 agc: "AGC" 10846 agc: ""
10850 </dest> 10847 </dest>
10851 <voice> 10848 <voice>
10852 *: none 10849 *: none
10853 agc: "AGC" 10850 agc: ""
10854 </voice> 10851 </voice>
10855</phrase> 10852</phrase>
10856<phrase> 10853<phrase>
10857 id: LANG_SYSFONT_AGC_SAFETY 10854 id: LANG_SYSFONT_AGC_SAFETY
10858 desc: AGC preset 10855 desc: deprecated
10859 <source> 10856 <source>
10860 *: none 10857 *: none
10861 agc: "Safety (clip)" 10858 agc: ""
10862 </source> 10859 </source>
10863 <dest> 10860 <dest>
10864 *: none 10861 *: none
10865 agc: "Safety (clip)" 10862 agc: ""
10866 </dest> 10863 </dest>
10867 <voice> 10864 <voice>
10868 *: none 10865 *: none
10869 agc: "Safety (clip)" 10866 agc: ""
10870 </voice> 10867 </voice>
10871</phrase> 10868</phrase>
10872<phrase> 10869<phrase>
10873 id: LANG_SYSFONT_AGC_LIVE 10870 id: LANG_SYSFONT_AGC_LIVE
10874 desc: AGC preset 10871 desc: deprecated
10875 <source> 10872 <source>
10876 *: none 10873 *: none
10877 agc: "Live (slow)" 10874 agc: ""
10878 </source> 10875 </source>
10879 <dest> 10876 <dest>
10880 *: none 10877 *: none
10881 agc: "Live (slow)" 10878 agc: ""
10882 </dest> 10879 </dest>
10883 <voice> 10880 <voice>
10884 *: none 10881 *: none
10885 agc: "Live (slow)" 10882 agc: ""
10886 </voice> 10883 </voice>
10887</phrase> 10884</phrase>
10888<phrase> 10885<phrase>
10889 id: LANG_SYSFONT_AGC_DJSET 10886 id: LANG_SYSFONT_AGC_DJSET
10890 desc: AGC preset 10887 desc: deprecated
10891 <source> 10888 <source>
10892 *: none 10889 *: none
10893 agc: "DJ-Set (slow)" 10890 agc: ""
10894 </source> 10891 </source>
10895 <dest> 10892 <dest>
10896 *: none 10893 *: none
10897 agc: "DJ-Set (slow)" 10894 agc: ""
10898 </dest> 10895 </dest>
10899 <voice> 10896 <voice>
10900 *: none 10897 *: none
10901 agc: "DJ set (slow)" 10898 agc: ""
10902 </voice> 10899 </voice>
10903</phrase> 10900</phrase>
10904<phrase> 10901<phrase>
10905 id: LANG_SYSFONT_AGC_MEDIUM 10902 id: LANG_SYSFONT_AGC_MEDIUM
10906 desc: AGC preset 10903 desc: deprecated
10907 <source> 10904 <source>
10908 *: none 10905 *: none
10909 agc: "Medium" 10906 agc: ""
10910 </source> 10907 </source>
10911 <dest> 10908 <dest>
10912 *: none 10909 *: none
10913 agc: "Medium" 10910 agc: ""
10914 </dest> 10911 </dest>
10915 <voice> 10912 <voice>
10916 *: none 10913 *: none
10917 agc: "Medium" 10914 agc: ""
10918 </voice> 10915 </voice>
10919</phrase> 10916</phrase>
10920<phrase> 10917<phrase>
10921 id: LANG_SYSFONT_AGC_VOICE 10918 id: LANG_SYSFONT_AGC_VOICE
10922 desc: AGC preset 10919 desc: deprecated
10923 <source> 10920 <source>
10924 *: none 10921 *: none
10925 agc: "Voice (fast)" 10922 agc: ""
10926 </source> 10923 </source>
10927 <dest> 10924 <dest>
10928 *: none 10925 *: none
10929 agc: "Voice (fast)" 10926 agc: ""
10930 </dest> 10927 </dest>
10931 <voice> 10928 <voice>
10932 *: none 10929 *: none
10933 agc: "Voice (fast)" 10930 agc: ""
10934 </voice> 10931 </voice>
10935</phrase> 10932</phrase>
10936<phrase> 10933<phrase>
10937 id: LANG_SYSFONT_RECORDING_AGC_MAXGAIN 10934 id: LANG_SYSFONT_RECORDING_AGC_MAXGAIN
10938 desc: AGC maximum gain in recording screen 10935 desc: deprecated
10939 <source> 10936 <source>
10940 *: none 10937 *: none
10941 agc: "AGC max. gain" 10938 agc: ""
10942 </source> 10939 </source>
10943 <dest> 10940 <dest>
10944 *: none 10941 *: none
10945 agc: "AGC max. gain" 10942 agc: ""
10946 </dest> 10943 </dest>
10947 <voice> 10944 <voice>
10948 *: none 10945 *: none
10949 agc: "AGC maximum gain" 10946 agc: ""
10950 </voice> 10947 </voice>
10951</phrase> 10948</phrase>
10952<phrase> 10949<phrase>
@@ -11162,15 +11159,15 @@
11162</phrase> 11159</phrase>
11163<phrase> 11160<phrase>
11164 id: LANG_SYSFONT_PM_CLIPCOUNT 11161 id: LANG_SYSFONT_PM_CLIPCOUNT
11165 desc: in recording GUI, for recording peak meter. MAX 5 characters! 11162 desc: deprecated
11166 user: 11163 user:
11167 <source> 11164 <source>
11168 *: none 11165 *: none
11169 recording: "CLIP:" 11166 recording: ""
11170 </source> 11167 </source>
11171 <dest> 11168 <dest>
11172 *: none 11169 *: none
11173 recording: "CLIP:" 11170 recording: ""
11174 </dest> 11171 </dest>
11175 <voice> 11172 <voice>
11176 *: none 11173 *: none
@@ -11857,3 +11854,153 @@
11857 *: "slash" 11854 *: "slash"
11858 </voice> 11855 </voice>
11859</phrase> 11856</phrase>
11857<phrase>
11858 id: LANG_GAIN_LEFT
11859 desc: in the recording screen
11860 user:
11861 <source>
11862 *: none
11863 recording: "Gain L"
11864 </source>
11865 <dest>
11866 *: none
11867 recording: "Gain L"
11868 </dest>
11869 <voice>
11870 *: none
11871 recording: "Gain Left"
11872 </voice>
11873</phrase>
11874<phrase>
11875 id: LANG_GAIN_RIGHT
11876 desc: in the recording screen
11877 user:
11878 <source>
11879 *: none
11880 recording: "Gain R"
11881 </source>
11882 <dest>
11883 *: none
11884 recording: "Gain R"
11885 </dest>
11886 <voice>
11887 *: none
11888 recording: "Gain Right"
11889 </voice>
11890</phrase>
11891<phrase>
11892 id: LANG_RECORDING_AGC_PRESET
11893 desc: automatic gain control in record settings and screen
11894 <source>
11895 *: none
11896 agc: "AGC"
11897 </source>
11898 <dest>
11899 *: none
11900 agc: "AGC"
11901 </dest>
11902 <voice>
11903 *: none
11904 agc: "Automatic gain control"
11905 </voice>
11906</phrase>
11907<phrase>
11908 id: LANG_RECORDING_AGC_CLIPTIME
11909 desc: in record settings
11910 <source>
11911 *: none
11912 agc: "AGC clip time"
11913 </source>
11914 <dest>
11915 *: none
11916 agc: "AGC clip time"
11917 </dest>
11918 <voice>
11919 *: none
11920 agc: "AGC clip time"
11921 </voice>
11922</phrase>
11923<phrase>
11924 id: LANG_RECORDING_AGC_MAXGAIN
11925 desc: AGC maximum gain in recording screen
11926 <source>
11927 *: none
11928 agc: "AGC max. gain"
11929 </source>
11930 <dest>
11931 *: none
11932 agc: "AGC max. gain"
11933 </dest>
11934 <voice>
11935 *: none
11936 agc: "AGC maximum gain"
11937 </voice>
11938</phrase>
11939<phrase>
11940 id: LANG_RECORDING_FILENAME
11941 desc: Filename header in recording screen
11942 user:
11943 <source>
11944 *: none
11945 recording: "Filename:"
11946 </source>
11947 <dest>
11948 *: none
11949 recording: "Filename:"
11950 </dest>
11951 <voice>
11952 *: none
11953 recording: ""
11954 </voice>
11955</phrase>
11956<phrase>
11957 id: LANG_PM_CLIPCOUNT
11958 desc: in recording GUI, for recording peak meter. MAX 5 characters!
11959 user:
11960 <source>
11961 *: none
11962 recording: "CLIP:"
11963 </source>
11964 <dest>
11965 *: none
11966 recording: "CLIP:"
11967 </dest>
11968 <voice>
11969 *: none
11970 recording: ""
11971 </voice>
11972</phrase>
11973<phrase>
11974 id: LANG_RECORDING_TIMESPLIT_REC
11975 desc: Display of record timer interval setting, on the record screen
11976 user:
11977 <source>
11978 *: none
11979 recording: "Split Time:"
11980 </source>
11981 <dest>
11982 *: none
11983 recording: "Split Time:"
11984 </dest>
11985 <voice>
11986 *: none
11987 recording: ""
11988 </voice>
11989</phrase>
11990<phrase>
11991 id: LANG_RECORDING_SIZE
11992 desc: Display of recorded file size
11993 user:
11994 <source>
11995 *: none
11996 recording: "Size:"
11997 </source>
11998 <dest>
11999 *: none
12000 recording: "Size:"
12001 </dest>
12002 <voice>
12003 *: none
12004 recording: ""
12005 </voice>
12006</phrase>
diff --git a/apps/menus/recording_menu.c b/apps/menus/recording_menu.c
index b3b33b7f52..277f8d93b7 100644
--- a/apps/menus/recording_menu.c
+++ b/apps/menus/recording_menu.c
@@ -344,11 +344,11 @@ static int agc_preset_func(void)
344 { STR(LANG_AGC_VOICE) }, 344 { STR(LANG_AGC_VOICE) },
345 }; 345 };
346 if (global_settings.rec_source) 346 if (global_settings.rec_source)
347 return set_option(str(LANG_RECORD_AGC_PRESET), 347 return set_option(str(LANG_RECORDING_AGC_PRESET),
348 &global_settings.rec_agc_preset_line, 348 &global_settings.rec_agc_preset_line,
349 INT, names, 6, NULL ); 349 INT, names, 6, NULL );
350 else 350 else
351 return set_option(str(LANG_RECORD_AGC_PRESET), 351 return set_option(str(LANG_RECORDING_AGC_PRESET),
352 &global_settings.rec_agc_preset_mic, 352 &global_settings.rec_agc_preset_mic,
353 INT, names, 6, NULL ); 353 INT, names, 6, NULL );
354} 354}
@@ -362,13 +362,13 @@ static int agc_cliptime_func(void)
362 { "800ms", TALK_ID(800, UNIT_MS) }, 362 { "800ms", TALK_ID(800, UNIT_MS) },
363 { "1s", TALK_ID(1, UNIT_SEC) } 363 { "1s", TALK_ID(1, UNIT_SEC) }
364 }; 364 };
365 return set_option(str(LANG_RECORD_AGC_CLIPTIME), 365 return set_option(str(LANG_RECORDING_AGC_CLIPTIME),
366 &global_settings.rec_agc_cliptime, 366 &global_settings.rec_agc_cliptime,
367 INT, names, 5, NULL ); 367 INT, names, 5, NULL );
368} 368}
369MENUITEM_FUNCTION(agc_preset, 0, ID2P(LANG_RECORD_AGC_PRESET), 369MENUITEM_FUNCTION(agc_preset, 0, ID2P(LANG_RECORDING_AGC_PRESET),
370 agc_preset_func, NULL, NULL, Icon_Menu_setting); 370 agc_preset_func, NULL, NULL, Icon_Menu_setting);
371MENUITEM_FUNCTION(agc_cliptime, 0, ID2P(LANG_RECORD_AGC_CLIPTIME), 371MENUITEM_FUNCTION(agc_cliptime, 0, ID2P(LANG_RECORDING_AGC_CLIPTIME),
372 agc_cliptime_func, NULL, NULL, Icon_Menu_setting); 372 agc_cliptime_func, NULL, NULL, Icon_Menu_setting);
373#endif /* HAVE_AGC */ 373#endif /* HAVE_AGC */
374 374
@@ -441,12 +441,14 @@ int rectrigger(void)
441 int i, action = ACTION_REDRAW; 441 int i, action = ACTION_REDRAW;
442 bool done = false, changed = true; 442 bool done = false, changed = true;
443 const struct settings_list *settings[TRIG_OPTION_COUNT]; 443 const struct settings_list *settings[TRIG_OPTION_COUNT];
444 444
445 int pm_x[NB_SCREENS];
445 int pm_y[NB_SCREENS]; 446 int pm_y[NB_SCREENS];
447 int pm_h[NB_SCREENS];
446 int trig_xpos[NB_SCREENS]; 448 int trig_xpos[NB_SCREENS];
447 int trig_ypos[NB_SCREENS]; 449 int trig_ypos[NB_SCREENS];
448 int trig_width[NB_SCREENS]; 450 int trig_width[NB_SCREENS];
449 451
450 int old_start_thres_db = global_settings.rec_start_thres_db; 452 int old_start_thres_db = global_settings.rec_start_thres_db;
451 int old_start_thres_linear = global_settings.rec_start_thres_linear; 453 int old_start_thres_linear = global_settings.rec_start_thres_linear;
452 int old_start_duration = global_settings.rec_start_duration; 454 int old_start_duration = global_settings.rec_start_duration;
@@ -466,7 +468,9 @@ int rectrigger(void)
466 vp[i].height -= SYSFONT_HEIGHT*2; 468 vp[i].height -= SYSFONT_HEIGHT*2;
467 trig_xpos[i] = 0; 469 trig_xpos[i] = 0;
468 trig_ypos[i] = vp[i].y + vp[i].height; 470 trig_ypos[i] = vp[i].y + vp[i].height;
471 pm_x[i] = 0;
469 pm_y[i] = screens[i].getheight() - SYSFONT_HEIGHT; 472 pm_y[i] = screens[i].getheight() - SYSFONT_HEIGHT;
473 pm_h[i] = SYSFONT_HEIGHT;
470 trig_width[i] = screens[i].getwidth(); 474 trig_width[i] = screens[i].getwidth();
471 } 475 }
472 /* TODO: what to do if there is < 4 lines on the screen? */ 476 /* TODO: what to do if there is < 4 lines on the screen? */
@@ -518,8 +522,8 @@ int rectrigger(void)
518 } 522 }
519 523
520 peak_meter_draw_trig(trig_xpos, trig_ypos, trig_width, NB_SCREENS); 524 peak_meter_draw_trig(trig_xpos, trig_ypos, trig_width, NB_SCREENS);
521 action = peak_meter_draw_get_btn(CONTEXT_SETTINGS_RECTRIGGER, 0, pm_y, 525 action = peak_meter_draw_get_btn(CONTEXT_SETTINGS_RECTRIGGER,
522 SYSFONT_HEIGHT, NB_SCREENS); 526 pm_x, pm_y, pm_h, NB_SCREENS);
523 FOR_NB_SCREENS(i) 527 FOR_NB_SCREENS(i)
524 screens[i].update(); 528 screens[i].update();
525 i = gui_synclist_get_sel_pos(&lists); 529 i = gui_synclist_get_sel_pos(&lists);
diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c
index fc7c9bc5f5..ce0974a084 100644
--- a/apps/recorder/peakmeter.c
+++ b/apps/recorder/peakmeter.c
@@ -47,7 +47,7 @@
47#if CONFIG_CODEC == SWCODEC 47#if CONFIG_CODEC == SWCODEC
48#include "pcm.h" 48#include "pcm.h"
49 49
50#ifdef HAVE_RECORDING 50#ifdef HAVE_RECORDING
51#include "pcm_record.h" 51#include "pcm_record.h"
52#endif 52#endif
53 53
@@ -265,7 +265,7 @@ int calc_db (int isample)
265 } 265 }
266 } 266 }
267 } 267 }
268 268
269 return n + (m * (long)(isample - istart)) / 100L; 269 return n + (m * (long)(isample - istart)) / 100L;
270} 270}
271 271
@@ -319,13 +319,13 @@ int peak_meter_db2sample(int db)
319 /* range check: db value to big */ 319 /* range check: db value to big */
320 if (max_peak_db + db < 0) { 320 if (max_peak_db + db < 0) {
321 retval = 0; 321 retval = 0;
322 } 322 }
323 323
324 /* range check: db value too small */ 324 /* range check: db value too small */
325 else if (max_peak_db + db >= max_peak_db) { 325 else if (max_peak_db + db >= max_peak_db) {
326 retval = MAX_PEAK -1; 326 retval = MAX_PEAK -1;
327 } 327 }
328 328
329 /* value in range: find the matching linear value */ 329 /* value in range: find the matching linear value */
330 else { 330 else {
331 retval = db_to_sample_bin_search(0, MAX_PEAK, max_peak_db + db); 331 retval = db_to_sample_bin_search(0, MAX_PEAK, max_peak_db + db);
@@ -359,7 +359,7 @@ static void peak_meter_set_min(int newmin)
359 } 359 }
360 360
361 pm_range = peak_meter_range_max - peak_meter_range_min; 361 pm_range = peak_meter_range_max - peak_meter_range_min;
362 362
363 /* Avoid division by zero. */ 363 /* Avoid division by zero. */
364 if (pm_range == 0) { 364 if (pm_range == 0) {
365 pm_range = 1; 365 pm_range = 1;
@@ -586,10 +586,10 @@ void peak_meter_peek(void)
586#if CONFIG_CODEC == SWCODEC 586#if CONFIG_CODEC == SWCODEC
587 if (pm_playback) 587 if (pm_playback)
588 pcm_calculate_peaks(&pm_cur_left, &pm_cur_right); 588 pcm_calculate_peaks(&pm_cur_left, &pm_cur_right);
589#ifdef HAVE_RECORDING 589#ifdef HAVE_RECORDING
590 else 590 else
591 pcm_calculate_rec_peaks(&pm_cur_left, &pm_cur_right); 591 pcm_calculate_rec_peaks(&pm_cur_left, &pm_cur_right);
592#endif 592#endif
593 left = pm_cur_left; 593 left = pm_cur_left;
594 right = pm_cur_right; 594 right = pm_cur_right;
595#else 595#else
@@ -812,7 +812,7 @@ static int peak_meter_read_l(void)
812 /* reset pm_max_left so that subsequent calls of peak_meter_peek don't 812 /* reset pm_max_left so that subsequent calls of peak_meter_peek don't
813 get fooled by an old maximum value */ 813 get fooled by an old maximum value */
814 pm_max_left = pm_cur_left; 814 pm_max_left = pm_cur_left;
815 815
816#if defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC) 816#if defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
817 srand(current_tick); 817 srand(current_tick);
818 retval = rand()%MAX_PEAK; 818 retval = rand()%MAX_PEAK;
@@ -1328,8 +1328,8 @@ void peak_meter_draw_trig(int xpos[], int ypos[],
1328} 1328}
1329#endif 1329#endif
1330 1330
1331int peak_meter_draw_get_btn(int action_context, int x, int y[], 1331int peak_meter_draw_get_btn(int action_context, int x[], int y[],
1332 int height, int nb_screens) 1332 int height[], int nb_screens)
1333{ 1333{
1334 int button = BUTTON_NONE; 1334 int button = BUTTON_NONE;
1335 long next_refresh = current_tick; 1335 long next_refresh = current_tick;
@@ -1362,10 +1362,10 @@ int peak_meter_draw_get_btn(int action_context, int x, int y[],
1362 if (TIME_AFTER(current_tick, next_refresh)) { 1362 if (TIME_AFTER(current_tick, next_refresh)) {
1363 for(i = 0; i < nb_screens; i++) 1363 for(i = 0; i < nb_screens; i++)
1364 { 1364 {
1365 peak_meter_screen(&screens[i], x, y[i], height); 1365 peak_meter_screen(&screens[i], x[i], y[i], height[i]);
1366 screens[i].update_viewport_rect(x, y[i], 1366 screens[i].update_viewport_rect(x[i], y[i],
1367 screens[i].getwidth() - x, 1367 screens[i].getwidth() - x[i],
1368 height); 1368 height[i]);
1369 } 1369 }
1370 next_refresh += HZ / PEAK_METER_FPS; 1370 next_refresh += HZ / PEAK_METER_FPS;
1371 dopeek = true; 1371 dopeek = true;
@@ -1430,3 +1430,4 @@ bool peak_meter_histogram(void)
1430} 1430}
1431#endif 1431#endif
1432 1432
1433
diff --git a/apps/recorder/peakmeter.h b/apps/recorder/peakmeter.h
index 7fbb14973a..8d3e92939f 100644
--- a/apps/recorder/peakmeter.h
+++ b/apps/recorder/peakmeter.h
@@ -35,8 +35,8 @@ extern void pm_activate_clipcount(bool active);
35extern bool peak_meter_enabled; 35extern bool peak_meter_enabled;
36 36
37extern void peak_meter_playback(bool playback); 37extern void peak_meter_playback(bool playback);
38extern int peak_meter_draw_get_btn(int action_context, int x, int y[], 38extern int peak_meter_draw_get_btn(int action_context, int x[], int y[],
39 int height, int nb_screens); 39 int height[], int nb_screens);
40extern void peak_meter_set_clip_hold(int time); 40extern void peak_meter_set_clip_hold(int time);
41extern void peak_meter_peek(void); 41extern void peak_meter_peek(void);
42extern void peak_meter_init_range( bool dbfs, int range_min, int range_max); 42extern void peak_meter_init_range( bool dbfs, int range_min, int range_max);
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index d9ef6812e1..7dfa16cb93 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -71,6 +71,7 @@
71#include "radio.h" 71#include "radio.h"
72#include "sound_menu.h" 72#include "sound_menu.h"
73#include "viewport.h" 73#include "viewport.h"
74#include "list.h"
74 75
75#ifdef HAVE_RECORDING 76#ifdef HAVE_RECORDING
76/* This array holds the record timer interval lengths, in seconds */ 77/* This array holds the record timer interval lengths, in seconds */
@@ -164,8 +165,6 @@ bool in_recording_screen(void)
164 return (rec_status & RCSTAT_IN_RECSCREEN) != 0; 165 return (rec_status & RCSTAT_IN_RECSCREEN) != 0;
165} 166}
166 167
167#define PM_HEIGHT ((LCD_HEIGHT >= 72) ? 2 : 1)
168
169#if CONFIG_KEYPAD == RECORDER_PAD 168#if CONFIG_KEYPAD == RECORDER_PAD
170static bool f2_rec_screen(void); 169static bool f2_rec_screen(void);
171static bool f3_rec_screen(void); 170static bool f3_rec_screen(void);
@@ -180,6 +179,11 @@ static int screen_update = NB_SCREENS;
180static bool remote_display_on = true; 179static bool remote_display_on = true;
181#endif 180#endif
182 181
182/* as we have the ability to disable the remote, we need an alternative loop */
183#define FOR_NB_ACTIVE_SCREENS(i) for(i = 0; i < screen_update; i++)
184
185static bool update_list = false; /* (GIU) list needs updating */
186
183/** File name creation **/ 187/** File name creation **/
184#if CONFIG_RTC == 0 188#if CONFIG_RTC == 0
185/* current file number to assist in creating unique numbered filenames 189/* current file number to assist in creating unique numbered filenames
@@ -279,6 +283,7 @@ static void set_gain(void)
279 } 283 }
280 /* reset the clipping indicators */ 284 /* reset the clipping indicators */
281 peak_meter_set_clip_hold(global_settings.peak_meter_clip_hold); 285 peak_meter_set_clip_hold(global_settings.peak_meter_clip_hold);
286 update_list = true;
282} 287}
283 288
284#ifdef HAVE_AGC 289#ifdef HAVE_AGC
@@ -541,51 +546,6 @@ static char *fmt_gain(int snd, int val, char *str, int len)
541 return str; 546 return str;
542} 547}
543 548
544static int cursor;
545
546static void adjust_cursor(void)
547{
548 int max_cursor;
549
550 if(cursor < 0)
551 cursor = 0;
552
553#ifdef HAVE_AGC
554 switch(global_settings.rec_source)
555 {
556 case REC_SRC_MIC:
557 if(cursor == 2)
558 cursor = 4;
559 else if(cursor == 3)
560 cursor = 1;
561 HAVE_LINE_REC_(case AUDIO_SRC_LINEIN:)
562 HAVE_FMRADIO_REC_(case AUDIO_SRC_FMRADIO:)
563 max_cursor = 5;
564 break;
565 default:
566 max_cursor = 0;
567 break;
568 }
569#else /* !HAVE_AGC */
570 switch(global_settings.rec_source)
571 {
572 case AUDIO_SRC_MIC:
573 max_cursor = 1;
574 break;
575 HAVE_LINE_REC_(case AUDIO_SRC_LINEIN:)
576 HAVE_FMRADIO_REC_(case AUDIO_SRC_FMRADIO:)
577 max_cursor = 3;
578 break;
579 default:
580 max_cursor = 0;
581 break;
582 }
583#endif /* HAVE_AGC */
584
585 if(cursor > max_cursor)
586 cursor = max_cursor;
587}
588
589/* the list below must match enum audio_sources in audio.h */ 549/* the list below must match enum audio_sources in audio.h */
590static const char* const prestr[] = 550static const char* const prestr[] =
591{ 551{
@@ -744,6 +704,7 @@ void rec_command(enum recording_command cmd)
744 audio_resume_recording(); 704 audio_resume_recording();
745 break; 705 break;
746 } 706 }
707 update_list = true;
747} 708}
748 709
749/* used in trigger_listerner and recording_screen */ 710/* used in trigger_listerner and recording_screen */
@@ -807,7 +768,7 @@ static void trigger_listener(int trigger_status)
807 /* tell recording_screen to reset the time */ 768 /* tell recording_screen to reset the time */
808 last_seconds = 0; 769 last_seconds = 0;
809 break; 770 break;
810 771
811 case 3: /* Stop and shutdown */ 772 case 3: /* Stop and shutdown */
812 rec_command(RECORDING_CMD_STOP_SHUTDOWN); 773 rec_command(RECORDING_CMD_STOP_SHUTDOWN);
813 break; 774 break;
@@ -823,25 +784,176 @@ static void trigger_listener(int trigger_status)
823 } 784 }
824} 785}
825 786
787/* Stuff for drawing the screen */
788
789enum rec_list_items_stereo {
790 ITEM_VOLUME = 0,
791 ITEM_GAIN = 1,
792 ITEM_GAIN_L = 2,
793 ITEM_GAIN_R = 3,
794#ifdef HAVE_AGC
795 ITEM_AGC_MODE = 4,
796 ITEM_AGC_MAXDB = 5,
797 ITEM_FILENAME = 6,
798 ITEM_COUNT = 7,
799#else
800 ITEM_FILENAME = 4,
801 ITEM_COUNT = 5,
802#endif
803};
804
805enum rec_list_items_mono {
806 ITEM_VOLUME_M = 0,
807 ITEM_GAIN_M = 1,
808#ifdef HAVE_AGC
809 ITEM_AGC_MODE_M = 4,
810 ITEM_AGC_MAXDB_M = 5,
811 ITEM_FILENAME_M = 6,
812 ITEM_COUNT_M = 5,
813#else
814 ITEM_FILENAME_M = 4,
815 ITEM_COUNT_M = 3,
816#endif
817};
818
819static int listid_to_enum[ITEM_COUNT];
820
821static char * reclist_get_name(int selected_item, void * data,
822 char * buffer, size_t buffer_len)
823{
824 char buf2[32];
825#ifdef HAVE_AGC
826 char buf3[32];
827#endif
828 data = data; /* not used */
829 if(selected_item >= ITEM_COUNT)
830 return "";
831
832 switch (listid_to_enum[selected_item])
833 {
834 case ITEM_VOLUME:
835 snprintf(buffer, buffer_len, "%s: %s", str(LANG_VOLUME),
836 fmt_gain(SOUND_VOLUME,
837 global_settings.volume,
838 buf2, sizeof(buf2)));
839 break;
840 case ITEM_GAIN:
841 if(global_settings.rec_source == AUDIO_SRC_MIC)
842 {
843 /* Draw MIC recording gain */
844 snprintf(buffer, buffer_len, "%s: %s", str(LANG_GAIN),
845 fmt_gain(SOUND_MIC_GAIN,
846 global_settings.rec_mic_gain,
847 buf2, sizeof(buf2)));
848 }
849 else
850 {
851 int avg_gain = (global_settings.rec_left_gain +
852 global_settings.rec_right_gain) / 2;
853 snprintf(buffer, buffer_len, "%s: %s", str(LANG_GAIN),
854 fmt_gain(SOUND_LEFT_GAIN,
855 avg_gain,
856 buf2, sizeof(buf2)));
857 }
858 break;
859 case ITEM_GAIN_L:
860 snprintf(buffer, buffer_len, "%s: %s",
861 str(LANG_GAIN_LEFT),
862 fmt_gain(SOUND_LEFT_GAIN,
863 global_settings.rec_left_gain,
864 buf2, sizeof(buf2)));
865 break;
866 case ITEM_GAIN_R:
867 snprintf(buffer, buffer_len, "%s: %s",
868 str(LANG_GAIN_RIGHT),
869 fmt_gain(SOUND_RIGHT_GAIN,
870 global_settings.rec_right_gain,
871 buf2, sizeof(buf2)));
872 break;
873#ifdef HAVE_AGC
874 case ITEM_AGC_MODE:
875 snprintf(buffer, buffer_len, "%s: %s",
876 str(LANG_RECORDING_AGC_PRESET),
877 agc_preset_str[agc_preset]);
878 break;
879 case ITEM_AGC_MAXDB:
880 if (agc_preset == 0)
881 snprintf(buffer, buffer_len, "%s: %s",
882 str(LANG_RECORDING_AGC_MAXGAIN),
883 fmt_gain(SOUND_LEFT_GAIN,
884 agc_maxgain, buf2, sizeof(buf2)));
885 else if (global_settings.rec_source == AUDIO_SRC_MIC)
886 snprintf(buffer, buffer_len, "%s: %s (%s)",
887 str(LANG_RECORDING_AGC_MAXGAIN),
888 fmt_gain(SOUND_MIC_GAIN,
889 agc_maxgain, buf2, sizeof(buf2)),
890 fmt_gain(SOUND_MIC_GAIN,
891 agc_maxgain - global_settings.rec_mic_gain,
892 buf3, sizeof(buf3)));
893 else
894 snprintf(buffer, buffer_len, "%s: %s (%s)",
895 str(LANG_RECORDING_AGC_MAXGAIN),
896 fmt_gain(SOUND_LEFT_GAIN,
897 agc_maxgain, buf2, sizeof(buf2)),
898 fmt_gain(SOUND_LEFT_GAIN,
899 agc_maxgain -
900 (global_settings.rec_left_gain +
901 global_settings.rec_right_gain)/2,
902 buf3, sizeof(buf3)));
903 break;
904#endif
905 case ITEM_FILENAME:
906 {
907 if(audio_status() & AUDIO_STATUS_RECORD)
908 {
909 size_t tot_len = strlen(path_buffer) +
910 strlen(str(LANG_RECORDING_FILENAME)) + 1;
911 if(tot_len > buffer_len)
912 {
913 snprintf(buffer, buffer_len, "%s %s",
914 str(LANG_RECORDING_FILENAME),
915 path_buffer + tot_len - buffer_len);
916 }
917 else
918 {
919 snprintf(buffer, buffer_len, "%s %s",
920 str(LANG_RECORDING_FILENAME), path_buffer);
921 }
922 }
923 else
924 {
925 strncpy(buffer, str(LANG_RECORDING_FILENAME), buffer_len);
926 }
927 break;
928 }
929 default:
930 return "";
931 }
932 return buffer;
933}
934
935
826bool recording_start_automatic = false; 936bool recording_start_automatic = false;
827 937
828bool recording_screen(bool no_source) 938bool recording_screen(bool no_source)
829{ 939{
830 long button; 940 int button;
831 bool done = false; 941 int done = -1; /* negative to re-init, positive to quit, zero to run */
832 char buf[32]; 942 char buf[32]; /* for preparing strings */
833 char buf2[32]; 943 char buf2[32]; /* for preparing strings */
834 int w, h; 944 int w, h; /* character width/height */
835 int update_countdown = 1; 945 int update_countdown = 1; /* refresh counter */
836 unsigned int seconds; 946 unsigned int seconds;
837 int hours, minutes; 947 int hours, minutes;
838 char filename[13]; 948 int audio_stat = 0; /* status of the audio system */
839 int last_audio_stat = -1; 949 int last_audio_stat = -1; /* previous status so we can act on changes */
840 int audio_stat; 950 struct viewport vp_list[NB_SCREENS], vp_top[NB_SCREENS]; /* the viewports */
951
841#if CONFIG_CODEC == SWCODEC 952#if CONFIG_CODEC == SWCODEC
842 int warning_counter = 0; 953 int warning_counter = 0;
843 #define WARNING_PERIOD 7 954 #define WARNING_PERIOD 7
844#endif 955#endif
956
845#ifdef HAVE_FMRADIO_REC 957#ifdef HAVE_FMRADIO_REC
846 /* Radio is left on if: 958 /* Radio is left on if:
847 * 1) Is was on at the start and the initial source is FM Radio 959 * 1) Is was on at the start and the initial source is FM Radio
@@ -859,18 +971,24 @@ bool recording_screen(bool no_source)
859 bool peak_valid = false; 971 bool peak_valid = false;
860 int peak_l, peak_r; 972 int peak_l, peak_r;
861 int balance = 0; 973 int balance = 0;
862 bool display_agc[NB_SCREENS];
863#endif 974#endif
864 int line[NB_SCREENS];
865 int i; 975 int i;
866 int filename_offset[NB_SCREENS]; 976 int pm_x[NB_SCREENS]; /* peakmeter (and trigger bar) x pos */
867 int pm_y[NB_SCREENS]; 977 int pm_y[NB_SCREENS]; /* peakmeter y pos */
868 int trig_xpos[NB_SCREENS]; 978 int pm_h[NB_SCREENS]; /* peakmeter height */
869 int trig_ypos[NB_SCREENS]; 979 int trig_ypos[NB_SCREENS]; /* trigger bar y pos */
870 int trig_width[NB_SCREENS]; 980 int trig_width[NB_SCREENS]; /* trigger bar width */
871 /* pm_x = offset pm to put clipcount in front. 981 struct gui_synclist lists; /* the list in the bottom vp */
872 Use lcd_getstringsize() when not using SYSFONT */ 982#ifdef HAVE_FMRADIO_REC
873 int pm_x = global_settings.peak_meter_clipcounter ? 30 : 0; 983 int prev_rec_source = global_settings.rec_source; /* detect source change */
984#endif
985
986#if CONFIG_TUNER
987 bool statusbar = global_settings.statusbar;
988 global_status.statusbar_forced = statusbar?0:1;
989 global_settings.statusbar = true;
990 gui_syncstatusbar_draw(&statusbars,true);
991#endif
874 992
875 static const unsigned char *byte_units[] = { 993 static const unsigned char *byte_units[] = {
876 ID2P(LANG_BYTE), 994 ID2P(LANG_BYTE),
@@ -879,29 +997,9 @@ bool recording_screen(bool no_source)
879 ID2P(LANG_GIGABYTE) 997 ID2P(LANG_GIGABYTE)
880 }; 998 };
881 999
882 int base_style = STYLE_INVERT;
883 int style;
884 struct viewport vp[NB_SCREENS];
885 int ymargin = global_settings.cursor_style?0:10;
886#ifdef HAVE_LCD_COLOR
887 if (global_settings.cursor_style == 2) {
888 base_style |= STYLE_COLORBAR;
889 }
890 else if (global_settings.cursor_style == 3) {
891 base_style |= STYLE_GRADIENT;
892 }
893#endif
894
895 struct audio_recording_options rec_options; 1000 struct audio_recording_options rec_options;
896 rec_status = RCSTAT_IN_RECSCREEN; 1001 rec_status = RCSTAT_IN_RECSCREEN;
897 1002
898 if (rec_create_directory() < 0)
899 {
900 rec_status = 0;
901 return false;
902 }
903
904 cursor = 0;
905#if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR) 1003#if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR)
906 ata_set_led_enabled(false); 1004 ata_set_led_enabled(false);
907#endif 1005#endif
@@ -917,68 +1015,166 @@ bool recording_screen(bool no_source)
917 peak_meter_playback(true); 1015 peak_meter_playback(true);
918#endif 1016#endif
919 1017
920 audio_init_recording(0);
921 sound_set_volume(global_settings.volume);
922
923#ifdef HAVE_AGC 1018#ifdef HAVE_AGC
924 peak_meter_get_peakhold(&peak_l, &peak_r); 1019 peak_meter_get_peakhold(&peak_l, &peak_r);
925#endif 1020#endif
926 1021
927 rec_init_recording_options(&rec_options);
928 rec_set_recording_options(&rec_options);
929
930 set_gain();
931
932#if CONFIG_RTC == 0
933 /* Create new filename for recording start */
934 rec_init_filename();
935#endif
936
937 pm_reset_clipcount(); 1022 pm_reset_clipcount();
938 pm_activate_clipcount(false); 1023 pm_activate_clipcount(false);
939 settings_apply_trigger(); 1024 settings_apply_trigger();
940 1025
941#ifdef HAVE_AGC 1026#ifdef HAVE_AGC
942 agc_preset_str[0] = str(LANG_SYSFONT_OFF); 1027 agc_preset_str[0] = str(LANG_OFF);
943 agc_preset_str[1] = str(LANG_SYSFONT_AGC_SAFETY); 1028 agc_preset_str[1] = str(LANG_AGC_SAFETY);
944 agc_preset_str[2] = str(LANG_SYSFONT_AGC_LIVE); 1029 agc_preset_str[2] = str(LANG_AGC_LIVE);
945 agc_preset_str[3] = str(LANG_SYSFONT_AGC_DJSET); 1030 agc_preset_str[3] = str(LANG_AGC_DJSET);
946 agc_preset_str[4] = str(LANG_SYSFONT_AGC_MEDIUM); 1031 agc_preset_str[4] = str(LANG_AGC_MEDIUM);
947 agc_preset_str[5] = str(LANG_SYSFONT_AGC_VOICE); 1032 agc_preset_str[5] = str(LANG_AGC_VOICE);
948 if (global_settings.rec_source == AUDIO_SRC_MIC) {
949 agc_preset = global_settings.rec_agc_preset_mic;
950 agc_maxgain = global_settings.rec_agc_maxgain_mic;
951 }
952 else {
953 agc_preset = global_settings.rec_agc_preset_line;
954 agc_maxgain = global_settings.rec_agc_maxgain_line;
955 }
956#endif /* HAVE_AGC */ 1033#endif /* HAVE_AGC */
957 1034
1035#if CONFIG_CODEC == SWCODEC
1036 audio_close_recording();
1037#endif
1038 audio_init_recording(0);
1039 sound_set_volume(global_settings.volume);
1040
1041#if CONFIG_RTC == 0
1042 /* Create new filename for recording start */
1043 rec_init_filename();
1044#endif
1045
1046 /* viewport init and calculations that only needs to be done once */
958 FOR_NB_SCREENS(i) 1047 FOR_NB_SCREENS(i)
959 { 1048 {
960 viewport_set_defaults(&vp[i], i); 1049 struct viewport *v;
961 vp[i].font = FONT_SYSFIXED; 1050 /* top vp, 4 lines, force sys font if total screen < 6 lines
962 screens[i].set_viewport(&vp[i]); 1051 NOTE: one could limit the list to 1 line and get away with 5 lines */
963 screens[i].getstringsize("M", &w, &h); 1052 v = &vp_top[i];
964 filename_offset[i] = ((vp[i].height >= 7*h) ? 1 : 0); 1053 viewport_set_defaults(v, i); /*already takes care of statusbar*/
965 pm_y[i] = h * (2 + filename_offset[i]); 1054 if (viewport_get_nb_lines(v) < (4+2)) /*top=4,list=2*/
1055 v->font = FONT_SYSFIXED;
1056 v->height = (font_get(v->font)->height)*4;
1057
1058 /* list section, rest of the screen */
1059 v = &vp_list[i];
1060 viewport_set_defaults(v, i);
1061 v->font = vp_top[i].font;
1062 v->y = vp_top[i].y + vp_top[i].height;
1063 v->height = screens[i].lcdheight - v->y; /* the rest */
1064 screens[i].set_viewport(&vp_top[i]); /* req for next calls */
1065
1066 screens[i].getstringsize("W", &w, &h);
1067 pm_y[i] = font_get(vp_top[i].font)->height * 2;
1068 trig_ypos[i] = font_get(vp_top[i].font)->height * 3;
966 } 1069 }
967 1070
968#ifdef HAVE_REMOTE_LCD 1071 /* init the bottom list */
969 if (!remote_display_on) 1072 gui_synclist_init(&lists, reclist_get_name, NULL, false, 1, vp_list);
1073 gui_synclist_set_title(&lists, NULL, Icon_NOICON);
1074
1075 /* start of the loop: we stay in this loop until user quits recscreen */
1076 while(done <= 0)
970 { 1077 {
971 screens[1].clear_display(); 1078 if(done < 0)
972 snprintf(buf, sizeof(buf), str(LANG_REMOTE_LCD_ON)); 1079 {
973 screens[1].puts((vp[1].width/w - strlen(buf))/2 + 1, 1080 /* request to re-init stuff, done after settings screen */
974 vp[1].height/(h*2) + 1, buf); 1081 done = 0;
975 screens[1].update(); 1082#ifdef HAVE_FMRADIO_REC
976 gui_syncsplash(0, str(LANG_REMOTE_LCD_OFF)); 1083 /* If input changes away from FM Radio,
977 } 1084 radio will remain off when recording screen closes. */
1085 if (global_settings.rec_source != prev_rec_source
1086 && prev_rec_source == AUDIO_SRC_FMRADIO)
1087 radio_status = FMRADIO_OFF;
1088 prev_rec_source = global_settings.rec_source;
978#endif 1089#endif
979 1090
980 while(!done) 1091 FOR_NB_SCREENS(i)
981 { 1092 {
1093 pm_x[i] = 0;
1094 if(global_settings.peak_meter_clipcounter)
1095 {
1096 int clipwidth = 0;
1097 screens[i].getstringsize(str(LANG_PM_CLIPCOUNT),
1098 &clipwidth, &h); /* h is same */
1099 pm_x[i] = clipwidth+1;
1100 }
1101 if(global_settings.rec_trigger_mode == TRIG_MODE_OFF)
1102 pm_h[i] = font_get(vp_top[i].font)->height * 2;
1103 else
1104 pm_h[i] = font_get(vp_top[i].font)->height;
1105 trig_width[i] = vp_top[i].width - pm_x[i];
1106 screens[i].clear_display();
1107 screens[i].update();
1108 }
1109
1110#if CONFIG_CODEC == SWCODEC
1111 audio_close_recording();
1112 audio_init_recording(0);
1113#endif
1114
1115 rec_init_recording_options(&rec_options);
1116 rec_set_recording_options(&rec_options);
1117
1118 if(rec_create_directory() < 0)
1119 {
1120 rec_status = 0;
1121 goto rec_abort;
1122 }
1123
1124#if CONFIG_CODEC == SWCODEC && CONFIG_RTC == 0
1125 /* If format changed, a new number is required */
1126 rec_init_filename();
1127#endif
1128
1129#ifdef HAVE_AGC
1130 if (global_settings.rec_source == AUDIO_SRC_MIC) {
1131 agc_preset = global_settings.rec_agc_preset_mic;
1132 agc_maxgain = global_settings.rec_agc_maxgain_mic;
1133 }
1134 else {
1135 agc_preset = global_settings.rec_agc_preset_line;
1136 agc_maxgain = global_settings.rec_agc_maxgain_line;
1137 }
1138#endif
1139
1140 set_gain();
1141 update_countdown = 1; /* Update immediately */
1142
1143 /* populate translation table for list id -> enum */
1144 if(global_settings.rec_source == AUDIO_SRC_MIC)
1145 {
1146 listid_to_enum[0] = ITEM_VOLUME_M;
1147 listid_to_enum[1] = ITEM_GAIN_M;
1148#ifdef HAVE_AGC
1149 listid_to_enum[2] = ITEM_AGC_MODE_M;
1150 listid_to_enum[3] = ITEM_AGC_MAXDB_M;
1151 listid_to_enum[4] = ITEM_FILENAME_M;
1152#else
1153 listid_to_enum[2] = ITEM_FILENAME_M;
1154#endif
1155 }
1156 else
1157 {
1158 listid_to_enum[0] = ITEM_VOLUME;
1159 listid_to_enum[1] = ITEM_GAIN;
1160 listid_to_enum[2] = ITEM_GAIN_L;
1161 listid_to_enum[3] = ITEM_GAIN_R;
1162#ifdef HAVE_AGC
1163 listid_to_enum[4] = ITEM_AGC_MODE;
1164 listid_to_enum[5] = ITEM_AGC_MAXDB;
1165 listid_to_enum[6] = ITEM_FILENAME;
1166#else
1167 listid_to_enum[4] = ITEM_FILENAME;
1168#endif
1169 }
1170
1171 if(global_settings.rec_source == AUDIO_SRC_MIC)
1172 gui_synclist_set_nb_items(&lists, ITEM_COUNT_M); /* mono */
1173 else
1174 gui_synclist_set_nb_items(&lists, ITEM_COUNT); /* stereo */
1175 gui_synclist_draw(&lists);
1176 } /* if(done < 0) */
1177
982 audio_stat = audio_status(); 1178 audio_stat = audio_status();
983 1179
984#if (CONFIG_LED == LED_REAL) 1180#if (CONFIG_LED == LED_REAL)
@@ -1028,9 +1224,13 @@ bool recording_screen(bool no_source)
1028 } 1224 }
1029#endif /* CONFIG_LED */ 1225#endif /* CONFIG_LED */
1030 1226
1227 /* first set current vp - stays like this for drawing that follows */
1228 FOR_NB_SCREENS(i)
1229 screens[i].set_viewport(&vp_top[i]);
1230
1031 /* Wait for a button a while (HZ/10) drawing the peak meter */ 1231 /* Wait for a button a while (HZ/10) drawing the peak meter */
1032 button = peak_meter_draw_get_btn(CONTEXT_RECSCREEN, 1232 button = peak_meter_draw_get_btn(CONTEXT_RECSCREEN,
1033 pm_x, pm_y, h * PM_HEIGHT, 1233 pm_x, pm_y, pm_h,
1034 screen_update); 1234 screen_update);
1035 1235
1036 if (last_audio_stat != audio_stat) 1236 if (last_audio_stat != audio_stat)
@@ -1040,9 +1240,9 @@ bool recording_screen(bool no_source)
1040 rec_status |= RCSTAT_HAVE_RECORDED; 1240 rec_status |= RCSTAT_HAVE_RECORDED;
1041 } 1241 }
1042 last_audio_stat = audio_stat; 1242 last_audio_stat = audio_stat;
1243 update_list = true;
1043 } 1244 }
1044 1245
1045
1046 if (recording_start_automatic) 1246 if (recording_start_automatic)
1047 { 1247 {
1048 /* simulate a button press */ 1248 /* simulate a button press */
@@ -1050,133 +1250,29 @@ bool recording_screen(bool no_source)
1050 recording_start_automatic = false; 1250 recording_start_automatic = false;
1051 } 1251 }
1052 1252
1053 switch(button) 1253 /* let list handle the button */
1054 { 1254 gui_synclist_do_button(&lists, &button, LIST_WRAP_UNLESS_HELD);
1055#ifdef HAVE_REMOTE_LCD
1056 case ACTION_REC_LCD:
1057 if (remote_display_on)
1058 {
1059 remote_display_on = false;
1060 screen_update = 1;
1061 screens[1].clear_display();
1062 snprintf(buf, sizeof(buf), str(LANG_REMOTE_LCD_ON));
1063 screens[1].puts((screens[1].getwidth()/w - strlen(buf))/2 +
1064 1,
1065 screens[1].getheight()/(h*2) + 1, buf);
1066 screens[1].update();
1067 gui_syncsplash(0, str(LANG_REMOTE_LCD_OFF));
1068 }
1069 else
1070 {
1071 remote_display_on = true;
1072 screen_update = NB_SCREENS;
1073 }
1074 break;
1075#endif
1076 case ACTION_STD_CANCEL:
1077 /* turn off the trigger */
1078 peak_meter_trigger(false);
1079 peak_meter_set_trigger_listener(NULL);
1080 1255
1081 if(audio_stat & AUDIO_STATUS_RECORD) 1256 /* list code changes active viewport - change it back */
1082 { 1257 FOR_NB_SCREENS(i)
1083 rec_command(RECORDING_CMD_STOP); 1258 screens[i].set_viewport(&vp_top[i]);
1084 }
1085 else
1086 {
1087#if CONFIG_CODEC != SWCODEC
1088 peak_meter_playback(true);
1089 peak_meter_enabled = false;
1090#endif
1091 done = true;
1092 }
1093 update_countdown = 1; /* Update immediately */
1094 break;
1095
1096 case ACTION_REC_PAUSE:
1097 case ACTION_REC_NEWFILE:
1098 /* Only act if the mpeg is stopped */
1099 if(!(audio_stat & AUDIO_STATUS_RECORD))
1100 {
1101 /* is this manual or triggered recording? */
1102 if ((global_settings.rec_trigger_mode == TRIG_MODE_OFF) ||
1103 (peak_meter_trigger_status() != TRIG_OFF))
1104 {
1105 /* manual recording */
1106 rec_status |= RCSTAT_HAVE_RECORDED;
1107 rec_command(RECORDING_CMD_START);
1108 last_seconds = 0;
1109 if (global_settings.talk_menu)
1110 {
1111 /* no voice possible here, but a beep */
1112 audio_beep(HZ/2); /* longer beep on start */
1113 }
1114 }
1115 /* this is triggered recording */
1116 else
1117 {
1118 /* we don't start recording now, but enable the
1119 trigger and let the callback function
1120 trigger_listener control when the recording starts */
1121 peak_meter_trigger(true);
1122 peak_meter_set_trigger_listener(&trigger_listener);
1123 }
1124 }
1125 else
1126 {
1127 /*if new file button pressed, start new file */
1128 if (button == ACTION_REC_NEWFILE)
1129 {
1130 rec_command(RECORDING_CMD_START_NEWFILE);
1131 last_seconds = 0;
1132 }
1133 else
1134 /* if pause button pressed, pause or resume */
1135 {
1136 if(audio_stat & AUDIO_STATUS_PAUSE)
1137 {
1138 rec_command(RECORDING_CMD_RESUME);
1139 if (global_settings.talk_menu)
1140 {
1141 /* no voice possible here, but a beep */
1142 audio_beep(HZ/4); /* short beep on resume */
1143 }
1144 }
1145 else
1146 {
1147 rec_command(RECORDING_CMD_PAUSE);
1148 }
1149 }
1150 }
1151 update_countdown = 1; /* Update immediately */
1152 break;
1153
1154 case ACTION_STD_PREV:
1155 cursor--;
1156 adjust_cursor();
1157 update_countdown = 1; /* Update immediately */
1158 break;
1159
1160 case ACTION_STD_NEXT:
1161 cursor++;
1162 adjust_cursor();
1163 update_countdown = 1; /* Update immediately */
1164 break;
1165 1259
1260 switch(button)
1261 {
1166 case ACTION_SETTINGS_INC: 1262 case ACTION_SETTINGS_INC:
1167 case ACTION_SETTINGS_INCREPEAT: 1263 case ACTION_SETTINGS_INCREPEAT:
1168 switch(cursor) 1264 switch (listid_to_enum[gui_synclist_get_sel_pos(&lists)])
1169 { 1265 {
1170 case 0: 1266 case ITEM_VOLUME:
1171 global_settings.volume++; 1267 global_settings.volume++;
1172 setvol(); 1268 setvol();
1173 break; 1269 break;
1174 case 1: 1270 case ITEM_GAIN:
1175 if(global_settings.rec_source == AUDIO_SRC_MIC) 1271 if(global_settings.rec_source == AUDIO_SRC_MIC)
1176 { 1272 {
1177 if(global_settings.rec_mic_gain < 1273 if(global_settings.rec_mic_gain <
1178 sound_max(SOUND_MIC_GAIN)) 1274 sound_max(SOUND_MIC_GAIN))
1179 global_settings.rec_mic_gain++; 1275 global_settings.rec_mic_gain++;
1180 } 1276 }
1181 else 1277 else
1182 { 1278 {
@@ -1188,18 +1284,18 @@ bool recording_screen(bool no_source)
1188 global_settings.rec_right_gain++; 1284 global_settings.rec_right_gain++;
1189 } 1285 }
1190 break; 1286 break;
1191 case 2: 1287 case ITEM_GAIN_L:
1192 if(global_settings.rec_left_gain < 1288 if(global_settings.rec_left_gain <
1193 sound_max(SOUND_LEFT_GAIN)) 1289 sound_max(SOUND_LEFT_GAIN))
1194 global_settings.rec_left_gain++; 1290 global_settings.rec_left_gain++;
1195 break; 1291 break;
1196 case 3: 1292 case ITEM_GAIN_R:
1197 if(global_settings.rec_right_gain < 1293 if(global_settings.rec_right_gain <
1198 sound_max(SOUND_RIGHT_GAIN)) 1294 sound_max(SOUND_RIGHT_GAIN))
1199 global_settings.rec_right_gain++; 1295 global_settings.rec_right_gain++;
1200 break; 1296 break;
1201#ifdef HAVE_AGC 1297#ifdef HAVE_AGC
1202 case 4: 1298 case ITEM_AGC_MODE:
1203 agc_preset = MIN(agc_preset + 1, AGC_MODE_SIZE); 1299 agc_preset = MIN(agc_preset + 1, AGC_MODE_SIZE);
1204 agc_enable = (agc_preset != 0); 1300 agc_enable = (agc_preset != 0);
1205 if (global_settings.rec_source == AUDIO_SRC_MIC) { 1301 if (global_settings.rec_source == AUDIO_SRC_MIC) {
@@ -1210,7 +1306,7 @@ bool recording_screen(bool no_source)
1210 agc_maxgain = global_settings.rec_agc_maxgain_line; 1306 agc_maxgain = global_settings.rec_agc_maxgain_line;
1211 } 1307 }
1212 break; 1308 break;
1213 case 5: 1309 case ITEM_AGC_MAXDB:
1214 if (global_settings.rec_source == AUDIO_SRC_MIC) 1310 if (global_settings.rec_source == AUDIO_SRC_MIC)
1215 { 1311 {
1216 agc_maxgain = MIN(agc_maxgain + 1, 1312 agc_maxgain = MIN(agc_maxgain + 1,
@@ -1229,16 +1325,15 @@ bool recording_screen(bool no_source)
1229 set_gain(); 1325 set_gain();
1230 update_countdown = 1; /* Update immediately */ 1326 update_countdown = 1; /* Update immediately */
1231 break; 1327 break;
1232
1233 case ACTION_SETTINGS_DEC: 1328 case ACTION_SETTINGS_DEC:
1234 case ACTION_SETTINGS_DECREPEAT: 1329 case ACTION_SETTINGS_DECREPEAT:
1235 switch(cursor) 1330 switch (listid_to_enum[gui_synclist_get_sel_pos(&lists)])
1236 { 1331 {
1237 case 0: 1332 case ITEM_VOLUME:
1238 global_settings.volume--; 1333 global_settings.volume--;
1239 setvol(); 1334 setvol();
1240 break; 1335 break;
1241 case 1: 1336 case ITEM_GAIN:
1242 if(global_settings.rec_source == AUDIO_SRC_MIC) 1337 if(global_settings.rec_source == AUDIO_SRC_MIC)
1243 { 1338 {
1244 if(global_settings.rec_mic_gain > 1339 if(global_settings.rec_mic_gain >
@@ -1255,18 +1350,18 @@ bool recording_screen(bool no_source)
1255 global_settings.rec_right_gain--; 1350 global_settings.rec_right_gain--;
1256 } 1351 }
1257 break; 1352 break;
1258 case 2: 1353 case ITEM_GAIN_L:
1259 if(global_settings.rec_left_gain > 1354 if(global_settings.rec_left_gain >
1260 sound_min(SOUND_LEFT_GAIN)) 1355 sound_min(SOUND_LEFT_GAIN))
1261 global_settings.rec_left_gain--; 1356 global_settings.rec_left_gain--;
1262 break; 1357 break;
1263 case 3: 1358 case ITEM_GAIN_R:
1264 if(global_settings.rec_right_gain > 1359 if(global_settings.rec_right_gain >
1265 sound_min(SOUND_RIGHT_GAIN)) 1360 sound_min(SOUND_RIGHT_GAIN))
1266 global_settings.rec_right_gain--; 1361 global_settings.rec_right_gain--;
1267 break; 1362 break;
1268#ifdef HAVE_AGC 1363#ifdef HAVE_AGC
1269 case 4: 1364 case ITEM_AGC_MODE:
1270 agc_preset = MAX(agc_preset - 1, 0); 1365 agc_preset = MAX(agc_preset - 1, 0);
1271 agc_enable = (agc_preset != 0); 1366 agc_enable = (agc_preset != 0);
1272 if (global_settings.rec_source == AUDIO_SRC_MIC) { 1367 if (global_settings.rec_source == AUDIO_SRC_MIC) {
@@ -1277,7 +1372,7 @@ bool recording_screen(bool no_source)
1277 agc_maxgain = global_settings.rec_agc_maxgain_line; 1372 agc_maxgain = global_settings.rec_agc_maxgain_line;
1278 } 1373 }
1279 break; 1374 break;
1280 case 5: 1375 case ITEM_AGC_MAXDB:
1281 if (global_settings.rec_source == AUDIO_SRC_MIC) 1376 if (global_settings.rec_source == AUDIO_SRC_MIC)
1282 { 1377 {
1283 agc_maxgain = MAX(agc_maxgain - 1, 1378 agc_maxgain = MAX(agc_maxgain - 1,
@@ -1296,25 +1391,123 @@ bool recording_screen(bool no_source)
1296 set_gain(); 1391 set_gain();
1297 update_countdown = 1; /* Update immediately */ 1392 update_countdown = 1; /* Update immediately */
1298 break; 1393 break;
1394 case ACTION_STD_CANCEL:
1395 /* turn off the trigger */
1396 peak_meter_trigger(false);
1397 peak_meter_set_trigger_listener(NULL);
1299 1398
1399 if(audio_stat & AUDIO_STATUS_RECORD)
1400 {
1401 rec_command(RECORDING_CMD_STOP);
1402 }
1403 else
1404 {
1405#if CONFIG_CODEC != SWCODEC
1406 peak_meter_playback(true);
1407 peak_meter_enabled = false;
1408#endif
1409 done = 1;
1410 }
1411 update_countdown = 1; /* Update immediately */
1412 break;
1413#ifdef HAVE_REMOTE_LCD
1414 case ACTION_REC_LCD:
1415 /* this feature exists for some h1x0/h3x0 targets that suffer
1416 from noise caused by remote LCD updates
1417 NOTE 1: this will leave the list on the remote
1418 NOTE 2: to be replaced by a global LCD_off() routine */
1419 if(remote_display_on)
1420 {
1421 /* switch to single screen and put up a splash on the main.
1422 On the remote we put a two line message */
1423 screen_update = 1;
1424 screens[1].clear_viewport();
1425 screens[1].puts(0, 0, str(LANG_REMOTE_LCD_OFF));
1426 screens[1].puts(0, 1, str(LANG_REMOTE_LCD_ON));
1427 screens[1].update_viewport();
1428 gui_splash(&screens[0], 0, str(LANG_REMOTE_LCD_OFF));
1429 }
1430 else
1431 {
1432 /* remote switched on again */
1433 update_list = true;
1434 screen_update = NB_SCREENS;
1435 }
1436 remote_display_on = !remote_display_on; /* toggle */
1437 update_countdown = 1; /* Update immediately */
1438 break;
1439#endif
1440 case ACTION_REC_PAUSE:
1441 case ACTION_REC_NEWFILE:
1442 /* Only act if the mpeg is stopped */
1443 if(!(audio_stat & AUDIO_STATUS_RECORD))
1444 {
1445 /* is this manual or triggered recording? */
1446 if ((global_settings.rec_trigger_mode == TRIG_MODE_OFF) ||
1447 (peak_meter_trigger_status() != TRIG_OFF))
1448 {
1449 /* manual recording */
1450 rec_status |= RCSTAT_HAVE_RECORDED;
1451 rec_command(RECORDING_CMD_START);
1452 last_seconds = 0;
1453 if (global_settings.talk_menu)
1454 {
1455 /* no voice possible here, but a beep */
1456 audio_beep(HZ/2); /* longer beep on start */
1457 }
1458 }
1459 /* this is triggered recording */
1460 else
1461 {
1462 /* we don't start recording now, but enable the
1463 trigger and let the callback function
1464 trigger_listener control when the recording starts */
1465 peak_meter_trigger(true);
1466 peak_meter_set_trigger_listener(&trigger_listener);
1467 }
1468 }
1469 else
1470 {
1471 /*if new file button pressed, start new file */
1472 if (button == ACTION_REC_NEWFILE)
1473 {
1474 rec_command(RECORDING_CMD_START_NEWFILE);
1475 last_seconds = 0;
1476 }
1477 else
1478 /* if pause button pressed, pause or resume */
1479 {
1480 if(audio_stat & AUDIO_STATUS_PAUSE)
1481 {
1482 rec_command(RECORDING_CMD_RESUME);
1483 if (global_settings.talk_menu)
1484 {
1485 /* no voice possible here, but a beep */
1486 audio_beep(HZ/4); /* short beep on resume */
1487 }
1488 }
1489 else
1490 {
1491 rec_command(RECORDING_CMD_PAUSE);
1492 }
1493 }
1494 }
1495 update_countdown = 1; /* Update immediately */
1496 break;
1300 case ACTION_STD_MENU: 1497 case ACTION_STD_MENU:
1301#if CONFIG_CODEC == SWCODEC 1498#if CONFIG_CODEC == SWCODEC
1302 if(!(audio_stat & AUDIO_STATUS_RECORD)) 1499 if(!(audio_stat & AUDIO_STATUS_RECORD))
1303#else 1500#else
1304 if(audio_stat != AUDIO_STATUS_RECORD) 1501 if(audio_stat != AUDIO_STATUS_RECORD)
1305#endif 1502#endif
1306 { 1503 {
1307#ifdef HAVE_FMRADIO_REC
1308 const int prev_rec_source = global_settings.rec_source;
1309#endif
1310
1311#if (CONFIG_LED == LED_REAL) 1504#if (CONFIG_LED == LED_REAL)
1312 /* led is restored at begin of loop / end of function */ 1505 /* led is restored at begin of loop / end of function */
1313 led(false); 1506 led(false);
1314#endif 1507#endif
1315 if (recording_menu(no_source)) 1508 if (recording_menu(no_source))
1316 { 1509 {
1317 done = true; 1510 done = 1;
1318 rec_status |= RCSTAT_BEEN_IN_USB_MODE; 1511 rec_status |= RCSTAT_BEEN_IN_USB_MODE;
1319#ifdef HAVE_FMRADIO_REC 1512#ifdef HAVE_FMRADIO_REC
1320 radio_status = FMRADIO_OFF; 1513 radio_status = FMRADIO_OFF;
@@ -1322,53 +1515,8 @@ bool recording_screen(bool no_source)
1322 } 1515 }
1323 else 1516 else
1324 { 1517 {
1325#ifdef HAVE_FMRADIO_REC 1518 done = -1;
1326 /* If input changes away from FM Radio, radio will 1519 /* the init is now done at the beginning of the loop */
1327 remain off when recording screen closes. */
1328 if (global_settings.rec_source != prev_rec_source
1329 && prev_rec_source == AUDIO_SRC_FMRADIO)
1330 radio_status = FMRADIO_OFF;
1331#endif
1332
1333#if CONFIG_CODEC == SWCODEC
1334 /* reinit after submenu exit */
1335 audio_close_recording();
1336 audio_init_recording(0);
1337#endif
1338
1339 rec_init_recording_options(&rec_options);
1340 rec_set_recording_options(&rec_options);
1341
1342 if(rec_create_directory() < 0)
1343 {
1344 goto rec_abort;
1345 }
1346
1347#if CONFIG_CODEC == SWCODEC && CONFIG_RTC == 0
1348 /* If format changed, a new number is required */
1349 rec_init_filename();
1350#endif
1351
1352#ifdef HAVE_AGC
1353 if (global_settings.rec_source == AUDIO_SRC_MIC) {
1354 agc_preset = global_settings.rec_agc_preset_mic;
1355 agc_maxgain = global_settings.rec_agc_maxgain_mic;
1356 }
1357 else {
1358 agc_preset = global_settings.rec_agc_preset_line;
1359 agc_maxgain = global_settings.rec_agc_maxgain_line;
1360 }
1361#endif
1362
1363 adjust_cursor();
1364 set_gain();
1365 update_countdown = 1; /* Update immediately */
1366
1367 FOR_NB_SCREENS(i)
1368 {
1369 screens[i].set_viewport(&vp[i]);
1370 screens[i].setfont(FONT_SYSFIXED);
1371 }
1372 } 1520 }
1373 } 1521 }
1374 break; 1522 break;
@@ -1418,6 +1566,8 @@ bool recording_screen(bool no_source)
1418 /* Only accept USB connection when not recording */ 1566 /* Only accept USB connection when not recording */
1419 if(!(audio_stat & AUDIO_STATUS_RECORD)) 1567 if(!(audio_stat & AUDIO_STATUS_RECORD))
1420 { 1568 {
1569 FOR_NB_SCREENS(i)
1570 screens[i].set_viewport(NULL);
1421 default_event_handler(SYS_USB_CONNECTED); 1571 default_event_handler(SYS_USB_CONNECTED);
1422 done = true; 1572 done = true;
1423 rec_status |= RCSTAT_BEEN_IN_USB_MODE; 1573 rec_status |= RCSTAT_BEEN_IN_USB_MODE;
@@ -1426,11 +1576,7 @@ bool recording_screen(bool no_source)
1426#endif 1576#endif
1427 } 1577 }
1428 break; 1578 break;
1429 1579 } /*switch(button)*/
1430 default:
1431 default_event_handler(button);
1432 break;
1433 } /* end switch */
1434 1580
1435#ifdef HAVE_AGC 1581#ifdef HAVE_AGC
1436 peak_read = !peak_read; 1582 peak_read = !peak_read;
@@ -1444,17 +1590,17 @@ bool recording_screen(bool no_source)
1444 auto_gain_control(&peak_l, &peak_r, &balance); 1590 auto_gain_control(&peak_l, &peak_r, &balance);
1445#endif 1591#endif
1446 1592
1447 FOR_NB_SCREENS(i)
1448 screens[i].setfont(FONT_SYSFIXED);
1449
1450 seconds = audio_recorded_time() / HZ; 1593 seconds = audio_recorded_time() / HZ;
1451 1594
1452 update_countdown--; 1595 /* start of vp_top drawing */
1453 if(update_countdown == 0 || seconds > last_seconds) 1596 if(update_countdown-- == 0 || seconds > last_seconds)
1454 { 1597 {
1455 unsigned int dseconds, dhours, dminutes; 1598 unsigned int dseconds, dhours, dminutes;
1456 unsigned long num_recorded_bytes, dsize, dmb; 1599 unsigned long num_recorded_bytes, dsize, dmb;
1457 int pos = 0; 1600
1601 /* we assume vp_top is the current viewport! */
1602 FOR_NB_ACTIVE_SCREENS(i)
1603 screens[i].clear_viewport();
1458 1604
1459 update_countdown = 5; 1605 update_countdown = 5;
1460 last_seconds = seconds; 1606 last_seconds = seconds;
@@ -1463,17 +1609,6 @@ bool recording_screen(bool no_source)
1463 dsize = rec_sizesplit_bytes(); 1609 dsize = rec_sizesplit_bytes();
1464 num_recorded_bytes = audio_num_recorded_bytes(); 1610 num_recorded_bytes = audio_num_recorded_bytes();
1465 1611
1466 for(i = 0; i < screen_update; i++)
1467 screens[i].clear_display();
1468
1469 style = base_style;
1470
1471#ifdef HAVE_LCD_COLOR
1472 /* special action for gradient - set default for 1 line gradient */
1473 if(global_settings.cursor_style == 3)
1474 style = base_style | CURLN_PACK(0) | NUMLN_PACK(1);
1475#endif /* HAVE_LCD_COLOR */
1476
1477#if CONFIG_CODEC == SWCODEC 1612#if CONFIG_CODEC == SWCODEC
1478 if ((audio_stat & AUDIO_STATUS_WARNING) 1613 if ((audio_stat & AUDIO_STATUS_WARNING)
1479 && (warning_counter++ % WARNING_PERIOD) < WARNING_PERIOD/2) 1614 && (warning_counter++ % WARNING_PERIOD) < WARNING_PERIOD/2)
@@ -1493,40 +1628,39 @@ bool recording_screen(bool no_source)
1493 { 1628 {
1494 dmb = dsize/1024/1024; 1629 dmb = dsize/1024/1024;
1495 snprintf(buf, sizeof(buf), "%s %dMB", 1630 snprintf(buf, sizeof(buf), "%s %dMB",
1496 str(LANG_SYSFONT_SPLIT_SIZE), dmb); 1631 str(LANG_SPLIT_SIZE), dmb);
1497 } 1632 }
1498 else 1633 else
1499 { 1634 {
1500 hours = seconds / 3600; 1635 hours = seconds / 3600;
1501 minutes = (seconds - (hours * 3600)) / 60; 1636 minutes = (seconds - (hours * 3600)) / 60;
1502 snprintf(buf, sizeof(buf), "%s %02d:%02d:%02d", 1637 snprintf(buf, sizeof(buf), "%s %02d:%02d:%02d",
1503 str(LANG_SYSFONT_RECORDING_TIME), 1638 str(LANG_RECORDING_TIME),
1504 hours, minutes, seconds%60); 1639 hours, minutes, seconds%60);
1505 } 1640 }
1506 1641
1507 for(i = 0; i < screen_update; i++) 1642 FOR_NB_ACTIVE_SCREENS(i)
1508 screens[i].puts(0, 0, buf); 1643 screens[i].puts(0, 0, buf);
1509 1644
1510 if(audio_stat & AUDIO_STATUS_PRERECORD) 1645 if(audio_stat & AUDIO_STATUS_PRERECORD)
1511 { 1646 {
1512 snprintf(buf, sizeof(buf), "%s...", 1647 snprintf(buf, sizeof(buf), "%s...",
1513 str(LANG_SYSFONT_RECORD_PRERECORD)); 1648 str(LANG_RECORD_PRERECORD));
1514 } 1649 }
1515 else 1650 else
1516 { 1651 {
1517 /* Display the split interval if the record timesplit 1652 /* Display the split interval if the record timesplit
1518 is active */ 1653 is active */
1519 if ((global_settings.rec_timesplit) && 1654 if ((global_settings.rec_timesplit) &&
1520 !(global_settings.rec_split_method)) 1655 !(global_settings.rec_split_method))
1521 { 1656 {
1522 /* Display the record timesplit interval rather 1657 /* Display the record timesplit interval rather
1523 than the file size if the record timer is 1658 than the file size if the record timer is active */
1524 active */
1525 dhours = dseconds / 3600; 1659 dhours = dseconds / 3600;
1526 dminutes = (dseconds - (dhours * 3600)) / 60; 1660 dminutes = (dseconds - (dhours * 3600)) / 60;
1527 snprintf(buf, sizeof(buf), "%s %02d:%02d", 1661 snprintf(buf, sizeof(buf), "%s %02d:%02d",
1528 str(LANG_SYSFONT_RECORD_TIMESPLIT_REC), 1662 str(LANG_RECORDING_TIMESPLIT_REC),
1529 dhours, dminutes); 1663 dhours, dminutes);
1530 } 1664 }
1531 else 1665 else
1532 { 1666 {
@@ -1534,42 +1668,25 @@ bool recording_screen(bool no_source)
1534 num_recorded_bytes, 1668 num_recorded_bytes,
1535 byte_units, true); 1669 byte_units, true);
1536 snprintf(buf, sizeof(buf), "%s %s", 1670 snprintf(buf, sizeof(buf), "%s %s",
1537 str(LANG_SYSFONT_RECORDING_SIZE), buf2); 1671 str(LANG_RECORDING_SIZE), buf2);
1538 } 1672 }
1539 } 1673 }
1540 for(i = 0; i < screen_update; i++)
1541 screens[i].puts(0, 1, buf);
1542 1674
1543 for(i = 0; i < screen_update; i++) 1675 FOR_NB_ACTIVE_SCREENS(i)
1544 { 1676 screens[i].puts(0, 1, buf);
1545 if (filename_offset[i] > 0)
1546 {
1547 *filename = '\0';
1548 if (audio_stat & AUDIO_STATUS_RECORD)
1549 {
1550 strncpy(filename, path_buffer +
1551 strlen(path_buffer) - 12, 13);
1552 filename[12]='\0';
1553 }
1554
1555 snprintf(buf, sizeof(buf), "%s %s",
1556 str(LANG_SYSFONT_RECORDING_FILENAME), filename);
1557 screens[i].puts(0, 2, buf);
1558 }
1559 }
1560 1677
1561 /* We will do file splitting regardless, either at the end of 1678 /* We will do file splitting regardless, either at the end of
1562 a split interval, or when the filesize approaches the 2GB 1679 a split interval, or when the filesize approaches the 2GB
1563 FAT file size (compatibility) limit. */ 1680 FAT file size (compatibility) limit. */
1564 if ((audio_stat && !(global_settings.rec_split_method) 1681 if ((audio_stat && !(global_settings.rec_split_method)
1565 && global_settings.rec_timesplit && (seconds >= dseconds)) 1682 && global_settings.rec_timesplit && (seconds >= dseconds))
1566 || (audio_stat && global_settings.rec_split_method 1683 || (audio_stat && global_settings.rec_split_method
1567 && global_settings.rec_sizesplit 1684 && global_settings.rec_sizesplit
1568 && (num_recorded_bytes >= dsize)) 1685 && (num_recorded_bytes >= dsize))
1569 || (num_recorded_bytes >= MAX_FILE_SIZE)) 1686 || (num_recorded_bytes >= MAX_FILE_SIZE))
1570 { 1687 {
1571 if (!(global_settings.rec_split_type) 1688 if (!(global_settings.rec_split_type)
1572 || (num_recorded_bytes >= MAX_FILE_SIZE)) 1689 || (num_recorded_bytes >= MAX_FILE_SIZE))
1573 { 1690 {
1574 rec_command(RECORDING_CMD_START_NEWFILE); 1691 rec_command(RECORDING_CMD_START_NEWFILE);
1575 last_seconds = 0; 1692 last_seconds = 0;
@@ -1591,214 +1708,28 @@ bool recording_screen(bool no_source)
1591 { 1708 {
1592 char clpstr[32]; 1709 char clpstr[32];
1593 snprintf(clpstr, 32, "%4d", pm_get_clipcount()); 1710 snprintf(clpstr, 32, "%4d", pm_get_clipcount());
1594 for(i = 0; i < screen_update; i++) 1711 FOR_NB_ACTIVE_SCREENS(i)
1595 {
1596 if(PM_HEIGHT > 1)
1597 screens[i].puts(0, 2 + filename_offset[i],
1598 str(LANG_SYSFONT_PM_CLIPCOUNT));
1599 screens[i].puts(0, 1 + PM_HEIGHT + filename_offset[i],
1600 clpstr);
1601 }
1602 }
1603
1604 snprintf(buf, sizeof(buf), "%s: %s", str(LANG_SYSFONT_VOLUME),
1605 fmt_gain(SOUND_VOLUME,
1606 global_settings.volume,
1607 buf2, sizeof(buf2)));
1608
1609 if (global_settings.cursor_style && (pos++ == cursor))
1610 {
1611 for(i = 0; i < screen_update; i++)
1612 screens[i].puts_style_offset(0, filename_offset[i] +
1613 PM_HEIGHT + 2, buf, style,0);
1614 }
1615 else
1616 {
1617 for(i = 0; i < screen_update; i++)
1618 screens[i].putsxy(ymargin,
1619 SYSFONT_HEIGHT*(filename_offset[i]+
1620 PM_HEIGHT + 2), buf);
1621 }
1622
1623 if(global_settings.rec_source == AUDIO_SRC_MIC)
1624 {
1625 /* Draw MIC recording gain */
1626 snprintf(buf, sizeof(buf), "%s:%s", str(LANG_SYSFONT_GAIN),
1627 fmt_gain(SOUND_MIC_GAIN,
1628 global_settings.rec_mic_gain,
1629 buf2, sizeof(buf2)));
1630 if(global_settings.cursor_style && ((1==cursor)||(2==cursor)))
1631 {
1632 for(i = 0; i < screen_update; i++)
1633 screens[i].puts_style_offset(0, filename_offset[i] +
1634 PM_HEIGHT + 3, buf, style,0);
1635 }
1636 else
1637 {
1638 for(i = 0; i < screen_update; i++)
1639 screens[i].putsxy(ymargin,
1640 SYSFONT_HEIGHT*(filename_offset[i] +
1641 PM_HEIGHT + 3), buf);
1642 }
1643 }
1644 else if(0
1645 HAVE_LINE_REC_( || global_settings.rec_source ==
1646 AUDIO_SRC_LINEIN)
1647 HAVE_FMRADIO_REC_( || global_settings.rec_source ==
1648 AUDIO_SRC_FMRADIO)
1649 )
1650 {
1651 /* Draw LINE or FMRADIO recording gain */
1652 snprintf(buf, sizeof(buf), "%s:%s",
1653 str(LANG_SYSFONT_RECORDING_LEFT),
1654 fmt_gain(SOUND_LEFT_GAIN,
1655 global_settings.rec_left_gain,
1656 buf2, sizeof(buf2)));
1657#ifdef HAVE_LCD_COLOR
1658 /* special action for gradient - double line gradient - line1 */
1659 if((global_settings.cursor_style == 3) &&
1660 (1==cursor))
1661 style = base_style | CURLN_PACK(0) | NUMLN_PACK(2);
1662#endif /* HAVE_LCD_COLOR */
1663 if(global_settings.cursor_style && ((1==cursor)||(2==cursor)))
1664 {
1665 for(i = 0; i < screen_update; i++)
1666 screens[i].puts_style_offset(0, filename_offset[i] +
1667 PM_HEIGHT + 3, buf, style,0);
1668 }
1669 else
1670 {
1671 for(i = 0; i < screen_update; i++)
1672 screens[i].putsxy(ymargin,
1673 SYSFONT_HEIGHT*(filename_offset[i] +
1674 PM_HEIGHT + 3), buf);
1675 }
1676
1677 snprintf(buf, sizeof(buf), "%s:%s",
1678 str(LANG_SYSFONT_RECORDING_RIGHT),
1679 fmt_gain(SOUND_RIGHT_GAIN,
1680 global_settings.rec_right_gain,
1681 buf2, sizeof(buf2)));
1682#ifdef HAVE_LCD_COLOR
1683 /* special action for gradient - double line gradient - line2 */
1684 if((global_settings.cursor_style == 3) &&
1685 (1==cursor))
1686 style = base_style | CURLN_PACK(1) | NUMLN_PACK(2);
1687#endif /* HAVE_LCD_COLOR */
1688 if(global_settings.cursor_style && ((1==cursor)||(3==cursor)))
1689 {
1690 for(i = 0; i < screen_update; i++)
1691 screens[i].puts_style_offset(0, filename_offset[i] +
1692 PM_HEIGHT + 4, buf, style,0);
1693 }
1694 else
1695 { 1712 {
1696 for(i = 0; i < screen_update; i++) 1713 screens[i].puts(0, 2,str(LANG_PM_CLIPCOUNT));
1697 screens[i].putsxy(ymargin, 1714 screens[i].puts(0, 3, clpstr);
1698 SYSFONT_HEIGHT*(filename_offset[i] +
1699 PM_HEIGHT + 4), buf);
1700 } 1715 }
1701 } 1716 }
1702#ifdef HAVE_LCD_COLOR
1703 /* special action for gradient - back to single line gradient */
1704 if(global_settings.cursor_style == 3)
1705 style = base_style | CURLN_PACK(0) | NUMLN_PACK(1);
1706#endif /* HAVE_LCD_COLOR */
1707 1717
1708 FOR_NB_SCREENS(i)
1709 {
1710 switch (global_settings.rec_source)
1711 {
1712 HAVE_LINE_REC_(case AUDIO_SRC_LINEIN:)
1713 HAVE_FMRADIO_REC_(case AUDIO_SRC_FMRADIO:)
1714 line[i] = 5;
1715 break;
1716
1717 case AUDIO_SRC_MIC:
1718 line[i] = 4;
1719 break;
1720#ifdef HAVE_SPDIF_REC
1721 case AUDIO_SRC_SPDIF:
1722 line[i] = 3;
1723 break;
1724#endif
1725 default:
1726 line[i] = 5; /* to prevent uninitialisation
1727 warnings for line[0] */
1728 break;
1729 } /* end switch */
1730#ifdef HAVE_AGC 1718#ifdef HAVE_AGC
1731 if (vp[i].height < h * (2 + filename_offset[i] + 1719 hist_time++;
1732 PM_HEIGHT + line[i])) 1720#endif
1733 {
1734 line[i] -= 1;
1735 display_agc[i] = false;
1736 }
1737 else
1738 display_agc[i] = true;
1739
1740 if ((cursor==4) || (cursor==5))
1741 display_agc[i] = true;
1742 }
1743
1744 /************** AGC test info ******************
1745 snprintf(buf, sizeof(buf), "D:%d U:%d",
1746 (agc_droptime+2)/5, (agc_risetime+2)/5);
1747 lcd_putsxy(1, LCD_HEIGHT - 8, buf);
1748 snprintf(buf, sizeof(buf), "B:%d",
1749 (agc_baltime+2)/5);
1750 lcd_putsxy(LCD_WIDTH/2 + 3, LCD_HEIGHT - 8, buf);
1751 ***********************************************/
1752
1753 if (cursor == 5)
1754 snprintf(buf, sizeof(buf), "%s: %s",
1755 str(LANG_SYSFONT_RECORDING_AGC_MAXGAIN),
1756 fmt_gain(SOUND_LEFT_GAIN,
1757 agc_maxgain, buf2, sizeof(buf2)));
1758 else if (agc_preset == 0)
1759 snprintf(buf, sizeof(buf), "%s: %s",
1760 str(LANG_SYSFONT_RECORDING_AGC_PRESET),
1761 agc_preset_str[agc_preset]);
1762 else if (global_settings.rec_source == AUDIO_SRC_MIC)
1763 snprintf(buf, sizeof(buf), "%s: %s%s",
1764 str(LANG_SYSFONT_RECORDING_AGC_PRESET),
1765 agc_preset_str[agc_preset],
1766 fmt_gain(SOUND_LEFT_GAIN,
1767 agc_maxgain -
1768 global_settings.rec_mic_gain,
1769 buf2, sizeof(buf2)));
1770 else
1771 snprintf(buf, sizeof(buf), "%s: %s%s",
1772 str(LANG_SYSFONT_RECORDING_AGC_PRESET),
1773 agc_preset_str[agc_preset],
1774 fmt_gain(SOUND_LEFT_GAIN,
1775 agc_maxgain -
1776 (global_settings.rec_left_gain +
1777 global_settings.rec_right_gain)/2,
1778 buf2, sizeof(buf2)));
1779 1721
1780 if(global_settings.cursor_style && ((cursor==4) || (cursor==5))) 1722 /* draw the trigger status */
1781 { 1723 if (peak_meter_trigger_status() != TRIG_OFF)
1782 for(i = 0; i < screen_update; i++)
1783 screens[i].puts_style_offset(0, filename_offset[i] +
1784 PM_HEIGHT + line[i], buf, style,0);
1785 }
1786 else if (global_settings.rec_source == AUDIO_SRC_MIC
1787 HAVE_LINE_REC_(|| global_settings.rec_source ==
1788 AUDIO_SRC_LINEIN)
1789 HAVE_FMRADIO_REC_(|| global_settings.rec_source ==
1790 AUDIO_SRC_FMRADIO)
1791 )
1792 { 1724 {
1793 for(i = 0; i < screen_update; i++) { 1725 peak_meter_draw_trig(pm_x, trig_ypos, trig_width,
1794 if (display_agc[i]) { 1726 screen_update);
1795 screens[i].putsxy(ymargin, 1727 FOR_NB_ACTIVE_SCREENS(i)
1796 SYSFONT_HEIGHT*(filename_offset[i] + 1728 screens[i].update_viewport_rect(pm_x[i], trig_ypos[i],
1797 PM_HEIGHT + line[i]), buf); 1729 trig_width[i] + 2, TRIG_HEIGHT);
1798 }
1799 }
1800 } 1730 }
1801 1731
1732#ifdef HAVE_AGC
1802 if (global_settings.rec_source == AUDIO_SRC_MIC) 1733 if (global_settings.rec_source == AUDIO_SRC_MIC)
1803 { 1734 {
1804 if(agc_maxgain < (global_settings.rec_mic_gain)) 1735 if(agc_maxgain < (global_settings.rec_mic_gain))
@@ -1811,98 +1742,25 @@ bool recording_screen(bool no_source)
1811 if(agc_maxgain < (global_settings.rec_right_gain)) 1742 if(agc_maxgain < (global_settings.rec_right_gain))
1812 change_recording_gain(false, false, true); 1743 change_recording_gain(false, false, true);
1813 } 1744 }
1814#else /* !HAVE_AGC */
1815 }
1816#endif /* HAVE_AGC */ 1745#endif /* HAVE_AGC */
1817 1746
1818 if(!global_settings.cursor_style) { 1747 if(update_list)
1819 switch(cursor) 1748 {
1820 { 1749 /* update_list is set whenever content changes */
1821 case 1: 1750 update_list = false;
1822 for(i = 0; i < screen_update; i++) 1751 gui_synclist_draw(&lists);
1823 screen_put_cursorxy(&screens[i], 0,
1824 filename_offset[i] +
1825 PM_HEIGHT + 3, true);
1826
1827 if(global_settings.rec_source != AUDIO_SRC_MIC)
1828 {
1829 for(i = 0; i < screen_update; i++)
1830 screen_put_cursorxy(&screens[i], 0,
1831 filename_offset[i] +
1832 PM_HEIGHT + 4, true);
1833 }
1834 break;
1835 case 2:
1836 for(i = 0; i < screen_update; i++)
1837 screen_put_cursorxy(&screens[i], 0,
1838 filename_offset[i] +
1839 PM_HEIGHT + 3, true);
1840 break;
1841 case 3:
1842 for(i = 0; i < screen_update; i++)
1843 screen_put_cursorxy(&screens[i], 0,
1844 filename_offset[i] +
1845 PM_HEIGHT + 4, true);
1846 break;
1847#ifdef HAVE_AGC
1848 case 4:
1849 case 5:
1850 for(i = 0; i < screen_update; i++)
1851 screen_put_cursorxy(&screens[i], 0,
1852 filename_offset[i] +
1853 PM_HEIGHT + line[i], true);
1854 break;
1855#endif /* HAVE_AGC */
1856 default:
1857 for(i = 0; i < screen_update; i++)
1858 screen_put_cursorxy(&screens[i], 0,
1859 filename_offset[i] +
1860 PM_HEIGHT + 2, true);
1861 }
1862 } 1752 }
1863 1753
1864#ifdef HAVE_AGC 1754 /* draw peakmeter again (check if this can be removed) */
1865 hist_time++; 1755 FOR_NB_ACTIVE_SCREENS(i)
1866#endif
1867
1868 for(i = 0; i < screen_update; i++)
1869 { 1756 {
1870 screens[i].set_viewport(NULL); 1757 screens[i].set_viewport(NULL);
1871 gui_statusbar_draw(&(statusbars.statusbars[i]), true); 1758 gui_statusbar_draw(&(statusbars.statusbars[i]), true);
1872 screens[i].set_viewport(&vp[i]); 1759 screens[i].set_viewport(&vp_top[i]);
1873 peak_meter_screen(&screens[i], pm_x, pm_y[i], h*PM_HEIGHT); 1760 peak_meter_screen(&screens[i], pm_x[i], pm_y[i], pm_h[i]);
1874 screens[i].update(); 1761 screens[i].update();
1875 } 1762 }
1876 1763 } /* display update every second */
1877 /* draw the trigger status */
1878 FOR_NB_SCREENS(i)
1879 {
1880 /* NOTE: UGLY width setting based on height! To be fixed! */
1881 trig_width[i] = ((vp[i].height < 64) ||
1882 ((vp[i].height < 72) && (PM_HEIGHT > 1))) ?
1883 screens[i].getwidth() - 14 * w :
1884 screens[i].getwidth();
1885 trig_xpos[i] = screens[i].getwidth() - trig_width[i];
1886 trig_ypos[i] = ((vp[i].height < 72) && (PM_HEIGHT > 1)) ?
1887 h*2 :
1888 h*(1 + filename_offset[i] + PM_HEIGHT +
1889 line[i]
1890#ifdef HAVE_AGC
1891 + 1
1892#endif
1893 );
1894 }
1895
1896 if (peak_meter_trigger_status() != TRIG_OFF)
1897 {
1898 peak_meter_draw_trig(trig_xpos, trig_ypos, trig_width,
1899 screen_update);
1900 for(i = 0; i < screen_update; i++){
1901 screens[i].update_rect(trig_xpos[i], trig_ypos[i],
1902 trig_width[i] + 2, TRIG_HEIGHT);
1903 }
1904 }
1905 }
1906 1764
1907 if(audio_stat & AUDIO_STATUS_ERROR) 1765 if(audio_stat & AUDIO_STATUS_ERROR)
1908 { 1766 {
@@ -1913,7 +1771,7 @@ bool recording_screen(bool no_source)
1913 audio_stat = audio_status(); 1771 audio_stat = audio_status();
1914 if (audio_stat & AUDIO_STATUS_ERROR) 1772 if (audio_stat & AUDIO_STATUS_ERROR)
1915 { 1773 {
1916 gui_syncsplash(0, str(LANG_SYSFONT_DISK_FULL)); 1774 gui_syncsplash(0, str(LANG_DISK_FULL));
1917 gui_syncstatusbar_draw(&statusbars, true); 1775 gui_syncstatusbar_draw(&statusbars, true);
1918 1776
1919 FOR_NB_SCREENS(i) 1777 FOR_NB_SCREENS(i)
@@ -1977,6 +1835,11 @@ rec_abort:
1977 ata_set_led_enabled(true); 1835 ata_set_led_enabled(true);
1978#endif 1836#endif
1979 1837
1838#if CONFIG_TUNER
1839 global_settings.statusbar = statusbar;
1840 global_status.statusbar_forced = 0;
1841#endif
1842
1980 settings_save(); 1843 settings_save();
1981 1844
1982 return (rec_status & RCSTAT_BEEN_IN_USB_MODE) != 0; 1845 return (rec_status & RCSTAT_BEEN_IN_USB_MODE) != 0;
@@ -2056,10 +1919,10 @@ static bool f2_rec_screen(void)
2056 { 1919 {
2057 screens[i].getstringsize(str(LANG_SYSFONT_CHANNELS), &w, &h); 1920 screens[i].getstringsize(str(LANG_SYSFONT_CHANNELS), &w, &h);
2058 screens[i].putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h*2, 1921 screens[i].putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h*2,
2059 str(LANG_SYSFONT_CHANNELS)); 1922 str(LANG_SYSFONT_CHANNELS));
2060 screens[i].getstringsize(str(LANG_SYSFONT_MODE), &w, &h); 1923 screens[i].getstringsize(str(LANG_SYSFONT_MODE), &w, &h);
2061 screens[i].putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h, 1924 screens[i].putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h,
2062 str(LANG_SYSFONT_MODE)); 1925 str(LANG_SYSFONT_MODE));
2063 screens[i].getstringsize(ptr, &w, &h); 1926 screens[i].getstringsize(ptr, &w, &h);
2064 screens[i].putsxy(LCD_WIDTH - w, LCD_HEIGHT/2, ptr); 1927 screens[i].putsxy(LCD_WIDTH - w, LCD_HEIGHT/2, ptr);
2065 screens[i].mono_bitmap(bitmap_icons_7x8[Icon_FastForward], 1928 screens[i].mono_bitmap(bitmap_icons_7x8[Icon_FastForward],
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 48ebd9e63d..477d0138b1 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -899,11 +899,11 @@ const struct settings_list settings[] = {
899#endif /* DEFAULT_REC_MIC_GAIN */ 899#endif /* DEFAULT_REC_MIC_GAIN */
900#ifdef DEFAULT_REC_LEFT_GAIN 900#ifdef DEFAULT_REC_LEFT_GAIN
901 {F_T_INT|F_RECSETTING,&global_settings.rec_left_gain, 901 {F_T_INT|F_RECSETTING,&global_settings.rec_left_gain,
902 LANG_RECORDING_LEFT,INT(DEFAULT_REC_LEFT_GAIN), 902 LANG_GAIN_LEFT,INT(DEFAULT_REC_LEFT_GAIN),
903 "rec left gain",NULL,UNUSED}, 903 "rec left gain",NULL,UNUSED},
904#endif /* DEFAULT_REC_LEFT_GAIN */ 904#endif /* DEFAULT_REC_LEFT_GAIN */
905#ifdef DEFAULT_REC_RIGHT_GAIN 905#ifdef DEFAULT_REC_RIGHT_GAIN
906 {F_T_INT|F_RECSETTING,&global_settings.rec_right_gain,LANG_RECORDING_RIGHT, 906 {F_T_INT|F_RECSETTING,&global_settings.rec_right_gain,LANG_GAIN_RIGHT,
907 INT(DEFAULT_REC_RIGHT_GAIN), 907 INT(DEFAULT_REC_RIGHT_GAIN),
908 "rec right gain",NULL,UNUSED}, 908 "rec right gain",NULL,UNUSED},
909#endif /* DEFAULT_REC_RIGHT_GAIN */ 909#endif /* DEFAULT_REC_RIGHT_GAIN */
@@ -1180,16 +1180,16 @@ const struct settings_list settings[] = {
1180#endif 1180#endif
1181 1181
1182#ifdef HAVE_AGC 1182#ifdef HAVE_AGC
1183 {F_T_INT,&global_settings.rec_agc_preset_mic,LANG_RECORD_AGC_PRESET,INT(1), 1183 {F_T_INT,&global_settings.rec_agc_preset_mic,LANG_RECORDING_AGC_PRESET,
1184 "agc mic preset",NULL,UNUSED}, 1184 INT(1),"agc mic preset",NULL,UNUSED},
1185 {F_T_INT,&global_settings.rec_agc_preset_line,LANG_RECORD_AGC_PRESET,INT(1), 1185 {F_T_INT,&global_settings.rec_agc_preset_line,LANG_RECORDING_AGC_PRESET,
1186 "agc line preset",NULL,UNUSED}, 1186 INT(1),"agc line preset",NULL,UNUSED},
1187 {F_T_INT,&global_settings.rec_agc_maxgain_mic,-1,INT(104), 1187 {F_T_INT,&global_settings.rec_agc_maxgain_mic,-1,INT(104),
1188 "agc maximum mic gain",NULL,UNUSED}, 1188 "agc maximum mic gain",NULL,UNUSED},
1189 {F_T_INT,&global_settings.rec_agc_maxgain_line,-1,INT(96), 1189 {F_T_INT,&global_settings.rec_agc_maxgain_line,-1,INT(96),
1190 "agc maximum line gain",NULL,UNUSED}, 1190 "agc maximum line gain",NULL,UNUSED},
1191 {F_T_INT,&global_settings.rec_agc_cliptime,LANG_RECORD_AGC_CLIPTIME,INT(1), 1191 {F_T_INT,&global_settings.rec_agc_cliptime,LANG_RECORDING_AGC_CLIPTIME,
1192 "agc cliptime","0.2s,0.4s,0.6s,0.8,1s",UNUSED}, 1192 INT(1),"agc cliptime","0.2s,0.4s,0.6s,0.8,1s",UNUSED},
1193#endif 1193#endif
1194 1194
1195#ifdef HAVE_REMOTE_LCD 1195#ifdef HAVE_REMOTE_LCD