From 145ec81d2f879482fbfe192dcf39350f36bda3d7 Mon Sep 17 00:00:00 2001 From: Steve Bavin Date: Mon, 30 Oct 2006 08:54:48 +0000 Subject: Rearrange and comment variable declarations; no functional change git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11391 a1c6a512-1295-4272-9138-f99709370657 --- apps/playback.c | 159 +++++++++++++++++++++++++------------------------------- 1 file changed, 72 insertions(+), 87 deletions(-) (limited to 'apps') diff --git a/apps/playback.c b/apps/playback.c index feeb61a3ff..53dd05866e 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -154,14 +154,6 @@ enum { #endif #define CODEC_IRAM_SIZE 0xc000 -#ifdef PLAYBACK_VOICE -#ifdef SIMULATOR -static unsigned char sim_iram[CODEC_IRAM_SIZE]; -#undef CODEC_IRAM_ORIGIN -#define CODEC_IRAM_ORIGIN sim_iram -#endif -#endif - #ifndef SIMULATOR extern bool audio_is_initialized; #else @@ -169,87 +161,66 @@ static bool audio_is_initialized = false; #endif +/* Variables are commented with the threads that use them: * + * A=audio, C=codec, V=voice. A suffix of - indicates that * + * the variable is read but not updated on that thread. */ -static struct mutex mutex_codecthread; -static struct event_queue codec_callback_queue; - -static volatile bool audio_codec_loaded; -static volatile bool playing; -static volatile bool paused; - -/* Is file buffer currently being refilled? */ -static volatile bool filling IDATA_ATTR; - -volatile int current_codec IDATA_ATTR; -extern unsigned char codecbuf[]; +/* Main state control */ +static struct event_queue codec_callback_queue; /* Queue for codec callback responses */ +static volatile bool audio_codec_loaded; /* Is codec loaded? (C/A-) */ +static volatile bool playing; /* Is audio playing? (A) */ +static volatile bool paused; /* Is audio paused? (A/C-) */ +static volatile bool filling IDATA_ATTR; /* Is file buffer currently being refilled? (A/C-) */ -/* Ring buffer where tracks and codecs are loaded. */ -static char *filebuf; +/* Ring buffer where tracks and codecs are loaded */ +static char *filebuf; /* Pointer to start of ring buffer (A/C-) */ +size_t filebuflen; /* Total size of the ring buffer FIXME: make static (A/C-)*/ +static volatile size_t buf_ridx IDATA_ATTR; /* Ring buffer read position (A/C) FIXME? should be (C/A-) */ +static volatile size_t buf_widx IDATA_ATTR; /* Ring buffer read position (A/C-) */ -/* Total size of the ring buffer. */ -size_t filebuflen; - -/* Ring buffer read and write indexes. */ -static volatile size_t buf_ridx IDATA_ATTR; -static volatile size_t buf_widx IDATA_ATTR; - -/* Ring buffer arithmetic */ #define RINGBUF_ADD(p,v) ((p+v)=v) ? p-v : p+filebuflen-v) #define RINGBUF_ADD_CROSS(p1,v,p2) ((p1 audio Q_AUDIO_TRACK_CHANGED"); queue_post(&audio_queue, Q_AUDIO_TRACK_CHANGED, 0); } -- cgit v1.2.3