diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2010-07-04 13:37:52 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2010-07-04 13:37:52 +0000 |
commit | 3982f1e9322184de6bb15bbe8d04476d8bc11601 (patch) | |
tree | b15642a5c1d6d1e3c8ed6b159ed7918f515e3d9e /apps | |
parent | bf83ac624083af0c53fdc358df8270798831d8cb (diff) | |
download | rockbox-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
Diffstat (limited to 'apps')
-rw-r--r-- | apps/SOURCES | 2 | ||||
-rw-r--r-- | apps/codecs.c | 10 | ||||
-rw-r--r-- | apps/codecs.h | 4 | ||||
-rw-r--r-- | apps/codecs/SOURCES | 10 | ||||
-rw-r--r-- | apps/recorder/pcm_record.c | 2 | ||||
-rw-r--r-- | apps/recorder/recording.c | 77 |
6 files changed, 16 insertions, 89 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 | |||
161 | tdspeed.c | 161 | tdspeed.c |
162 | #ifdef HAVE_RECORDING | 162 | #ifdef HAVE_RECORDING |
163 | enc_config.c | 163 | enc_config.c |
164 | #ifndef SIMULATOR | ||
165 | recorder/pcm_record.c | 164 | recorder/pcm_record.c |
166 | #endif /* SIMULATOR */ | ||
167 | #endif | 165 | #endif |
168 | eq.c | 166 | eq.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 | |||
3 | vorbis.c | 3 | vorbis.c |
4 | mpa.c | 4 | mpa.c |
5 | flac.c | 5 | flac.c |
@@ -32,12 +32,14 @@ au.c | |||
32 | vox.c | 32 | vox.c |
33 | wav64.c | 33 | wav64.c |
34 | tta.c | 34 | tta.c |
35 | #if defined(HAVE_RECORDING) && !defined(SIMULATOR) | 35 | |
36 | #ifdef HAVE_RECORDING | ||
37 | |||
36 | /* encoders */ | 38 | /* encoders */ |
39 | |||
37 | aiff_enc.c | 40 | aiff_enc.c |
38 | mp3_enc.c | 41 | mp3_enc.c |
39 | wav_enc.c | 42 | wav_enc.c |
40 | wavpack_enc.c | 43 | wavpack_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 |
695 | void rec_set_source(int source, unsigned flags) | 695 | void 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 | ||
706 | void rec_set_recording_options(struct audio_recording_options *options) | 706 | void 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 */ | ||
2327 | void audio_init_recording(unsigned int buffer_offset) | ||
2328 | { | ||
2329 | buffer_offset = buffer_offset; | ||
2330 | } | ||
2331 | |||
2332 | void audio_close_recording(void) | ||
2333 | { | ||
2334 | } | ||
2335 | |||
2336 | unsigned long pcm_rec_get_warnings(void) | ||
2337 | { | ||
2338 | return 0; | ||
2339 | } | ||
2340 | |||
2341 | unsigned long pcm_rec_sample_rate(void) | ||
2342 | { | ||
2343 | return 0; | ||
2344 | } | ||
2345 | |||
2346 | unsigned long audio_recorded_time(void) | ||
2347 | { | ||
2348 | return 123; | ||
2349 | } | ||
2350 | |||
2351 | unsigned long audio_num_recorded_bytes(void) | ||
2352 | { | ||
2353 | return 5 * 1024 * 1024; | ||
2354 | } | ||
2355 | |||
2356 | void rec_set_source(int source, unsigned flags) | ||
2357 | { | ||
2358 | source = source; | ||
2359 | flags = flags; | ||
2360 | } | ||
2361 | |||
2362 | void audio_set_recording_options(struct audio_recording_options *options) | ||
2363 | { | ||
2364 | options = options; | ||
2365 | } | ||
2366 | |||
2367 | void audio_set_recording_gain(int left, int right, int type) | ||
2368 | { | ||
2369 | left = left; | ||
2370 | right = right; | ||
2371 | type = type; | ||
2372 | } | ||
2373 | |||
2374 | void audio_record(const char *filename) | ||
2375 | { | ||
2376 | filename = filename; | ||
2377 | } | ||
2378 | |||
2379 | void audio_new_file(const char *filename) | ||
2380 | { | ||
2381 | filename = filename; | ||
2382 | } | ||
2383 | |||
2384 | void audio_stop_recording(void) | ||
2385 | { | ||
2386 | } | ||
2387 | |||
2388 | void audio_pause_recording(void) | ||
2389 | { | ||
2390 | } | ||
2391 | |||
2392 | void 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 */ |