summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Scarratt <mmmm@rockbox.org>2006-09-02 17:30:30 +0000
committerMartin Scarratt <mmmm@rockbox.org>2006-09-02 17:30:30 +0000
commit617b67e769661d4841b4fd1ace358b932f9c0378 (patch)
tree22a1b0dddc51ac890b2804ce100df30d10f271ea
parentee88a3bb2c137078c4e1d3285e1d7c5b5ff61572 (diff)
downloadrockbox-617b67e769661d4841b4fd1ace358b932f9c0378.tar.gz
rockbox-617b67e769661d4841b4fd1ace358b932f9c0378.zip
Display bitrate (Q value for Archos), samplerate, channels and recording format (M = MP3) in the statusbar in the recording screen. This is all new info for archos targets and I-river targets now have this info on the remote as well as the main screen
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10856 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/statusbar.c189
-rw-r--r--apps/gui/statusbar.h4
-rw-r--r--apps/recorder/icons.c27
-rw-r--r--apps/recorder/icons.h15
-rw-r--r--apps/recorder/recording.c46
-rw-r--r--apps/settings.c6
-rw-r--r--apps/settings.h1
-rw-r--r--firmware/pcm_record.c2
8 files changed, 225 insertions, 65 deletions
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c
index cbd1709bbc..72e681faaf 100644
--- a/apps/gui/statusbar.c
+++ b/apps/gui/statusbar.c
@@ -36,7 +36,9 @@
36#include "status.h" /* needed for battery_state global var */ 36#include "status.h" /* needed for battery_state global var */
37#include "action.h" /* for keys_locked */ 37#include "action.h" /* for keys_locked */
38#include "statusbar.h" 38#include "statusbar.h"
39 39#ifdef HAVE_RECORDING
40#include "audio.h"
41#endif
40 42
41/* FIXME: should be removed from icon.h to avoid redefinition, 43/* FIXME: should be removed from icon.h to avoid redefinition,
42 but still needed for compatibility with old system */ 44 but still needed for compatibility with old system */
@@ -52,6 +54,11 @@
52 STATUSBAR_PLUG_WIDTH + \ 54 STATUSBAR_PLUG_WIDTH + \
53 2*ICONS_SPACING 55 2*ICONS_SPACING
54#define STATUSBAR_VOLUME_WIDTH 16 56#define STATUSBAR_VOLUME_WIDTH 16
57#define STATUSBAR_ENCODER_X_POS STATUSBAR_X_POS + \
58 STATUSBAR_BATTERY_WIDTH + \
59 STATUSBAR_PLUG_WIDTH + \
60 2*ICONS_SPACING - 1
61#define STATUSBAR_ENCODER_WIDTH 18
55#define STATUSBAR_PLAY_STATE_X_POS STATUSBAR_X_POS + \ 62#define STATUSBAR_PLAY_STATE_X_POS STATUSBAR_X_POS + \
56 STATUSBAR_BATTERY_WIDTH + \ 63 STATUSBAR_BATTERY_WIDTH + \
57 STATUSBAR_PLUG_WIDTH + \ 64 STATUSBAR_PLUG_WIDTH + \
@@ -65,6 +72,21 @@
65 STATUSBAR_PLAY_STATE_WIDTH + \ 72 STATUSBAR_PLAY_STATE_WIDTH + \
66 4*ICONS_SPACING 73 4*ICONS_SPACING
67#define STATUSBAR_PLAY_MODE_WIDTH 7 74#define STATUSBAR_PLAY_MODE_WIDTH 7
75#define STATUSBAR_RECFREQ_X_POS STATUSBAR_X_POS + \
76 STATUSBAR_BATTERY_WIDTH + \
77 STATUSBAR_PLUG_WIDTH + \
78 STATUSBAR_VOLUME_WIDTH + \
79 STATUSBAR_PLAY_STATE_WIDTH + \
80 3*ICONS_SPACING
81#define STATUSBAR_RECFREQ_WIDTH 12
82#define STATUSBAR_RECCHANNELS_X_POS STATUSBAR_X_POS + \
83 STATUSBAR_BATTERY_WIDTH + \
84 STATUSBAR_PLUG_WIDTH + \
85 STATUSBAR_VOLUME_WIDTH + \
86 STATUSBAR_PLAY_STATE_WIDTH + \
87 STATUSBAR_RECFREQ_WIDTH + \
88 4*ICONS_SPACING
89#define STATUSBAR_RECCHANNELS_WIDTH 5
68#define STATUSBAR_SHUFFLE_X_POS STATUSBAR_X_POS + \ 90#define STATUSBAR_SHUFFLE_X_POS STATUSBAR_X_POS + \
69 STATUSBAR_BATTERY_WIDTH + \ 91 STATUSBAR_BATTERY_WIDTH + \
70 STATUSBAR_PLUG_WIDTH + \ 92 STATUSBAR_PLUG_WIDTH + \
@@ -102,6 +124,18 @@
102#endif 124#endif
103#define STATUSBAR_TIME_X_END(statusbar_width) statusbar_width - 1 - \ 125#define STATUSBAR_TIME_X_END(statusbar_width) statusbar_width - 1 - \
104 STATUSBAR_DISK_WIDTH 126 STATUSBAR_DISK_WIDTH
127#if defined(HAVE_RECORDING)
128/* analogue frequency numbers taken from the order of frequencies in sample_rate */
129#define FREQ_44 7
130#define FREQ_48 8
131#define FREQ_32 6
132#define FREQ_22 4
133#define FREQ_24 5
134#define FREQ_16 3
135#ifdef HAVE_SPDIF_IN
136#define SOURCE_SPDIF 2
137#endif
138#endif
105 139
106struct gui_syncstatusbar statusbars; 140struct gui_syncstatusbar statusbars;
107 141
@@ -234,28 +268,40 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
234 STATUSBAR_Y_POS, STATUSBAR_PLUG_WIDTH, 268 STATUSBAR_Y_POS, STATUSBAR_PLUG_WIDTH,
235 STATUSBAR_HEIGHT); 269 STATUSBAR_HEIGHT);
236#endif 270#endif
237 271#ifdef HAVE_RECORDING
238 bar->redraw_volume = gui_statusbar_icon_volume(bar, bar->info.volume); 272 /* turn off volume display in recording screen */
273 if (!global_settings.recscreen_on)
274#endif
275 bar->redraw_volume = gui_statusbar_icon_volume(bar, bar->info.volume);
239 gui_statusbar_icon_play_state(display, current_playmode() + Icon_Play); 276 gui_statusbar_icon_play_state(display, current_playmode() + Icon_Play);
240 277
241 switch (bar->info.repeat) { 278#ifdef HAVE_RECORDING
279 /* If in recording screen, replace repeat mode, volume
280 and shuffle icons with recording info */
281 if (global_settings.recscreen_on)
282 gui_statusbar_icon_recording_info(display);
283 else
284#endif
285 {
286 switch (bar->info.repeat) {
242#if (AB_REPEAT_ENABLE == 1) 287#if (AB_REPEAT_ENABLE == 1)
243 case REPEAT_AB: 288 case REPEAT_AB:
244 gui_statusbar_icon_play_mode(display, Icon_RepeatAB); 289 gui_statusbar_icon_play_mode(display, Icon_RepeatAB);
245 break; 290 break;
246#endif /* AB_REPEAT_ENABLE == 1 */ 291#endif /* AB_REPEAT_ENABLE == 1 */
247 292
248 case REPEAT_ONE: 293 case REPEAT_ONE:
249 gui_statusbar_icon_play_mode(display, Icon_RepeatOne); 294 gui_statusbar_icon_play_mode(display, Icon_RepeatOne);
250 break; 295 break;
251 296
252 case REPEAT_ALL: 297 case REPEAT_ALL:
253 case REPEAT_SHUFFLE: 298 case REPEAT_SHUFFLE:
254 gui_statusbar_icon_play_mode(display, Icon_Repeat); 299 gui_statusbar_icon_play_mode(display, Icon_Repeat);
255 break; 300 break;
301 }
302 if (bar->info.shuffle)
303 gui_statusbar_icon_shuffle(display);
256 } 304 }
257 if (bar->info.shuffle)
258 gui_statusbar_icon_shuffle(display);
259 if (bar->info.keylock) 305 if (bar->info.keylock)
260 gui_statusbar_icon_lock(display); 306 gui_statusbar_icon_lock(display);
261#ifdef HAS_REMOTE_BUTTON_HOLD 307#ifdef HAS_REMOTE_BUTTON_HOLD
@@ -553,6 +599,115 @@ void gui_statusbar_time(struct screen * display, int hour, int minute)
553} 599}
554#endif 600#endif
555 601
602#ifdef HAVE_RECORDING
603void gui_statusbar_icon_recording_info(struct screen * display)
604{
605 int width, height;
606 char buffer[4];
607 char* const sample_rate[12] =
608 {
609 "8",
610 "11",
611 "12",
612 "16",
613 "22",
614 "24",
615 "32",
616 "44",
617 "48",
618 "64",
619 "88",
620 "96"
621 };
622#if CONFIG_CODEC != SWCODEC
623 char* const bit_rate[9] =
624 {
625 "MQ0",
626 "MQ1",
627 "MQ2",
628 "MQ3",
629 "MQ4",
630 "MQ5",
631 "MQ6",
632 "MQ7",
633 "WAV"
634 };
635#endif
636
637 display->setfont(FONT_SYSFIXED);
638
639 /* Display Codec info in statusbar */
640#if CONFIG_CODEC == SWCODEC
641 /* Can't fit info for sw codec targets in statusbar using FONT_SYSFIXED
642 so must use icons */
643 display->mono_bitmap(bitmap_icons_18x8[global_settings.rec_quality],
644 STATUSBAR_ENCODER_X_POS, STATUSBAR_Y_POS,
645 STATUSBAR_ENCODER_WIDTH, STATUSBAR_HEIGHT);
646#else
647 snprintf(buffer, sizeof(buffer), "%s", bit_rate[global_settings.rec_quality]);
648 display->getstringsize(buffer, &width, &height);
649 if (height <= STATUSBAR_HEIGHT)
650 {
651 display->putsxy(STATUSBAR_ENCODER_X_POS, STATUSBAR_Y_POS, buffer);
652 }
653#endif
654
655 /* Display Samplerate info in statusbar */
656#if defined(HAVE_SPDIF_IN)
657 if (global_settings.rec_source == SOURCE_SPDIF)
658 {
659#if (CONFIG_CODEC != MAS3587F) && !defined(SIMULATOR)
660 snprintf(buffer, sizeof(buffer), "%s", sample_rate[audio_get_spdif_sample_rate()]);
661#else
662 /* Can't measure S/PDIF sample rate on Archos/Sim yet so just display input type */
663 snprintf(buffer, sizeof(buffer), "Dg");
664#endif
665 }
666 else
667#endif /* HAVE_SPDIF_IN */
668 {
669 /* Analogue frequency in wrong order so remap settings numbers */
670 int freq = global_settings.rec_frequency;
671 if (freq == 0)
672 freq = FREQ_44;
673 else if (freq == 1)
674 freq = FREQ_48;
675 else if (freq == 2)
676 freq = FREQ_32;
677 else if (freq == 3)
678 freq = FREQ_22;
679 else if (freq == 4)
680 freq = FREQ_24;
681 else if (freq == 5)
682 freq = FREQ_16;
683
684 snprintf(buffer, sizeof(buffer), "%s", sample_rate[freq]);
685 }
686
687 display->getstringsize(buffer, &width, &height);
688 if (height <= STATUSBAR_HEIGHT)
689 {
690 display->putsxy(STATUSBAR_RECFREQ_X_POS, STATUSBAR_Y_POS, buffer);
691 }
692
693 display->setfont(FONT_UI);
694
695 /* Display Channel status in status bar */
696 if(global_settings.rec_channels)
697 {
698 display->mono_bitmap(bitmap_icons_5x8[Icon_Mono],
699 STATUSBAR_RECCHANNELS_X_POS , STATUSBAR_Y_POS,
700 STATUSBAR_RECCHANNELS_WIDTH, STATUSBAR_HEIGHT);
701 }
702 else
703 {
704 display->mono_bitmap(bitmap_icons_5x8[Icon_Stereo],
705 STATUSBAR_RECCHANNELS_X_POS, STATUSBAR_Y_POS,
706 STATUSBAR_RECCHANNELS_WIDTH, STATUSBAR_HEIGHT);
707 }
708}
709#endif /* HAVE_RECORDING */
710
556#endif /* HAVE_LCD_BITMAP */ 711#endif /* HAVE_LCD_BITMAP */
557 712
558void gui_syncstatusbar_init(struct gui_syncstatusbar * bars) 713void gui_syncstatusbar_init(struct gui_syncstatusbar * bars)
diff --git a/apps/gui/statusbar.h b/apps/gui/statusbar.h
index a03c294523..5ab97d09ea 100644
--- a/apps/gui/statusbar.h
+++ b/apps/gui/statusbar.h
@@ -105,7 +105,9 @@ void gui_statusbar_icon_shuffle(struct screen * display);
105void gui_statusbar_icon_lock(struct screen * display); 105void gui_statusbar_icon_lock(struct screen * display);
106void gui_statusbar_icon_lock_remote(struct screen * display); 106void gui_statusbar_icon_lock_remote(struct screen * display);
107void gui_statusbar_led(struct screen * display); 107void gui_statusbar_led(struct screen * display);
108 108#ifdef HAVE_RECORDING
109void gui_statusbar_icon_recording_info(struct screen * display);
110#endif
109 111
110#ifdef CONFIG_RTC 112#ifdef CONFIG_RTC
111void gui_statusbar_time(struct screen * display, int hour, int minute); 113void gui_statusbar_time(struct screen * display, int hour, int minute);
diff --git a/apps/recorder/icons.c b/apps/recorder/icons.c
index 9fab6cf71d..fc271e890f 100644
--- a/apps/recorder/icons.c
+++ b/apps/recorder/icons.c
@@ -31,7 +31,9 @@
31const unsigned char bitmap_icons_5x8[][5] = 31const unsigned char bitmap_icons_5x8[][5] =
32{ 32{
33 [Icon_Lock_Main] ={0x78,0x7f,0x49,0x7f,0x78}, /* Lock Main */ 33 [Icon_Lock_Main] ={0x78,0x7f,0x49,0x7f,0x78}, /* Lock Main */
34 [Icon_Lock_Remote]={0x78,0x7f,0x49,0x7f,0x78} /* Lock Remote */ 34 [Icon_Lock_Remote]={0x78,0x7f,0x49,0x7f,0x78}, /* Lock Remote */
35 [Icon_Stereo]={0x1c, 0x22, 0x1c, 0x22, 0x1c}, /* Stereo recording */
36 [Icon_Mono]={0x00, 0x1c, 0x22, 0x1c, 0x00} /* Mono recording */
35}; 37};
36 38
37const unsigned char bitmap_icons_6x8[][6] = 39const unsigned char bitmap_icons_6x8[][6] =
@@ -75,6 +77,29 @@ const unsigned char bitmap_icons_7x8[][7] =
75 {0x7f,0x04,0x4e,0x5f,0x44,0x38,0x7f} /* Repeat-AB playmode */ 77 {0x7f,0x04,0x4e,0x5f,0x44,0x38,0x7f} /* Repeat-AB playmode */
76}; 78};
77 79
80const unsigned char bitmap_icons_18x8[][18] =
81{
82 {0x00, 0x00, 0x00, 0x00, 0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x1c, 0x2a,
83 0x12, 0x00, 0x1e, 0x30, 0x10}, /* mp3 64kbps */
84 {0x00, 0x00, 0x00, 0x00, 0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x04, 0x0a,
85 0x3e, 0x00, 0x1c, 0x2a, 0x12}, /* mp3 96kbps */
86 {0x00, 0x00, 0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x3e, 0x00, 0x32, 0x2a,
87 0x24, 0x00, 0x14, 0x2a, 0x14}, /* mp3 128kbps */
88 {0x00, 0x00, 0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x3e, 0x00, 0x1c, 0x2a,
89 0x12, 0x00, 0x1c, 0x22, 0x1c}, /* mp3 160kbps */
90 {0x00, 0x00, 0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x3e, 0x00, 0x04, 0x0a,
91 0x3e, 0x00, 0x32, 0x2a, 0x24}, /* mp3 192kbps */
92 {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x32, 0x2a, 0x24, 0x00, 0x32, 0x2a,
93 0x24, 0x00, 0x1e, 0x30, 0x10}, /* mp3 224kbps */
94 {0x3e, 0x04, 0x08, 0x04, 0x3e, 0x00, 0x00, 0x22, 0x2a, 0x14, 0x00, 0x32, 0x2a,
95 0x24, 0x00, 0x1c, 0x22, 0x1c}, /* mp3 320kbps */
96 {0x00, 0x00, 0x00, 0x00, 0x1e, 0x20, 0x18, 0x20, 0x1e, 0x00, 0x1e, 0x20, 0x18,
97 0x06, 0x00, 0x00, 0x00, 0x00}, /* wv */
98 {0x00, 0x1e, 0x20, 0x18, 0x20, 0x1e, 0x00, 0x3c, 0x12, 0x12, 0x3c, 0x00, 0x1e,
99 0x20, 0x18, 0x06, 0x00, 0x00} /* wav */
100};
101
102
78/* Disk/MMC activity */ 103/* Disk/MMC activity */
79const unsigned char bitmap_icon_disk[12] = 104const unsigned char bitmap_icon_disk[12] =
80#ifdef HAVE_MMC 105#ifdef HAVE_MMC
diff --git a/apps/recorder/icons.h b/apps/recorder/icons.h
index d29b549245..5e7f157c75 100644
--- a/apps/recorder/icons.h
+++ b/apps/recorder/icons.h
@@ -39,6 +39,8 @@
39enum icons_5x8 { 39enum icons_5x8 {
40 Icon_Lock_Main, 40 Icon_Lock_Main,
41 Icon_Lock_Remote, 41 Icon_Lock_Remote,
42 Icon_Stereo,
43 Icon_Mono,
42 Icon5x8Last 44 Icon5x8Last
43}; 45};
44 46
@@ -83,9 +85,22 @@ enum icons_7x8 {
83 Icon7x8Last 85 Icon7x8Last
84}; 86};
85 87
88enum icons_18x8 {
89 Icon_mp364,
90 Icon_mp396,
91 Icon_mp3128,
92 Icon_mp3160,
93 Icon_mp3192,
94 Icon_mp3224,
95 Icon_mp3320,
96 Icon_wv,
97 Icon_wav,
98 Icon18x8Last
99};
86extern const unsigned char bitmap_icons_5x8[Icon5x8Last][5]; 100extern const unsigned char bitmap_icons_5x8[Icon5x8Last][5];
87extern const unsigned char bitmap_icons_6x8[Icon6x8Last][6]; 101extern const unsigned char bitmap_icons_6x8[Icon6x8Last][6];
88extern const unsigned char bitmap_icons_7x8[Icon7x8Last][7]; 102extern const unsigned char bitmap_icons_7x8[Icon7x8Last][7];
103extern const unsigned char bitmap_icons_18x8[Icon18x8Last][18];
89extern const unsigned char bitmap_icon_disk[]; 104extern const unsigned char bitmap_icon_disk[];
90 105
91#define STATUSBAR_X_POS 0 106#define STATUSBAR_X_POS 0
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index b39a96e60f..e964db1e23 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -810,6 +810,7 @@ bool recording_screen(bool no_source)
810 ID2P(LANG_GIGABYTE) 810 ID2P(LANG_GIGABYTE)
811 }; 811 };
812 812
813 global_settings.recscreen_on = true;
813 cursor = 0; 814 cursor = 0;
814#if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR) 815#if (CONFIG_LED == LED_REAL) && !defined(SIMULATOR)
815 ata_set_led_enabled(false); 816 ata_set_led_enabled(false);
@@ -1353,7 +1354,6 @@ bool recording_screen(bool no_source)
1353 unsigned int dseconds, dhours, dminutes; 1354 unsigned int dseconds, dhours, dminutes;
1354 unsigned long num_recorded_bytes, dsize, dmb; 1355 unsigned long num_recorded_bytes, dsize, dmb;
1355 int pos = 0; 1356 int pos = 0;
1356 char spdif_sfreq[8];
1357 1357
1358 update_countdown = 5; 1358 update_countdown = 5;
1359 last_seconds = seconds; 1359 last_seconds = seconds;
@@ -1687,53 +1687,11 @@ bool recording_screen(bool no_source)
1687 PM_HEIGHT + 2, true); 1687 PM_HEIGHT + 2, true);
1688 } 1688 }
1689 } 1689 }
1690/* Can't measure S/PDIF sample rate on Archos yet */
1691#if (CONFIG_CODEC != MAS3587F) && defined(HAVE_SPDIF_IN) && !defined(SIMULATOR)
1692 if (global_settings.rec_source == AUDIO_SRC_SPDIF)
1693 snprintf(spdif_sfreq, 8, "%dHz", audio_get_spdif_sample_rate());
1694#else
1695 (void)spdif_sfreq;
1696#endif
1697 snprintf(buf, 32, "%s %s",
1698#if (CONFIG_CODEC != MAS3587F) && defined(HAVE_SPDIF_IN) && !defined(SIMULATOR)
1699 global_settings.rec_source == AUDIO_SRC_SPDIF ?
1700 spdif_sfreq :
1701#endif
1702 freq_str[global_settings.rec_frequency],
1703 global_settings.rec_channels ?
1704 str(LANG_SYSFONT_CHANNEL_MONO) :
1705 str(LANG_SYSFONT_CHANNEL_STEREO));
1706
1707 for(i = 0; i < screen_update; i++) {
1708#ifdef HAVE_AGC
1709 if ((global_settings.rec_source == AUDIO_SRC_MIC)
1710 || (global_settings.rec_source == AUDIO_SRC_LINEIN)
1711 || (global_settings.rec_source == AUDIO_SRC_FMRADIO))
1712 screens[i].puts(0, filename_offset[i] + PM_HEIGHT + line[i] + 1, buf);
1713 else
1714#endif
1715 screens[i].puts(0, filename_offset[i] + PM_HEIGHT + line[i], buf);
1716 }
1717 1690
1718#ifdef HAVE_AGC 1691#ifdef HAVE_AGC
1719 hist_time++; 1692 hist_time++;
1720#endif 1693#endif
1721 1694
1722#if CONFIG_CODEC == SWCODEC
1723 snprintf(buf, 32, "%s",
1724 REC_QUALITY_LABEL(global_settings.rec_quality));
1725 for(i = 0; i < screen_update; i++){
1726#ifdef HAVE_AGC
1727 if ((global_settings.rec_source == AUDIO_SRC_MIC)
1728 || (global_settings.rec_source == AUDIO_SRC_LINEIN)
1729 || (global_settings.rec_source == AUDIO_SRC_FMRADIO))
1730 screens[i].puts(0, filename_offset[i] + PM_HEIGHT + line[i] + 2, buf);
1731 else
1732#endif
1733 screens[i].puts(0, filename_offset[i] + PM_HEIGHT + line[i] + 1, buf);
1734 }
1735#endif
1736
1737 for(i = 0; i < screen_update; i++) 1695 for(i = 0; i < screen_update; i++)
1738 { 1696 {
1739 gui_statusbar_draw(&(statusbars.statusbars[i]), true); 1697 gui_statusbar_draw(&(statusbars.statusbars[i]), true);
@@ -1758,7 +1716,6 @@ bool recording_screen(bool no_source)
1758 } 1716 }
1759 } /* end while(!done) */ 1717 } /* end while(!done) */
1760 1718
1761
1762#if CONFIG_CODEC == SWCODEC 1719#if CONFIG_CODEC == SWCODEC
1763 audio_stat = pcm_rec_status(); 1720 audio_stat = pcm_rec_status();
1764#else 1721#else
@@ -1806,6 +1763,7 @@ bool recording_screen(bool no_source)
1806 peak_meter_trigger(false); 1763 peak_meter_trigger(false);
1807 peak_meter_set_trigger_listener(NULL); 1764 peak_meter_set_trigger_listener(NULL);
1808 1765
1766 global_settings.recscreen_on = false;
1809 sound_settings_apply(); 1767 sound_settings_apply();
1810 1768
1811 FOR_NB_SCREENS(i) 1769 FOR_NB_SCREENS(i)
diff --git a/apps/settings.c b/apps/settings.c
index aa79946c85..d298ec8d60 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -92,7 +92,7 @@ const char rec_base_directory[] = REC_BASE_DIR;
92#include "dsp.h" 92#include "dsp.h"
93#endif 93#endif
94 94
95#define CONFIG_BLOCK_VERSION 51 95#define CONFIG_BLOCK_VERSION 52
96#define CONFIG_BLOCK_SIZE 512 96#define CONFIG_BLOCK_SIZE 512
97#define RTC_BLOCK_SIZE 44 97#define RTC_BLOCK_SIZE 44
98 98
@@ -464,6 +464,7 @@ static const struct bit_entry hd_bits[] =
464 464
465#ifdef HAVE_RECORDING 465#ifdef HAVE_RECORDING
466 /* recording */ 466 /* recording */
467 {1, S_O(recscreen_on), false, "recscreen on", off_on },
467 {1, S_O(rec_startup), false, "rec screen on startup", off_on }, 468 {1, S_O(rec_startup), false, "rec screen on startup", off_on },
468 {4, S_O(rec_timesplit), 0, "rec timesplit", /* 0...15 */ 469 {4, S_O(rec_timesplit), 0, "rec timesplit", /* 0...15 */
469 "off,00:05,00:10,00:15,00:30,01:00,01:14,01:20,02:00,04:00,06:00,08:00,10:00,12:00,18:00,24:00" }, 470 "off,00:05,00:10,00:15,00:30,01:00,01:14,01:20,02:00,04:00,06:00,08:00,10:00,12:00,18:00,24:00" },
@@ -1336,6 +1337,9 @@ void settings_load(int which)
1336 RTC_BLOCK_SIZE*8); 1337 RTC_BLOCK_SIZE*8);
1337 } 1338 }
1338 1339
1340#ifdef HAVE_RECORDING
1341 global_settings.recscreen_on = false;
1342#endif
1339#ifdef HAVE_LCD_CONTRAST 1343#ifdef HAVE_LCD_CONTRAST
1340 if ( global_settings.contrast < MIN_CONTRAST_SETTING ) 1344 if ( global_settings.contrast < MIN_CONTRAST_SETTING )
1341 global_settings.contrast = lcd_default_contrast(); 1345 global_settings.contrast = lcd_default_contrast();
diff --git a/apps/settings.h b/apps/settings.h
index af0eef57b1..e4787f53a6 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -151,6 +151,7 @@ struct user_settings
151 int rec_left_gain; /* 0-15 */ 151 int rec_left_gain; /* 0-15 */
152 int rec_right_gain; /* 0-15 */ 152 int rec_right_gain; /* 0-15 */
153 bool rec_editable; /* true means that the bit reservoir is off */ 153 bool rec_editable; /* true means that the bit reservoir is off */
154 bool recscreen_on; /* true if using the recording screen */
154 155
155 /* note: timesplit setting is not saved */ 156 /* note: timesplit setting is not saved */
156 int rec_timesplit; /* 0 = off, 157 int rec_timesplit; /* 0 = off,
diff --git a/firmware/pcm_record.c b/firmware/pcm_record.c
index 4e4d5f25a0..68fc22b937 100644
--- a/firmware/pcm_record.c
+++ b/firmware/pcm_record.c
@@ -289,7 +289,7 @@ unsigned long audio_get_spdif_sample_rate(void)
289 289
290 if (diff2 > diff1) --i; 290 if (diff2 > diff1) --i;
291 } 291 }
292 return spdif_sample_rates[i]; 292 return i;
293} 293}
294#endif 294#endif
295 295