summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2005-04-05 11:33:58 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2005-04-05 11:33:58 +0000
commitd34865a5307e7bf91d986036797423975ac828b4 (patch)
tree41dcc1775f6cdc1d655f1eddadaabdf90c7ac22f /apps
parent6cf9d51b3374cdc436c45f165a10f607832126ee (diff)
downloadrockbox-d34865a5307e7bf91d986036797423975ac828b4.tar.gz
rockbox-d34865a5307e7bf91d986036797423975ac828b4.tar.bz2
rockbox-d34865a5307e7bf91d986036797423975ac828b4.zip
mp3buf renamed to audiobuf
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6252 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/debug_menu.c12
-rw-r--r--apps/main_menu.c2
-rw-r--r--apps/playlist.c10
-rw-r--r--apps/plugin.c8
-rw-r--r--apps/plugin.h4
-rw-r--r--apps/plugins/battery_test.c2
-rw-r--r--apps/plugins/jpeg.c2
-rw-r--r--apps/plugins/lib/xxx2wav.c14
-rw-r--r--apps/plugins/rockboy.c9
-rw-r--r--apps/plugins/rockboy/rockboy.c34
-rw-r--r--apps/plugins/sort.c2
-rw-r--r--apps/plugins/vbrfix.c26
-rw-r--r--apps/plugins/video.c2
-rw-r--r--apps/talk.c20
14 files changed, 74 insertions, 73 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index d8ebe9bfb1..2ab2194199 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -126,7 +126,7 @@ int load_wave(char *filename)
if (audio_size > 8*1024*1024)
audio_size = 8*1024*1024;
- audio_buffer = mp3buf;
+ audio_buffer = audiobuf;
puts("Reading %d bytes..", audio_size);
@@ -356,11 +356,11 @@ bool dbg_audio_thread(void)
lcd_clear_display();
- snprintf(buf, sizeof(buf), "read: %x", d.mp3buf_read);
+ snprintf(buf, sizeof(buf), "read: %x", d.audiobuf_read);
lcd_puts(0, 0, buf);
- snprintf(buf, sizeof(buf), "write: %x", d.mp3buf_write);
+ snprintf(buf, sizeof(buf), "write: %x", d.audiobuf_write);
lcd_puts(0, 1, buf);
- snprintf(buf, sizeof(buf), "swap: %x", d.mp3buf_swapwrite);
+ snprintf(buf, sizeof(buf), "swap: %x", d.audiobuf_swapwrite);
lcd_puts(0, 2, buf);
snprintf(buf, sizeof(buf), "playing: %d", d.playing);
lcd_puts(0, 3, buf);
@@ -370,11 +370,11 @@ bool dbg_audio_thread(void)
lcd_puts(0, 5, buf);
/* Playable space left */
- scrollbar(0, 6*8, 112, 4, d.mp3buflen, 0,
+ scrollbar(0, 6*8, 112, 4, d.audiobuflen, 0,
d.playable_space, HORIZONTAL);
/* Show the watermark limit */
- scrollbar(0, 6*8+4, 112, 4, d.mp3buflen, 0,
+ scrollbar(0, 6*8+4, 112, 4, d.audiobuflen, 0,
d.low_watermark_level, HORIZONTAL);
snprintf(buf, sizeof(buf), "wm: %x - %x",
diff --git a/apps/main_menu.c b/apps/main_menu.c
index c7cfb0ea70..055a83bc24 100644
--- a/apps/main_menu.c
+++ b/apps/main_menu.c
@@ -138,7 +138,7 @@ extern bool simulate_usb(void);
bool show_info(void)
{
char s[32], s2[32];
- long buflen = ((mp3end - mp3buf) * 2) / 2097; /* avoid overflow */
+ long buflen = ((audiobufend - audiobuf) * 2) / 2097; /* avoid overflow */
int integer, decimal;
bool done = false;
int key;
diff --git a/apps/playlist.c b/apps/playlist.c
index 3370937a69..8c9d6d11c7 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -351,8 +351,8 @@ static int add_indices_to_playlist(struct playlist_info* playlist,
audio_stop();
talk_buffer_steal(); /* we use the mp3 buffer, need to tell */
- buffer = mp3buf;
- buflen = (mp3end - mp3buf);
+ buffer = audiobuf;
+ buflen = (audiobufend - audiobuf);
}
store_index = true;
@@ -1211,8 +1211,8 @@ int playlist_resume(void)
/* use mp3 buffer for maximum load speed */
talk_buffer_steal(); /* we use the mp3 buffer, need to tell */
- buflen = (mp3end - mp3buf);
- buffer = mp3buf;
+ buflen = (audiobufend - audiobuf);
+ buffer = audiobuf;
empty_playlist(playlist, true);
@@ -1294,7 +1294,7 @@ int playlist_resume(void)
if (str3[0] != '\0')
{
/* NOTE: add_indices_to_playlist() overwrites the
- mp3buf so we need to reload control file
+ audiobuf so we need to reload control file
data */
add_indices_to_playlist(playlist, NULL, 0);
}
diff --git a/apps/plugin.c b/apps/plugin.c
index 412d86b4c9..7a9875ac2c 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -238,7 +238,7 @@ static const struct plugin_api rockbox_api = {
get_time,
set_time,
plugin_get_buffer,
- plugin_get_mp3_buffer,
+ plugin_get_audio_buffer,
#ifndef SIMULATOR
plugin_register_timer,
plugin_unregister_timer,
@@ -407,12 +407,12 @@ void* plugin_get_buffer(int* buffer_size)
/* Returns a pointer to the mp3 buffer.
Playback gets stopped, to avoid conflicts. */
-void* plugin_get_mp3_buffer(int* buffer_size)
+void* plugin_get_audio_buffer(int* buffer_size)
{
audio_stop();
talk_buffer_steal(); /* we use the mp3 buffer, need to tell */
- *buffer_size = mp3end - mp3buf;
- return mp3buf;
+ *buffer_size = audiobufend - audiobuf;
+ return audiobuf;
}
#ifndef SIMULATOR
diff --git a/apps/plugin.h b/apps/plugin.h
index ff37a7c46d..9fd9a9421c 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -280,7 +280,7 @@ struct plugin_api {
struct tm* (*get_time)(void);
int (*set_time)(const struct tm *tm);
void* (*plugin_get_buffer)(int* buffer_size);
- void* (*plugin_get_mp3_buffer)(int* buffer_size);
+ void* (*plugin_get_audio_buffer)(int* buffer_size);
#ifndef SIMULATOR
int (*plugin_register_timer)(int cycles, int prio, void (*timer_callback)(void));
void (*plugin_unregister_timer)(void);
@@ -334,7 +334,7 @@ struct plugin_api {
/* defined by the plugin loader (plugin.c) */
int plugin_load(const char* plugin, void* parameter);
void* plugin_get_buffer(int *buffer_size);
-void* plugin_get_mp3_buffer(int *buffer_size);
+void* plugin_get_audio_buffer(int *buffer_size);
int plugin_register_timer(int cycles, int prio, void (*timer_callback)(void));
void plugin_unregister_timer(void);
void plugin_tsr(void (*exit_callback)(void));
diff --git a/apps/plugins/battery_test.c b/apps/plugins/battery_test.c
index 73affddf8b..47042e6cf0 100644
--- a/apps/plugins/battery_test.c
+++ b/apps/plugins/battery_test.c
@@ -48,7 +48,7 @@ int buffersize;
int init(void)
{
int f;
- buffer = rb->plugin_get_mp3_buffer(&buffersize);
+ buffer = rb->plugin_get_audio_buffer(&buffersize);
#ifdef HAVE_MMC
/* present info what's going on. MMC is slow. */
diff --git a/apps/plugins/jpeg.c b/apps/plugins/jpeg.c
index f705271240..7ca59b29cd 100644
--- a/apps/plugins/jpeg.c
+++ b/apps/plugins/jpeg.c
@@ -1824,7 +1824,7 @@ int main(char* filename)
rb->memset(&disp, 0, sizeof(disp));
- buf = rb->plugin_get_mp3_buffer(&buf_size); /* start munching memory */
+ buf = rb->plugin_get_audio_buffer(&buf_size); /* start munching memory */
/* initialize the grayscale buffer:
diff --git a/apps/plugins/lib/xxx2wav.c b/apps/plugins/lib/xxx2wav.c
index 4d0c139f1b..d864527fc2 100644
--- a/apps/plugins/lib/xxx2wav.c
+++ b/apps/plugins/lib/xxx2wav.c
@@ -29,9 +29,9 @@ static struct plugin_api* local_rb;
int mem_ptr;
int bufsize;
-unsigned char* mp3buf; // The actual MP3 buffer from Rockbox
-unsigned char* mallocbuf; // 512K from the start of MP3 buffer
-unsigned char* filebuf; // The rest of the MP3 buffer
+unsigned char* audiobuf; // The actual audio buffer from Rockbox
+unsigned char* mallocbuf; // 512K from the start of audio buffer
+unsigned char* filebuf; // The rest of the audio buffer
void* codec_malloc(size_t size) {
void* x;
@@ -169,11 +169,11 @@ int local_init(char* infilename, char* outfilename, file_info_struct* file_info,
local_rb=rb;
mem_ptr=0;
- mp3buf=local_rb->plugin_get_mp3_buffer(&bufsize);
- mallocbuf=mp3buf;
- filebuf=&mp3buf[MALLOC_BUFSIZE];
+ audiobuf=local_rb->plugin_get_audio_buffer(&bufsize);
+ mallocbuf=audiobuf;
+ filebuf=&audiobuf[MALLOC_BUFSIZE];
- local_rb->snprintf(s,32,"mp3 bufsize: %d",bufsize);
+ local_rb->snprintf(s,32,"audio bufsize: %d",bufsize);
local_rb->lcd_putsxy(0,100,s);
local_rb->lcd_update();
diff --git a/apps/plugins/rockboy.c b/apps/plugins/rockboy.c
index 4778fa8ee6..d531c9405b 100644
--- a/apps/plugins/rockboy.c
+++ b/apps/plugins/rockboy.c
@@ -26,8 +26,8 @@
#define OVL_DISPLAYNAME "RockBoy"
struct plugin_api* rb;
-unsigned char *mp3buf;
-int mp3buf_size;
+unsigned char *audiobuf;
+int audiobuf_size;
/* this is the plugin entry point */
enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
@@ -60,8 +60,9 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
return PLUGIN_ERROR;
}
- mp3buf = rb->plugin_get_mp3_buffer(&mp3buf_size);
- if (header.start_addr < mp3buf || header.end_addr > mp3buf + mp3buf_size)
+ audiobuf = rb->plugin_get_audio_buffer(&audiobuf_size);
+ if (header.start_addr < audiobuf ||
+ header.end_addr > audiobuf + audiobuf_size)
{
rb->close(fh);
rb->splash(2*HZ, true, OVL_DISPLAYNAME
diff --git a/apps/plugins/rockboy/rockboy.c b/apps/plugins/rockboy/rockboy.c
index c6d006a131..1b4c0c7a7d 100644
--- a/apps/plugins/rockboy/rockboy.c
+++ b/apps/plugins/rockboy/rockboy.c
@@ -59,37 +59,37 @@ void die(char *message, ...)
errormsg=message;
}
-void *mp3_bufferbase;
-void *mp3_bufferpointer;
-unsigned int mp3_buffer_free;
+void *audio_bufferbase;
+void *audio_bufferpointer;
+unsigned int audio_buffer_free;
void *my_malloc(size_t size)
{
void *alloc;
- if (!mp3_bufferbase)
+ if (!audio_bufferbase)
{
- mp3_bufferbase = mp3_bufferpointer
- = rb->plugin_get_mp3_buffer(&mp3_buffer_free);
+ audio_bufferbase = audio_bufferpointer
+ = rb->plugin_get_audio_buffer(&audio_buffer_free);
#if MEM <= 8 && !defined(SIMULATOR)
/* loaded as an overlay, protect from overwriting ourselves */
- if ((unsigned)(ovl_start_addr - (unsigned char *)mp3_bufferbase)
- < mp3_buffer_free)
- mp3_buffer_free = ovl_start_addr - (unsigned char *)mp3_bufferbase;
+ if ((unsigned)(ovl_start_addr - (unsigned char *)audio_bufferbase)
+ < audio_buffer_free)
+ audio_buffer_free = ovl_start_addr - (unsigned char *)audio_bufferbase;
#endif
}
- if (size + 4 > mp3_buffer_free)
+ if (size + 4 > audio_buffer_free)
return 0;
- alloc = mp3_bufferpointer;
- mp3_bufferpointer += size + 4;
- mp3_buffer_free -= size + 4;
+ alloc = audio_bufferpointer;
+ audio_bufferpointer += size + 4;
+ audio_buffer_free -= size + 4;
return alloc;
}
void setmallocpos(void *pointer)
{
- mp3_bufferpointer = pointer;
- mp3_buffer_free = mp3_bufferpointer - mp3_bufferbase;
+ audio_bufferpointer = pointer;
+ audio_buffer_free = audio_bufferpointer - audio_bufferbase;
}
/* this is the plugin entry point */
@@ -113,8 +113,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
#endif
shut=0;
cleanshut=0;
- mp3_bufferbase=mp3_bufferpointer=0;
- mp3_buffer_free=0;
+ audio_bufferbase=audio_bufferpointer=0;
+ audio_buffer_free=0;
/* now go ahead and have fun! */
/* rb->splash(HZ*2, true, "Rockboy v0.3"); */
diff --git a/apps/plugins/sort.c b/apps/plugins/sort.c
index b17f5a441a..cf91dbb4dd 100644
--- a/apps/plugins/sort.c
+++ b/apps/plugins/sort.c
@@ -184,7 +184,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
rb = api;
- buf = rb->plugin_get_mp3_buffer(&buf_size); /* start munching memory */
+ buf = rb->plugin_get_audio_buffer(&buf_size); /* start munching memory */
stringbuffer = buf;
pointers = (char **)(buf + buf_size - sizeof(int));
diff --git a/apps/plugins/vbrfix.c b/apps/plugins/vbrfix.c
index 0077340ec9..7fb072c656 100644
--- a/apps/plugins/vbrfix.c
+++ b/apps/plugins/vbrfix.c
@@ -20,8 +20,8 @@
static struct plugin_api* rb;
-static char *mp3buf;
-static int mp3buflen;
+static char *audiobuf;
+static int audiobuflen;
static void xingupdate(int percent)
{
@@ -56,14 +56,14 @@ static int insert_data_in_file(char *fname, int fpos, char *buf, int num_bytes)
/* First, copy the initial portion (the ID3 tag) */
if(fpos) {
- readlen = rb->read(orig_fd, mp3buf, fpos);
+ readlen = rb->read(orig_fd, audiobuf, fpos);
if(readlen < 0) {
rb->close(fd);
rb->close(orig_fd);
return 10*readlen - 3;
}
- rc = rb->write(fd, mp3buf, readlen);
+ rc = rb->write(fd, audiobuf, readlen);
if(rc < 0) {
rb->close(fd);
rb->close(orig_fd);
@@ -81,14 +81,14 @@ static int insert_data_in_file(char *fname, int fpos, char *buf, int num_bytes)
/* Copy the file */
do {
- readlen = rb->read(orig_fd, mp3buf, mp3buflen);
+ readlen = rb->read(orig_fd, audiobuf, audiobuflen);
if(readlen < 0) {
rb->close(fd);
rb->close(orig_fd);
return 10*readlen - 7;
}
- rc = rb->write(fd, mp3buf, readlen);
+ rc = rb->write(fd, audiobuf, readlen);
if(rc < 0) {
rb->close(fd);
rb->close(orig_fd);
@@ -193,8 +193,8 @@ static bool vbr_fix(char *selected_file)
and write it to the file */
if(unused_space)
{
- rb->memset(mp3buf, 0, unused_space);
- rc = rb->write(fd, mp3buf, unused_space);
+ rb->memset(audiobuf, 0, unused_space);
+ rc = rb->write(fd, audiobuf, unused_space);
if(rc < 0) {
rb->close(fd);
fileerror(rc);
@@ -230,20 +230,20 @@ static bool vbr_fix(char *selected_file)
DEBUGF("Inserting 4096+%d bytes\n", framelen);
numbytes = 4096 + framelen;
- rb->memset(mp3buf + 0x100000, 0, numbytes);
+ rb->memset(audiobuf + 0x100000, 0, numbytes);
/* Insert the ID3 header */
- rb->memcpy(mp3buf + 0x100000, empty_id3_header,
+ rb->memcpy(audiobuf + 0x100000, empty_id3_header,
sizeof(empty_id3_header));
}
/* Copy the Xing header */
- rb->memcpy(mp3buf + 0x100000 + numbytes - framelen,
+ rb->memcpy(audiobuf + 0x100000 + numbytes - framelen,
xingbuf, framelen);
rc = insert_data_in_file(selected_file,
entry.first_frame_offset,
- mp3buf + 0x100000, numbytes);
+ audiobuf + 0x100000, numbytes);
if(rc < 0) {
fileerror(rc);
@@ -272,7 +272,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void *parameter)
if (!parameter)
return PLUGIN_ERROR;
- mp3buf = rb->plugin_get_mp3_buffer(&mp3buflen);
+ audiobuf = rb->plugin_get_audio_buffer(&audiobuflen);
vbr_fix(parameter);
diff --git a/apps/plugins/video.c b/apps/plugins/video.c
index 0257ad26b7..db371392d5 100644
--- a/apps/plugins/video.c
+++ b/apps/plugins/video.c
@@ -864,7 +864,7 @@ int main(char* filename)
// init buffer
rb->memset(&gBuf, 0, sizeof(gBuf));
gBuf.pOSD = rb->lcd_framebuffer + LCD_WIDTH*7; // last screen line
- gBuf.pBufStart = rb->plugin_get_mp3_buffer(&gBuf.bufsize);
+ gBuf.pBufStart = rb->plugin_get_audio_buffer(&gBuf.bufsize);
//gBuf.bufsize = 1700*1024; // test, like 2MB version!!!!
gBuf.pBufFill = gBuf.pBufStart; // all empty
diff --git a/apps/talk.c b/apps/talk.c
index 2b97629d55..b6e2ec57a1 100644
--- a/apps/talk.c
+++ b/apps/talk.c
@@ -131,7 +131,7 @@ static void load_voicefile(void)
goto load_err;
file_size = filesize(filehandle);
- if (file_size > mp3end - mp3buf) /* won't fit? */
+ if (file_size > audiobufend - audiobuf) /* won't fit? */
goto load_err;
#ifdef HAVE_MMC /* load only the header for now */
@@ -140,17 +140,17 @@ static void load_voicefile(void)
load_size = file_size;
#endif
- got_size = read(filehandle, mp3buf, load_size);
+ got_size = read(filehandle, audiobuf, load_size);
if (got_size == load_size /* success */
- && ((struct voicefile*)mp3buf)->table /* format check */
+ && ((struct voicefile*)audiobuf)->table /* format check */
== offsetof(struct voicefile, index))
{
- p_voicefile = (struct voicefile*)mp3buf;
+ p_voicefile = (struct voicefile*)audiobuf;
/* thumbnail buffer is the remaining space behind */
- p_thumbnail = mp3buf + file_size;
+ p_thumbnail = audiobuf + file_size;
p_thumbnail += (long)p_thumbnail % 2; /* 16-bit align */
- size_for_thumbnail = mp3end - p_thumbnail;
+ size_for_thumbnail = audiobufend - p_thumbnail;
}
else
goto load_err;
@@ -160,7 +160,7 @@ static void load_voicefile(void)
load_size = (p_voicefile->id1_max + p_voicefile->id2_max)
* sizeof(struct clip_entry);
got_size = read(filehandle,
- mp3buf + offsetof(struct voicefile, index), load_size);
+ audiobuf + offsetof(struct voicefile, index), load_size);
if (got_size != load_size) /* read error */
goto load_err;
#else
@@ -356,7 +356,7 @@ static unsigned char* get_clip(long id, long* p_size)
clipsize = p_voicefile->index[id].size;
if (clipsize == 0) /* clip not included in voicefile */
return NULL;
- clipbuf = mp3buf + p_voicefile->index[id].offset;
+ clipbuf = audiobuf + p_voicefile->index[id].offset;
#ifdef HAVE_MMC /* dynamic loading, on demand */
if (!(clipsize & LOADED_MASK))
@@ -383,8 +383,8 @@ static void reset_state(void)
{
queue_write = queue_read = 0; /* reset the queue */
p_voicefile = NULL; /* indicate no voicefile (trashed) */
- p_thumbnail = mp3buf; /* whole space for thumbnail */
- size_for_thumbnail = mp3end - mp3buf;
+ p_thumbnail = audiobuf; /* whole space for thumbnail */
+ size_for_thumbnail = audiobufend - audiobuf;
p_silence = NULL; /* pause clip not accessible */
}