2003-06-29 16:33:04 +00:00
|
|
|
|
/***************************************************************************
|
|
|
|
|
* __________ __ ___.
|
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
|
* $Id$
|
|
|
|
|
*
|
|
|
|
|
* Copyright (C) 2002 Bj<EFBFBD>rn Stenberg
|
|
|
|
|
*
|
|
|
|
|
* 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
|
|
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
2005-02-22 12:19:12 +00:00
|
|
|
|
#include <sys/types.h>
|
2003-06-29 16:33:04 +00:00
|
|
|
|
#include "config.h"
|
|
|
|
|
#include "dir.h"
|
|
|
|
|
#include "kernel.h"
|
|
|
|
|
#include "button.h"
|
|
|
|
|
#include "font.h"
|
|
|
|
|
#include "system.h"
|
|
|
|
|
#include "lcd.h"
|
2003-07-20 21:29:16 +00:00
|
|
|
|
#include "id3.h"
|
|
|
|
|
#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"
|
2005-04-25 08:21:10 +00:00
|
|
|
|
#if (HWCODEC == MASNONE)
|
2005-03-28 00:00:24 +00:00
|
|
|
|
#include "pcm_playback.h"
|
2005-04-25 08:21:10 +00:00
|
|
|
|
#endif
|
2004-01-30 22:30:40 +00:00
|
|
|
|
#include "settings.h"
|
2004-04-30 20:37:11 +00:00
|
|
|
|
#include "thread.h"
|
2004-06-19 09:36:03 +00:00
|
|
|
|
#include "playlist.h"
|
2004-07-08 13:14:44 +00:00
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
|
|
|
|
#include "widgets.h"
|
|
|
|
|
#endif
|
2005-04-01 13:41:03 +00:00
|
|
|
|
#include "sound.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
|
|
|
|
|
#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
|
|
|
|
|
#endif
|
|
|
|
|
|
2005-02-22 12:19:12 +00:00
|
|
|
|
#ifdef SIMULATOR
|
|
|
|
|
#define PREFIX(_x_) sim_ ## _x_
|
|
|
|
|
#else
|
|
|
|
|
#define PREFIX(_x_) _x_
|
|
|
|
|
#endif
|
|
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
|
/* increase this every time the api struct changes */
|
2005-04-28 12:33:38 +00:00
|
|
|
|
#define PLUGIN_API_VERSION 39
|
2003-07-25 23:04:59 +00:00
|
|
|
|
|
|
|
|
|
/* update this to latest version if a change to the api struct breaks
|
2004-02-03 23:56:25 +00:00
|
|
|
|
backwards compatibility (and please take the opportunity to sort in any
|
|
|
|
|
new function which are "waiting" at the end of the function table) */
|
2005-02-22 12:19:12 +00:00
|
|
|
|
#define PLUGIN_MIN_API_VERSION 32
|
2003-06-29 16:33:04 +00:00
|
|
|
|
|
|
|
|
|
/* plugin return codes */
|
|
|
|
|
enum plugin_status {
|
|
|
|
|
PLUGIN_OK = 0,
|
|
|
|
|
PLUGIN_USB_CONNECTED,
|
|
|
|
|
|
|
|
|
|
PLUGIN_WRONG_API_VERSION = -1,
|
|
|
|
|
PLUGIN_WRONG_MODEL = -2,
|
|
|
|
|
PLUGIN_ERROR = -3,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* different (incompatible) plugin models */
|
|
|
|
|
enum model {
|
|
|
|
|
PLAYER,
|
|
|
|
|
RECORDER
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
|
|
|
|
#define MODEL PLAYER
|
|
|
|
|
#else
|
|
|
|
|
#define MODEL RECORDER
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* compatibility test macro */
|
|
|
|
|
#define TEST_PLUGIN_API(_api_) \
|
|
|
|
|
do { \
|
2003-07-13 22:15:19 +00:00
|
|
|
|
int _rc_ = _api_->plugin_test(PLUGIN_API_VERSION, MODEL, MEM); \
|
2003-06-29 16:33:04 +00:00
|
|
|
|
if (_rc_<0) \
|
|
|
|
|
return _rc_; \
|
|
|
|
|
} while(0)
|
|
|
|
|
|
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 {
|
|
|
|
|
/* these two fields must always be first, to ensure
|
|
|
|
|
TEST_PLUGIN_API will always work */
|
|
|
|
|
int version;
|
2003-07-13 22:15:19 +00:00
|
|
|
|
int (*plugin_test)(int api_version, int model, int memsize);
|
2003-06-29 16:33:04 +00:00
|
|
|
|
|
|
|
|
|
/* lcd */
|
|
|
|
|
void (*lcd_clear_display)(void);
|
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);
|
2004-07-27 14:10:48 +00:00
|
|
|
|
void (*lcd_set_contrast)(int x);
|
2003-06-29 16:33:04 +00:00
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
2004-08-17 01:45:48 +00:00
|
|
|
|
void (*lcd_define_pattern)(int which,const char *pattern);
|
2003-07-24 09:35:32 +00:00
|
|
|
|
unsigned char (*lcd_get_locked_pattern)(void);
|
|
|
|
|
void (*lcd_unlock_pattern)(unsigned char pat);
|
|
|
|
|
void (*lcd_putc)(int x, int y, unsigned short ch);
|
2004-07-27 14:10:48 +00:00
|
|
|
|
void (*lcd_put_cursor)(int x, int y, char cursor_char);
|
|
|
|
|
void (*lcd_remove_cursor)(void);
|
2005-02-22 13:02:33 +00:00
|
|
|
|
void (*PREFIX(lcd_icon))(int icon, bool enable);
|
2003-06-29 16:33:04 +00:00
|
|
|
|
#else
|
2004-07-19 21:46:37 +00:00
|
|
|
|
void (*lcd_putsxy)(int x, int y, const unsigned char *string);
|
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);
|
2004-07-19 21:46:37 +00:00
|
|
|
|
void (*lcd_bitmap)(const unsigned char *src, int x, int y,
|
2003-06-29 16:33:04 +00:00
|
|
|
|
int nx, int ny, bool clear);
|
|
|
|
|
void (*lcd_drawline)(int x1, int y1, int x2, int y2);
|
|
|
|
|
void (*lcd_clearline)(int x1, int y1, int x2, int y2);
|
|
|
|
|
void (*lcd_drawpixel)(int x, int y);
|
|
|
|
|
void (*lcd_clearpixel)(int x, int y);
|
|
|
|
|
void (*lcd_setfont)(int font);
|
2004-07-27 14:10:48 +00:00
|
|
|
|
struct font* (*font_get)(int font);
|
2003-06-29 16:33:04 +00:00
|
|
|
|
void (*lcd_clearrect)(int x, int y, int nx, int ny);
|
|
|
|
|
void (*lcd_fillrect)(int x, int y, int nx, int ny);
|
|
|
|
|
void (*lcd_drawrect)(int x, int y, int nx, int ny);
|
|
|
|
|
void (*lcd_invertrect)(int x, int y, int nx, int ny);
|
2004-08-01 21:50:57 +00:00
|
|
|
|
int (*lcd_getstringsize)(const unsigned char *str, int *w, int *h);
|
2003-06-29 16:33:04 +00:00
|
|
|
|
void (*lcd_update)(void);
|
|
|
|
|
void (*lcd_update_rect)(int x, int y, int width, int height);
|
2003-07-09 22:36:23 +00:00
|
|
|
|
void (*scrollbar)(int x, int y, int width, int height, int items,
|
|
|
|
|
int min_shown, int max_shown, int orientation);
|
2004-07-27 14:10:48 +00:00
|
|
|
|
void (*checkbox)(int x, int y, int width, int height, bool checked);
|
|
|
|
|
unsigned char* lcd_framebuffer;
|
2004-08-17 01:45:48 +00:00
|
|
|
|
void (*lcd_blit) (const unsigned char* p_data, int x, int y, int width,
|
|
|
|
|
int height, int stride);
|
2003-06-29 16:33:04 +00:00
|
|
|
|
#ifndef SIMULATOR
|
|
|
|
|
void (*lcd_roll)(int pixels);
|
|
|
|
|
#endif
|
|
|
|
|
#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);
|
2004-08-18 01:09:31 +00:00
|
|
|
|
void (*splash)(int ticks, bool center, const char *fmt, ...);
|
2003-06-29 16:33:04 +00:00
|
|
|
|
|
2005-04-15 12:55:31 +00:00
|
|
|
|
#ifdef HAVE_REMOTE_LCD
|
2005-04-25 23:47:51 +00:00
|
|
|
|
void (*remote_clear_display)(void);
|
|
|
|
|
void (*remote_puts)(int x, int y, const unsigned char *string);
|
|
|
|
|
void (*remote_lcd_puts_scroll)(int x, int y, const unsigned char* string);
|
|
|
|
|
void (*remote_lcd_stop_scroll)(void);
|
|
|
|
|
void (*remote_set_contrast)(int x);
|
|
|
|
|
|
|
|
|
|
void (*remote_putsxy)(int x, int y, const unsigned char *string);
|
|
|
|
|
void (*remote_puts_style)(int x, int y, const unsigned char *str, int style);
|
|
|
|
|
void (*remote_puts_scroll_style)(int x, int y, const unsigned char* string,
|
|
|
|
|
int style);
|
|
|
|
|
void (*remote_bitmap)(const unsigned char *src, int x, int y,
|
|
|
|
|
int nx, int ny, bool clear);
|
|
|
|
|
void (*remote_drawline)(int x1, int y1, int x2, int y2);
|
|
|
|
|
void (*remote_clearline)(int x1, int y1, int x2, int y2);
|
|
|
|
|
void (*remote_drawpixel)(int x, int y);
|
|
|
|
|
void (*remote_clearpixel)(int x, int y);
|
|
|
|
|
void (*remote_setfont)(int font);
|
|
|
|
|
struct font* (*remote_font_get)(int font);
|
|
|
|
|
void (*remote_clearrect)(int x, int y, int nx, int ny);
|
|
|
|
|
void (*remote_fillrect)(int x, int y, int nx, int ny);
|
|
|
|
|
void (*remote_drawrect)(int x, int y, int nx, int ny);
|
|
|
|
|
void (*remote_invertrect)(int x, int y, int nx, int ny);
|
|
|
|
|
int (*remote_getstringsize)(const unsigned char *str, int *w, int *h);
|
|
|
|
|
void (*remote_update)(void);
|
|
|
|
|
void (*remote_update_rect)(int x, int y, int width, int height);
|
|
|
|
|
// void (*remote_scrollbar)(int x, int y, int width, int height, int items,
|
|
|
|
|
// int min_shown, int max_shown, int orientation);
|
|
|
|
|
//void (*remote_checkbox)(int x, int y, int width, int height, bool checked);
|
2005-04-15 12:55:31 +00:00
|
|
|
|
void (*remote_backlight_on)(void);
|
2005-04-25 23:47:51 +00:00
|
|
|
|
void (*remote_backlight_off)(void);
|
2005-04-15 12:55:31 +00:00
|
|
|
|
unsigned char* lcd_remote_framebuffer;
|
|
|
|
|
#endif
|
|
|
|
|
|
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);
|
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);
|
2005-02-22 12:19:12 +00:00
|
|
|
|
int (*PREFIX(creat))(const char *pathname, mode_t mode);
|
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);
|
|
|
|
|
int (*fdprintf)(int fd, const char *fmt, ...);
|
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
|
|
|
|
|
int (*ata_sleep)(void);
|
|
|
|
|
#endif
|
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);
|
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);
|
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);
|
2004-08-03 05:58:46 +00:00
|
|
|
|
int (*create_thread)(void* function, void* stack, int stack_size, const char *name);
|
2004-07-27 14:10:48 +00:00
|
|
|
|
void (*remove_thread)(int threadnum);
|
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);
|
|
|
|
|
#endif
|
2003-06-29 16:33:04 +00:00
|
|
|
|
|
|
|
|
|
/* strings and memory */
|
2004-10-23 09:59:53 +00:00
|
|
|
|
int (*snprintf)(char *buf, size_t size, const char *fmt, ...);
|
|
|
|
|
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 *);
|
|
|
|
|
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);
|
2004-07-20 22:32:17 +00:00
|
|
|
|
const 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);
|
|
|
|
|
int (*memcmp)(const void *s1, const void *s2, size_t n);
|
2003-06-29 16:33:04 +00:00
|
|
|
|
|
|
|
|
|
/* sound */
|
2005-04-01 13:41:03 +00:00
|
|
|
|
void (*sound_set)(int setting, int value);
|
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);
|
|
|
|
|
void (*bitswap)(unsigned char *data, int length);
|
2003-06-29 16:33:04 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
2004-07-27 14:10:48 +00:00
|
|
|
|
/* playback control */
|
2005-04-04 12:06:29 +00:00
|
|
|
|
void (*PREFIX(audio_play))(int offset);
|
|
|
|
|
void (*audio_stop)(void);
|
|
|
|
|
void (*audio_pause)(void);
|
|
|
|
|
void (*audio_resume)(void);
|
|
|
|
|
void (*audio_next)(void);
|
|
|
|
|
void (*audio_prev)(void);
|
|
|
|
|
void (*audio_ff_rewind)(int newtime);
|
|
|
|
|
struct mp3entry* (*audio_next_track)(void);
|
2004-07-27 14:10:48 +00:00
|
|
|
|
int (*playlist_amount)(void);
|
2005-04-04 12:06:29 +00:00
|
|
|
|
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-04-25 08:59:19 +00:00
|
|
|
|
#if !defined(SIMULATOR) && (CONFIG_HWCODEC != MASNONE)
|
2005-04-25 08:21:10 +00:00
|
|
|
|
unsigned long (*mpeg_get_last_header)(void);
|
2005-04-25 08:59:19 +00:00
|
|
|
|
#endif
|
|
|
|
|
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F)
|
2005-04-01 13:41:03 +00:00
|
|
|
|
void (*sound_set_pitch)(int pitch);
|
2004-10-23 09:59:53 +00:00
|
|
|
|
#endif
|
2004-07-27 19:16:58 +00:00
|
|
|
|
|
|
|
|
|
/* MAS communication */
|
2005-02-03 10:06:02 +00:00
|
|
|
|
#if !defined(SIMULATOR) && (CONFIG_HWCODEC != MASNONE)
|
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);
|
2004-09-29 19:51:41 +00:00
|
|
|
|
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F)
|
2004-07-27 19:16:58 +00:00
|
|
|
|
int (*mas_codec_writereg)(int reg, unsigned int val);
|
|
|
|
|
int (*mas_codec_readreg)(int reg);
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
2004-10-23 09:59:53 +00:00
|
|
|
|
|
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);
|
2004-01-30 22:30:40 +00:00
|
|
|
|
#ifndef SIMULATOR
|
2004-07-27 14:10:48 +00:00
|
|
|
|
int (*plugin_register_timer)(int cycles, int prio, void (*timer_callback)(void));
|
|
|
|
|
void (*plugin_unregister_timer)(void);
|
2004-01-30 22:30:40 +00:00
|
|
|
|
#endif
|
2004-07-27 14:10:48 +00:00
|
|
|
|
void (*plugin_tsr)(void (*exit_callback)(void));
|
2004-06-10 13:29:52 +00:00
|
|
|
|
#if defined(DEBUG) || defined(SIMULATOR)
|
2004-08-18 19:59:06 +00:00
|
|
|
|
void (*debugf)(const char *fmt, ...);
|
2004-06-10 13:48:53 +00:00
|
|
|
|
#endif
|
2004-07-27 19:16:58 +00:00
|
|
|
|
struct user_settings* global_settings;
|
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));
|
|
|
|
|
int (*create_xing_header)(int fd, int startpos, int filesize,
|
|
|
|
|
unsigned char *buf, int num_frames,
|
|
|
|
|
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,
|
|
|
|
|
long max_offset, unsigned long last_header);
|
2004-10-23 09:59:53 +00:00
|
|
|
|
int (*battery_level)(void);
|
|
|
|
|
bool (*battery_level_safe)(void);
|
2004-09-29 19:51:41 +00:00
|
|
|
|
#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F)
|
2004-07-29 13:59:04 +00:00
|
|
|
|
unsigned short (*peak_meter_scale_value)(unsigned short val,
|
|
|
|
|
int meterwidth);
|
|
|
|
|
void (*peak_meter_set_use_dbfs)(int use);
|
2004-10-23 09:59:53 +00:00
|
|
|
|
int (*peak_meter_get_use_dbfs)(void);
|
2004-08-30 19:52:45 +00:00
|
|
|
|
#endif
|
2004-10-23 09:59:53 +00:00
|
|
|
|
|
|
|
|
|
/* new stuff at the end, sort into place next time
|
|
|
|
|
the API gets incompatible */
|
2005-03-01 14:36:16 +00:00
|
|
|
|
#ifndef SIMULATOR
|
|
|
|
|
long *cpu_frequency;
|
2005-03-02 14:32:53 +00:00
|
|
|
|
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
|
|
|
|
void (*cpu_boost)(bool on_off);
|
|
|
|
|
#endif
|
2005-03-01 14:36:16 +00:00
|
|
|
|
#endif
|
2005-03-02 22:50:38 +00:00
|
|
|
|
int (*PREFIX(mkdir))(const char *name, int mode);
|
2005-03-03 14:10:17 +00:00
|
|
|
|
#if CONFIG_KEYPAD == IRIVER_H100_PAD
|
|
|
|
|
bool (*button_hold)(void);
|
|
|
|
|
#endif
|
2005-03-28 00:29:07 +00:00
|
|
|
|
#if (CONFIG_HWCODEC == MASNONE) && !defined(SIMULATOR)
|
2005-03-20 23:05:44 +00:00
|
|
|
|
void (*pcm_play_data)(const unsigned char *start, int size,
|
|
|
|
|
void (*get_more)(unsigned char** start, long*size));
|
2005-03-28 00:00:24 +00:00
|
|
|
|
void (*pcm_play_stop)(void);
|
|
|
|
|
void (*pcm_set_frequency)(unsigned int frequency);
|
2005-03-20 23:05:44 +00:00
|
|
|
|
bool (*pcm_is_playing)(void);
|
2005-03-28 00:00:24 +00:00
|
|
|
|
void (*pcm_set_volume)(int volume);
|
2005-03-31 06:50:59 +00:00
|
|
|
|
void (*pcm_play_pause)(bool play);
|
2005-03-21 00:24:31 +00:00
|
|
|
|
#endif
|
2005-04-25 07:42:10 +00:00
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
|
|
|
|
int (*read_bmp_file)(char* filename, int *get_width, int *get_height,
|
|
|
|
|
char *bitmap, int maxsize);
|
|
|
|
|
#endif
|
2005-04-28 12:33:38 +00:00
|
|
|
|
struct tagdb_header *tagdbheader;
|
|
|
|
|
int *tagdb_fd;
|
|
|
|
|
int *tagdb_initialized;
|
|
|
|
|
int (*tagdb_init) (void);
|
|
|
|
|
char *(*strcasestr) (const char* phaystack, const char* pneedle);
|
2003-06-29 16:33:04 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* defined by the plugin loader (plugin.c) */
|
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);
|
2004-04-30 20:37:11 +00:00
|
|
|
|
int plugin_register_timer(int cycles, int prio, void (*timer_callback)(void));
|
|
|
|
|
void plugin_unregister_timer(void);
|
|
|
|
|
void plugin_tsr(void (*exit_callback)(void));
|
2003-06-29 16:33:04 +00:00
|
|
|
|
|
|
|
|
|
/* defined by the plugin */
|
|
|
|
|
enum plugin_status plugin_start(struct plugin_api* rockbox, void* parameter)
|
|
|
|
|
__attribute__ ((section (".entry")));
|
|
|
|
|
|
|
|
|
|
#endif
|