forked from len0rd/rockbox
Big Patch adds primarily: Samplerate and format selection to recording for SWCODEC. Supprort for samplerates changing in playback (just goes with the recording part inseparably). Samplerates to all encoders. Encoders can be configured individually on a menu specific to the encoder in the recording menu. File creation is delayed until flush time to reduce spinups when splitting. Misc: statusbar icons for numbers are individual digits to display any number. Audio buffer was rearranged to maximize memory available to recording and properly reinitialized when trashed. ColdFire PCM stuff moved to target tree to avoid a complicated mess when adding samplerate switching. Some needed API changes and to neaten up growing gap between hardware and software codecs.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11452 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
0b22795e26
commit
0f5cb94aa4
58 changed files with 4769 additions and 2781 deletions
|
@ -50,6 +50,7 @@
|
|||
#include "sound.h"
|
||||
#include "database.h"
|
||||
#include "splash.h"
|
||||
#include "general.h"
|
||||
|
||||
#ifdef SIMULATOR
|
||||
#if CONFIG_CODEC == SWCODEC
|
||||
|
@ -104,6 +105,7 @@ struct codec_api ci = {
|
|||
PREFIX(remove),
|
||||
PREFIX(rename),
|
||||
PREFIX(ftruncate),
|
||||
PREFIX(fsync),
|
||||
fdprintf,
|
||||
read_line,
|
||||
settings_parseline,
|
||||
|
@ -187,6 +189,7 @@ struct codec_api ci = {
|
|||
get_time,
|
||||
set_time,
|
||||
plugin_get_audio_buffer,
|
||||
round_value_to_list32,
|
||||
|
||||
#if defined(DEBUG) || defined(SIMULATOR)
|
||||
debugf,
|
||||
|
@ -213,11 +216,11 @@ struct codec_api ci = {
|
|||
false,
|
||||
enc_get_inputs,
|
||||
enc_set_parameters,
|
||||
enc_alloc_chunk,
|
||||
enc_free_chunk,
|
||||
enc_wavbuf_near_empty,
|
||||
enc_get_wav_data,
|
||||
&enc_set_header_callback,
|
||||
enc_get_chunk,
|
||||
enc_finish_chunk,
|
||||
enc_pcm_buf_near_empty,
|
||||
enc_get_pcm_data,
|
||||
enc_unget_pcm_data
|
||||
#endif
|
||||
|
||||
/* new stuff at the end, sort into place next time
|
||||
|
@ -225,10 +228,10 @@ struct codec_api ci = {
|
|||
|
||||
};
|
||||
|
||||
void codec_get_full_path(char *path, const char *codec_fn)
|
||||
void codec_get_full_path(char *path, const char *codec_root_fn)
|
||||
{
|
||||
/* Create full codec path */
|
||||
snprintf(path, MAX_PATH-1, CODECS_DIR "/%s", codec_fn);
|
||||
snprintf(path, MAX_PATH-1, CODECS_DIR "/%s." CODEC_EXTENSION,
|
||||
codec_root_fn);
|
||||
}
|
||||
|
||||
int codec_load_ram(char* codecptr, int size, void* ptr2, int bufwrap,
|
||||
|
@ -254,7 +257,11 @@ int codec_load_ram(char* codecptr, int size, void* ptr2, int bufwrap,
|
|||
hdr = (struct codec_header *)codecbuf;
|
||||
|
||||
if (size <= (signed)sizeof(struct codec_header)
|
||||
|| hdr->magic != CODEC_MAGIC
|
||||
|| (hdr->magic != CODEC_MAGIC
|
||||
#ifdef HAVE_RECORDING
|
||||
&& hdr->magic != CODEC_ENC_MAGIC
|
||||
#endif
|
||||
)
|
||||
|| hdr->target_id != TARGET_ID
|
||||
|| hdr->load_addr != codecbuf
|
||||
|| hdr->end_addr > codecbuf + CODEC_SIZE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue