mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-20 02:22:43 -05:00
Patch #5056 by Jonathan Gordon, with rework and additions by me: Updated Viewer plugin. Replaces annoying mode-toggle key-combos with a settings menu, including a new 'Scroll by Line' option. I've also added a 'hands-free' auto-scroll feature and added lcd_setmargins to the plugin API, since we need it here.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9844 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
0d6b5557a1
commit
07fcf77cb0
3 changed files with 354 additions and 394 deletions
|
|
@ -182,7 +182,7 @@ static const struct plugin_api rockbox_api = {
|
||||||
button_get_w_tmo,
|
button_get_w_tmo,
|
||||||
button_status,
|
button_status,
|
||||||
button_clear_queue,
|
button_clear_queue,
|
||||||
#ifdef HAS_BUTTON_HOLD
|
#ifdef HAS_BUTTON_HOLD
|
||||||
button_hold,
|
button_hold,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -202,7 +202,7 @@ static const struct plugin_api rockbox_api = {
|
||||||
settings_parseline,
|
settings_parseline,
|
||||||
#ifndef SIMULATOR
|
#ifndef SIMULATOR
|
||||||
ata_sleep,
|
ata_sleep,
|
||||||
ata_disk_is_active,
|
ata_disk_is_active,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* dir */
|
/* dir */
|
||||||
|
|
@ -290,7 +290,7 @@ static const struct plugin_api rockbox_api = {
|
||||||
bitswap,
|
bitswap,
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_CODEC == SWCODEC
|
#if CONFIG_CODEC == SWCODEC
|
||||||
pcm_play_data,
|
pcm_play_data,
|
||||||
pcm_play_stop,
|
pcm_play_stop,
|
||||||
pcm_set_frequency,
|
pcm_set_frequency,
|
||||||
pcm_is_playing,
|
pcm_is_playing,
|
||||||
|
|
@ -357,7 +357,7 @@ static const struct plugin_api rockbox_api = {
|
||||||
battery_level_safe,
|
battery_level_safe,
|
||||||
battery_time,
|
battery_time,
|
||||||
#ifndef SIMULATOR
|
#ifndef SIMULATOR
|
||||||
battery_voltage,
|
battery_voltage,
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_CHARGING
|
#ifdef HAVE_CHARGING
|
||||||
charger_inserted,
|
charger_inserted,
|
||||||
|
|
@ -434,6 +434,10 @@ static const struct plugin_api rockbox_api = {
|
||||||
gui_synclist_scroll_left,
|
gui_synclist_scroll_left,
|
||||||
#endif
|
#endif
|
||||||
gui_synclist_do_button,
|
gui_synclist_do_button,
|
||||||
|
|
||||||
|
#ifdef HAVE_LCD_BITMAP
|
||||||
|
lcd_setmargins,
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
int plugin_load(const char* plugin, void* parameter)
|
int plugin_load(const char* plugin, void* parameter)
|
||||||
|
|
@ -553,7 +557,7 @@ int plugin_load(const char* plugin, void* parameter)
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
#if LCD_DEPTH > 1
|
#if LCD_DEPTH > 1
|
||||||
#ifdef HAVE_LCD_COLOR
|
#ifdef HAVE_LCD_COLOR
|
||||||
lcd_set_drawinfo(DRMODE_SOLID, global_settings.fg_color,
|
lcd_set_drawinfo(DRMODE_SOLID, global_settings.fg_color,
|
||||||
global_settings.bg_color);
|
global_settings.bg_color);
|
||||||
#else
|
#else
|
||||||
lcd_set_drawinfo(DRMODE_SOLID, LCD_DEFAULT_FG, LCD_DEFAULT_BG);
|
lcd_set_drawinfo(DRMODE_SOLID, LCD_DEFAULT_FG, LCD_DEFAULT_BG);
|
||||||
|
|
@ -607,7 +611,7 @@ void* plugin_get_buffer(int* buffer_size)
|
||||||
{
|
{
|
||||||
if (plugin_size >= PLUGIN_BUFFER_SIZE)
|
if (plugin_size >= PLUGIN_BUFFER_SIZE)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
*buffer_size = PLUGIN_BUFFER_SIZE-plugin_size;
|
*buffer_size = PLUGIN_BUFFER_SIZE-plugin_size;
|
||||||
buffer_pos = plugin_size;
|
buffer_pos = plugin_size;
|
||||||
}
|
}
|
||||||
|
|
@ -620,7 +624,7 @@ void* plugin_get_buffer(int* buffer_size)
|
||||||
return &pluginbuf[buffer_pos];
|
return &pluginbuf[buffer_pos];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns a pointer to the mp3 buffer.
|
/* Returns a pointer to the mp3 buffer.
|
||||||
Playback gets stopped, to avoid conflicts. */
|
Playback gets stopped, to avoid conflicts. */
|
||||||
void* plugin_get_audio_buffer(int* buffer_size)
|
void* plugin_get_audio_buffer(int* buffer_size)
|
||||||
{
|
{
|
||||||
|
|
@ -631,7 +635,7 @@ void* plugin_get_audio_buffer(int* buffer_size)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The plugin wants to stay resident after leaving its main function, e.g.
|
/* The plugin wants to stay resident after leaving its main function, e.g.
|
||||||
runs from timer or own thread. The callback is registered to later
|
runs from timer or own thread. The callback is registered to later
|
||||||
instruct it to free its resources before a new plugin gets loaded. */
|
instruct it to free its resources before a new plugin gets loaded. */
|
||||||
void plugin_tsr(void (*exit_callback)(void))
|
void plugin_tsr(void (*exit_callback)(void))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@
|
||||||
#define PLUGIN_API_VERSION 18
|
#define PLUGIN_API_VERSION 18
|
||||||
|
|
||||||
/* update this to latest version if a change to the api struct breaks
|
/* update this to latest version if a change to the api struct breaks
|
||||||
backwards compatibility (and please take the opportunity to sort in any
|
backwards compatibility (and please take the opportunity to sort in any
|
||||||
new function which are "waiting" at the end of the function table) */
|
new function which are "waiting" at the end of the function table) */
|
||||||
#define PLUGIN_MIN_API_VERSION 14
|
#define PLUGIN_MIN_API_VERSION 14
|
||||||
|
|
||||||
|
|
@ -233,7 +233,7 @@ struct plugin_api {
|
||||||
long (*button_get_w_tmo)(int ticks);
|
long (*button_get_w_tmo)(int ticks);
|
||||||
int (*button_status)(void);
|
int (*button_status)(void);
|
||||||
void (*button_clear_queue)(void);
|
void (*button_clear_queue)(void);
|
||||||
#ifdef HAS_BUTTON_HOLD
|
#ifdef HAS_BUTTON_HOLD
|
||||||
bool (*button_hold)(void);
|
bool (*button_hold)(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -255,7 +255,7 @@ struct plugin_api {
|
||||||
void (*ata_sleep)(void);
|
void (*ata_sleep)(void);
|
||||||
bool (*ata_disk_is_active)(void);
|
bool (*ata_disk_is_active)(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* dir */
|
/* dir */
|
||||||
DIR* (*PREFIX(opendir))(const char* name);
|
DIR* (*PREFIX(opendir))(const char* name);
|
||||||
int (*PREFIX(closedir))(DIR* dir);
|
int (*PREFIX(closedir))(DIR* dir);
|
||||||
|
|
@ -376,7 +376,7 @@ struct plugin_api {
|
||||||
#endif
|
#endif
|
||||||
#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) || \
|
#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) || \
|
||||||
(CONFIG_CODEC == SWCODEC)
|
(CONFIG_CODEC == SWCODEC)
|
||||||
void (*sound_set_pitch)(int pitch);
|
void (*sound_set_pitch)(int pitch);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* MAS communication */
|
/* MAS communication */
|
||||||
|
|
@ -408,8 +408,8 @@ struct plugin_api {
|
||||||
void (*menu_insert)(int menu, int position, char *desc, bool (*function) (void));
|
void (*menu_insert)(int menu, int position, char *desc, bool (*function) (void));
|
||||||
void (*menu_set_cursor)(int menu, int position);
|
void (*menu_set_cursor)(int menu, int position);
|
||||||
|
|
||||||
bool (*set_option)(const char* string, void* variable,
|
bool (*set_option)(const char* string, void* variable,
|
||||||
enum optiontype type, const struct opt_items* options,
|
enum optiontype type, const struct opt_items* options,
|
||||||
int numoptions, void (*function)(int));
|
int numoptions, void (*function)(int));
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -473,7 +473,7 @@ struct plugin_api {
|
||||||
struct tree_context* (*tree_get_context)(void);
|
struct tree_context* (*tree_get_context)(void);
|
||||||
|
|
||||||
/* new stuff at the end, sort into place next time
|
/* new stuff at the end, sort into place next time
|
||||||
the API gets incompatible */
|
the API gets incompatible */
|
||||||
bool (*set_sound)(const unsigned char * string,
|
bool (*set_sound)(const unsigned char * string,
|
||||||
int* variable, int setting);
|
int* variable, int setting);
|
||||||
#if ((CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)) && !defined(SIMULATOR)
|
#if ((CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)) && !defined(SIMULATOR)
|
||||||
|
|
@ -510,6 +510,10 @@ struct plugin_api {
|
||||||
void (*gui_synclist_scroll_left)(struct gui_synclist * lists);
|
void (*gui_synclist_scroll_left)(struct gui_synclist * lists);
|
||||||
#endif
|
#endif
|
||||||
unsigned (*gui_synclist_do_button)(struct gui_synclist * lists, unsigned button);
|
unsigned (*gui_synclist_do_button)(struct gui_synclist * lists, unsigned button);
|
||||||
|
|
||||||
|
#ifdef HAVE_LCD_BITMAP
|
||||||
|
void (*lcd_setmargins)(int x, int y);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/* plugin header */
|
/* plugin header */
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue