summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-07-04 13:37:52 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-07-04 13:37:52 +0000
commit3982f1e9322184de6bb15bbe8d04476d8bc11601 (patch)
treeb15642a5c1d6d1e3c8ed6b159ed7918f515e3d9e
parentbf83ac624083af0c53fdc358df8270798831d8cb (diff)
downloadrockbox-3982f1e9322184de6bb15bbe8d04476d8bc11601.tar.gz
rockbox-3982f1e9322184de6bb15bbe8d04476d8bc11601.zip
Simulator: build recording code
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27280 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/SOURCES2
-rw-r--r--apps/codecs.c10
-rw-r--r--apps/codecs.h4
-rw-r--r--apps/codecs/SOURCES10
-rw-r--r--apps/recorder/pcm_record.c2
-rw-r--r--apps/recorder/recording.c77
-rw-r--r--firmware/target/hosted/sdl/pcm-sdl.c15
-rw-r--r--uisimulator/common/stubs.c5
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
161tdspeed.c 161tdspeed.c
162#ifdef HAVE_RECORDING 162#ifdef HAVE_RECORDING
163enc_config.c 163enc_config.c
164#ifndef SIMULATOR
165recorder/pcm_record.c 164recorder/pcm_record.c
166#endif /* SIMULATOR */
167#endif 165#endif
168eq.c 166eq.c
169#if defined(CPU_COLDFIRE) 167#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 = {
167 __cyg_profile_func_exit, 167 __cyg_profile_func_exit,
168#endif 168#endif
169 169
170#if defined(HAVE_RECORDING) && !defined(SIMULATOR) 170#ifdef HAVE_RECORDING
171 false, /* stop_encoder */ 171 false, /* stop_encoder */
172 0, /* enc_codec_loaded */ 172 0, /* enc_codec_loaded */
173 enc_get_inputs, 173 enc_get_inputs,
@@ -179,13 +179,13 @@ struct codec_api ci = {
179 179
180 /* file */ 180 /* file */
181 (open_func)PREFIX(open), 181 (open_func)PREFIX(open),
182 close, 182 PREFIX(close),
183 (read_func)read, 183 (read_func)PREFIX(read),
184 PREFIX(lseek), 184 PREFIX(lseek),
185 (write_func)write, 185 (write_func)PREFIX(write),
186 round_value_to_list32, 186 round_value_to_list32,
187 187
188#endif 188#endif /* HAVE_RECORDING */
189 189
190 /* new stuff at the end, sort into place next time 190 /* new stuff at the end, sort into place next time
191 the API gets incompatible */ 191 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 @@
44#include "thread.h" 44#include "thread.h"
45#endif 45#endif
46#if (CONFIG_CODEC == SWCODEC) 46#if (CONFIG_CODEC == SWCODEC)
47#if !defined(SIMULATOR) && defined(HAVE_RECORDING) 47#ifdef HAVE_RECORDING
48#include "pcm_record.h" 48#include "pcm_record.h"
49#endif 49#endif
50#include "dsp.h" 50#include "dsp.h"
@@ -213,7 +213,7 @@ struct codec_api {
213 void (*profile_func_exit)(void *this_fn, void *call_site); 213 void (*profile_func_exit)(void *this_fn, void *call_site);
214#endif 214#endif
215 215
216#if defined(HAVE_RECORDING) && !defined(SIMULATOR) 216#ifdef HAVE_RECORDING
217 volatile bool stop_encoder; 217 volatile bool stop_encoder;
218 volatile int enc_codec_loaded; /* <0=error, 0=pending, >0=ok */ 218 volatile int enc_codec_loaded; /* <0=error, 0=pending, >0=ok */
219 void (*enc_get_inputs)(struct enc_inputs *inputs); 219 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 @@
1#if CONFIG_CODEC == SWCODEC
2/* decoders */ 1/* decoders */
2
3vorbis.c 3vorbis.c
4mpa.c 4mpa.c
5flac.c 5flac.c
@@ -32,12 +32,14 @@ au.c
32vox.c 32vox.c
33wav64.c 33wav64.c
34tta.c 34tta.c
35#if defined(HAVE_RECORDING) && !defined(SIMULATOR) 35
36#ifdef HAVE_RECORDING
37
36/* encoders */ 38/* encoders */
39
37aiff_enc.c 40aiff_enc.c
38mp3_enc.c 41mp3_enc.c
39wav_enc.c 42wav_enc.c
40wavpack_enc.c 43wavpack_enc.c
41#endif
42#endif
43 44
45#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 @@
23#include "kernel.h" 23#include "kernel.h"
24#include "logf.h" 24#include "logf.h"
25#include "thread.h" 25#include "thread.h"
26#include <string.h> 26#include "string-extra.h"
27#include "storage.h" 27#include "storage.h"
28#include "usb.h" 28#include "usb.h"
29#include "buffer.h" 29#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)
691#endif 691#endif
692} 692}
693 693
694#if CONFIG_CODEC == SWCODEC && !defined (SIMULATOR) 694#if CONFIG_CODEC == SWCODEC
695void rec_set_source(int source, unsigned flags) 695void rec_set_source(int source, unsigned flags)
696{ 696{
697 /* Set audio input source, power up/down devices */ 697 /* Set audio input source, power up/down devices */
@@ -701,7 +701,7 @@ void rec_set_source(int source, unsigned flags)
701 peak_meter_playback((flags & SRCF_RECORDING) == 0); 701 peak_meter_playback((flags & SRCF_RECORDING) == 0);
702 peak_meter_enable(true); 702 peak_meter_enable(true);
703} 703}
704#endif /* CONFIG_CODEC == SWCODEC && !defined (SIMULATOR) */ 704#endif /* CONFIG_CODEC == SWCODEC */
705 705
706void rec_set_recording_options(struct audio_recording_options *options) 706void rec_set_recording_options(struct audio_recording_options *options)
707{ 707{
@@ -2321,79 +2321,6 @@ void audio_beep(int duration)
2321 /* dummy */ 2321 /* dummy */
2322 (void)duration; 2322 (void)duration;
2323} 2323}
2324
2325#ifdef SIMULATOR
2326/* stubs for recording sim */
2327void audio_init_recording(unsigned int buffer_offset)
2328{
2329 buffer_offset = buffer_offset;
2330}
2331
2332void audio_close_recording(void)
2333{
2334}
2335
2336unsigned long pcm_rec_get_warnings(void)
2337{
2338 return 0;
2339}
2340
2341unsigned long pcm_rec_sample_rate(void)
2342{
2343 return 0;
2344}
2345
2346unsigned long audio_recorded_time(void)
2347{
2348 return 123;
2349}
2350
2351unsigned long audio_num_recorded_bytes(void)
2352{
2353 return 5 * 1024 * 1024;
2354}
2355
2356void rec_set_source(int source, unsigned flags)
2357{
2358 source = source;
2359 flags = flags;
2360}
2361
2362void audio_set_recording_options(struct audio_recording_options *options)
2363{
2364 options = options;
2365}
2366
2367void audio_set_recording_gain(int left, int right, int type)
2368{
2369 left = left;
2370 right = right;
2371 type = type;
2372}
2373
2374void audio_record(const char *filename)
2375{
2376 filename = filename;
2377}
2378
2379void audio_new_file(const char *filename)
2380{
2381 filename = filename;
2382}
2383
2384void audio_stop_recording(void)
2385{
2386}
2387
2388void audio_pause_recording(void)
2389{
2390}
2391
2392void audio_resume_recording(void)
2393{
2394}
2395
2396#endif /* #ifdef SIMULATOR */
2397#endif /* #ifdef CONFIG_CODEC == SWCODEC */ 2324#endif /* #ifdef CONFIG_CODEC == SWCODEC */
2398 2325
2399#endif /* HAVE_RECORDING */ 2326#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 @@
31#include "audiohw.h" 31#include "audiohw.h"
32#include "system.h" 32#include "system.h"
33 33
34#ifdef HAVE_RECORDING
35#include "audiohw.h"
36#endif
37
34#include "pcm.h" 38#include "pcm.h"
35#include "pcm_sampr.h" 39#include "pcm_sampr.h"
36 40
@@ -284,16 +288,19 @@ void pcm_rec_dma_stop(void)
284{ 288{
285} 289}
286 290
287unsigned long pcm_rec_status(void) 291const void * pcm_rec_dma_get_peak_buffer(void)
288{ 292{
289 return 0; 293 return NULL;
290} 294}
291 295
292const void * pcm_rec_dma_get_peak_buffer(void) 296void audiohw_set_recvol(int left, int right, int type)
293{ 297{
294 return NULL; 298 (void)left;
299 (void)right;
300 (void)type;
295} 301}
296 302
303
297#endif /* HAVE_RECORDING */ 304#endif /* HAVE_RECORDING */
298 305
299void pcm_play_dma_init(void) 306void 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)
56 return true; 56 return true;
57} 57}
58 58
59int storage_spinup_time(void)
60{
61 return 0;
62}
63
59int storage_init(void) 64int storage_init(void)
60{ 65{
61 return 1; 66 return 1;