stats's plugin PLA integration (main code + manual)
1) this patch replace all keymaps with PLA ones. It also clean some optionnal compiling that are not needed anymore througt PLA 2) the patch also made required change to the manual in order to match code's change. 3) it also add an alternative exit button (PLA_EXIT or PLA_CANCEL) TO TEST: I'm not sure if remote control works anymore and cannot test it. I'm not sure about the way PLA handle those so if that doesn't work let me know ;) Change-Id: I3fb81e75ef6e4d49e19be24f09c0413599ed0c9c Reviewed-on: http://gerrit.rockbox.org/90 Tested-by: Thomas Martitz <kugel@rockbox.org> Reviewed-by: Thomas Martitz <kugel@rockbox.org>
This commit is contained in:
parent
164cb21fe5
commit
d8fd988cf2
2 changed files with 16 additions and 113 deletions
|
@ -19,105 +19,19 @@
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include "plugin.h"
|
#include "plugin.h"
|
||||||
|
#include "lib/pluginlib_actions.h"
|
||||||
|
|
||||||
|
|
||||||
static int files, dirs, audiofiles, m3ufiles, imagefiles, videofiles, largestdir;
|
static int files, dirs, audiofiles, m3ufiles, imagefiles, videofiles, largestdir;
|
||||||
static int lasttick;
|
static int lasttick;
|
||||||
static bool cancel;
|
static bool cancel;
|
||||||
|
|
||||||
#if CONFIG_KEYPAD == PLAYER_PAD
|
|
||||||
#define STATS_STOP BUTTON_STOP
|
|
||||||
|
|
||||||
#elif (CONFIG_KEYPAD == RECORDER_PAD) \
|
/* we use PLA */
|
||||||
|| (CONFIG_KEYPAD == ONDIO_PAD) \
|
#define STATS_STOP PLA_EXIT
|
||||||
|| (CONFIG_KEYPAD == ARCHOS_AV300_PAD)
|
#define STATS_STOP2 PLA_CANCEL
|
||||||
#define STATS_STOP BUTTON_OFF
|
/* this set the context to use with PLA */
|
||||||
|
static const struct button_mapping *plugin_contexts[] = { pla_main_ctx };
|
||||||
#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) \
|
|
||||||
|| (CONFIG_KEYPAD == IRIVER_H300_PAD)
|
|
||||||
#define STATS_STOP BUTTON_OFF
|
|
||||||
#define STATS_STOP_REMOTE BUTTON_RC_STOP
|
|
||||||
|
|
||||||
#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \
|
|
||||||
(CONFIG_KEYPAD == IPOD_3G_PAD) || \
|
|
||||||
(CONFIG_KEYPAD == IPOD_1G2G_PAD)
|
|
||||||
#define STATS_STOP BUTTON_MENU
|
|
||||||
|
|
||||||
#elif (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD) || \
|
|
||||||
(CONFIG_KEYPAD == SAMSUNG_YH_PAD)
|
|
||||||
#define STATS_STOP BUTTON_PLAY
|
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD
|
|
||||||
#define STATS_STOP BUTTON_POWER
|
|
||||||
#define STATS_STOP_REMOTE BUTTON_RC_PLAY
|
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == GIGABEAT_PAD
|
|
||||||
#define STATS_STOP BUTTON_POWER
|
|
||||||
|
|
||||||
#elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \
|
|
||||||
(CONFIG_KEYPAD == SANSA_C200_PAD) || \
|
|
||||||
(CONFIG_KEYPAD == SANSA_CLIP_PAD) || \
|
|
||||||
(CONFIG_KEYPAD == SANSA_M200_PAD) || \
|
|
||||||
(CONFIG_KEYPAD == SANSA_CONNECT_PAD)
|
|
||||||
#define STATS_STOP BUTTON_POWER
|
|
||||||
|
|
||||||
#elif (CONFIG_KEYPAD == SANSA_FUZE_PAD)
|
|
||||||
#define STATS_STOP BUTTON_HOME
|
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == IRIVER_H10_PAD
|
|
||||||
#define STATS_STOP BUTTON_POWER
|
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MROBE500_PAD
|
|
||||||
#define STATS_STOP BUTTON_POWER
|
|
||||||
#define STATS_STOP_REMOTE BUTTON_RC_DOWN
|
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == GIGABEAT_S_PAD || \
|
|
||||||
CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
|
|
||||||
#define STATS_STOP BUTTON_BACK
|
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MROBE100_PAD
|
|
||||||
#define STATS_STOP BUTTON_POWER
|
|
||||||
#define STATS_STOP_REMOTE BUTTON_RC_DOWN
|
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == IAUDIO_M3_PAD
|
|
||||||
#define STATS_STOP BUTTON_REC
|
|
||||||
#define STATS_STOP_REMOTE BUTTON_RC_REC
|
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == COWON_D2_PAD
|
|
||||||
#define STATS_STOP BUTTON_POWER
|
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == IAUDIO67_PAD
|
|
||||||
#define STATS_STOP BUTTON_POWER
|
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == CREATIVEZVM_PAD
|
|
||||||
#define STATS_STOP BUTTON_BACK
|
|
||||||
|
|
||||||
#elif (CONFIG_KEYPAD == PHILIPS_HDD1630_PAD) || \
|
|
||||||
(CONFIG_KEYPAD == PHILIPS_HDD6330_PAD) || \
|
|
||||||
(CONFIG_KEYPAD == PHILIPS_SA9200_PAD)
|
|
||||||
#define STATS_STOP BUTTON_POWER
|
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == ONDAVX747_PAD
|
|
||||||
#define STATS_STOP BUTTON_POWER
|
|
||||||
#elif CONFIG_KEYPAD == ONDAVX777_PAD
|
|
||||||
#define STATS_STOP BUTTON_POWER
|
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == PBELL_VIBE500_PAD
|
|
||||||
#define STATS_STOP BUTTON_REC
|
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MPIO_HD200_PAD
|
|
||||||
#define STATS_STOP BUTTON_REC
|
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == MPIO_HD300_PAD
|
|
||||||
#define STATS_STOP BUTTON_REC
|
|
||||||
|
|
||||||
#elif CONFIG_KEYPAD == SANSA_FUZEPLUS_PAD
|
|
||||||
#define STATS_STOP BUTTON_BACK
|
|
||||||
|
|
||||||
#else
|
|
||||||
#error No keymap defined!
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* we don't have yet a filetype attribute for image files */
|
/* we don't have yet a filetype attribute for image files */
|
||||||
static const char *image_exts[] = {"bmp","jpg","jpe","jpeg","png","ppm"};
|
static const char *image_exts[] = {"bmp","jpg","jpe","jpeg","png","ppm"};
|
||||||
|
@ -240,12 +154,9 @@ static void traversedir(char* location, char* name)
|
||||||
if (*rb->current_tick - lasttick > (HZ/2)) {
|
if (*rb->current_tick - lasttick > (HZ/2)) {
|
||||||
update_screen();
|
update_screen();
|
||||||
lasttick = *rb->current_tick;
|
lasttick = *rb->current_tick;
|
||||||
button = rb->button_get(false);
|
button = pluginlib_getaction(TIMEOUT_NOBLOCK, plugin_contexts,
|
||||||
if (button == STATS_STOP
|
ARRAYLEN(plugin_contexts));
|
||||||
#ifdef HAVE_REMOTE_LCD
|
if (button == STATS_STOP) {
|
||||||
|| button == STATS_STOP_REMOTE
|
|
||||||
#endif
|
|
||||||
) {
|
|
||||||
cancel = true;
|
cancel = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -292,12 +203,12 @@ enum plugin_status plugin_start(const void* parameter)
|
||||||
rb->splash(HZ, "Done");
|
rb->splash(HZ, "Done");
|
||||||
update_screen();
|
update_screen();
|
||||||
while (1) {
|
while (1) {
|
||||||
button = rb->button_get(true);
|
|
||||||
|
button = pluginlib_getaction(TIMEOUT_BLOCK, plugin_contexts,
|
||||||
|
ARRAYLEN(plugin_contexts));
|
||||||
switch (button) {
|
switch (button) {
|
||||||
#ifdef HAVE_REMOTE_LCD
|
|
||||||
case STATS_STOP_REMOTE:
|
|
||||||
#endif
|
|
||||||
case STATS_STOP:
|
case STATS_STOP:
|
||||||
|
case STATS_STOP2:
|
||||||
return PLUGIN_OK;
|
return PLUGIN_OK;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -5,14 +5,6 @@ The stats plugin counts the directories and files%
|
||||||
\nopt{archosplayer}{ (the total number as well as the number
|
\nopt{archosplayer}{ (the total number as well as the number
|
||||||
of audio, playlist, image and video files) }%
|
of audio, playlist, image and video files) }%
|
||||||
on your \dap{}.
|
on your \dap{}.
|
||||||
Press %
|
Press \PluginCancel{} or \PluginExit{} to abort counting and
|
||||||
\opt{PLAYER_PAD}{\ButtonStop}%
|
exit the plugin. Press it again to quit after counting has
|
||||||
\opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}%
|
finished.
|
||||||
\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu}%
|
|
||||||
\opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,GIGABEAT_PAD%
|
|
||||||
,MROBE100_PAD,COWON_D2_PAD}{\ButtonPower}%
|
|
||||||
\opt{SANSA_FUZE_PAD}{\ButtonHome}%
|
|
||||||
\opt{PBELL_VIBE500_PAD}{\ButtonRec}%
|
|
||||||
\opt{GIGABEAT_S_PAD}{\ButtonBack} %
|
|
||||||
to abort counting and exit the plugin. Press it again to quit after counting
|
|
||||||
has finished.
|
|
||||||
|
|
Loading…
Reference in a new issue