summaryrefslogtreecommitdiff
path: root/apps/recorder/recording.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2006-12-10 14:21:31 +0000
committerMichael Sevakis <jethead71@rockbox.org>2006-12-10 14:21:31 +0000
commiteca9f7fd6023a2b7acde89692812d1ecbd8964e6 (patch)
treef434bcc02db8245b27de67fda4977f19a723815f /apps/recorder/recording.c
parent0a8d88228baf68c3bc515ca4a1add44aac7e5617 (diff)
Place all recording functionality on pcmrec thread to serialize all recording operations. Button mash problems should be ruled out of pcm_record.c. Add additional lightweight checks by default and display any warnings that occurred during recording in first line of recording screen when they occur by blinking back and forth from warning display to normal line (Warning: <hex bitmask>). Warnings are cleared when beginning a new recording so write the number down if you see it and file a report. Add heavier checks when PCMREC_PARANOID is defined in the player config header (encoders and pcm_record must be aware of the define since it changes the chunk header format). These checks are mainly concerned with things that may cause skipping but also add unwanted overhead for normal operation. Best used with logf enabled.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11705 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/recorder/recording.c')
-rw-r--r--apps/recorder/recording.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index 61103a8209..12090ee412 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -751,6 +751,10 @@ bool recording_screen(bool no_source)
bool been_in_usb_mode = false;
int last_audio_stat = -1;
int audio_stat;
+#if CONFIG_CODEC == SWCODEC
+ int warning_counter = 0;
+ #define WARNING_PERIOD 7
+#endif
#ifdef HAVE_FMRADIO_IN
/* Radio is left on if:
* 1) Is was on at the start and the initial source is FM Radio
@@ -1292,7 +1296,7 @@ bool recording_screen(bool no_source)
default:
default_event_handler(button);
break;
- }
+ } /* end switch */
#ifdef HAVE_AGC
peak_read = !peak_read;
@@ -1328,6 +1332,20 @@ bool recording_screen(bool no_source)
for(i = 0; i < screen_update; i++)
screens[i].clear_display();
+#if CONFIG_CODEC == SWCODEC
+ if ((audio_stat & AUDIO_STATUS_WARNING)
+ && (warning_counter++ % WARNING_PERIOD) < WARNING_PERIOD/2)
+ {
+ /* Switch back and forth displaying warning on first available
+ line to ensure visibility - the motion should also help
+ draw attention */
+ /* Don't use language string unless agreed upon to make this
+ method permanent - could do something in the statusbar */
+ snprintf(buf, sizeof(buf), "Warning: %08X",
+ pcm_rec_get_warnings());
+ }
+ else
+#endif /* CONFIG_CODEC == SWCODEC */
if ((global_settings.rec_sizesplit) && (global_settings.rec_split_method))
{
dmb = dsize/1024/1024;
@@ -1381,18 +1399,17 @@ bool recording_screen(bool no_source)
{
if (filename_offset[i] > 0)
{
+ *filename = '\0';
if (audio_stat & AUDIO_STATUS_RECORD)
{
strncpy(filename, path_buffer +
strlen(path_buffer) - 12, 13);
filename[12]='\0';
}
- else
- strcpy(filename, "");
snprintf(buf, sizeof(buf), "%s %s",
str(LANG_SYSFONT_RECORDING_FILENAME), filename);
- screens[i].puts(0, 2, buf);
+ screens[i].puts(0, 2, buf);
}
}