1
0
Fork 0
forked from len0rd/rockbox

Simulator: build recording code

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27280 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rafaël Carré 2010-07-04 13:37:52 +00:00
parent bf83ac6240
commit 3982f1e932
8 changed files with 33 additions and 94 deletions

View file

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

View file

@ -167,7 +167,7 @@ struct codec_api ci = {
__cyg_profile_func_exit, __cyg_profile_func_exit,
#endif #endif
#if defined(HAVE_RECORDING) && !defined(SIMULATOR) #ifdef HAVE_RECORDING
false, /* stop_encoder */ false, /* stop_encoder */
0, /* enc_codec_loaded */ 0, /* enc_codec_loaded */
enc_get_inputs, enc_get_inputs,
@ -179,13 +179,13 @@ struct codec_api ci = {
/* file */ /* file */
(open_func)PREFIX(open), (open_func)PREFIX(open),
close, PREFIX(close),
(read_func)read, (read_func)PREFIX(read),
PREFIX(lseek), PREFIX(lseek),
(write_func)write, (write_func)PREFIX(write),
round_value_to_list32, round_value_to_list32,
#endif #endif /* HAVE_RECORDING */
/* new stuff at the end, sort into place next time /* new stuff at the end, sort into place next time
the API gets incompatible */ the API gets incompatible */

View file

@ -44,7 +44,7 @@
#include "thread.h" #include "thread.h"
#endif #endif
#if (CONFIG_CODEC == SWCODEC) #if (CONFIG_CODEC == SWCODEC)
#if !defined(SIMULATOR) && defined(HAVE_RECORDING) #ifdef HAVE_RECORDING
#include "pcm_record.h" #include "pcm_record.h"
#endif #endif
#include "dsp.h" #include "dsp.h"
@ -213,7 +213,7 @@ struct codec_api {
void (*profile_func_exit)(void *this_fn, void *call_site); void (*profile_func_exit)(void *this_fn, void *call_site);
#endif #endif
#if defined(HAVE_RECORDING) && !defined(SIMULATOR) #ifdef HAVE_RECORDING
volatile bool stop_encoder; volatile bool stop_encoder;
volatile int enc_codec_loaded; /* <0=error, 0=pending, >0=ok */ volatile int enc_codec_loaded; /* <0=error, 0=pending, >0=ok */
void (*enc_get_inputs)(struct enc_inputs *inputs); void (*enc_get_inputs)(struct enc_inputs *inputs);

View file

@ -1,5 +1,5 @@
#if CONFIG_CODEC == SWCODEC
/* decoders */ /* decoders */
vorbis.c vorbis.c
mpa.c mpa.c
flac.c flac.c
@ -32,12 +32,14 @@ au.c
vox.c vox.c
wav64.c wav64.c
tta.c tta.c
#if defined(HAVE_RECORDING) && !defined(SIMULATOR)
#ifdef HAVE_RECORDING
/* encoders */ /* encoders */
aiff_enc.c aiff_enc.c
mp3_enc.c mp3_enc.c
wav_enc.c wav_enc.c
wavpack_enc.c wavpack_enc.c
#endif
#endif
#endif /* HAVE_RECORDING */

View file

@ -23,7 +23,7 @@
#include "kernel.h" #include "kernel.h"
#include "logf.h" #include "logf.h"
#include "thread.h" #include "thread.h"
#include <string.h> #include "string-extra.h"
#include "storage.h" #include "storage.h"
#include "usb.h" #include "usb.h"
#include "buffer.h" #include "buffer.h"

View file

@ -691,7 +691,7 @@ void rec_init_recording_options(struct audio_recording_options *options)
#endif #endif
} }
#if CONFIG_CODEC == SWCODEC && !defined (SIMULATOR) #if CONFIG_CODEC == SWCODEC
void rec_set_source(int source, unsigned flags) void rec_set_source(int source, unsigned flags)
{ {
/* Set audio input source, power up/down devices */ /* Set audio input source, power up/down devices */
@ -701,7 +701,7 @@ void rec_set_source(int source, unsigned flags)
peak_meter_playback((flags & SRCF_RECORDING) == 0); peak_meter_playback((flags & SRCF_RECORDING) == 0);
peak_meter_enable(true); peak_meter_enable(true);
} }
#endif /* CONFIG_CODEC == SWCODEC && !defined (SIMULATOR) */ #endif /* CONFIG_CODEC == SWCODEC */
void rec_set_recording_options(struct audio_recording_options *options) void rec_set_recording_options(struct audio_recording_options *options)
{ {
@ -2321,79 +2321,6 @@ void audio_beep(int duration)
/* dummy */ /* dummy */
(void)duration; (void)duration;
} }
#ifdef SIMULATOR
/* stubs for recording sim */
void audio_init_recording(unsigned int buffer_offset)
{
buffer_offset = buffer_offset;
}
void audio_close_recording(void)
{
}
unsigned long pcm_rec_get_warnings(void)
{
return 0;
}
unsigned long pcm_rec_sample_rate(void)
{
return 0;
}
unsigned long audio_recorded_time(void)
{
return 123;
}
unsigned long audio_num_recorded_bytes(void)
{
return 5 * 1024 * 1024;
}
void rec_set_source(int source, unsigned flags)
{
source = source;
flags = flags;
}
void audio_set_recording_options(struct audio_recording_options *options)
{
options = options;
}
void audio_set_recording_gain(int left, int right, int type)
{
left = left;
right = right;
type = type;
}
void audio_record(const char *filename)
{
filename = filename;
}
void audio_new_file(const char *filename)
{
filename = filename;
}
void audio_stop_recording(void)
{
}
void audio_pause_recording(void)
{
}
void audio_resume_recording(void)
{
}
#endif /* #ifdef SIMULATOR */
#endif /* #ifdef CONFIG_CODEC == SWCODEC */ #endif /* #ifdef CONFIG_CODEC == SWCODEC */
#endif /* HAVE_RECORDING */ #endif /* HAVE_RECORDING */

View file

@ -31,6 +31,10 @@
#include "audiohw.h" #include "audiohw.h"
#include "system.h" #include "system.h"
#ifdef HAVE_RECORDING
#include "audiohw.h"
#endif
#include "pcm.h" #include "pcm.h"
#include "pcm_sampr.h" #include "pcm_sampr.h"
@ -284,16 +288,19 @@ void pcm_rec_dma_stop(void)
{ {
} }
unsigned long pcm_rec_status(void)
{
return 0;
}
const void * pcm_rec_dma_get_peak_buffer(void) const void * pcm_rec_dma_get_peak_buffer(void)
{ {
return NULL; return NULL;
} }
void audiohw_set_recvol(int left, int right, int type)
{
(void)left;
(void)right;
(void)type;
}
#endif /* HAVE_RECORDING */ #endif /* HAVE_RECORDING */
void pcm_play_dma_init(void) void pcm_play_dma_init(void)

View file

@ -56,6 +56,11 @@ bool fat_ismounted(int volume)
return true; return true;
} }
int storage_spinup_time(void)
{
return 0;
}
int storage_init(void) int storage_init(void)
{ {
return 1; return 1;