Initial suppport for building Rockbox for Neo. The Neo has a different
key layout so we need to check for this. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4138 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
ca71062221
commit
8e43ccbec6
10 changed files with 130 additions and 70 deletions
|
@ -85,7 +85,9 @@ bool dbg_os(void)
|
|||
|
||||
switch(button)
|
||||
{
|
||||
#ifdef BUTTON_OFF
|
||||
case BUTTON_OFF:
|
||||
#endif
|
||||
case BUTTON_LEFT:
|
||||
return false;
|
||||
}
|
||||
|
@ -1194,9 +1196,9 @@ static bool view_runtime(void)
|
|||
/* Wait for a key to be pushed */
|
||||
key = button_get_w_tmo(HZ);
|
||||
switch(key) {
|
||||
#ifdef HAVE_PLAYER_KEYPAD
|
||||
#if defined(HAVE_PLAYER_KEYPAD) || defined(HAVE_NEO_KEYPAD)
|
||||
case BUTTON_STOP | BUTTON_REL:
|
||||
#else
|
||||
#elif HAVE_RECORDER_KEYPAD
|
||||
case BUTTON_OFF | BUTTON_REL:
|
||||
#endif
|
||||
done = true;
|
||||
|
@ -1301,7 +1303,7 @@ static bool dbg_disk_info(void)
|
|||
/* Wait for a key to be pushed */
|
||||
key = button_get_w_tmo(HZ*5);
|
||||
switch(key) {
|
||||
#ifdef HAVE_PLAYER_KEYPAD
|
||||
#if defined(HAVE_PLAYER_KEYPAD) || defined(HAVE_NEO_KEYPAD)
|
||||
case BUTTON_STOP | BUTTON_REL:
|
||||
#else
|
||||
case BUTTON_OFF | BUTTON_REL:
|
||||
|
|
|
@ -138,6 +138,7 @@ void init(void)
|
|||
|
||||
powermgmt_init();
|
||||
|
||||
#ifdef HAVE_BATTERIES
|
||||
if (coldstart && charger_inserted())
|
||||
{
|
||||
rc = charging_screen(); /* display a "charging" screen */
|
||||
|
@ -145,6 +146,7 @@ void init(void)
|
|||
power_off();
|
||||
/* "On" pressed or USB connected: proceed */
|
||||
}
|
||||
#endif
|
||||
|
||||
rc = ata_init();
|
||||
if(rc)
|
||||
|
|
|
@ -218,7 +218,7 @@ bool show_info(void)
|
|||
/* Wait for a key to be pushed */
|
||||
key = button_get_w_tmo(HZ*5);
|
||||
switch(key) {
|
||||
#ifdef HAVE_PLAYER_KEYPAD
|
||||
#if defined(HAVE_PLAYER_KEYPAD) || defined(HAVE_NEO_KEYPAD)
|
||||
case BUTTON_STOP | BUTTON_REL:
|
||||
#else
|
||||
case BUTTON_LEFT | BUTTON_REL:
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
#define KEYBOARD_PAGES 3
|
||||
|
||||
unsigned short *lcd_ascii;
|
||||
extern unsigned short *lcd_ascii;
|
||||
|
||||
static unsigned short* kbd_setupkeys(int page, int* len)
|
||||
{
|
||||
|
|
|
@ -453,7 +453,7 @@ static int add_directory_to_playlist(char *dirname, int *position, bool queue,
|
|||
for (i=0; i<num_files; i++)
|
||||
{
|
||||
/* user abort */
|
||||
#ifdef HAVE_PLAYER_KEYPAD
|
||||
#if defined(HAVE_PLAYER_KEYPAD) || defined(HAVE_NEO_KEYPAD)
|
||||
if (button_get(false) == BUTTON_STOP)
|
||||
#else
|
||||
if (button_get(false) == BUTTON_OFF)
|
||||
|
@ -1553,7 +1553,7 @@ int playlist_insert_playlist(char *filename, int position, bool queue)
|
|||
while ((max = read_line(fd, temp_buf, sizeof(temp_buf))) > 0)
|
||||
{
|
||||
/* user abort */
|
||||
#ifdef HAVE_PLAYER_KEYPAD
|
||||
#if defined(HAVE_PLAYER_KEYPAD) || defined(HAVE_NEO_KEYPAD)
|
||||
if (button_get(false) == BUTTON_STOP)
|
||||
#else
|
||||
if (button_get(false) == BUTTON_OFF)
|
||||
|
@ -2019,7 +2019,7 @@ int playlist_save(char *filename)
|
|||
int seek;
|
||||
|
||||
/* user abort */
|
||||
#ifdef HAVE_PLAYER_KEYPAD
|
||||
#if defined(HAVE_PLAYER_KEYPAD) || defined(HAVE_NEO_KEYPAD)
|
||||
if (button_get(false) == BUTTON_STOP)
|
||||
#else
|
||||
if (button_get(false) == BUTTON_OFF)
|
||||
|
|
|
@ -103,6 +103,9 @@ void usb_display_info(void)
|
|||
|
||||
void usb_screen(void)
|
||||
{
|
||||
#ifdef USB_NONE
|
||||
/* nothing here! */
|
||||
#else
|
||||
#ifndef SIMULATOR
|
||||
backlight_on();
|
||||
usb_acknowledge(SYS_USB_CONNECTED_ACK);
|
||||
|
@ -118,6 +121,7 @@ void usb_screen(void)
|
|||
|
||||
backlight_on();
|
||||
#endif
|
||||
#endif /* USB_NONE */
|
||||
}
|
||||
|
||||
|
||||
|
@ -230,7 +234,7 @@ void charging_display_info(bool animate)
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_BATTERIES
|
||||
/* blocks while charging, returns on event:
|
||||
1 if charger cable was removed
|
||||
2 if Off/Stop key was pressed
|
||||
|
@ -279,7 +283,7 @@ int charging_screen(void)
|
|||
|
||||
return rc;
|
||||
}
|
||||
|
||||
#endif /* HAVE_BATTERIES */
|
||||
|
||||
|
||||
#ifdef HAVE_RECORDER_KEYPAD
|
||||
|
|
|
@ -92,7 +92,7 @@ bool sleeptimer_screen(void)
|
|||
done = true;
|
||||
break;
|
||||
|
||||
#ifdef HAVE_PLAYER_KEYPAD
|
||||
#if defined(HAVE_PLAYER_KEYPAD) || defined(HAVE_NEO_KEYPAD)
|
||||
case BUTTON_RIGHT:
|
||||
#else
|
||||
case BUTTON_UP:
|
||||
|
|
128
apps/tree.c
128
apps/tree.c
|
@ -67,7 +67,7 @@ static struct
|
|||
char* extension; /* extension for which the file type is recognized */
|
||||
int tree_attr; /* which identifier */
|
||||
int icon; /* the icon which shall be used for it, -1 if unknown */
|
||||
/* To have it extendable, there could be more useful stuff in here,
|
||||
/* To have it extendable, there could be more useful stuff in here,
|
||||
like handler functions, plugin name, etc. */
|
||||
} filetypes[] = {
|
||||
{ ".mp3", TREE_ATTR_MPA, File },
|
||||
|
@ -140,7 +140,7 @@ void browse_root(void)
|
|||
#define MARGIN_Y (global_settings.statusbar ? STATUSBAR_HEIGHT : 0)
|
||||
|
||||
/* position the entry-list starts at */
|
||||
#define LINE_X 0
|
||||
#define LINE_X 0
|
||||
#define LINE_Y (global_settings.statusbar ? 1 : 0)
|
||||
|
||||
#define CURSOR_X (global_settings.scrollbar && \
|
||||
|
@ -213,13 +213,13 @@ static int compare(const void* p1, const void* p2)
|
|||
{
|
||||
struct entry* e1 = (struct entry*)p1;
|
||||
struct entry* e2 = (struct entry*)p2;
|
||||
|
||||
|
||||
if (( e1->attr & ATTR_DIRECTORY ) == ( e2->attr & ATTR_DIRECTORY ))
|
||||
if (global_settings.sort_case)
|
||||
return strncmp(e1->name, e2->name, MAX_PATH);
|
||||
else
|
||||
return strncasecmp(e1->name, e2->name, MAX_PATH);
|
||||
else
|
||||
else
|
||||
return ( e2->attr & ATTR_DIRECTORY ) - ( e1->attr & ATTR_DIRECTORY );
|
||||
}
|
||||
|
||||
|
@ -234,7 +234,7 @@ static void showfileline(int line, int direntry, bool scroll, int *dirfilter)
|
|||
#endif
|
||||
|
||||
/* if any file filter is on, strip the extension */
|
||||
if (*dirfilter != SHOW_ALL &&
|
||||
if (*dirfilter != SHOW_ALL &&
|
||||
!(dircache[direntry].attr & ATTR_DIRECTORY))
|
||||
{
|
||||
char* dotpos = strrchr(name, '.');
|
||||
|
@ -277,35 +277,35 @@ struct entry* load_and_sort_directory(char *dirname, int *dirfilter,
|
|||
DIR *dir = opendir(dirname);
|
||||
if(!dir)
|
||||
return NULL; /* not a directory */
|
||||
|
||||
|
||||
name_buffer_length = 0;
|
||||
*buffer_full = false;
|
||||
|
||||
|
||||
for ( i=0; i < max_files_in_dir; i++ ) {
|
||||
int len;
|
||||
struct dirent *entry = readdir(dir);
|
||||
struct entry* dptr = &dircache[i];
|
||||
if (!entry)
|
||||
break;
|
||||
|
||||
|
||||
len = strlen(entry->d_name);
|
||||
|
||||
|
||||
/* skip directories . and .. */
|
||||
if ((entry->attribute & ATTR_DIRECTORY) &&
|
||||
(((len == 1) &&
|
||||
(((len == 1) &&
|
||||
(!strncmp(entry->d_name, ".", 1))) ||
|
||||
((len == 2) &&
|
||||
((len == 2) &&
|
||||
(!strncmp(entry->d_name, "..", 2))))) {
|
||||
i--;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/* Skip FAT volume ID */
|
||||
if (entry->attribute & ATTR_VOLUME_ID) {
|
||||
i--;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/* filter out dotfiles and hidden files */
|
||||
if (*dirfilter != SHOW_ALL &&
|
||||
((entry->d_name[0]=='.') ||
|
||||
|
@ -313,11 +313,11 @@ struct entry* load_and_sort_directory(char *dirname, int *dirfilter,
|
|||
i--;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
dptr->attr = entry->attribute;
|
||||
|
||||
|
||||
/* check for known file types */
|
||||
if ( !(dptr->attr & ATTR_DIRECTORY) && (len > 4) )
|
||||
if ( !(dptr->attr & ATTR_DIRECTORY) && (len > 4) )
|
||||
{
|
||||
unsigned j;
|
||||
for (j=0; j<sizeof(filetypes)/sizeof(*filetypes); j++)
|
||||
|
@ -361,7 +361,7 @@ struct entry* load_and_sort_directory(char *dirname, int *dirfilter,
|
|||
i--;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (len > name_buffer_size - name_buffer_length - 1) {
|
||||
/* Tell the world that we ran out of buffer space */
|
||||
*buffer_full = true;
|
||||
|
@ -514,8 +514,8 @@ static int showdir(char *path, int start, int *dirfilter)
|
|||
int offset=0;
|
||||
if ( line_height > 8 )
|
||||
offset = (line_height - 8) / 2;
|
||||
lcd_bitmap(bitmap_icons_6x8[icon_type],
|
||||
CURSOR_X * 6 + CURSOR_WIDTH,
|
||||
lcd_bitmap(bitmap_icons_6x8[icon_type],
|
||||
CURSOR_X * 6 + CURSOR_WIDTH,
|
||||
MARGIN_Y+(i-start)*line_height + offset,
|
||||
6, 8, true);
|
||||
#else
|
||||
|
@ -527,7 +527,7 @@ static int showdir(char *path, int start, int *dirfilter)
|
|||
}
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
if (global_settings.scrollbar && (filesindir > tree_max_on_screen))
|
||||
if (global_settings.scrollbar && (filesindir > tree_max_on_screen))
|
||||
scrollbar(SCROLLBAR_X, SCROLLBAR_Y, SCROLLBAR_WIDTH - 1,
|
||||
LCD_HEIGHT - SCROLLBAR_Y, filesindir, start,
|
||||
start + tree_max_on_screen, VERTICAL);
|
||||
|
@ -539,7 +539,7 @@ static int showdir(char *path, int start, int *dirfilter)
|
|||
static bool ask_resume(bool ask_once)
|
||||
{
|
||||
bool stop = false;
|
||||
|
||||
|
||||
#ifdef HAVE_LCD_CHARCELLS
|
||||
lcd_double_height(false);
|
||||
#endif
|
||||
|
@ -562,16 +562,20 @@ static bool ask_resume(bool ask_once)
|
|||
while (!stop) {
|
||||
switch (button_get(true)) {
|
||||
case BUTTON_PLAY:
|
||||
#ifdef BUTTON_RC_PLAY
|
||||
case BUTTON_RC_PLAY:
|
||||
#endif
|
||||
return true;
|
||||
|
||||
#ifdef BUTTON_ON
|
||||
/* ignore the ON button, since it might
|
||||
still be pressed since booting */
|
||||
case BUTTON_ON:
|
||||
case BUTTON_ON | BUTTON_REL:
|
||||
case BUTTON_ON | BUTTON_REPEAT:
|
||||
break;
|
||||
|
||||
#endif
|
||||
|
||||
case SYS_USB_CONNECTED:
|
||||
usb_screen();
|
||||
stop = true;
|
||||
|
@ -600,7 +604,7 @@ void resume_directory(char *dir)
|
|||
&buffer_full))
|
||||
return;
|
||||
lastdir[0] = 0;
|
||||
|
||||
|
||||
build_playlist(0);
|
||||
}
|
||||
|
||||
|
@ -635,7 +639,7 @@ static void start_resume(bool ask_once)
|
|||
|
||||
if (!ask_resume(ask_once))
|
||||
return;
|
||||
|
||||
|
||||
if (playlist_resume() != -1)
|
||||
{
|
||||
playlist_start(global_settings.resume_index,
|
||||
|
@ -680,7 +684,7 @@ void set_current_file(char *path)
|
|||
dirlevel = 0;
|
||||
dirpos[dirlevel] = -1;
|
||||
cursorpos[dirlevel] = 0;
|
||||
|
||||
|
||||
/* use '/' to calculate dirlevel */
|
||||
for (i=1; i<strlen(path)+1; i++)
|
||||
{
|
||||
|
@ -711,9 +715,13 @@ static bool handle_on(int *ds, int *dc, int numentries, int tree_max_on_screen,
|
|||
while (!exit) {
|
||||
switch (button_get(true)) {
|
||||
case TREE_PREV:
|
||||
#ifdef BUTTON_RC_LEFT
|
||||
case BUTTON_RC_LEFT:
|
||||
#endif
|
||||
#ifdef BUTTON_ON
|
||||
case BUTTON_ON | TREE_PREV:
|
||||
case BUTTON_ON | TREE_PREV | BUTTON_REPEAT:
|
||||
#endif
|
||||
used = true;
|
||||
if ( dirstart ) {
|
||||
dirstart -= tree_max_on_screen;
|
||||
|
@ -723,15 +731,19 @@ static bool handle_on(int *ds, int *dc, int numentries, int tree_max_on_screen,
|
|||
else
|
||||
dircursor = 0;
|
||||
break;
|
||||
|
||||
|
||||
case TREE_NEXT:
|
||||
#ifdef BUTTON_RC_RIGHT
|
||||
case BUTTON_RC_RIGHT:
|
||||
#endif
|
||||
#ifdef BUTTON_ON
|
||||
case BUTTON_ON | TREE_NEXT:
|
||||
case BUTTON_ON | TREE_NEXT | BUTTON_REPEAT:
|
||||
#endif
|
||||
used = true;
|
||||
if ( dirstart < numentries - tree_max_on_screen ) {
|
||||
dirstart += tree_max_on_screen;
|
||||
if ( dirstart >
|
||||
if ( dirstart >
|
||||
numentries - tree_max_on_screen )
|
||||
dirstart = numentries - tree_max_on_screen;
|
||||
}
|
||||
|
@ -741,8 +753,13 @@ static bool handle_on(int *ds, int *dc, int numentries, int tree_max_on_screen,
|
|||
|
||||
|
||||
case BUTTON_PLAY:
|
||||
#ifdef BUTTON_RC_PLAY
|
||||
case BUTTON_RC_PLAY:
|
||||
case BUTTON_ON | BUTTON_PLAY: {
|
||||
#endif
|
||||
#ifdef BUTTON_ON
|
||||
case BUTTON_ON | BUTTON_PLAY:
|
||||
#endif
|
||||
{
|
||||
int onplay_result;
|
||||
|
||||
if (currdir[1])
|
||||
|
@ -768,12 +785,14 @@ static bool handle_on(int *ds, int *dc, int numentries, int tree_max_on_screen,
|
|||
}
|
||||
exit = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#ifdef BUTTON_ON
|
||||
case BUTTON_ON | BUTTON_REL:
|
||||
case BUTTON_ON | TREE_PREV | BUTTON_REL:
|
||||
case BUTTON_ON | TREE_NEXT | BUTTON_REL:
|
||||
exit = true;
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
if ( used && !exit ) {
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
|
@ -834,15 +853,15 @@ static bool dirbrowse(char *root, int *dirfilter)
|
|||
start_resume(true);
|
||||
|
||||
numentries = showdir(currdir, dirstart, dirfilter);
|
||||
if (numentries == -1)
|
||||
if (numentries == -1)
|
||||
return false; /* currdir is not a directory */
|
||||
|
||||
|
||||
if (*dirfilter > NUM_FILTER_MODES && numentries==0)
|
||||
{
|
||||
splash(HZ*2, 0, true, str(LANG_NO_FILES));
|
||||
return false; /* No files found for rockbox_browser() */
|
||||
}
|
||||
|
||||
|
||||
update_all = true;
|
||||
|
||||
put_cursorxy(CURSOR_X, CURSOR_Y + dircursor, true);
|
||||
|
@ -873,7 +892,9 @@ static bool dirbrowse(char *root, int *dirfilter)
|
|||
|
||||
switch ( button ) {
|
||||
case TREE_EXIT:
|
||||
#ifdef BUTTON_RC_STOP
|
||||
case BUTTON_RC_STOP:
|
||||
#endif
|
||||
#ifdef HAVE_RECORDER_KEYPAD
|
||||
case BUTTON_LEFT | BUTTON_REPEAT:
|
||||
#endif
|
||||
|
@ -918,7 +939,7 @@ static bool dirbrowse(char *root, int *dirfilter)
|
|||
#endif
|
||||
settings_save();
|
||||
break;
|
||||
|
||||
|
||||
#ifdef HAVE_RECORDER_KEYPAD
|
||||
case BUTTON_OFF | BUTTON_REPEAT:
|
||||
#else
|
||||
|
@ -932,10 +953,12 @@ static bool dirbrowse(char *root, int *dirfilter)
|
|||
|
||||
case TREE_ENTER:
|
||||
case TREE_ENTER | BUTTON_REPEAT:
|
||||
#ifdef BUTTON_RC_PLAY
|
||||
case BUTTON_RC_PLAY:
|
||||
#endif
|
||||
#ifdef HAVE_RECORDER_KEYPAD
|
||||
case BUTTON_PLAY:
|
||||
case BUTTON_PLAY | BUTTON_REPEAT:
|
||||
case BUTTON_PLAY | BUTTON_REPEAT:
|
||||
#endif
|
||||
if ( !numentries )
|
||||
break;
|
||||
|
@ -971,7 +994,7 @@ static bool dirbrowse(char *root, int *dirfilter)
|
|||
play = true;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case TREE_ATTR_MPA:
|
||||
if (playlist_create(currdir, NULL) != -1)
|
||||
{
|
||||
|
@ -981,14 +1004,14 @@ static bool dirbrowse(char *root, int *dirfilter)
|
|||
{
|
||||
start_index =
|
||||
playlist_shuffle(seed,start_index);
|
||||
|
||||
|
||||
/* when shuffling dir.: play all files
|
||||
even if the file selected by user is
|
||||
not the first one */
|
||||
if (!global_settings.play_selected)
|
||||
start_index = 0;
|
||||
}
|
||||
|
||||
|
||||
playlist_start(start_index, 0);
|
||||
play = true;
|
||||
}
|
||||
|
@ -1015,7 +1038,7 @@ static bool dirbrowse(char *root, int *dirfilter)
|
|||
lcd_getstringsize("A", &fw, &fh);
|
||||
tree_max_on_screen = (LCD_HEIGHT - MARGIN_Y) / fh;
|
||||
/* make sure cursor is on screen */
|
||||
while ( dircursor > tree_max_on_screen )
|
||||
while ( dircursor > tree_max_on_screen )
|
||||
{
|
||||
dircursor--;
|
||||
dirstart++;
|
||||
|
@ -1043,7 +1066,7 @@ static bool dirbrowse(char *root, int *dirfilter)
|
|||
/* chip-8 game */
|
||||
case TREE_ATTR_CH8:
|
||||
plugin_load("/.rockbox/rocks/chip8.rock",buf);
|
||||
break;
|
||||
break;
|
||||
|
||||
case TREE_ATTR_FONT:
|
||||
font_load(buf);
|
||||
|
@ -1070,7 +1093,7 @@ static bool dirbrowse(char *root, int *dirfilter)
|
|||
/* ucl flash file */
|
||||
case TREE_ATTR_UCL:
|
||||
plugin_load("/.rockbox/rocks/rockbox_flash.rock",buf);
|
||||
break;
|
||||
break;
|
||||
#endif
|
||||
|
||||
/* plugin file */
|
||||
|
@ -1109,7 +1132,9 @@ static bool dirbrowse(char *root, int *dirfilter)
|
|||
|
||||
case TREE_PREV:
|
||||
case TREE_PREV | BUTTON_REPEAT:
|
||||
#ifdef BUTTON_RC_LEFT
|
||||
case BUTTON_RC_LEFT:
|
||||
#endif
|
||||
if(filesindir) {
|
||||
if(dircursor) {
|
||||
put_cursorxy(CURSOR_X, CURSOR_Y + dircursor, false);
|
||||
|
@ -1147,7 +1172,9 @@ static bool dirbrowse(char *root, int *dirfilter)
|
|||
|
||||
case TREE_NEXT:
|
||||
case TREE_NEXT | BUTTON_REPEAT:
|
||||
#ifdef BUTTON_RC_RIGHT
|
||||
case BUTTON_RC_RIGHT:
|
||||
#endif
|
||||
if(filesindir)
|
||||
{
|
||||
if (dircursor + dirstart + 1 < numentries ) {
|
||||
|
@ -1155,7 +1182,7 @@ static bool dirbrowse(char *root, int *dirfilter)
|
|||
put_cursorxy(CURSOR_X, CURSOR_Y + dircursor, false);
|
||||
dircursor++;
|
||||
put_cursorxy(CURSOR_X, CURSOR_Y + dircursor, true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
dirstart++;
|
||||
numentries = showdir(currdir, dirstart, dirfilter);
|
||||
|
@ -1168,7 +1195,7 @@ static bool dirbrowse(char *root, int *dirfilter)
|
|||
put_cursorxy(CURSOR_X, CURSOR_Y + dircursor, false);
|
||||
dirstart = dircursor = 0;
|
||||
put_cursorxy(CURSOR_X, CURSOR_Y + dircursor, true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
dirstart = dircursor = 0;
|
||||
numentries = showdir(currdir, dirstart, dirfilter);
|
||||
|
@ -1190,6 +1217,8 @@ static bool dirbrowse(char *root, int *dirfilter)
|
|||
}
|
||||
break;
|
||||
|
||||
#ifdef BUTTON_ON /* I bet the folks without ON-button want this to
|
||||
work on a different button */
|
||||
case BUTTON_ON:
|
||||
if (handle_on(&dirstart, &dircursor, numentries,
|
||||
tree_max_on_screen, dirfilter))
|
||||
|
@ -1216,6 +1245,7 @@ static bool dirbrowse(char *root, int *dirfilter)
|
|||
}
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_RECORDER_KEYPAD
|
||||
case BUTTON_F2:
|
||||
|
@ -1254,7 +1284,7 @@ static bool dirbrowse(char *root, int *dirfilter)
|
|||
|
||||
if ( button )
|
||||
ata_spin();
|
||||
|
||||
|
||||
/* do we need to rescan dir? */
|
||||
if (reload_dir || reload_root ||
|
||||
lastfilter != *dirfilter ||
|
||||
|
@ -1298,7 +1328,7 @@ static bool dirbrowse(char *root, int *dirfilter)
|
|||
numentries = showdir(currdir, dirstart, dirfilter);
|
||||
update_all = true;
|
||||
put_cursorxy(CURSOR_X, CURSOR_Y + dircursor, true);
|
||||
|
||||
|
||||
need_update = true;
|
||||
reload_dir = false;
|
||||
}
|
||||
|
@ -1340,15 +1370,15 @@ static bool add_dir(char* dirname, int fd)
|
|||
bool abort = false;
|
||||
char buf[MAX_PATH/2]; /* saving a little stack... */
|
||||
DIR* dir;
|
||||
|
||||
|
||||
/* check for user abort */
|
||||
#ifdef HAVE_PLAYER_KEYPAD
|
||||
#ifdef BUTTON_STOP
|
||||
if (button_get(false) == BUTTON_STOP)
|
||||
#else
|
||||
if (button_get(false) == BUTTON_OFF)
|
||||
#endif
|
||||
return true;
|
||||
|
||||
|
||||
dir = opendir(dirname);
|
||||
if(!dir)
|
||||
return true;
|
||||
|
@ -1431,7 +1461,7 @@ bool create_playlist(void)
|
|||
add_dir(currdir[1] ? currdir : "/", fd);
|
||||
close(fd);
|
||||
sleep(HZ);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1465,7 +1495,7 @@ void tree_init(void)
|
|||
use it until the next reboot. */
|
||||
max_files_in_dir = global_settings.max_files_in_dir;
|
||||
name_buffer_size = AVERAGE_FILENAME_LENGTH * max_files_in_dir;
|
||||
|
||||
|
||||
name_buffer = buffer_alloc(name_buffer_size);
|
||||
dircache = buffer_alloc(max_files_in_dir * sizeof(struct entry));
|
||||
}
|
||||
|
|
|
@ -414,6 +414,7 @@ static char* get_tag(struct mp3entry* id3,
|
|||
#endif
|
||||
case 'f': /* full-line progress bar */
|
||||
#ifdef HAVE_LCD_CHARCELLS
|
||||
#ifndef HAVE_NEO_LCD
|
||||
if(has_new_lcd()) {
|
||||
*flags |= WPS_REFRESH_PLAYER_PROGRESS;
|
||||
*flags |= WPS_REFRESH_DYNAMIC;
|
||||
|
@ -421,7 +422,10 @@ static char* get_tag(struct mp3entry* id3,
|
|||
/* we need 11 characters (full line) for
|
||||
progress-bar */
|
||||
snprintf(buf, buf_size, " ");
|
||||
} else {
|
||||
}
|
||||
else
|
||||
#endif /* HAVE_NEO_LCD */
|
||||
{
|
||||
/* Tell the user if we have an OldPlayer */
|
||||
snprintf(buf, buf_size, " <Old LCD> ");
|
||||
}
|
||||
|
|
36
apps/wps.c
36
apps/wps.c
|
@ -53,7 +53,7 @@ static bool paused = false;
|
|||
static struct mp3entry* id3 = NULL;
|
||||
static char current_track_path[MAX_PATH+1];
|
||||
|
||||
#ifdef HAVE_PLAYER_KEYPAD
|
||||
#if defined(HAVE_PLAYER_KEYPAD) || defined(HAVE_NEO_KEYPAD)
|
||||
void player_change_volume(int button)
|
||||
{
|
||||
bool exit = false;
|
||||
|
@ -278,7 +278,7 @@ bool browse_id3(void)
|
|||
case BUTTON_REPEAT:
|
||||
break;
|
||||
|
||||
#ifdef HAVE_PLAYER_KEYPAD
|
||||
#ifdef BUTTON_STOP
|
||||
case BUTTON_STOP:
|
||||
#else
|
||||
case BUTTON_OFF:
|
||||
|
@ -506,7 +506,7 @@ static bool menu(void)
|
|||
break;
|
||||
|
||||
/* mute */
|
||||
#ifdef HAVE_PLAYER_KEYPAD
|
||||
#ifdef BUTTON_MENU
|
||||
case BUTTON_MENU | BUTTON_PLAY:
|
||||
#else
|
||||
case BUTTON_F1 | BUTTON_PLAY:
|
||||
|
@ -534,7 +534,7 @@ static bool menu(void)
|
|||
while (button_get(false)); /* clear button queue */
|
||||
break;
|
||||
|
||||
#ifdef HAVE_PLAYER_KEYPAD
|
||||
#ifdef BUTTON_MENU
|
||||
/* change volume */
|
||||
case BUTTON_MENU | BUTTON_LEFT:
|
||||
case BUTTON_MENU | BUTTON_LEFT | BUTTON_REPEAT:
|
||||
|
@ -545,9 +545,11 @@ static bool menu(void)
|
|||
break;
|
||||
|
||||
/* show id3 tags */
|
||||
#ifdef BUTTON_ON
|
||||
case BUTTON_MENU | BUTTON_ON:
|
||||
status_set_param(true);
|
||||
status_set_audio(true);
|
||||
#endif
|
||||
#else
|
||||
case BUTTON_F1 | BUTTON_ON:
|
||||
#endif
|
||||
|
@ -742,8 +744,11 @@ int wps_show(void)
|
|||
! ((button & BUTTON_MENU) ||
|
||||
#endif
|
||||
(button == BUTTON_NONE) ||
|
||||
(button == SYS_USB_CONNECTED) ||
|
||||
(button & BUTTON_REMOTE)))
|
||||
(button == SYS_USB_CONNECTED)
|
||||
#ifdef BUTTON_REMOTE
|
||||
|| (button & BUTTON_REMOTE)
|
||||
#endif
|
||||
))
|
||||
{
|
||||
while (button_get(false)); /* clear button queue */
|
||||
display_keylock_text(true);
|
||||
|
@ -759,6 +764,7 @@ int wps_show(void)
|
|||
|
||||
switch(button)
|
||||
{
|
||||
#ifdef BUTTON_ON
|
||||
case BUTTON_ON:
|
||||
#ifdef HAVE_RECORDER_KEYPAD
|
||||
switch (on_screen()) {
|
||||
|
@ -795,10 +801,12 @@ int wps_show(void)
|
|||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
#endif /* BUTTON_ON */
|
||||
/* play/pause */
|
||||
case BUTTON_PLAY:
|
||||
#ifdef BUTTON_RC_PLAY
|
||||
case BUTTON_RC_PLAY:
|
||||
#endif
|
||||
if ( paused )
|
||||
{
|
||||
paused = false;
|
||||
|
@ -830,7 +838,9 @@ int wps_show(void)
|
|||
case BUTTON_UP:
|
||||
case BUTTON_UP | BUTTON_REPEAT:
|
||||
#endif
|
||||
#ifdef BUTTON_RC_VOL_UP
|
||||
case BUTTON_RC_VOL_UP:
|
||||
#endif
|
||||
global_settings.volume++;
|
||||
if(global_settings.volume > mpeg_sound_max(SOUND_VOLUME))
|
||||
global_settings.volume = mpeg_sound_max(SOUND_VOLUME);
|
||||
|
@ -844,7 +854,9 @@ int wps_show(void)
|
|||
case BUTTON_DOWN:
|
||||
case BUTTON_DOWN | BUTTON_REPEAT:
|
||||
#endif
|
||||
#ifdef BUTTON_RC_VOL_DOWN
|
||||
case BUTTON_RC_VOL_DOWN:
|
||||
#endif
|
||||
global_settings.volume--;
|
||||
if(global_settings.volume < mpeg_sound_min(SOUND_VOLUME))
|
||||
global_settings.volume = mpeg_sound_min(SOUND_VOLUME);
|
||||
|
@ -860,7 +872,9 @@ int wps_show(void)
|
|||
break;
|
||||
|
||||
/* prev / restart */
|
||||
#ifdef BUTTON_RC_LEFT
|
||||
case BUTTON_RC_LEFT:
|
||||
#endif
|
||||
case BUTTON_LEFT | BUTTON_REL:
|
||||
#ifdef HAVE_RECORDER_KEYPAD
|
||||
if ((button == (BUTTON_LEFT | BUTTON_REL)) &&
|
||||
|
@ -882,7 +896,9 @@ int wps_show(void)
|
|||
break;
|
||||
|
||||
/* next */
|
||||
#ifdef BUTTON_RC_RIGHT
|
||||
case BUTTON_RC_RIGHT:
|
||||
#endif
|
||||
case BUTTON_RIGHT | BUTTON_REL:
|
||||
#ifdef HAVE_RECORDER_KEYPAD
|
||||
if ((button == (BUTTON_RIGHT | BUTTON_REL)) &&
|
||||
|
@ -893,7 +909,7 @@ int wps_show(void)
|
|||
break;
|
||||
|
||||
/* menu key functions */
|
||||
#ifdef HAVE_PLAYER_KEYPAD
|
||||
#ifdef BUTTON_MENU
|
||||
case BUTTON_MENU:
|
||||
#else
|
||||
case BUTTON_F1:
|
||||
|
@ -922,8 +938,10 @@ int wps_show(void)
|
|||
#endif
|
||||
|
||||
/* stop and exit wps */
|
||||
#ifdef BUTTON_RC_STOP
|
||||
case BUTTON_RC_STOP:
|
||||
#ifdef HAVE_RECORDER_KEYPAD
|
||||
#endif
|
||||
#ifdef BUTTON_OFF
|
||||
case BUTTON_OFF:
|
||||
#else
|
||||
case BUTTON_STOP | BUTTON_REL:
|
||||
|
|
Loading…
Reference in a new issue