diff options
author | Thomas Martitz <kugel@rockbox.org> | 2010-11-26 18:02:50 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2010-11-26 18:02:50 +0000 |
commit | 9393e4c24b4c18d7fe1fa8313008f30370cb726e (patch) | |
tree | 746e9210b2144c96b6d58a3f858ccdcb358d854e /apps/metadata.h | |
parent | 756c59a534d2e26b0e62fb94a326182f376b8a97 (diff) | |
download | rockbox-9393e4c24b4c18d7fe1fa8313008f30370cb726e.tar.gz rockbox-9393e4c24b4c18d7fe1fa8313008f30370cb726e.zip |
Change how all the metadata parsers are read from a giant swich/case to function pointers via array index. Also unify the api.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28672 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/metadata.h')
-rw-r--r-- | apps/metadata.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/metadata.h b/apps/metadata.h index 39da30e1a5..e2deece727 100644 --- a/apps/metadata.h +++ b/apps/metadata.h | |||
@@ -108,7 +108,6 @@ enum | |||
108 | #define CODEC_EXTENSION "codec" | 108 | #define CODEC_EXTENSION "codec" |
109 | 109 | ||
110 | #ifdef HAVE_RECORDING | 110 | #ifdef HAVE_RECORDING |
111 | #define ENCODER_SUFFIX "_enc" | ||
112 | enum rec_format_indexes | 111 | enum rec_format_indexes |
113 | { | 112 | { |
114 | __REC_FORMAT_START_INDEX = -1, | 113 | __REC_FORMAT_START_INDEX = -1, |
@@ -139,11 +138,11 @@ extern const int rec_format_afmt[REC_NUM_FORMATS]; | |||
139 | /* get AFMT_* corresponding REC_FORMAT_* */ | 138 | /* get AFMT_* corresponding REC_FORMAT_* */ |
140 | extern const int afmt_rec_format[AFMT_NUM_CODECS]; | 139 | extern const int afmt_rec_format[AFMT_NUM_CODECS]; |
141 | 140 | ||
142 | #define AFMT_ENTRY(label, root_fname, enc_root_fname, ext_list) \ | 141 | #define AFMT_ENTRY(label, root_fname, enc_root_fname, func, ext_list) \ |
143 | { label, root_fname, enc_root_fname, ext_list } | 142 | { label, root_fname, enc_root_fname, func, ext_list } |
144 | #else /* !HAVE_RECORDING */ | 143 | #else /* !HAVE_RECORDING */ |
145 | #define AFMT_ENTRY(label, root_fname, enc_root_fname, ext_list) \ | 144 | #define AFMT_ENTRY(label, root_fname, enc_root_fname, func, ext_list) \ |
146 | { label, root_fname, ext_list } | 145 | { label, root_fname, func, ext_list } |
147 | #endif /* HAVE_RECORDING */ | 146 | #endif /* HAVE_RECORDING */ |
148 | 147 | ||
149 | #else /* !SWCODEC */ | 148 | #else /* !SWCODEC */ |
@@ -154,6 +153,7 @@ extern const int afmt_rec_format[AFMT_NUM_CODECS]; | |||
154 | 153 | ||
155 | /** Database of audio formats **/ | 154 | /** Database of audio formats **/ |
156 | /* record describing the audio format */ | 155 | /* record describing the audio format */ |
156 | struct mp3entry; | ||
157 | struct afmt_entry | 157 | struct afmt_entry |
158 | { | 158 | { |
159 | const char *label; /* format label */ | 159 | const char *label; /* format label */ |
@@ -163,7 +163,8 @@ struct afmt_entry | |||
163 | const char *codec_enc_root_fn; /* filename of encoder codec */ | 163 | const char *codec_enc_root_fn; /* filename of encoder codec */ |
164 | #endif | 164 | #endif |
165 | #endif | 165 | #endif |
166 | const char *ext_list; /* double NULL terminated extension | 166 | bool (*parse_func)(int fd, struct mp3entry *id3); /* return true on success */ |
167 | const char *ext_list; /* NULL terminated extension | ||
167 | list for type with the first as | 168 | list for type with the first as |
168 | the default for recording */ | 169 | the default for recording */ |
169 | }; | 170 | }; |