From 4d34457cd0a1958ff271bb2d87bfdba1432b678e Mon Sep 17 00:00:00 2001 From: Steve Bavin Date: Tue, 2 Oct 2007 07:47:43 +0000 Subject: [PATCH] Thanks to Nico_P, struct track_info can now be internal to playback.c git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14947 a1c6a512-1295-4272-9138-f99709370657 --- apps/playback.c | 17 +++++++++++++++++ apps/playback.h | 17 ----------------- apps/plugins/test_codec.c | 7 ++++++- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/apps/playback.c b/apps/playback.c index c58c5a6bf2..b80c68384f 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -222,6 +222,23 @@ static int buffer_state = BUFFER_STATE_TRASHED; /* Buffer state */ #define FILEBUFUSED RINGBUF_SUB(buf_widx, buf_ridx) /* Track info structure about songs in the file buffer (A/C-) */ +struct track_info { + struct mp3entry id3; /* TAG metadata */ + char *codecbuf; /* Pointer to codec buffer */ + size_t codecsize; /* Codec length in bytes */ + bool has_codec; /* Does this track have a codec on the buffer */ + + size_t buf_idx; /* Pointer to the track's buffer */ + size_t filerem; /* Remaining bytes of file NOT in buffer */ + size_t filesize; /* File total length */ + size_t start_pos; /* Position to first bytes of file in buffer */ + volatile size_t available; /* Available bytes to read from buffer */ + + bool taginfo_ready; /* Is metadata read */ + + bool event_sent; /* Was this track's buffered event sent */ +}; + static struct track_info tracks[MAX_TRACK]; static volatile int track_ridx = 0; /* Track being decoded (A/C-) */ static int track_widx = 0; /* Track being buffered (A) */ diff --git a/apps/playback.h b/apps/playback.h index ac3adc4d3e..43cdd5972f 100644 --- a/apps/playback.h +++ b/apps/playback.h @@ -39,23 +39,6 @@ #define MAX_TRACK_MASK (MAX_TRACK-1) -struct track_info { - struct mp3entry id3; /* TAG metadata */ - char *codecbuf; /* Pointer to codec buffer */ - size_t codecsize; /* Codec length in bytes */ - bool has_codec; /* Does this track have a codec on the buffer */ - - size_t buf_idx; /* Pointer to the track's buffer */ - size_t filerem; /* Remaining bytes of file NOT in buffer */ - size_t filesize; /* File total length */ - size_t start_pos; /* Position to first bytes of file in buffer */ - volatile size_t available; /* Available bytes to read from buffer */ - - bool taginfo_ready; /* Is metadata read */ - - bool event_sent; /* Was this track's buffered event sent */ -}; - /* Functions */ const char * get_codec_filename(int cod_spec); void audio_set_track_changed_event(void (*handler)(struct mp3entry *id3)); diff --git a/apps/plugins/test_codec.c b/apps/plugins/test_codec.c index 4e671094c8..01166cc025 100644 --- a/apps/plugins/test_codec.c +++ b/apps/plugins/test_codec.c @@ -94,7 +94,12 @@ static char str[MAX_PATH]; /* Our local implementation of the codec API */ static struct codec_api ci; -static struct track_info track; +struct test_track_info { + struct mp3entry id3; /* TAG metadata */ + size_t filesize; /* File total length */ +}; + +static struct test_track_info track; static bool taginfo_ready = true; static volatile unsigned int elapsed;