summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorPeter D'Hoye <peter.dhoye@gmail.com>2008-10-08 22:18:16 +0000
committerPeter D'Hoye <peter.dhoye@gmail.com>2008-10-08 22:18:16 +0000
commit528fe442fc6e6e077172b2e8a3b586a3ce96d16b (patch)
tree4985fe6f102727419862cf58bcb5aa8a7d736f11 /firmware
parentcb1173cedd4eb1c8648420a3926a591995390537 (diff)
downloadrockbox-528fe442fc6e6e077172b2e8a3b586a3ce96d16b.zip
rockbox-528fe442fc6e6e077172b2e8a3b586a3ce96d16b.tar.gz
rockbox-528fe442fc6e6e077172b2e8a3b586a3ce96d16b.tar.bz2
rockbox-528fe442fc6e6e077172b2e8a3b586a3ce96d16b.tar.xz
New recording setting to configure how mono recordings are made. Previously, this was always L+R, which was kinda silly if your signal was on L only. This setting allows for L, R or L+R. SWCODEC only for now, to be added for HWCODEC (although that will only be L and L+R probably)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18745 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/audio.h1
-rw-r--r--firmware/export/enc_base.h1
-rw-r--r--firmware/pcm_record.c9
3 files changed, 8 insertions, 3 deletions
diff --git a/firmware/export/audio.h b/firmware/export/audio.h
index aedaffb..9530082 100644
--- a/firmware/export/audio.h
+++ b/firmware/export/audio.h
@@ -176,6 +176,7 @@ struct audio_recording_options
int rec_channels;
int rec_prerecord_time;
#if CONFIG_CODEC == SWCODEC
+ int rec_mono_mode;
int rec_source_flags; /* for rec_set_source */
struct encoder_config enc_config;
#else
diff --git a/firmware/export/enc_base.h b/firmware/export/enc_base.h
index e73e876..321421c 100644
--- a/firmware/export/enc_base.h
+++ b/firmware/export/enc_base.h
@@ -246,6 +246,7 @@ struct enc_inputs
{
unsigned long sample_rate; /* out - pcm frequency */
int num_channels; /* out - number of audio channels */
+ int rec_mono_mode; /* out - how to create mono */
struct encoder_config *config; /* out - encoder settings */
};
diff --git a/firmware/pcm_record.c b/firmware/pcm_record.c
index 045ace9..0e0102a 100644
--- a/firmware/pcm_record.c
+++ b/firmware/pcm_record.c
@@ -90,6 +90,7 @@ static int rec_source; /* current rec_source setting */
static int rec_frequency; /* current frequency setting */
static unsigned long sample_rate; /* Sample rate in HZ */
static int num_channels; /* Current number of channels */
+static int rec_mono_mode; /* how mono is created */
static struct encoder_config enc_config; /* Current encoder configuration */
static unsigned long pre_record_ticks; /* pre-record time in ticks */
@@ -1178,6 +1179,7 @@ static void pcmrec_set_recording_options(
rec_frequency = options->rec_frequency;
rec_source = options->rec_source;
num_channels = options->rec_channels == 1 ? 1 : 2;
+ rec_mono_mode = options->rec_mono_mode;
pre_record_ticks = options->rec_prerecord_time * HZ;
enc_config = options->enc_config;
enc_config.afmt = rec_format_afmt[enc_config.rec_format];
@@ -1526,17 +1528,18 @@ void enc_get_inputs(struct enc_inputs *inputs)
{
inputs->sample_rate = sample_rate;
inputs->num_channels = num_channels;
+ inputs->rec_mono_mode = rec_mono_mode;
inputs->config = &enc_config;
} /* enc_get_inputs */
-
+
/* set the encoder dimensions (called by encoder codec at initialization and
termination) */
void enc_set_parameters(struct enc_parameters *params)
{
size_t bufsize, resbytes;
-
+
logf("enc_set_parameters");
-
+
if (!params)
{
logf("reset");