From 3982f1e9322184de6bb15bbe8d04476d8bc11601 Mon Sep 17 00:00:00 2001 From: Rafaël Carré Date: Sun, 4 Jul 2010 13:37:52 +0000 Subject: Simulator: build recording code git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27280 a1c6a512-1295-4272-9138-f99709370657 --- apps/SOURCES | 2 - apps/codecs.c | 10 ++--- apps/codecs.h | 4 +- apps/codecs/SOURCES | 10 +++-- apps/recorder/pcm_record.c | 2 +- apps/recorder/recording.c | 77 +----------------------------------- firmware/target/hosted/sdl/pcm-sdl.c | 15 +++++-- uisimulator/common/stubs.c | 5 +++ 8 files changed, 32 insertions(+), 93 deletions(-) diff --git a/apps/SOURCES b/apps/SOURCES index 58186d2154..181c780fb6 100644 --- a/apps/SOURCES +++ b/apps/SOURCES @@ -161,9 +161,7 @@ dsp.c tdspeed.c #ifdef HAVE_RECORDING enc_config.c -#ifndef SIMULATOR recorder/pcm_record.c -#endif /* SIMULATOR */ #endif eq.c #if defined(CPU_COLDFIRE) diff --git a/apps/codecs.c b/apps/codecs.c index 22e692c111..154faa3f3f 100644 --- a/apps/codecs.c +++ b/apps/codecs.c @@ -167,7 +167,7 @@ struct codec_api ci = { __cyg_profile_func_exit, #endif -#if defined(HAVE_RECORDING) && !defined(SIMULATOR) +#ifdef HAVE_RECORDING false, /* stop_encoder */ 0, /* enc_codec_loaded */ enc_get_inputs, @@ -179,13 +179,13 @@ struct codec_api ci = { /* file */ (open_func)PREFIX(open), - close, - (read_func)read, + PREFIX(close), + (read_func)PREFIX(read), PREFIX(lseek), - (write_func)write, + (write_func)PREFIX(write), round_value_to_list32, -#endif +#endif /* HAVE_RECORDING */ /* new stuff at the end, sort into place next time the API gets incompatible */ diff --git a/apps/codecs.h b/apps/codecs.h index c3dbc4aaa3..c7bd1a87d0 100644 --- a/apps/codecs.h +++ b/apps/codecs.h @@ -44,7 +44,7 @@ #include "thread.h" #endif #if (CONFIG_CODEC == SWCODEC) -#if !defined(SIMULATOR) && defined(HAVE_RECORDING) +#ifdef HAVE_RECORDING #include "pcm_record.h" #endif #include "dsp.h" @@ -213,7 +213,7 @@ struct codec_api { void (*profile_func_exit)(void *this_fn, void *call_site); #endif -#if defined(HAVE_RECORDING) && !defined(SIMULATOR) +#ifdef HAVE_RECORDING volatile bool stop_encoder; volatile int enc_codec_loaded; /* <0=error, 0=pending, >0=ok */ void (*enc_get_inputs)(struct enc_inputs *inputs); diff --git a/apps/codecs/SOURCES b/apps/codecs/SOURCES index fe573548d7..ca50529aed 100644 --- a/apps/codecs/SOURCES +++ b/apps/codecs/SOURCES @@ -1,5 +1,5 @@ -#if CONFIG_CODEC == SWCODEC /* decoders */ + vorbis.c mpa.c flac.c @@ -32,12 +32,14 @@ au.c vox.c wav64.c tta.c -#if defined(HAVE_RECORDING) && !defined(SIMULATOR) + +#ifdef HAVE_RECORDING + /* encoders */ + aiff_enc.c mp3_enc.c wav_enc.c wavpack_enc.c -#endif -#endif +#endif /* HAVE_RECORDING */ diff --git a/apps/recorder/pcm_record.c b/apps/recorder/pcm_record.c index 3217509707..704d859e57 100644 --- a/apps/recorder/pcm_record.c +++ b/apps/recorder/pcm_record.c @@ -23,7 +23,7 @@ #include "kernel.h" #include "logf.h" #include "thread.h" -#include +#include "string-extra.h" #include "storage.h" #include "usb.h" #include "buffer.h" diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index fd1ff75e08..ab7e7c9b32 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c @@ -691,7 +691,7 @@ void rec_init_recording_options(struct audio_recording_options *options) #endif } -#if CONFIG_CODEC == SWCODEC && !defined (SIMULATOR) +#if CONFIG_CODEC == SWCODEC void rec_set_source(int source, unsigned flags) { /* 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_enable(true); } -#endif /* CONFIG_CODEC == SWCODEC && !defined (SIMULATOR) */ +#endif /* CONFIG_CODEC == SWCODEC */ void rec_set_recording_options(struct audio_recording_options *options) { @@ -2321,79 +2321,6 @@ void audio_beep(int duration) /* dummy */ (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 /* HAVE_RECORDING */ diff --git a/firmware/target/hosted/sdl/pcm-sdl.c b/firmware/target/hosted/sdl/pcm-sdl.c index 811d5c7814..5591980217 100644 --- a/firmware/target/hosted/sdl/pcm-sdl.c +++ b/firmware/target/hosted/sdl/pcm-sdl.c @@ -31,6 +31,10 @@ #include "audiohw.h" #include "system.h" +#ifdef HAVE_RECORDING +#include "audiohw.h" +#endif + #include "pcm.h" #include "pcm_sampr.h" @@ -284,16 +288,19 @@ void pcm_rec_dma_stop(void) { } -unsigned long pcm_rec_status(void) +const void * pcm_rec_dma_get_peak_buffer(void) { - return 0; + return NULL; } -const void * pcm_rec_dma_get_peak_buffer(void) +void audiohw_set_recvol(int left, int right, int type) { - return NULL; + (void)left; + (void)right; + (void)type; } + #endif /* HAVE_RECORDING */ void pcm_play_dma_init(void) diff --git a/uisimulator/common/stubs.c b/uisimulator/common/stubs.c index ee0c9f113c..6d7d7de06b 100644 --- a/uisimulator/common/stubs.c +++ b/uisimulator/common/stubs.c @@ -56,6 +56,11 @@ bool fat_ismounted(int volume) return true; } +int storage_spinup_time(void) +{ + return 0; +} + int storage_init(void) { return 1; -- cgit v1.2.3