2003-06-29 16:33:04 +00:00
|
|
|
|
/***************************************************************************
|
|
|
|
|
* __________ __ ___.
|
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
|
* $Id$
|
|
|
|
|
*
|
2006-07-02 12:28:27 +00:00
|
|
|
|
* Copyright (C) 2002 Bj<EFBFBD>rn Stenberg
|
2003-06-29 16:33:04 +00:00
|
|
|
|
*
|
|
|
|
|
* All files in this archive are subject to the GNU General Public License.
|
|
|
|
|
* See the file COPYING in the source tree root for full license agreement.
|
|
|
|
|
*
|
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
|
* KIND, either express or implied.
|
|
|
|
|
*
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
#ifndef _PLUGIN_H_
|
|
|
|
|
#define _PLUGIN_H_
|
|
|
|
|
|
|
|
|
|
/* instruct simulator code to not redefine any symbols when compiling plugins.
|
|
|
|
|
(the PLUGIN macro is defined in apps/plugins/Makefile) */
|
|
|
|
|
#ifdef PLUGIN
|
|
|
|
|
#define NO_REDEFINES_PLEASE
|
|
|
|
|
#endif
|
|
|
|
|
|
2003-07-13 22:15:19 +00:00
|
|
|
|
#ifndef MEM
|
|
|
|
|
#define MEM 2
|
|
|
|
|
#endif
|
|
|
|
|
|
2007-04-10 14:18:30 +00:00
|
|
|
|
#include <stdbool.h>
|
2006-11-11 05:11:05 +00:00
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
#include <stdarg.h>
|
2003-06-29 16:33:04 +00:00
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include "config.h"
|
2006-11-11 05:11:05 +00:00
|
|
|
|
#include "system.h"
|
2003-06-29 16:33:04 +00:00
|
|
|
|
#include "dir.h"
|
2006-11-30 22:29:48 +00:00
|
|
|
|
#ifndef SIMULATOR
|
|
|
|
|
#include "dircache.h"
|
|
|
|
|
#endif
|
2003-06-29 16:33:04 +00:00
|
|
|
|
#include "kernel.h"
|
2006-11-11 05:11:05 +00:00
|
|
|
|
#include "thread.h"
|
2003-06-29 16:33:04 +00:00
|
|
|
|
#include "button.h"
|
2006-08-15 12:27:07 +00:00
|
|
|
|
#include "action.h"
|
2006-01-25 18:29:56 +00:00
|
|
|
|
#include "usb.h"
|
2003-06-29 16:33:04 +00:00
|
|
|
|
#include "font.h"
|
|
|
|
|
#include "lcd.h"
|
2003-07-20 21:29:16 +00:00
|
|
|
|
#include "id3.h"
|
2006-11-11 05:11:05 +00:00
|
|
|
|
#include "sound.h"
|
2003-07-20 21:29:16 +00:00
|
|
|
|
#include "mpeg.h"
|
2005-04-04 12:06:29 +00:00
|
|
|
|
#include "audio.h"
|
2004-01-30 22:30:40 +00:00
|
|
|
|
#include "mp3_playback.h"
|
2006-11-11 05:11:05 +00:00
|
|
|
|
#include "talk.h"
|
2006-01-18 20:54:13 +00:00
|
|
|
|
#ifdef RB_PROFILE
|
|
|
|
|
#include "profile.h"
|
|
|
|
|
#endif
|
2005-09-02 05:39:09 +00:00
|
|
|
|
#include "misc.h"
|
2006-03-26 23:00:24 +00:00
|
|
|
|
#if (CONFIG_CODEC == SWCODEC)
|
2006-03-05 19:34:54 +00:00
|
|
|
|
#include "dsp.h"
|
2006-11-11 05:11:05 +00:00
|
|
|
|
#ifdef HAVE_RECORDING
|
|
|
|
|
#include "recording.h"
|
|
|
|
|
#endif
|
2006-03-26 23:00:24 +00:00
|
|
|
|
#else
|
|
|
|
|
#include "mas.h"
|
2006-11-11 05:11:05 +00:00
|
|
|
|
#endif /* CONFIG_CODEC == SWCODEC */
|
2004-01-30 22:30:40 +00:00
|
|
|
|
#include "settings.h"
|
2005-07-26 20:01:11 +00:00
|
|
|
|
#include "timer.h"
|
2004-06-19 09:36:03 +00:00
|
|
|
|
#include "playlist.h"
|
2004-07-08 13:14:44 +00:00
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
2006-11-19 14:11:42 +00:00
|
|
|
|
#include "scrollbar.h"
|
2004-07-08 13:14:44 +00:00
|
|
|
|
#endif
|
2005-09-22 08:54:48 +00:00
|
|
|
|
#include "menu.h"
|
2005-12-06 13:27:15 +00:00
|
|
|
|
#include "rbunicode.h"
|
2006-04-03 08:51:08 +00:00
|
|
|
|
#include "list.h"
|
2006-11-11 05:11:05 +00:00
|
|
|
|
#include "tree.h"
|
2003-07-24 09:35:32 +00:00
|
|
|
|
|
2005-04-15 12:55:31 +00:00
|
|
|
|
#ifdef HAVE_REMOTE_LCD
|
|
|
|
|
#include "lcd-remote.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
2004-06-10 13:29:52 +00:00
|
|
|
|
#ifdef PLUGIN
|
2005-06-18 19:19:12 +00:00
|
|
|
|
|
2004-06-10 13:29:52 +00:00
|
|
|
|
#if defined(DEBUG) || defined(SIMULATOR)
|
2005-02-22 12:19:12 +00:00
|
|
|
|
#undef DEBUGF
|
2004-08-30 19:52:45 +00:00
|
|
|
|
#define DEBUGF rb->debugf
|
2005-02-22 12:19:12 +00:00
|
|
|
|
#undef LDEBUGF
|
2004-06-10 13:29:52 +00:00
|
|
|
|
#define LDEBUGF rb->debugf
|
|
|
|
|
#else
|
|
|
|
|
#define DEBUGF(...)
|
|
|
|
|
#define LDEBUGF(...)
|
|
|
|
|
#endif
|
2005-06-18 19:19:12 +00:00
|
|
|
|
|
|
|
|
|
#ifdef ROCKBOX_HAS_LOGF
|
|
|
|
|
#undef LOGF
|
|
|
|
|
#define LOGF rb->logf
|
|
|
|
|
#else
|
|
|
|
|
#define LOGF(...)
|
|
|
|
|
#endif
|
|
|
|
|
|
2004-06-10 13:29:52 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2005-02-22 12:19:12 +00:00
|
|
|
|
#ifdef SIMULATOR
|
|
|
|
|
#define PREFIX(_x_) sim_ ## _x_
|
|
|
|
|
#else
|
|
|
|
|
#define PREFIX(_x_) _x_
|
|
|
|
|
#endif
|
|
|
|
|
|
2006-01-15 18:20:18 +00:00
|
|
|
|
#define PLUGIN_MAGIC 0x526F634B /* RocK */
|
|
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
|
/* increase this every time the api struct changes */
|
2007-04-10 14:18:30 +00:00
|
|
|
|
#define PLUGIN_API_VERSION 52
|
2003-07-25 23:04:59 +00:00
|
|
|
|
|
|
|
|
|
/* update this to latest version if a change to the api struct breaks
|
2006-05-01 05:45:18 +00:00
|
|
|
|
backwards compatibility (and please take the opportunity to sort in any
|
2004-02-03 23:56:25 +00:00
|
|
|
|
new function which are "waiting" at the end of the function table) */
|
2007-04-10 14:18:30 +00:00
|
|
|
|
#define PLUGIN_MIN_API_VERSION 52
|
2003-06-29 16:33:04 +00:00
|
|
|
|
|
|
|
|
|
/* plugin return codes */
|
|
|
|
|
enum plugin_status {
|
|
|
|
|
PLUGIN_OK = 0,
|
|
|
|
|
PLUGIN_USB_CONNECTED,
|
2006-01-15 18:20:18 +00:00
|
|
|
|
PLUGIN_ERROR = -1,
|
2003-06-29 16:33:04 +00:00
|
|
|
|
};
|
|
|
|
|
|
2003-07-25 23:04:59 +00:00
|
|
|
|
/* NOTE: To support backwards compatibility, only add new functions at
|
|
|
|
|
the end of the structure. Every time you add a new function,
|
|
|
|
|
remember to increase PLUGIN_API_VERSION. If you make changes to the
|
|
|
|
|
existing APIs then also update PLUGIN_MIN_API_VERSION to current
|
|
|
|
|
version
|
|
|
|
|
*/
|
2003-06-29 16:33:04 +00:00
|
|
|
|
struct plugin_api {
|
|
|
|
|
|
|
|
|
|
/* lcd */
|
2005-06-24 22:33:21 +00:00
|
|
|
|
void (*lcd_set_contrast)(int x);
|
2007-03-31 09:58:49 +00:00
|
|
|
|
void (*lcd_update)(void);
|
2003-06-29 16:33:04 +00:00
|
|
|
|
void (*lcd_clear_display)(void);
|
2007-03-26 07:52:13 +00:00
|
|
|
|
void (*lcd_setmargins)(int x, int y);
|
|
|
|
|
int (*lcd_getstringsize)(const unsigned char *str, int *w, int *h);
|
|
|
|
|
void (*lcd_putsxy)(int x, int y, const unsigned char *string);
|
2004-08-01 21:50:57 +00:00
|
|
|
|
void (*lcd_puts)(int x, int y, const unsigned char *string);
|
2004-08-16 23:37:23 +00:00
|
|
|
|
void (*lcd_puts_scroll)(int x, int y, const unsigned char* string);
|
2003-06-29 16:33:04 +00:00
|
|
|
|
void (*lcd_stop_scroll)(void);
|
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
2007-03-26 07:52:13 +00:00
|
|
|
|
void (*lcd_define_pattern)(unsigned long ucs, const char *pattern);
|
|
|
|
|
unsigned long (*lcd_get_locked_pattern)(void);
|
|
|
|
|
void (*lcd_unlock_pattern)(unsigned long ucs);
|
|
|
|
|
void (*lcd_putc)(int x, int y, unsigned long ucs);
|
|
|
|
|
void (*lcd_put_cursor)(int x, int y, unsigned long ucs);
|
2004-07-27 14:10:48 +00:00
|
|
|
|
void (*lcd_remove_cursor)(void);
|
2007-04-03 18:06:13 +00:00
|
|
|
|
void (*lcd_icon)(int icon, bool enable);
|
2005-09-02 05:39:09 +00:00
|
|
|
|
void (*lcd_double_height)(bool on);
|
2003-06-29 16:33:04 +00:00
|
|
|
|
#else
|
2005-06-24 22:33:21 +00:00
|
|
|
|
void (*lcd_set_drawmode)(int mode);
|
|
|
|
|
int (*lcd_get_drawmode)(void);
|
|
|
|
|
void (*lcd_setfont)(int font);
|
|
|
|
|
void (*lcd_drawpixel)(int x, int y);
|
|
|
|
|
void (*lcd_drawline)(int x1, int y1, int x2, int y2);
|
2005-06-28 23:15:47 +00:00
|
|
|
|
void (*lcd_hline)(int x1, int x2, int y);
|
|
|
|
|
void (*lcd_vline)(int x, int y1, int y2);
|
|
|
|
|
void (*lcd_drawrect)(int x, int y, int width, int height);
|
|
|
|
|
void (*lcd_fillrect)(int x, int y, int width, int height);
|
2005-07-06 22:58:02 +00:00
|
|
|
|
void (*lcd_mono_bitmap_part)(const unsigned char *src, int src_x, int src_y,
|
|
|
|
|
int stride, int x, int y, int width, int height);
|
|
|
|
|
void (*lcd_mono_bitmap)(const unsigned char *src, int x, int y,
|
|
|
|
|
int width, int height);
|
2005-07-26 20:01:11 +00:00
|
|
|
|
#if LCD_DEPTH > 1
|
2005-11-16 21:09:23 +00:00
|
|
|
|
void (*lcd_set_foreground)(unsigned foreground);
|
|
|
|
|
unsigned (*lcd_get_foreground)(void);
|
|
|
|
|
void (*lcd_set_background)(unsigned foreground);
|
|
|
|
|
unsigned (*lcd_get_background)(void);
|
2005-11-14 20:43:49 +00:00
|
|
|
|
void (*lcd_bitmap_part)(const fb_data *src, int src_x, int src_y,
|
2005-07-26 20:01:11 +00:00
|
|
|
|
int stride, int x, int y, int width, int height);
|
2005-11-14 20:43:49 +00:00
|
|
|
|
void (*lcd_bitmap)(const fb_data *src, int x, int y, int width,
|
2005-07-26 20:01:11 +00:00
|
|
|
|
int height);
|
2006-11-19 14:11:42 +00:00
|
|
|
|
void (*lcd_set_backdrop)(fb_data* backdrop);
|
2006-02-07 20:38:55 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if LCD_DEPTH == 16
|
|
|
|
|
void (*lcd_bitmap_transparent_part)(const fb_data *src,
|
|
|
|
|
int src_x, int src_y, int stride,
|
|
|
|
|
int x, int y, int width, int height);
|
2006-03-05 19:34:54 +00:00
|
|
|
|
void (*lcd_bitmap_transparent)(const fb_data *src, int x, int y,
|
2006-02-07 20:38:55 +00:00
|
|
|
|
int width, int height);
|
2005-07-26 20:01:11 +00:00
|
|
|
|
#endif
|
2006-09-16 16:18:11 +00:00
|
|
|
|
unsigned short *(*bidi_l2v)( const unsigned char *str, int orientation );
|
|
|
|
|
const unsigned char *(*font_get_bits)( struct font *pf, unsigned short char_code );
|
|
|
|
|
struct font* (*font_load)(const char *path);
|
2004-08-01 21:50:57 +00:00
|
|
|
|
void (*lcd_puts_style)(int x, int y, const unsigned char *str, int style);
|
2004-10-23 09:59:53 +00:00
|
|
|
|
void (*lcd_puts_scroll_style)(int x, int y, const unsigned char* string,
|
|
|
|
|
int style);
|
2005-11-14 20:43:49 +00:00
|
|
|
|
fb_data* lcd_framebuffer;
|
|
|
|
|
void (*lcd_blit) (const fb_data* data, int x, int by, int width,
|
2005-06-28 23:15:47 +00:00
|
|
|
|
int bheight, int stride);
|
2003-06-29 16:33:04 +00:00
|
|
|
|
void (*lcd_update_rect)(int x, int y, int width, int height);
|
2006-11-19 14:11:42 +00:00
|
|
|
|
void (*gui_scrollbar_draw)(struct screen * screen, int x, int y,
|
|
|
|
|
int width, int height, int items,
|
|
|
|
|
int min_shown, int max_shown,
|
|
|
|
|
unsigned flags);
|
2005-06-24 22:33:21 +00:00
|
|
|
|
struct font* (*font_get)(int font);
|
2005-07-26 20:01:11 +00:00
|
|
|
|
int (*font_getstringsize)(const unsigned char *str, int *w, int *h,
|
|
|
|
|
int fontnumber);
|
2006-01-15 18:20:18 +00:00
|
|
|
|
int (*font_get_width)(struct font* pf, unsigned short char_code);
|
2003-06-29 16:33:04 +00:00
|
|
|
|
#endif
|
2004-07-27 14:10:48 +00:00
|
|
|
|
void (*backlight_on)(void);
|
|
|
|
|
void (*backlight_off)(void);
|
2004-10-23 09:59:53 +00:00
|
|
|
|
void (*backlight_set_timeout)(int index);
|
2007-03-17 09:02:53 +00:00
|
|
|
|
void (*splash)(int ticks, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3);
|
2003-06-29 16:33:04 +00:00
|
|
|
|
|
2005-04-15 12:55:31 +00:00
|
|
|
|
#ifdef HAVE_REMOTE_LCD
|
2005-06-18 01:25:47 +00:00
|
|
|
|
/* remote lcd */
|
2005-06-29 01:39:50 +00:00
|
|
|
|
void (*lcd_remote_set_contrast)(int x);
|
|
|
|
|
void (*lcd_remote_clear_display)(void);
|
|
|
|
|
void (*lcd_remote_puts)(int x, int y, const unsigned char *string);
|
|
|
|
|
void (*lcd_remote_lcd_puts_scroll)(int x, int y, const unsigned char* string);
|
|
|
|
|
void (*lcd_remote_lcd_stop_scroll)(void);
|
|
|
|
|
void (*lcd_remote_set_drawmode)(int mode);
|
|
|
|
|
int (*lcd_remote_get_drawmode)(void);
|
|
|
|
|
void (*lcd_remote_setfont)(int font);
|
|
|
|
|
int (*lcd_remote_getstringsize)(const unsigned char *str, int *w, int *h);
|
|
|
|
|
void (*lcd_remote_drawpixel)(int x, int y);
|
|
|
|
|
void (*lcd_remote_drawline)(int x1, int y1, int x2, int y2);
|
|
|
|
|
void (*lcd_remote_hline)(int x1, int x2, int y);
|
|
|
|
|
void (*lcd_remote_vline)(int x, int y1, int y2);
|
|
|
|
|
void (*lcd_remote_drawrect)(int x, int y, int nx, int ny);
|
|
|
|
|
void (*lcd_remote_fillrect)(int x, int y, int nx, int ny);
|
2005-07-07 00:05:29 +00:00
|
|
|
|
void (*lcd_remote_mono_bitmap_part)(const unsigned char *src, int src_x,
|
|
|
|
|
int src_y, int stride, int x, int y,
|
|
|
|
|
int width, int height);
|
|
|
|
|
void (*lcd_remote_mono_bitmap)(const unsigned char *src, int x, int y,
|
2005-06-29 01:39:50 +00:00
|
|
|
|
int width, int height);
|
|
|
|
|
void (*lcd_remote_putsxy)(int x, int y, const unsigned char *string);
|
|
|
|
|
void (*lcd_remote_puts_style)(int x, int y, const unsigned char *str, int style);
|
|
|
|
|
void (*lcd_remote_puts_scroll_style)(int x, int y, const unsigned char* string,
|
|
|
|
|
int style);
|
2006-07-28 07:35:45 +00:00
|
|
|
|
fb_remote_data* lcd_remote_framebuffer;
|
2005-06-29 01:39:50 +00:00
|
|
|
|
void (*lcd_remote_update)(void);
|
|
|
|
|
void (*lcd_remote_update_rect)(int x, int y, int width, int height);
|
2005-06-18 01:25:47 +00:00
|
|
|
|
|
2005-04-15 12:55:31 +00:00
|
|
|
|
void (*remote_backlight_on)(void);
|
2005-06-18 01:25:47 +00:00
|
|
|
|
void (*remote_backlight_off)(void);
|
2005-04-15 12:55:31 +00:00
|
|
|
|
#endif
|
2006-09-16 16:18:11 +00:00
|
|
|
|
struct screen* screens[NB_SCREENS];
|
|
|
|
|
#if defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1)
|
|
|
|
|
void (*lcd_remote_set_foreground)(unsigned foreground);
|
|
|
|
|
unsigned (*lcd_remote_get_foreground)(void);
|
2006-10-14 01:32:58 +00:00
|
|
|
|
void (*lcd_remote_set_background)(unsigned background);
|
2006-09-16 16:18:11 +00:00
|
|
|
|
unsigned (*lcd_remote_get_background)(void);
|
|
|
|
|
void (*lcd_remote_bitmap_part)(const fb_remote_data *src, int src_x, int src_y,
|
|
|
|
|
int stride, int x, int y, int width, int height);
|
|
|
|
|
void (*lcd_remote_bitmap)(const fb_remote_data *src, int x, int y, int width,
|
|
|
|
|
int height);
|
|
|
|
|
#endif
|
|
|
|
|
#if defined(HAVE_LCD_COLOR) && !defined(SIMULATOR)
|
|
|
|
|
void (*lcd_yuv_blit)(unsigned char * const src[3],
|
|
|
|
|
int src_x, int src_y, int stride,
|
|
|
|
|
int x, int y, int width, int height);
|
|
|
|
|
#endif
|
2005-04-15 12:55:31 +00:00
|
|
|
|
|
2006-09-16 16:18:11 +00:00
|
|
|
|
/* list */
|
|
|
|
|
void (*gui_synclist_init)(struct gui_synclist * lists,
|
|
|
|
|
list_get_name callback_get_item_name,void * data,
|
|
|
|
|
bool scroll_all,int selected_size);
|
|
|
|
|
void (*gui_synclist_set_nb_items)(struct gui_synclist * lists, int nb_items);
|
|
|
|
|
void (*gui_synclist_set_icon_callback)(struct gui_synclist * lists, list_get_icon icon_callback);
|
|
|
|
|
int (*gui_synclist_get_nb_items)(struct gui_synclist * lists);
|
|
|
|
|
int (*gui_synclist_get_sel_pos)(struct gui_synclist * lists);
|
|
|
|
|
void (*gui_synclist_draw)(struct gui_synclist * lists);
|
|
|
|
|
void (*gui_synclist_select_item)(struct gui_synclist * lists,
|
|
|
|
|
int item_number);
|
|
|
|
|
void (*gui_synclist_add_item)(struct gui_synclist * lists);
|
|
|
|
|
void (*gui_synclist_del_item)(struct gui_synclist * lists);
|
|
|
|
|
void (*gui_synclist_limit_scroll)(struct gui_synclist * lists, bool scroll);
|
|
|
|
|
void (*gui_synclist_flash)(struct gui_synclist * lists);
|
2006-11-06 10:11:51 +00:00
|
|
|
|
unsigned (*gui_synclist_do_button)(struct gui_synclist * lists,
|
|
|
|
|
unsigned button,enum list_wrap wrap);
|
2006-11-30 22:29:48 +00:00
|
|
|
|
void (*gui_synclist_set_title)(struct gui_synclist *lists, char* title, ICON icon);
|
2006-10-14 01:32:58 +00:00
|
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
|
/* button */
|
2005-02-07 23:11:20 +00:00
|
|
|
|
long (*button_get)(bool block);
|
|
|
|
|
long (*button_get_w_tmo)(int ticks);
|
2004-07-27 14:10:48 +00:00
|
|
|
|
int (*button_status)(void);
|
|
|
|
|
void (*button_clear_queue)(void);
|
2006-05-01 05:45:18 +00:00
|
|
|
|
#ifdef HAS_BUTTON_HOLD
|
2005-06-18 01:25:47 +00:00
|
|
|
|
bool (*button_hold)(void);
|
|
|
|
|
#endif
|
2003-06-29 16:33:04 +00:00
|
|
|
|
|
|
|
|
|
/* file */
|
2005-02-22 12:19:12 +00:00
|
|
|
|
int (*PREFIX(open))(const char* pathname, int flags);
|
2003-06-29 16:33:04 +00:00
|
|
|
|
int (*close)(int fd);
|
2003-12-08 21:58:38 +00:00
|
|
|
|
ssize_t (*read)(int fd, void* buf, size_t count);
|
2005-02-28 18:32:57 +00:00
|
|
|
|
off_t (*PREFIX(lseek))(int fd, off_t offset, int whence);
|
2007-02-01 23:08:15 +00:00
|
|
|
|
int (*PREFIX(creat))(const char *pathname);
|
2003-12-08 21:58:38 +00:00
|
|
|
|
ssize_t (*write)(int fd, const void* buf, size_t count);
|
2005-02-22 12:19:12 +00:00
|
|
|
|
int (*PREFIX(remove))(const char* pathname);
|
|
|
|
|
int (*PREFIX(rename))(const char* path, const char* newname);
|
|
|
|
|
int (*PREFIX(ftruncate))(int fd, off_t length);
|
|
|
|
|
off_t (*PREFIX(filesize))(int fd);
|
2007-03-17 09:02:53 +00:00
|
|
|
|
int (*fdprintf)(int fd, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3);
|
2003-06-29 16:33:04 +00:00
|
|
|
|
int (*read_line)(int fd, char* buffer, int buffer_size);
|
2004-07-27 14:10:48 +00:00
|
|
|
|
bool (*settings_parseline)(char* line, char** name, char** value);
|
2004-07-27 19:16:58 +00:00
|
|
|
|
#ifndef SIMULATOR
|
2005-11-07 23:19:06 +00:00
|
|
|
|
void (*ata_sleep)(void);
|
2006-02-07 20:38:55 +00:00
|
|
|
|
bool (*ata_disk_is_active)(void);
|
2004-07-27 19:16:58 +00:00
|
|
|
|
#endif
|
2006-10-31 11:17:00 +00:00
|
|
|
|
void (*ata_spindown)(int seconds);
|
2006-09-16 16:18:11 +00:00
|
|
|
|
void (*reload_directory)(void);
|
2006-05-01 05:45:18 +00:00
|
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
|
/* dir */
|
2005-02-28 21:58:09 +00:00
|
|
|
|
DIR* (*PREFIX(opendir))(const char* name);
|
|
|
|
|
int (*PREFIX(closedir))(DIR* dir);
|
|
|
|
|
struct dirent* (*PREFIX(readdir))(DIR* dir);
|
2007-02-03 10:28:55 +00:00
|
|
|
|
int (*PREFIX(mkdir))(const char *name);
|
2006-09-16 16:18:11 +00:00
|
|
|
|
int (*PREFIX(rmdir))(const char *name);
|
2006-11-30 22:29:48 +00:00
|
|
|
|
/* dir, cached */
|
|
|
|
|
#ifdef HAVE_DIRCACHE
|
|
|
|
|
DIRCACHED* (*opendir_cached)(const char* name);
|
|
|
|
|
struct dircache_entry* (*readdir_cached)(DIRCACHED* dir);
|
|
|
|
|
int (*closedir_cached)(DIRCACHED* dir);
|
|
|
|
|
#endif
|
2003-06-29 16:33:04 +00:00
|
|
|
|
|
2004-10-23 09:59:53 +00:00
|
|
|
|
/* kernel/ system */
|
2005-02-22 12:19:12 +00:00
|
|
|
|
void (*PREFIX(sleep))(int ticks);
|
2004-07-27 14:10:48 +00:00
|
|
|
|
void (*yield)(void);
|
2007-04-10 14:18:30 +00:00
|
|
|
|
#ifdef HAVE_PRIORITY_SCHEDULING
|
|
|
|
|
void (*priority_yield)(void);
|
|
|
|
|
#endif
|
2003-06-29 16:33:04 +00:00
|
|
|
|
long* current_tick;
|
2005-02-07 22:56:37 +00:00
|
|
|
|
long (*default_event_handler)(long event);
|
|
|
|
|
long (*default_event_handler_ex)(long event, void (*callback)(void *), void *parameter);
|
2006-10-14 01:32:58 +00:00
|
|
|
|
struct thread_entry* (*create_thread)(void (*function)(void), void* stack,
|
|
|
|
|
int stack_size, const char *name
|
2007-03-04 20:06:41 +00:00
|
|
|
|
IF_PRIO(, int priority)
|
|
|
|
|
IF_COP(, unsigned int core, bool fallback));
|
2006-09-16 16:18:11 +00:00
|
|
|
|
void (*remove_thread)(struct thread_entry *thread);
|
2004-07-27 19:16:58 +00:00
|
|
|
|
void (*reset_poweroff_timer)(void);
|
2004-10-23 09:59:53 +00:00
|
|
|
|
#ifndef SIMULATOR
|
|
|
|
|
int (*system_memory_guard)(int newmode);
|
2005-06-18 01:25:47 +00:00
|
|
|
|
long *cpu_frequency;
|
|
|
|
|
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
2007-01-22 10:41:25 +00:00
|
|
|
|
#ifdef CPU_BOOST_LOGGING
|
|
|
|
|
void (*cpu_boost_)(bool on_off,char*location,int line);
|
|
|
|
|
#else
|
2005-06-18 01:25:47 +00:00
|
|
|
|
void (*cpu_boost)(bool on_off);
|
2007-01-22 10:41:25 +00:00
|
|
|
|
#endif
|
2005-06-18 01:25:47 +00:00
|
|
|
|
#endif
|
2005-07-26 20:01:11 +00:00
|
|
|
|
bool (*timer_register)(int reg_prio, void (*unregister_callback)(void),
|
|
|
|
|
long cycles, int int_prio,
|
|
|
|
|
void (*timer_callback)(void));
|
|
|
|
|
void (*timer_unregister)(void);
|
|
|
|
|
bool (*timer_set_period)(long count);
|
2004-10-23 09:59:53 +00:00
|
|
|
|
#endif
|
2006-09-16 16:18:11 +00:00
|
|
|
|
void (*queue_init)(struct event_queue *q, bool register_queue);
|
2006-02-07 20:38:55 +00:00
|
|
|
|
void (*queue_delete)(struct event_queue *q);
|
2006-12-19 16:50:07 +00:00
|
|
|
|
void (*queue_post)(struct event_queue *q, long id, intptr_t data);
|
2006-02-07 20:38:55 +00:00
|
|
|
|
void (*queue_wait_w_tmo)(struct event_queue *q, struct event *ev,
|
|
|
|
|
int ticks);
|
|
|
|
|
void (*usb_acknowledge)(long id);
|
|
|
|
|
#ifdef RB_PROFILE
|
|
|
|
|
void (*profile_thread)(void);
|
|
|
|
|
void (*profstop)(void);
|
|
|
|
|
void (*profile_func_enter)(void *this_fn, void *call_site);
|
|
|
|
|
void (*profile_func_exit)(void *this_fn, void *call_site);
|
|
|
|
|
#endif
|
2003-06-29 16:33:04 +00:00
|
|
|
|
|
2006-03-11 09:28:49 +00:00
|
|
|
|
#ifdef SIMULATOR
|
|
|
|
|
/* special simulator hooks */
|
|
|
|
|
#if defined(HAVE_LCD_BITMAP) && LCD_DEPTH < 8
|
|
|
|
|
void (*sim_lcd_ex_init)(int shades, unsigned long (*getpixel)(int, int));
|
|
|
|
|
void (*sim_lcd_ex_update_rect)(int x, int y, int width, int height);
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
|
/* strings and memory */
|
2007-03-17 09:02:53 +00:00
|
|
|
|
int (*snprintf)(char *buf, size_t size, const char *fmt, ...)
|
|
|
|
|
ATTRIBUTE_PRINTF(3, 4);
|
2006-09-16 16:18:11 +00:00
|
|
|
|
int (*vsnprintf)(char *buf, int size, const char *fmt, va_list ap);
|
2004-10-23 09:59:53 +00:00
|
|
|
|
char* (*strcpy)(char *dst, const char *src);
|
|
|
|
|
char* (*strncpy)(char *dst, const char *src, size_t length);
|
2003-06-29 16:33:04 +00:00
|
|
|
|
size_t (*strlen)(const char *str);
|
2004-07-13 14:14:30 +00:00
|
|
|
|
char * (*strrchr)(const char *s, int c);
|
2004-07-27 14:10:48 +00:00
|
|
|
|
int (*strcmp)(const char *, const char *);
|
2005-07-26 20:01:11 +00:00
|
|
|
|
int (*strncmp)(const char *, const char *, size_t);
|
2004-07-27 14:10:48 +00:00
|
|
|
|
int (*strcasecmp)(const char *, const char *);
|
2004-10-23 09:59:53 +00:00
|
|
|
|
int (*strncasecmp)(const char *s1, const char *s2, size_t n);
|
|
|
|
|
void* (*memset)(void *dst, int c, size_t length);
|
|
|
|
|
void* (*memcpy)(void *out, const void *in, size_t n);
|
2006-02-07 20:38:55 +00:00
|
|
|
|
void* (*memmove)(void *out, const void *in, size_t n);
|
2005-07-12 11:06:38 +00:00
|
|
|
|
const unsigned char *_ctype_;
|
2004-07-27 19:16:58 +00:00
|
|
|
|
int (*atoi)(const char *str);
|
2005-02-22 12:19:12 +00:00
|
|
|
|
char *(*strchr)(const char *s, int c);
|
|
|
|
|
char *(*strcat)(char *s1, const char *s2);
|
2006-09-16 16:18:11 +00:00
|
|
|
|
void *(*memchr)(const void *s1, int c, size_t n);
|
2005-02-22 12:19:12 +00:00
|
|
|
|
int (*memcmp)(const void *s1, const void *s2, size_t n);
|
2005-06-18 01:25:47 +00:00
|
|
|
|
char *(*strcasestr) (const char* phaystack, const char* pneedle);
|
2006-10-31 11:17:00 +00:00
|
|
|
|
char* (*strtok_r)(char *ptr, const char *sep, char **end);
|
2006-01-15 18:20:18 +00:00
|
|
|
|
/* unicode stuff */
|
|
|
|
|
const unsigned char* (*utf8decode)(const unsigned char *utf8, unsigned short *ucs);
|
|
|
|
|
unsigned char* (*iso_decode)(const unsigned char *iso, unsigned char *utf8, int cp, int count);
|
2006-07-25 18:12:57 +00:00
|
|
|
|
unsigned char* (*utf16LEdecode)(const unsigned char *utf16, unsigned char *utf8, int count);
|
|
|
|
|
unsigned char* (*utf16BEdecode)(const unsigned char *utf16, unsigned char *utf8, int count);
|
2006-01-15 18:20:18 +00:00
|
|
|
|
unsigned char* (*utf8encode)(unsigned long ucs, unsigned char *utf8);
|
|
|
|
|
unsigned long (*utf8length)(const unsigned char *utf8);
|
2006-09-16 16:18:11 +00:00
|
|
|
|
int (*utf8seek)(const unsigned char* utf8, int offset);
|
2003-06-29 16:33:04 +00:00
|
|
|
|
|
|
|
|
|
/* sound */
|
2007-04-10 14:18:30 +00:00
|
|
|
|
#if CONFIG_CODEC == SWCODEC && defined(HAVE_RECORDING)
|
|
|
|
|
int (*sound_default)(int setting);
|
|
|
|
|
#endif
|
2005-04-01 13:41:03 +00:00
|
|
|
|
void (*sound_set)(int setting, int value);
|
2006-09-16 16:18:11 +00:00
|
|
|
|
bool (*set_sound)(const unsigned char * string,
|
|
|
|
|
int* variable, int setting);
|
2006-01-15 18:20:18 +00:00
|
|
|
|
int (*sound_min)(int setting);
|
|
|
|
|
int (*sound_max)(int setting);
|
2003-06-29 16:33:04 +00:00
|
|
|
|
#ifndef SIMULATOR
|
2004-08-16 23:37:23 +00:00
|
|
|
|
void (*mp3_play_data)(const unsigned char* start, int size, void (*get_more)(unsigned char** start, int* size));
|
2004-07-27 14:10:48 +00:00
|
|
|
|
void (*mp3_play_pause)(bool play);
|
|
|
|
|
void (*mp3_play_stop)(void);
|
|
|
|
|
bool (*mp3_is_playing)(void);
|
2005-08-29 21:15:27 +00:00
|
|
|
|
#if CONFIG_CODEC != SWCODEC
|
2004-07-27 14:10:48 +00:00
|
|
|
|
void (*bitswap)(unsigned char *data, int length);
|
2005-06-06 00:34:07 +00:00
|
|
|
|
#endif
|
2007-01-01 13:21:19 +00:00
|
|
|
|
#endif /* !SIMULATOR */
|
2005-08-29 21:15:27 +00:00
|
|
|
|
#if CONFIG_CODEC == SWCODEC
|
2007-04-10 14:18:30 +00:00
|
|
|
|
const unsigned long *audio_master_sampr_list;
|
|
|
|
|
const unsigned long *hw_freq_sampr;
|
|
|
|
|
#ifndef SIMULATOR
|
|
|
|
|
void (*pcm_apply_settings)(void);
|
|
|
|
|
#endif
|
2006-11-11 05:11:05 +00:00
|
|
|
|
void (*pcm_play_data)(pcm_more_callback_type get_more,
|
2006-02-07 20:38:55 +00:00
|
|
|
|
unsigned char* start, size_t size);
|
2005-06-18 01:25:47 +00:00
|
|
|
|
void (*pcm_play_stop)(void);
|
|
|
|
|
void (*pcm_set_frequency)(unsigned int frequency);
|
|
|
|
|
bool (*pcm_is_playing)(void);
|
2007-04-10 14:18:30 +00:00
|
|
|
|
bool (*pcm_is_paused)(void);
|
2005-06-18 01:25:47 +00:00
|
|
|
|
void (*pcm_play_pause)(bool play);
|
2007-04-10 14:18:30 +00:00
|
|
|
|
size_t (*pcm_get_bytes_waiting)(void);
|
2006-03-11 09:38:12 +00:00
|
|
|
|
void (*pcm_calculate_peaks)(int *left, int *right);
|
2007-04-10 14:18:30 +00:00
|
|
|
|
#ifdef HAVE_RECORDING
|
|
|
|
|
const unsigned long *rec_freq_sampr;
|
|
|
|
|
#ifndef SIMULATOR
|
|
|
|
|
void (*pcm_init_recording)(void);
|
|
|
|
|
void (*pcm_close_recording)(void);
|
|
|
|
|
void (*pcm_record_data)(pcm_more_callback_type2 more_ready,
|
|
|
|
|
void *start, size_t size);
|
|
|
|
|
void (*pcm_record_more)(void *start, size_t size);
|
|
|
|
|
void (*pcm_stop_recording)(void);
|
|
|
|
|
void (*pcm_calculate_rec_peaks)(int *left, int *right);
|
|
|
|
|
void (*audio_set_recording_gain)(int left, int right, int type);
|
|
|
|
|
void (*audio_set_output_source)(int monitor);
|
|
|
|
|
void (*rec_set_source)(int source, unsigned flags);
|
|
|
|
|
#endif
|
|
|
|
|
#endif /* HAVE_RECORDING */
|
|
|
|
|
|
2006-03-11 09:38:12 +00:00
|
|
|
|
#endif
|
2003-06-29 16:33:04 +00:00
|
|
|
|
|
2004-07-27 14:10:48 +00:00
|
|
|
|
/* playback control */
|
2007-04-10 14:18:30 +00:00
|
|
|
|
int (*playlist_amount)(void);
|
|
|
|
|
int (*playlist_resume)(void);
|
|
|
|
|
int (*playlist_start)(int start_index, int offset);
|
2006-03-03 02:09:58 +00:00
|
|
|
|
void (*PREFIX(audio_play))(long offset);
|
2005-04-04 12:06:29 +00:00
|
|
|
|
void (*audio_stop)(void);
|
|
|
|
|
void (*audio_pause)(void);
|
|
|
|
|
void (*audio_resume)(void);
|
|
|
|
|
void (*audio_next)(void);
|
|
|
|
|
void (*audio_prev)(void);
|
2006-03-03 02:09:58 +00:00
|
|
|
|
void (*audio_ff_rewind)(long newtime);
|
2005-04-04 12:06:29 +00:00
|
|
|
|
struct mp3entry* (*audio_next_track)(void);
|
|
|
|
|
int (*audio_status)(void);
|
|
|
|
|
bool (*audio_has_changed_track)(void);
|
|
|
|
|
struct mp3entry* (*audio_current_track)(void);
|
|
|
|
|
void (*audio_flush_and_reload_tracks)(void);
|
|
|
|
|
int (*audio_get_file_pos)(void);
|
2005-08-29 21:15:27 +00:00
|
|
|
|
#if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
|
2005-04-25 08:21:10 +00:00
|
|
|
|
unsigned long (*mpeg_get_last_header)(void);
|
2005-04-25 08:59:19 +00:00
|
|
|
|
#endif
|
2006-03-05 19:46:33 +00:00
|
|
|
|
#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) || \
|
|
|
|
|
(CONFIG_CODEC == SWCODEC)
|
2006-05-01 05:45:18 +00:00
|
|
|
|
void (*sound_set_pitch)(int pitch);
|
2006-03-05 19:46:33 +00:00
|
|
|
|
#endif
|
2004-07-27 19:16:58 +00:00
|
|
|
|
|
|
|
|
|
/* MAS communication */
|
2005-08-29 21:15:27 +00:00
|
|
|
|
#if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
|
2004-07-27 19:16:58 +00:00
|
|
|
|
int (*mas_readmem)(int bank, int addr, unsigned long* dest, int len);
|
2004-08-17 01:45:48 +00:00
|
|
|
|
int (*mas_writemem)(int bank, int addr, const unsigned long* src, int len);
|
2004-07-27 19:16:58 +00:00
|
|
|
|
int (*mas_readreg)(int reg);
|
|
|
|
|
int (*mas_writereg)(int reg, unsigned int val);
|
2005-08-29 21:15:27 +00:00
|
|
|
|
#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
|
2004-07-27 19:16:58 +00:00
|
|
|
|
int (*mas_codec_writereg)(int reg, unsigned int val);
|
|
|
|
|
int (*mas_codec_readreg)(int reg);
|
2006-09-16 16:18:11 +00:00
|
|
|
|
void (*i2c_begin)(void);
|
|
|
|
|
void (*i2c_end)(void);
|
|
|
|
|
int (*i2c_write)(int address, unsigned char* buf, int count );
|
2004-07-27 19:16:58 +00:00
|
|
|
|
#endif
|
|
|
|
|
#endif
|
2004-10-23 09:59:53 +00:00
|
|
|
|
|
2006-01-15 18:20:18 +00:00
|
|
|
|
/* menu */
|
2007-03-07 13:00:46 +00:00
|
|
|
|
int (*do_menu)(const struct menu_item_ex *menu, int *start_selected);
|
|
|
|
|
/* OLD API - dont use unless you have to */
|
2006-01-15 18:20:18 +00:00
|
|
|
|
int (*menu_init)(const struct menu_item* mitems, int count,
|
|
|
|
|
int (*callback)(int, int),
|
|
|
|
|
const char *button1, const char *button2, const char *button3);
|
|
|
|
|
void (*menu_exit)(int menu);
|
|
|
|
|
int (*menu_show)(int m);
|
|
|
|
|
bool (*menu_run)(int menu);
|
|
|
|
|
int (*menu_count)(int menu);
|
|
|
|
|
|
2006-05-01 05:45:18 +00:00
|
|
|
|
bool (*set_option)(const char* string, void* variable,
|
|
|
|
|
enum optiontype type, const struct opt_items* options,
|
2006-03-21 09:36:13 +00:00
|
|
|
|
int numoptions, void (*function)(int));
|
2006-09-16 16:18:11 +00:00
|
|
|
|
bool (*set_int)(const unsigned char* string, const char* unit, int voice_unit,
|
|
|
|
|
int* variable, void (*function)(int), int step, int min,
|
|
|
|
|
int max, void (*formatter)(char*, int, int, const char*) );
|
|
|
|
|
bool (*set_bool)(const char* string, bool* variable );
|
2006-03-21 09:36:13 +00:00
|
|
|
|
|
2006-09-16 16:18:11 +00:00
|
|
|
|
/* action handling */
|
|
|
|
|
int (*get_custom_action)(int context,int timeout,
|
|
|
|
|
const struct button_mapping* (*get_context_map)(int));
|
|
|
|
|
int (*get_action)(int context, int timeout);
|
|
|
|
|
void (*action_signalscreenchange)(void);
|
|
|
|
|
bool (*action_userabort)(int timeout);
|
2006-03-21 09:36:13 +00:00
|
|
|
|
|
2006-02-07 20:38:55 +00:00
|
|
|
|
/* power */
|
|
|
|
|
int (*battery_level)(void);
|
|
|
|
|
bool (*battery_level_safe)(void);
|
|
|
|
|
int (*battery_time)(void);
|
|
|
|
|
#ifndef SIMULATOR
|
|
|
|
|
unsigned int (*battery_voltage)(void);
|
|
|
|
|
#endif
|
2007-02-18 05:32:06 +00:00
|
|
|
|
#if CONFIG_CHARGING
|
2006-02-07 20:38:55 +00:00
|
|
|
|
bool (*charger_inserted)(void);
|
2006-06-06 22:23:52 +00:00
|
|
|
|
# if CONFIG_CHARGING == CHARGING_MONITOR
|
2006-02-07 20:38:55 +00:00
|
|
|
|
bool (*charging_state)(void);
|
2006-03-05 19:34:54 +00:00
|
|
|
|
# endif
|
2006-02-07 20:38:55 +00:00
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_USB_POWER
|
|
|
|
|
bool (*usb_powered)(void);
|
|
|
|
|
#endif
|
|
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
|
/* misc */
|
2005-02-15 13:28:39 +00:00
|
|
|
|
void (*srand)(unsigned int seed);
|
|
|
|
|
int (*rand)(void);
|
2003-06-29 21:42:15 +00:00
|
|
|
|
void (*qsort)(void *base, size_t nmemb, size_t size,
|
|
|
|
|
int(*compar)(const void *, const void *));
|
2003-07-09 22:36:23 +00:00
|
|
|
|
int (*kbd_input)(char* buffer, int buflen);
|
2003-07-24 10:02:45 +00:00
|
|
|
|
struct tm* (*get_time)(void);
|
2004-08-17 01:45:48 +00:00
|
|
|
|
int (*set_time)(const struct tm *tm);
|
2003-07-25 23:04:59 +00:00
|
|
|
|
void* (*plugin_get_buffer)(int* buffer_size);
|
2005-04-05 11:33:58 +00:00
|
|
|
|
void* (*plugin_get_audio_buffer)(int* buffer_size);
|
2006-10-31 11:17:00 +00:00
|
|
|
|
void (*plugin_tsr)(bool (*exit_callback)(bool reenter));
|
2007-04-10 14:18:30 +00:00
|
|
|
|
#ifdef IRAM_STEAL
|
|
|
|
|
void (*plugin_iram_init)(char *iramstart, char *iramcopy, size_t iram_size,
|
|
|
|
|
char *iedata, size_t iedata_size);
|
|
|
|
|
#endif
|
2004-06-10 13:29:52 +00:00
|
|
|
|
#if defined(DEBUG) || defined(SIMULATOR)
|
2007-03-17 09:02:53 +00:00
|
|
|
|
void (*debugf)(const char *fmt, ...) ATTRIBUTE_PRINTF(1, 2);
|
2005-07-26 20:01:11 +00:00
|
|
|
|
#endif
|
|
|
|
|
#ifdef ROCKBOX_HAS_LOGF
|
2007-03-17 09:02:53 +00:00
|
|
|
|
void (*logf)(const char *fmt, ...) ATTRIBUTE_PRINTF(1, 2);
|
2004-06-10 13:48:53 +00:00
|
|
|
|
#endif
|
2004-07-27 19:16:58 +00:00
|
|
|
|
struct user_settings* global_settings;
|
2007-04-10 14:18:30 +00:00
|
|
|
|
struct system_status *global_status;
|
2004-08-16 23:37:23 +00:00
|
|
|
|
bool (*mp3info)(struct mp3entry *entry, const char *filename, bool v1first);
|
2004-07-27 19:16:58 +00:00
|
|
|
|
int (*count_mp3_frames)(int fd, int startpos, int filesize,
|
|
|
|
|
void (*progressfunc)(int));
|
2005-09-15 05:29:26 +00:00
|
|
|
|
int (*create_xing_header)(int fd, long startpos, long filesize,
|
2006-02-07 20:38:55 +00:00
|
|
|
|
unsigned char *buf, unsigned long num_frames,
|
|
|
|
|
unsigned long rec_time, unsigned long header_template,
|
|
|
|
|
void (*progressfunc)(int), bool generate_toc);
|
2005-01-30 14:33:33 +00:00
|
|
|
|
unsigned long (*find_next_frame)(int fd, long *offset,
|
2006-02-07 20:38:55 +00:00
|
|
|
|
long max_offset, unsigned long last_header);
|
|
|
|
|
|
2005-08-29 21:15:27 +00:00
|
|
|
|
#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
|
2004-07-29 13:59:04 +00:00
|
|
|
|
unsigned short (*peak_meter_scale_value)(unsigned short val,
|
|
|
|
|
int meterwidth);
|
2005-08-29 20:07:17 +00:00
|
|
|
|
void (*peak_meter_set_use_dbfs)(bool use);
|
|
|
|
|
bool (*peak_meter_get_use_dbfs)(void);
|
2004-08-30 19:52:45 +00:00
|
|
|
|
#endif
|
2005-04-25 07:42:10 +00:00
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
2006-01-28 12:12:42 +00:00
|
|
|
|
int (*read_bmp_file)(char* filename, struct bitmap *bm, int maxsize,
|
|
|
|
|
int format);
|
2006-01-15 18:20:18 +00:00
|
|
|
|
void (*screen_dump_set_hook)(void (*hook)(int fh));
|
2005-04-25 07:42:10 +00:00
|
|
|
|
#endif
|
2005-09-02 05:39:09 +00:00
|
|
|
|
int (*show_logo)(void);
|
2006-02-18 20:51:34 +00:00
|
|
|
|
struct tree_context* (*tree_get_context)(void);
|
2006-03-05 19:34:54 +00:00
|
|
|
|
|
2006-09-26 19:25:52 +00:00
|
|
|
|
#ifdef HAVE_WHEEL_POSITION
|
|
|
|
|
int (*wheel_status)(void);
|
|
|
|
|
void (*wheel_send_events)(bool send);
|
|
|
|
|
#endif
|
2006-12-07 17:23:52 +00:00
|
|
|
|
#if LCD_DEPTH > 1
|
|
|
|
|
fb_data* (*lcd_get_backdrop)(void);
|
|
|
|
|
#endif
|
2006-10-31 11:17:00 +00:00
|
|
|
|
/* new stuff at the end, sort into place next time
|
|
|
|
|
the API gets incompatible */
|
|
|
|
|
|
2007-01-12 18:34:00 +00:00
|
|
|
|
#ifdef IRIVER_H100_SERIES
|
|
|
|
|
/* Routines for the iriver_flash -plugin. */
|
|
|
|
|
bool (*detect_original_firmware)(void);
|
|
|
|
|
bool (*detect_flashed_ramimage)(void);
|
|
|
|
|
bool (*detect_flashed_romimage)(void);
|
2007-03-22 09:40:26 +00:00
|
|
|
|
#endif
|
2006-01-15 18:20:18 +00:00
|
|
|
|
};
|
2005-10-01 10:46:13 +00:00
|
|
|
|
|
2006-01-15 18:20:18 +00:00
|
|
|
|
/* plugin header */
|
|
|
|
|
struct plugin_header {
|
|
|
|
|
unsigned long magic;
|
|
|
|
|
unsigned short target_id;
|
|
|
|
|
unsigned short api_version;
|
|
|
|
|
unsigned char *load_addr;
|
|
|
|
|
unsigned char *end_addr;
|
|
|
|
|
enum plugin_status(*entry_point)(struct plugin_api*, void*);
|
2003-06-29 16:33:04 +00:00
|
|
|
|
};
|
2006-11-18 02:18:29 +00:00
|
|
|
|
|
2006-01-15 18:20:18 +00:00
|
|
|
|
#ifdef PLUGIN
|
2006-01-16 23:20:58 +00:00
|
|
|
|
#ifndef SIMULATOR
|
2006-01-15 18:20:18 +00:00
|
|
|
|
extern unsigned char plugin_start_addr[];
|
|
|
|
|
extern unsigned char plugin_end_addr[];
|
|
|
|
|
#define PLUGIN_HEADER \
|
|
|
|
|
const struct plugin_header __header \
|
|
|
|
|
__attribute__ ((section (".header")))= { \
|
|
|
|
|
PLUGIN_MAGIC, TARGET_ID, PLUGIN_API_VERSION, \
|
|
|
|
|
plugin_start_addr, plugin_end_addr, plugin_start };
|
|
|
|
|
#else /* SIMULATOR */
|
2006-01-16 23:20:58 +00:00
|
|
|
|
#define PLUGIN_HEADER \
|
|
|
|
|
const struct plugin_header __header = { \
|
|
|
|
|
PLUGIN_MAGIC, TARGET_ID, PLUGIN_API_VERSION, \
|
|
|
|
|
NULL, NULL, plugin_start };
|
2006-11-18 02:18:29 +00:00
|
|
|
|
#endif /* SIMULATOR */
|
|
|
|
|
|
|
|
|
|
#ifdef USE_IRAM
|
|
|
|
|
/* Declare IRAM variables */
|
|
|
|
|
#define PLUGIN_IRAM_DECLARE \
|
|
|
|
|
extern char iramcopy[]; \
|
|
|
|
|
extern char iramstart[]; \
|
|
|
|
|
extern char iramend[]; \
|
|
|
|
|
extern char iedata[]; \
|
|
|
|
|
extern char iend[];
|
|
|
|
|
/* Initialize IRAM */
|
|
|
|
|
#define PLUGIN_IRAM_INIT(api) \
|
|
|
|
|
(api)->plugin_iram_init(iramstart, iramcopy, iramend-iramstart, \
|
|
|
|
|
iedata, iend-iedata);
|
|
|
|
|
#else
|
|
|
|
|
#define PLUGIN_IRAM_DECLARE
|
|
|
|
|
#define PLUGIN_IRAM_INIT(api)
|
|
|
|
|
#endif /* USE_IRAM */
|
|
|
|
|
#endif /* PLUGIN */
|
2003-06-29 16:33:04 +00:00
|
|
|
|
|
2004-08-18 01:09:31 +00:00
|
|
|
|
int plugin_load(const char* plugin, void* parameter);
|
2003-07-25 23:04:59 +00:00
|
|
|
|
void* plugin_get_buffer(int *buffer_size);
|
2005-04-05 11:33:58 +00:00
|
|
|
|
void* plugin_get_audio_buffer(int *buffer_size);
|
2006-11-18 02:18:29 +00:00
|
|
|
|
#ifdef IRAM_STEAL
|
|
|
|
|
void plugin_iram_init(char *iramstart, char *iramcopy, size_t iram_size,
|
|
|
|
|
char *iedata, size_t iedata_size);
|
|
|
|
|
#endif
|
2006-10-31 11:17:00 +00:00
|
|
|
|
|
2007-04-10 14:18:30 +00:00
|
|
|
|
/* plugin_tsr,
|
2006-10-31 11:17:00 +00:00
|
|
|
|
callback returns true to allow the new plugin to load,
|
|
|
|
|
reenter means the currently running plugin is being reloaded */
|
|
|
|
|
void plugin_tsr(bool (*exit_callback)(bool reenter));
|
2003-06-29 16:33:04 +00:00
|
|
|
|
|
|
|
|
|
/* defined by the plugin */
|
2006-03-16 17:06:20 +00:00
|
|
|
|
enum plugin_status plugin_start(struct plugin_api* rockbox, void* parameter)
|
|
|
|
|
NO_PROF_ATTR;
|
2003-06-29 16:33:04 +00:00
|
|
|
|
|
|
|
|
|
#endif
|