Moved pcm_record from firmware to apps. Cleaned up some. Now all code using struct mp3entry is in apps.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18807 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Björn Stenberg 2008-10-14 11:12:20 +00:00
parent 91b9c6139b
commit 9558c4956d
15 changed files with 42 additions and 27 deletions

View file

@ -116,6 +116,9 @@ codecs.c
dsp.c
#ifdef HAVE_RECORDING
enc_config.c
#ifndef SIMULATOR
recorder/pcm_record.c
#endif /* SIMULATOR */
#endif
eq.c
#if defined(CPU_COLDFIRE)

View file

@ -2432,6 +2432,15 @@ void audio_set_recording_options(struct audio_recording_options *options)
DEBUGF("mas_writemem(MAS_BANK_D0, ENCODER_CONTROL, %x)\n", shadow_encoder_control);
#if CONFIG_TUNER & S1A0903X01
/* Store the (unpitched) MAS PLL frequency. Used for avoiding FM
interference with the Samsung tuner. */
if (rec_frequency_index)
mas_store_pllfreq(24576000);
else
mas_store_pllfreq(22579000);
#endif
shadow_soft_mute = options->rec_editable?4:0;
mas_writemem(MAS_BANK_D0, MAS_D0_SOFT_MUTE, &shadow_soft_mute,1);
@ -2484,22 +2493,6 @@ void audio_set_recording_gain(int left, int right, int type)
mas_codec_writereg(0x0, shadow_codec_reg0);
}
#if CONFIG_TUNER & S1A0903X01
/* Get the (unpitched) MAS PLL frequency, for avoiding FM interference with the
* Samsung tuner. Zero means unknown. Currently handles recording from analog
* input only. */
int mpeg_get_mas_pllfreq(void)
{
if (mpeg_mode != MPEG_ENCODER)
return 0;
if (rec_frequency_index == 0) /* 44.1 kHz / 22.05 kHz */
return 22579000;
else
return 24576000;
}
#endif /* CONFIG_TUNER & S1A0903X01 */
/* try to make some kind of beep, also in recording mode */
void audio_beep(int duration)
{

View file

@ -18,6 +18,7 @@
* KIND, either express or implied.
*
****************************************************************************/
#include "pcm_record.h"
#include "system.h"
#include "kernel.h"
#include "logf.h"

View file

@ -40,6 +40,7 @@
#include "spdif.h"
#endif
#endif /* CONFIG_CODEC == SWCODEC */
#include "pcm_record.h"
#include "recording.h"
#include "mp3_playback.h"
#include "mas.h"

View file

@ -191,9 +191,6 @@ pcm_sampr.c
pcm.c
#ifdef HAVE_RECORDING
enc_base.c
#ifndef SIMULATOR
pcm_record.c
#endif /* SIMULATOR */
#endif /* HAVE_RECORDING */
#endif /* BOOTLOADER */

View file

@ -466,3 +466,20 @@ unsigned long mas_readver(void)
}
#endif
#if CONFIG_TUNER & S1A0903X01
static int pllfreq;
void mas_store_pllfreq(int freq)
{
pllfreq = freq;
}
int mas_get_pllfreq(void)
{
return pllfreq;
}
#endif

View file

@ -26,7 +26,6 @@
#include "kernel.h"
#include "tuner.h" /* tuner abstraction interface */
#include "fmradio.h" /* physical interface driver */
#include "mpeg.h"
#include "sound.h"
#define DEFAULT_IN1 0x100003 /* Mute */
@ -64,7 +63,7 @@ int s1a0903x01_set(int setting, int value)
int pitch = 1000;
/* 4th harmonic falls in the FM frequency range */
int if_freq = 4 * mpeg_get_mas_pllfreq();
int if_freq = 4 * mas_get_pllfreq();
/* shift the mas harmonic >= 300 kHz away using the direction
* which needs less shifting. */

View file

@ -30,8 +30,6 @@
#include "pcm_sampr.h"
#include "pcm.h"
#ifdef HAVE_RECORDING
#include "pcm_record.h"
#include "id3.h"
#include "enc_base.h"
#endif /* HAVE_RECORDING */
#endif /* CONFIG_CODEC == SWCODEC */

View file

@ -163,3 +163,9 @@ int mas_codec_readreg(int reg);
unsigned long mas_readver(void);
#endif
#if CONFIG_TUNER & S1A0903X01
void mas_store_pllfreq(int freq);
int mas_get_pllfreq(void);
#endif

View file

@ -26,7 +26,6 @@
#include "debug.h"
#include "panic.h"
#include <kernel.h>
#include "mpeg.h" /* ToDo: remove crosslinks */
#include "mp3_playback.h"
#include "sound.h"
#ifndef SIMULATOR
@ -76,6 +75,10 @@ bool audio_is_initialized = false;
/* FIX: this code pretty much assumes a MAS */
/* dirty calls to mpeg.c */
extern void playback_tick(void);
extern void rec_tick(void);
#ifndef SIMULATOR
unsigned long mas_version_code;

View file

@ -46,9 +46,6 @@
#ifdef HAVE_LCD_BITMAP
#include "font.h"
#endif
#if defined(HAVE_RECORDING) && (CONFIG_CODEC == SWCODEC)
#include "pcm_record.h"
#endif
#include "logf.h"
#include "lcd-remote.h"
#ifdef SIMULATOR