summaryrefslogtreecommitdiff
path: root/apps/plugin.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugin.h')
-rw-r--r--apps/plugin.h170
1 files changed, 79 insertions, 91 deletions
diff --git a/apps/plugin.h b/apps/plugin.h
index 164a2c9847..30c04ce76c 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -119,12 +119,12 @@
119#define PLUGIN_MAGIC 0x526F634B /* RocK */ 119#define PLUGIN_MAGIC 0x526F634B /* RocK */
120 120
121/* increase this every time the api struct changes */ 121/* increase this every time the api struct changes */
122#define PLUGIN_API_VERSION 99 122#define PLUGIN_API_VERSION 100
123 123
124/* update this to latest version if a change to the api struct breaks 124/* update this to latest version if a change to the api struct breaks
125 backwards compatibility (and please take the opportunity to sort in any 125 backwards compatibility (and please take the opportunity to sort in any
126 new function which are "waiting" at the end of the function table) */ 126 new function which are "waiting" at the end of the function table) */
127#define PLUGIN_MIN_API_VERSION 98 127#define PLUGIN_MIN_API_VERSION 100
128 128
129/* plugin return codes */ 129/* plugin return codes */
130enum plugin_status { 130enum plugin_status {
@@ -144,6 +144,7 @@ struct plugin_api {
144 /* lcd */ 144 /* lcd */
145 void (*lcd_set_contrast)(int x); 145 void (*lcd_set_contrast)(int x);
146 void (*lcd_update)(void); 146 void (*lcd_update)(void);
147 void (*lcd_update_rect)(int x, int y, int width, int height);
147 void (*lcd_clear_display)(void); 148 void (*lcd_clear_display)(void);
148 void (*lcd_setmargins)(int x, int y); 149 void (*lcd_setmargins)(int x, int y);
149 int (*lcd_getstringsize)(const unsigned char *str, int *w, int *h); 150 int (*lcd_getstringsize)(const unsigned char *str, int *w, int *h);
@@ -160,7 +161,8 @@ struct plugin_api {
160 void (*lcd_remove_cursor)(void); 161 void (*lcd_remove_cursor)(void);
161 void (*lcd_icon)(int icon, bool enable); 162 void (*lcd_icon)(int icon, bool enable);
162 void (*lcd_double_height)(bool on); 163 void (*lcd_double_height)(bool on);
163#else 164#else /* HAVE_LCD_BITMAP */
165 fb_data* lcd_framebuffer;
164 void (*lcd_set_drawmode)(int mode); 166 void (*lcd_set_drawmode)(int mode);
165 int (*lcd_get_drawmode)(void); 167 int (*lcd_get_drawmode)(void);
166 void (*lcd_setfont)(int font); 168 void (*lcd_setfont)(int font);
@@ -192,28 +194,40 @@ struct plugin_api {
192 int x, int y, int width, int height); 194 int x, int y, int width, int height);
193 void (*lcd_bitmap_transparent)(const fb_data *src, int x, int y, 195 void (*lcd_bitmap_transparent)(const fb_data *src, int x, int y,
194 int width, int height); 196 int width, int height);
197 void (*lcd_blit_yuv)(unsigned char * const src[3],
198 int src_x, int src_y, int stride,
199 int x, int y, int width, int height);
200#if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200) \
201 || defined (IRIVER_H10)
202 void (*lcd_yuv_set_options)(unsigned options);
195#endif 203#endif
196 unsigned short *(*bidi_l2v)( const unsigned char *str, int orientation ); 204#elif (LCD_DEPTH < 4) || !defined(SIMULATOR)
197 const unsigned char *(*font_get_bits)( struct font *pf, unsigned short char_code ); 205 void (*lcd_blit_mono)(const unsigned char *data, int x, int by, int width,
198 struct font* (*font_load)(const char *path); 206 int bheight, int stride);
207 void (*lcd_blit_grey_phase)(unsigned char *values, unsigned char *phases,
208 int bx, int by, int bwidth, int bheight,
209 int stride);
210#endif /* LCD_DEPTH */
199 void (*lcd_puts_style)(int x, int y, const unsigned char *str, int style); 211 void (*lcd_puts_style)(int x, int y, const unsigned char *str, int style);
200 void (*lcd_puts_scroll_style)(int x, int y, const unsigned char* string, 212 void (*lcd_puts_scroll_style)(int x, int y, const unsigned char* string,
201 int style); 213 int style);
202 fb_data* lcd_framebuffer; 214
203 void (*lcd_blit) (const fb_data* data, int x, int by, int width, 215 unsigned short *(*bidi_l2v)( const unsigned char *str, int orientation );
204 int bheight, int stride); 216 const unsigned char *(*font_get_bits)( struct font *pf, unsigned short char_code );
205 void (*lcd_update_rect)(int x, int y, int width, int height); 217 struct font* (*font_load)(const char *path);
206 void (*gui_scrollbar_draw)(struct screen * screen, int x, int y,
207 int width, int height, int items,
208 int min_shown, int max_shown,
209 unsigned flags);
210 struct font* (*font_get)(int font); 218 struct font* (*font_get)(int font);
211 int (*font_getstringsize)(const unsigned char *str, int *w, int *h, 219 int (*font_getstringsize)(const unsigned char *str, int *w, int *h,
212 int fontnumber); 220 int fontnumber);
213 int (*font_get_width)(struct font* pf, unsigned short char_code); 221 int (*font_get_width)(struct font* pf, unsigned short char_code);
214 void (*screen_clear_area)(struct screen * display, int xstart, int ystart, 222 void (*screen_clear_area)(struct screen * display, int xstart, int ystart,
215 int width, int height); 223 int width, int height);
216#endif 224 void (*gui_scrollbar_draw)(struct screen * screen, int x, int y,
225 int width, int height, int items,
226 int min_shown, int max_shown,
227 unsigned flags);
228#endif /* HAVE_LCD_BITMAP */
229
230 /* backlight */
217 void (*backlight_on)(void); 231 void (*backlight_on)(void);
218 void (*backlight_off)(void); 232 void (*backlight_off)(void);
219 void (*backlight_set_timeout)(int index); 233 void (*backlight_set_timeout)(int index);
@@ -255,7 +269,11 @@ struct plugin_api {
255 269
256 void (*remote_backlight_on)(void); 270 void (*remote_backlight_on)(void);
257 void (*remote_backlight_off)(void); 271 void (*remote_backlight_off)(void);
272 void (*remote_backlight_set_timeout)(int index);
273#if CONFIG_CHARGING
274 void (*remote_backlight_set_timeout_plugged)(int index);
258#endif 275#endif
276#endif /* HAVE_REMOTE_LCD */
259 struct screen* screens[NB_SCREENS]; 277 struct screen* screens[NB_SCREENS];
260#if defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1) 278#if defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1)
261 void (*lcd_remote_set_foreground)(unsigned foreground); 279 void (*lcd_remote_set_foreground)(unsigned foreground);
@@ -267,22 +285,6 @@ struct plugin_api {
267 void (*lcd_remote_bitmap)(const fb_remote_data *src, int x, int y, int width, 285 void (*lcd_remote_bitmap)(const fb_remote_data *src, int x, int y, int width,
268 int height); 286 int height);
269#endif 287#endif
270#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4) && !defined(SIMULATOR)
271 void (*lcd_grey_phase_blit)(unsigned char *values, unsigned char *phases,
272 int bx, int by, int bwidth, int bheight,
273 int stride);
274#endif
275#if defined(HAVE_LCD_COLOR)
276 void (*lcd_yuv_blit)(unsigned char * const src[3],
277 int src_x, int src_y, int stride,
278 int x, int y, int width, int height);
279#endif
280
281#if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200) \
282 || defined (IRIVER_H10)
283 void (*lcd_yuv_set_options)(unsigned options);
284#endif
285
286 /* list */ 288 /* list */
287 void (*gui_synclist_init)(struct gui_synclist * lists, 289 void (*gui_synclist_init)(struct gui_synclist * lists,
288 list_get_name callback_get_item_name,void * data, 290 list_get_name callback_get_item_name,void * data,
@@ -329,11 +331,14 @@ struct plugin_api {
329 void (*ata_sleep)(void); 331 void (*ata_sleep)(void);
330 bool (*ata_disk_is_active)(void); 332 bool (*ata_disk_is_active)(void);
331#endif 333#endif
334 void (*ata_spin)(void);
332 void (*ata_spindown)(int seconds); 335 void (*ata_spindown)(int seconds);
333 void (*reload_directory)(void); 336 void (*reload_directory)(void);
334 char *(*create_numbered_filename)(char *buffer, const char *path, 337 char *(*create_numbered_filename)(char *buffer, const char *path,
335 const char *prefix, const char *suffix, 338 const char *prefix, const char *suffix,
336 int numberlen IF_CNFN_NUM_(, int *num)); 339 int numberlen IF_CNFN_NUM_(, int *num));
340 bool (*file_exists)(const char *file);
341
337 342
338 /* dir */ 343 /* dir */
339 DIR* (*opendir)(const char* name); 344 DIR* (*opendir)(const char* name);
@@ -341,6 +346,7 @@ struct plugin_api {
341 struct dirent* (*readdir)(DIR* dir); 346 struct dirent* (*readdir)(DIR* dir);
342 int (*mkdir)(const char *name); 347 int (*mkdir)(const char *name);
343 int (*rmdir)(const char *name); 348 int (*rmdir)(const char *name);
349 bool (*dir_exists)(const char *path);
344 350
345 /* kernel/ system */ 351 /* kernel/ system */
346 void (*PREFIX(sleep))(int ticks); 352 void (*PREFIX(sleep))(int ticks);
@@ -358,6 +364,14 @@ struct plugin_api {
358 IF_PRIO(, int priority) 364 IF_PRIO(, int priority)
359 IF_COP(, unsigned int core)); 365 IF_COP(, unsigned int core));
360 void (*remove_thread)(struct thread_entry *thread); 366 void (*remove_thread)(struct thread_entry *thread);
367 void (*thread_wait)(struct thread_entry *thread);
368#if CONFIG_CODEC == SWCODEC
369 void (*mutex_init)(struct mutex *m);
370 void (*mutex_lock)(struct mutex *m);
371 void (*mutex_unlock)(struct mutex *m);
372 size_t (*align_buffer)(void **start, size_t size, size_t align);
373#endif
374
361 void (*reset_poweroff_timer)(void); 375 void (*reset_poweroff_timer)(void);
362#ifndef SIMULATOR 376#ifndef SIMULATOR
363 int (*system_memory_guard)(int newmode); 377 int (*system_memory_guard)(int newmode);
@@ -368,7 +382,15 @@ struct plugin_api {
368#else 382#else
369 void (*cpu_boost)(bool on_off); 383 void (*cpu_boost)(bool on_off);
370#endif 384#endif
385#endif /* HAVE_ADJUSTABLE_CPU_FREQ */
386#endif /* !SIMULATOR */
387#ifdef HAVE_SCHEDULER_BOOSTCTRL
388 void (*trigger_cpu_boost)(void);
389 void (*cancel_cpu_boost)(void);
371#endif 390#endif
391#ifdef CACHE_FUNCTIONS_AS_CALL
392 void (*flush_icache)(void);
393 void (*invalidate_icache)(void);
372#endif 394#endif
373 bool (*timer_register)(int reg_prio, void (*unregister_callback)(void), 395 bool (*timer_register)(int reg_prio, void (*unregister_callback)(void),
374 long cycles, int int_prio, 396 long cycles, int int_prio,
@@ -381,6 +403,16 @@ struct plugin_api {
381 void (*queue_post)(struct event_queue *q, long id, intptr_t data); 403 void (*queue_post)(struct event_queue *q, long id, intptr_t data);
382 void (*queue_wait_w_tmo)(struct event_queue *q, struct queue_event *ev, 404 void (*queue_wait_w_tmo)(struct event_queue *q, struct queue_event *ev,
383 int ticks); 405 int ticks);
406#if CONFIG_CODEC == SWCODEC
407 void (*queue_enable_queue_send)(struct event_queue *q,
408 struct queue_sender_list *send);
409 bool (*queue_empty)(const struct event_queue *q);
410 void (*queue_wait)(struct event_queue *q, struct queue_event *ev);
411 intptr_t (*queue_send)(struct event_queue *q, long id,
412 intptr_t data);
413 void (*queue_reply)(struct event_queue *q, intptr_t retval);
414#endif /* CONFIG_CODEC == SWCODEC */
415
384 void (*usb_acknowledge)(long id); 416 void (*usb_acknowledge)(long id);
385#ifdef RB_PROFILE 417#ifdef RB_PROFILE
386 void (*profile_thread)(void); 418 void (*profile_thread)(void);
@@ -430,12 +462,12 @@ struct plugin_api {
430 int (*utf8seek)(const unsigned char* utf8, int offset); 462 int (*utf8seek)(const unsigned char* utf8, int offset);
431 463
432 /* sound */ 464 /* sound */
433#if CONFIG_CODEC == SWCODEC
434 int (*sound_default)(int setting);
435#endif
436 void (*sound_set)(int setting, int value); 465 void (*sound_set)(int setting, int value);
466 int (*sound_default)(int setting);
437 int (*sound_min)(int setting); 467 int (*sound_min)(int setting);
438 int (*sound_max)(int setting); 468 int (*sound_max)(int setting);
469 const char * (*sound_unit)(int setting);
470 int (*sound_val2phys)(int setting, int value);
439#ifndef SIMULATOR 471#ifndef SIMULATOR
440 void (*mp3_play_data)(const unsigned char* start, int size, void (*get_more)(unsigned char** start, size_t* size)); 472 void (*mp3_play_data)(const unsigned char* start, int size, void (*get_more)(unsigned char** start, size_t* size));
441 void (*mp3_play_pause)(bool play); 473 void (*mp3_play_pause)(bool play);
@@ -458,6 +490,8 @@ struct plugin_api {
458 void (*pcm_play_pause)(bool play); 490 void (*pcm_play_pause)(bool play);
459 size_t (*pcm_get_bytes_waiting)(void); 491 size_t (*pcm_get_bytes_waiting)(void);
460 void (*pcm_calculate_peaks)(int *left, int *right); 492 void (*pcm_calculate_peaks)(int *left, int *right);
493 void (*pcm_play_lock)(void);
494 void (*pcm_play_unlock)(void);
461#ifdef HAVE_RECORDING 495#ifdef HAVE_RECORDING
462 const unsigned long *rec_freq_sampr; 496 const unsigned long *rec_freq_sampr;
463 void (*pcm_init_recording)(void); 497 void (*pcm_init_recording)(void);
@@ -473,6 +507,13 @@ struct plugin_api {
473 void (*audio_set_output_source)(int monitor); 507 void (*audio_set_output_source)(int monitor);
474 void (*audio_set_input_source)(int source, unsigned flags); 508 void (*audio_set_input_source)(int source, unsigned flags);
475#endif 509#endif
510 void (*dsp_set_crossfeed)(bool enable);
511 void (*dsp_set_eq)(bool enable);
512 void (*dsp_dither_enable)(bool enable);
513 intptr_t (*dsp_configure)(struct dsp_config *dsp, int setting,
514 intptr_t value);
515 int (*dsp_process)(struct dsp_config *dsp, char *dest,
516 const char *src[], int count);
476#endif /* CONFIG_CODEC == SWCODC */ 517#endif /* CONFIG_CODEC == SWCODC */
477 518
478 /* playback control */ 519 /* playback control */
@@ -638,37 +679,8 @@ struct plugin_api {
638 679
639 void (*led)(bool on); 680 void (*led)(bool on);
640 681
641#ifdef CACHE_FUNCTIONS_AS_CALL
642 void (*flush_icache)(void);
643 void (*invalidate_icache)(void);
644#endif
645
646 /* new stuff at the end, sort into place next time
647 the API gets incompatible */
648
649#if (CONFIG_CODEC == SWCODEC)
650 void (*mutex_init)(struct mutex *m);
651 void (*mutex_lock)(struct mutex *m);
652 void (*mutex_unlock)(struct mutex *m);
653#endif
654
655 void (*thread_wait)(struct thread_entry *thread);
656
657#if (CONFIG_CODEC == SWCODEC)
658 size_t (*align_buffer)(void **start, size_t size, size_t align);
659#endif
660
661 bool (*file_exists)(const char *file);
662 bool (*dir_exists)(const char *path);
663
664#ifdef HAVE_REMOTE_LCD
665 void (*remote_backlight_set_timeout)(int index);
666#if CONFIG_CHARGING
667 void (*remote_backlight_set_timeout_plugged)(int index);
668#endif
669#endif /* HAVE_REMOTE_LCD */
670
671#if (CONFIG_CODEC == SWCODEC) 682#if (CONFIG_CODEC == SWCODEC)
683 /* buffering API */
672 int (*bufopen)(const char *file, size_t offset, enum data_type type); 684 int (*bufopen)(const char *file, size_t offset, enum data_type type);
673 int (*bufalloc)(const void *src, size_t size, enum data_type type); 685 int (*bufalloc)(const void *src, size_t size, enum data_type type);
674 bool (*bufclose)(int handle_id); 686 bool (*bufclose)(int handle_id);
@@ -704,33 +716,9 @@ struct plugin_api {
704 char *buf, int buflen); 716 char *buf, int buflen);
705#endif 717#endif
706 718
707#if CONFIG_CODEC == SWCODEC 719 /* new stuff at the end, sort into place next time
708 void (*pcm_play_lock)(void); 720 the API gets incompatible */
709 void (*pcm_play_unlock)(void); 721
710 void (*queue_enable_queue_send)(struct event_queue *q,
711 struct queue_sender_list *send);
712 bool (*queue_empty)(const struct event_queue *q);
713 void (*queue_wait)(struct event_queue *q, struct queue_event *ev);
714 intptr_t (*queue_send)(struct event_queue *q, long id,
715 intptr_t data);
716 void (*queue_reply)(struct event_queue *q, intptr_t retval);
717#ifndef HAVE_FLASH_STORAGE
718 void (*ata_spin)(void);
719#endif
720#ifdef HAVE_SCHEDULER_BOOSTCTRL
721 void (*trigger_cpu_boost)(void);
722 void (*cancel_cpu_boost)(void);
723#endif
724 const char * (*sound_unit)(int setting);
725 int (*sound_val2phys)(int setting, int value);
726 void (*dsp_set_crossfeed)(bool enable);
727 void (*dsp_set_eq)(bool enable);
728 void (*dsp_dither_enable)(bool enable);
729 intptr_t (*dsp_configure)(struct dsp_config *dsp, int setting,
730 intptr_t value);
731 int (*dsp_process)(struct dsp_config *dsp, char *dest,
732 const char *src[], int count);
733#endif /* CONFIG_CODEC == SWCODEC */
734}; 722};
735 723
736/* plugin header */ 724/* plugin header */