diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugin.c | 52 | ||||
-rw-r--r-- | apps/plugin.h | 70 |
2 files changed, 59 insertions, 63 deletions
diff --git a/apps/plugin.c b/apps/plugin.c index e5a496c567..dc7351de5a 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -124,6 +124,7 @@ static const struct plugin_api rockbox_api = { | |||
124 | #endif | 124 | #endif |
125 | backlight_on, | 125 | backlight_on, |
126 | backlight_off, | 126 | backlight_off, |
127 | splash, | ||
127 | 128 | ||
128 | /* button */ | 129 | /* button */ |
129 | button_get, | 130 | button_get, |
@@ -145,6 +146,9 @@ static const struct plugin_api rockbox_api = { | |||
145 | fprintf, | 146 | fprintf, |
146 | read_line, | 147 | read_line, |
147 | settings_parseline, | 148 | settings_parseline, |
149 | #ifndef SIMULATOR | ||
150 | ata_sleep, | ||
151 | #endif | ||
148 | 152 | ||
149 | /* dir */ | 153 | /* dir */ |
150 | PREFIX(opendir), | 154 | PREFIX(opendir), |
@@ -159,6 +163,7 @@ static const struct plugin_api rockbox_api = { | |||
159 | default_event_handler, | 163 | default_event_handler, |
160 | create_thread, | 164 | create_thread, |
161 | remove_thread, | 165 | remove_thread, |
166 | reset_poweroff_timer, | ||
162 | 167 | ||
163 | /* strings and memory */ | 168 | /* strings and memory */ |
164 | snprintf, | 169 | snprintf, |
@@ -173,6 +178,7 @@ static const struct plugin_api rockbox_api = { | |||
173 | #ifndef SIMULATOR | 178 | #ifndef SIMULATOR |
174 | _ctype_, | 179 | _ctype_, |
175 | #endif | 180 | #endif |
181 | atoi, | ||
176 | 182 | ||
177 | /* sound */ | 183 | /* sound */ |
178 | mpeg_sound_set, | 184 | mpeg_sound_set, |
@@ -182,9 +188,6 @@ static const struct plugin_api rockbox_api = { | |||
182 | mp3_play_stop, | 188 | mp3_play_stop, |
183 | mp3_is_playing, | 189 | mp3_is_playing, |
184 | bitswap, | 190 | bitswap, |
185 | #ifdef HAVE_MAS3587F | ||
186 | mas_codec_readreg, | ||
187 | #endif | ||
188 | #endif | 191 | #endif |
189 | 192 | ||
190 | /* playback control */ | 193 | /* playback control */ |
@@ -199,16 +202,27 @@ static const struct plugin_api rockbox_api = { | |||
199 | playlist_amount, | 202 | playlist_amount, |
200 | mpeg_status, | 203 | mpeg_status, |
201 | mpeg_has_changed_track, | 204 | mpeg_has_changed_track, |
205 | mpeg_current_track, | ||
206 | |||
207 | /* MAS communication */ | ||
208 | #ifndef SIMULATOR | ||
209 | mas_readmem, | ||
210 | mas_writemem, | ||
211 | mas_readreg, | ||
212 | mas_writereg, | ||
213 | #ifdef HAVE_MAS3587F | ||
214 | mas_codec_writereg, | ||
215 | mas_codec_readreg, | ||
216 | #endif | ||
217 | #endif | ||
202 | 218 | ||
203 | /* misc */ | 219 | /* misc */ |
204 | srand, | 220 | srand, |
205 | rand, | 221 | rand, |
206 | splash, | ||
207 | (qsort_func)qsort, | 222 | (qsort_func)qsort, |
208 | kbd_input, | 223 | kbd_input, |
209 | mpeg_current_track, | ||
210 | atoi, | ||
211 | get_time, | 224 | get_time, |
225 | set_time, | ||
212 | plugin_get_buffer, | 226 | plugin_get_buffer, |
213 | plugin_get_mp3_buffer, | 227 | plugin_get_mp3_buffer, |
214 | #ifndef SIMULATOR | 228 | #ifndef SIMULATOR |
@@ -216,34 +230,18 @@ static const struct plugin_api rockbox_api = { | |||
216 | plugin_unregister_timer, | 230 | plugin_unregister_timer, |
217 | #endif | 231 | #endif |
218 | plugin_tsr, | 232 | plugin_tsr, |
219 | |||
220 | /* new stuff at the end, sort into place next time the API gets incompatible */ | ||
221 | |||
222 | |||
223 | &global_settings, | ||
224 | backlight_set_timeout, | ||
225 | #ifndef SIMULATOR | ||
226 | ata_sleep, | ||
227 | #endif | ||
228 | #if defined(DEBUG) || defined(SIMULATOR) | 233 | #if defined(DEBUG) || defined(SIMULATOR) |
229 | debugf, | 234 | debugf, |
230 | #endif | 235 | #endif |
236 | &global_settings, | ||
237 | backlight_set_timeout, | ||
231 | mp3info, | 238 | mp3info, |
232 | count_mp3_frames, | 239 | count_mp3_frames, |
233 | create_xing_header, | 240 | create_xing_header, |
234 | |||
235 | #ifndef SIMULATOR | ||
236 | mas_readmem, | ||
237 | mas_writemem, | ||
238 | mas_readreg, | ||
239 | mas_writereg, | ||
240 | #ifdef HAVE_MAS3587F | ||
241 | mas_codec_writereg, | ||
242 | #endif | ||
243 | #endif | ||
244 | battery_level, | 241 | battery_level, |
245 | set_time, | 242 | |
246 | reset_poweroff_timer, | 243 | /* new stuff at the end, sort into place next time |
244 | the API gets incompatible */ | ||
247 | 245 | ||
248 | }; | 246 | }; |
249 | 247 | ||
diff --git a/apps/plugin.h b/apps/plugin.h index 51607a53e6..dc8a273c99 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -152,6 +152,7 @@ struct plugin_api { | |||
152 | #endif | 152 | #endif |
153 | void (*backlight_on)(void); | 153 | void (*backlight_on)(void); |
154 | void (*backlight_off)(void); | 154 | void (*backlight_off)(void); |
155 | void (*splash)(int ticks, bool center, char *fmt, ...); | ||
155 | 156 | ||
156 | /* button */ | 157 | /* button */ |
157 | int (*button_get)(bool block); | 158 | int (*button_get)(bool block); |
@@ -173,6 +174,9 @@ struct plugin_api { | |||
173 | int (*fprintf)(int fd, const char *fmt, ...); | 174 | int (*fprintf)(int fd, const char *fmt, ...); |
174 | int (*read_line)(int fd, char* buffer, int buffer_size); | 175 | int (*read_line)(int fd, char* buffer, int buffer_size); |
175 | bool (*settings_parseline)(char* line, char** name, char** value); | 176 | bool (*settings_parseline)(char* line, char** name, char** value); |
177 | #ifndef SIMULATOR | ||
178 | int (*ata_sleep)(void); | ||
179 | #endif | ||
176 | 180 | ||
177 | /* dir */ | 181 | /* dir */ |
178 | DIR* (*opendir)(const char* name); | 182 | DIR* (*opendir)(const char* name); |
@@ -187,6 +191,7 @@ struct plugin_api { | |||
187 | int (*default_event_handler)(int event); | 191 | int (*default_event_handler)(int event); |
188 | int (*create_thread)(void* function, void* stack, int stack_size, char *name); | 192 | int (*create_thread)(void* function, void* stack, int stack_size, char *name); |
189 | void (*remove_thread)(int threadnum); | 193 | void (*remove_thread)(int threadnum); |
194 | void (*reset_poweroff_timer)(void); | ||
190 | 195 | ||
191 | /* strings and memory */ | 196 | /* strings and memory */ |
192 | int (*snprintf)(char *buf, size_t size, const char *fmt, ...); | 197 | int (*snprintf)(char *buf, size_t size, const char *fmt, ...); |
@@ -201,6 +206,7 @@ struct plugin_api { | |||
201 | #ifndef SIMULATOR | 206 | #ifndef SIMULATOR |
202 | const char *_ctype_; | 207 | const char *_ctype_; |
203 | #endif | 208 | #endif |
209 | int (*atoi)(const char *str); | ||
204 | 210 | ||
205 | /* sound */ | 211 | /* sound */ |
206 | void (*mpeg_sound_set)(int setting, int value); | 212 | void (*mpeg_sound_set)(int setting, int value); |
@@ -210,9 +216,6 @@ struct plugin_api { | |||
210 | void (*mp3_play_stop)(void); | 216 | void (*mp3_play_stop)(void); |
211 | bool (*mp3_is_playing)(void); | 217 | bool (*mp3_is_playing)(void); |
212 | void (*bitswap)(unsigned char *data, int length); | 218 | void (*bitswap)(unsigned char *data, int length); |
213 | #ifdef HAVE_MAS3587F | ||
214 | int (*mas_codec_readreg)(int reg); | ||
215 | #endif | ||
216 | #endif | 219 | #endif |
217 | 220 | ||
218 | /* playback control */ | 221 | /* playback control */ |
@@ -227,17 +230,28 @@ struct plugin_api { | |||
227 | int (*playlist_amount)(void); | 230 | int (*playlist_amount)(void); |
228 | int (*mpeg_status)(void); | 231 | int (*mpeg_status)(void); |
229 | bool (*mpeg_has_changed_track)(void); | 232 | bool (*mpeg_has_changed_track)(void); |
233 | struct mp3entry* (*mpeg_current_track)(void); | ||
234 | |||
235 | /* MAS communication */ | ||
236 | #ifndef SIMULATOR | ||
237 | int (*mas_readmem)(int bank, int addr, unsigned long* dest, int len); | ||
238 | int (*mas_writemem)(int bank, int addr, unsigned long* src, int len); | ||
239 | int (*mas_readreg)(int reg); | ||
240 | int (*mas_writereg)(int reg, unsigned int val); | ||
241 | #ifdef HAVE_MAS3587F | ||
242 | int (*mas_codec_writereg)(int reg, unsigned int val); | ||
243 | int (*mas_codec_readreg)(int reg); | ||
244 | #endif | ||
245 | #endif | ||
230 | 246 | ||
231 | /* misc */ | 247 | /* misc */ |
232 | void (*srand)(unsigned int seed); | 248 | void (*srand)(unsigned int seed); |
233 | int (*rand)(void); | 249 | int (*rand)(void); |
234 | void (*splash)(int ticks, bool center, char *fmt, ...); | ||
235 | void (*qsort)(void *base, size_t nmemb, size_t size, | 250 | void (*qsort)(void *base, size_t nmemb, size_t size, |
236 | int(*compar)(const void *, const void *)); | 251 | int(*compar)(const void *, const void *)); |
237 | int (*kbd_input)(char* buffer, int buflen); | 252 | int (*kbd_input)(char* buffer, int buflen); |
238 | struct mp3entry* (*mpeg_current_track)(void); | ||
239 | int (*atoi)(const char *str); | ||
240 | struct tm* (*get_time)(void); | 253 | struct tm* (*get_time)(void); |
254 | int (*set_time)(struct tm *tm); | ||
241 | void* (*plugin_get_buffer)(int* buffer_size); | 255 | void* (*plugin_get_buffer)(int* buffer_size); |
242 | void* (*plugin_get_mp3_buffer)(int* buffer_size); | 256 | void* (*plugin_get_mp3_buffer)(int* buffer_size); |
243 | #ifndef SIMULATOR | 257 | #ifndef SIMULATOR |
@@ -245,39 +259,23 @@ struct plugin_api { | |||
245 | void (*plugin_unregister_timer)(void); | 259 | void (*plugin_unregister_timer)(void); |
246 | #endif | 260 | #endif |
247 | void (*plugin_tsr)(void (*exit_callback)(void)); | 261 | void (*plugin_tsr)(void (*exit_callback)(void)); |
248 | |||
249 | /* new stuff, sort in next time the API gets broken! */ | ||
250 | |||
251 | struct user_settings* global_settings; | ||
252 | void (*backlight_set_timeout)(int index); | ||
253 | #ifndef SIMULATOR | ||
254 | int (*ata_sleep)(void); | ||
255 | #endif | ||
256 | |||
257 | |||
258 | #if defined(DEBUG) || defined(SIMULATOR) | 262 | #if defined(DEBUG) || defined(SIMULATOR) |
259 | void (*debugf)(char *fmt, ...); | 263 | void (*debugf)(char *fmt, ...); |
260 | #endif | ||
261 | bool (*mp3info)(struct mp3entry *entry, char *filename, bool v1first); | ||
262 | int (*count_mp3_frames)(int fd, int startpos, int filesize, | ||
263 | void (*progressfunc)(int)); | ||
264 | int (*create_xing_header)(int fd, int startpos, int filesize, | ||
265 | unsigned char *buf, int num_frames, | ||
266 | unsigned long header_template, | ||
267 | void (*progressfunc)(int), bool generate_toc); | ||
268 | |||
269 | #ifndef SIMULATOR | ||
270 | int (*mas_readmem)(int bank, int addr, unsigned long* dest, int len); | ||
271 | int (*mas_writemem)(int bank, int addr, unsigned long* src, int len); | ||
272 | int (*mas_readreg)(int reg); | ||
273 | int (*mas_writereg)(int reg, unsigned int val); | ||
274 | #ifdef HAVE_MAS3587F | ||
275 | int (*mas_codec_writereg)(int reg, unsigned int val); | ||
276 | #endif | ||
277 | #endif | 264 | #endif |
265 | struct user_settings* global_settings; | ||
266 | void (*backlight_set_timeout)(int index); | ||
267 | bool (*mp3info)(struct mp3entry *entry, char *filename, bool v1first); | ||
268 | int (*count_mp3_frames)(int fd, int startpos, int filesize, | ||
269 | void (*progressfunc)(int)); | ||
270 | int (*create_xing_header)(int fd, int startpos, int filesize, | ||
271 | unsigned char *buf, int num_frames, | ||
272 | unsigned long header_template, | ||
273 | void (*progressfunc)(int), bool generate_toc); | ||
278 | int (*battery_level)(void); | 274 | int (*battery_level)(void); |
279 | int (*set_time)(struct tm *tm); | 275 | |
280 | void (*reset_poweroff_timer)(void); | 276 | /* new stuff at the end, sort into place next time |
277 | the API gets incompatible */ | ||
278 | |||
281 | 279 | ||
282 | }; | 280 | }; |
283 | 281 | ||