mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-07-10 13:29:52 -04:00
Compare commits
No commits in common. "814979d49b58b278a93324c4d20bfcbd06cb2895" and "7ab521cba681f16fdf6112929e4b3c6ed3185ad0" have entirely different histories.
814979d49b
...
7ab521cba6
3852 changed files with 15343 additions and 23179 deletions
21
.gitignore
vendored
21
.gitignore
vendored
|
|
@ -82,15 +82,7 @@ __pycache__
|
|||
/utils/bspatch/bspatch
|
||||
|
||||
# imxtools
|
||||
/utils/imxtools/misc/io_pins
|
||||
/utils/imxtools/misc/wiki_gen
|
||||
/utils/imxtools/scsitools/scsitool
|
||||
/utils/imxtools/sbtools/elftosb
|
||||
/utils/imxtools/sbtools/elftosb1
|
||||
/utils/imxtools/sbtools/rsrctool
|
||||
/utils/imxtools/sbtools/sbloader
|
||||
/utils/imxtools/sbtools/sbtoelf
|
||||
/utils/mkimxboot/mkimxboot
|
||||
|
||||
# /utils/rbutilqt/
|
||||
/utils/rbutilqt/build
|
||||
|
|
@ -108,22 +100,16 @@ __pycache__
|
|||
# /utils/rbutilqt/lang/
|
||||
/utils/rbutilqt/lang/*.qm
|
||||
|
||||
# More target-specific utilities
|
||||
# More rbutil
|
||||
/utils/*/buildposix
|
||||
/utils/*/uninstall_script.[ch]
|
||||
/utils/*/install_script.[ch]
|
||||
/utils/e200tool/e200load
|
||||
/utils/mkimxboot/mkimxboot
|
||||
/utils/mknwzboot/mknwzboot
|
||||
/utils/mkzenboot/mkzenboot
|
||||
/utils/sansapatcher/sansapatcher
|
||||
/utils/jztool/jztool
|
||||
/utils/tools/bin2c
|
||||
/utils/rk27utils/nandextract/nandextract
|
||||
/utils/rk27utils/rk27load/rk27load
|
||||
/utils/rk27utils/rkwtool/rkwtool
|
||||
/utils/rk27utils/rkusbtool/rkusbtool
|
||||
/utils/mkmpioboot/mkmpioboot
|
||||
/utils/mktccboot/mktccboot
|
||||
|
||||
# /tools/
|
||||
/tools/bdf2bmp
|
||||
|
|
@ -202,9 +188,8 @@ __pycache__
|
|||
# /utils/nwztools
|
||||
/utils/nwztools/scsitools/scsitool
|
||||
/utils/nwztools/upgtools/upgtool
|
||||
/utils/nwztools/emmctools/emmctool
|
||||
|
||||
# utils/rk27utils
|
||||
# utils/rk27utils
|
||||
/utils/rk27utils/rkboottool/rkboottool
|
||||
|
||||
# /utils/themeeditor/
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
# \/ \/ \/ \/ \/
|
||||
# $Id$
|
||||
#
|
||||
|
||||
PACKAGE=org.rockbox
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2011 Thomas Martitz
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2010 Thomas Martitz
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2010 Thomas Martitz
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2010 Thomas Martitz
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2010 Jonathan Gordon
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2010 Thomas Martitz
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2010 Thomas Martitz
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2010 Jonathan Gordon
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2011 Thomas Martitz
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2011 Thomas Martitz
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2010 Thomas Martitz
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2011 Antoine Cellerier <dionoea at videolan dot org>
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2011 Antoine Cellerier <dionoea at videolan dot org>
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2011 Antoine Cellerier <dionoea at videolan dot org>
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2011 Antoine Cellerier <dionoea at videolan dot org>
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2011 Antoine Cellerier <dionoea at videolan dot org>
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2005 Ray Lambert
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2005 Ray Lambert
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2006 Jonathan Gordon
|
||||
* Copyright (C) 2017 William Wilgus
|
||||
|
|
@ -429,7 +430,6 @@ static inline bool get_action_touchscreen(action_last_t *last, action_cur_t *cur
|
|||
{
|
||||
intptr_t data = button_get_data();
|
||||
long now = current_tick;
|
||||
last->repeated = false;
|
||||
|
||||
if (has_flag(last->button, BUTTON_TOUCHSCREEN) &&
|
||||
!has_flag(last->button, BUTTON_REL))
|
||||
|
|
@ -439,6 +439,7 @@ static inline bool get_action_touchscreen(action_last_t *last, action_cur_t *cur
|
|||
if (!has_flag(cur->button, BUTTON_REL))
|
||||
last->ts_data = data;
|
||||
|
||||
/* Historical baggage... may be unnecessary. */
|
||||
if (has_flag(cur->button, BUTTON_REPEAT))
|
||||
last->repeated = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2003 Uwe Freese
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2003 Uwe Freese
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2008 by Jonathan Gordon
|
||||
*
|
||||
|
|
@ -72,13 +73,11 @@ enum {
|
|||
|
||||
/** Generic GUI class events **/
|
||||
enum {
|
||||
/* Redraw skin as needed (or by force) */
|
||||
GUI_EVENT_ACTIONREDRAW = (EVENT_CLASS_GUI|1),
|
||||
/* Redraw skin, and update the screen if it's dirty */
|
||||
GUI_EVENT_STATUSBAR_TOGGLE = (EVENT_CLASS_GUI|1),
|
||||
GUI_EVENT_ACTIONUPDATE,
|
||||
GUI_EVENT_THEME_CHANGED,
|
||||
/* Called when the UI viewport is cleared in the skin engine to
|
||||
* notify the current screen that it needs to redraw itself */
|
||||
* notify the current screen that it needs to do an update */
|
||||
GUI_EVENT_NEED_UI_UPDATE,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2002 Linus Nielsen Feltzing
|
||||
*
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
# \/ \/ \/ \/ \/
|
||||
# $Id$
|
||||
#
|
||||
|
||||
INCLUDES += -I$(APPSDIR) $(patsubst %,-I$(APPSDIR)/%,$(subst :, ,$(APPEXTRA)))
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Audio signal path management APIs
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2005-2007 Miika Pekkarinen
|
||||
* Copyright (C) 2007-2008 Nicolas Pennequin
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2005-2007 Miika Pekkarinen
|
||||
* Copyright (C) 2007-2008 Nicolas Pennequin
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (c) 2011 Michael Sevakis
|
||||
*
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
# \/ \/ \/ \/ \/
|
||||
# $Id$
|
||||
#
|
||||
|
||||
BITMAPDIR = $(ROOTDIR)/apps/bitmaps
|
||||
|
|
|
|||
|
|
@ -959,15 +959,14 @@ static bool delete_bookmark(const char* bookmark_file_name, int bookmark_id)
|
|||
}
|
||||
|
||||
/* ----------------------------------------------------------------------- */
|
||||
/* Displays bookmarks in a file, so user can select one to play. */
|
||||
/* */
|
||||
/* Returns */
|
||||
/* BOOKMARK_SUCCESS A bookmark or 'Don't Resume' was selected */
|
||||
/* BOOKMARK_FAIL No selection was made */
|
||||
/* BOOKMARK_USB_CONNECTED USB connection forced exit of menu */
|
||||
/* */
|
||||
/* *selected_bookmark will point to bookmark if selected, or will be NULL */
|
||||
/* ----------------------------------------------------------------------- */
|
||||
/* This displays the bookmarks in a file and allows the user to */
|
||||
/* select one to play. */
|
||||
/* *selected_bookmark contains a non NULL value on successful bookmark */
|
||||
/* selection. */
|
||||
/* Returns BOOKMARK_SUCCESS on successful bookmark selection, BOOKMARK_FAIL*/
|
||||
/* if no selection was made and BOOKMARK_USB_CONNECTED if the selection */
|
||||
/* menu is forced to exit due to a USB connection. */
|
||||
/* ------------------------------------------------------------------------*/
|
||||
static int select_bookmark(const char* bookmark_file_name,
|
||||
bool show_dont_resume,
|
||||
char** selected_bookmark)
|
||||
|
|
@ -980,7 +979,6 @@ static int select_bookmark(const char* bookmark_file_name,
|
|||
bool exit = false;
|
||||
bool refresh = true;
|
||||
int ret = BOOKMARK_FAIL;
|
||||
*selected_bookmark = NULL;
|
||||
|
||||
bookmarks = plugin_get_buffer(&size);
|
||||
bookmarks->buffer_size = size;
|
||||
|
|
@ -998,9 +996,9 @@ static int select_bookmark(const char* bookmark_file_name,
|
|||
|
||||
while (!exit)
|
||||
{
|
||||
|
||||
if (refresh)
|
||||
{
|
||||
refresh = false;
|
||||
int count = get_bookmark_count(bookmark_file_name);
|
||||
bookmarks->total_count = count;
|
||||
|
||||
|
|
@ -1009,7 +1007,8 @@ static int select_bookmark(const char* bookmark_file_name,
|
|||
/* No more bookmarks, delete file and exit */
|
||||
splash(HZ, ID2P(LANG_BOOKMARK_LOAD_EMPTY));
|
||||
remove(bookmark_file_name);
|
||||
break;
|
||||
*selected_bookmark = NULL;
|
||||
return BOOKMARK_FAIL;
|
||||
}
|
||||
|
||||
if (bookmarks->show_dont_resume)
|
||||
|
|
@ -1033,61 +1032,80 @@ static int select_bookmark(const char* bookmark_file_name,
|
|||
gui_synclist_draw(&list);
|
||||
cond_talk_ids_fq(VOICE_EXT_BMARK);
|
||||
gui_synclist_speak_item(&list);
|
||||
refresh = false;
|
||||
}
|
||||
|
||||
list_do_action(CONTEXT_BOOKMARKSCREEN, HZ / 2, &list, &action);
|
||||
item = gui_synclist_get_sel_pos(&list) / 2;
|
||||
|
||||
if (bookmarks->show_dont_resume)
|
||||
{
|
||||
item--;
|
||||
}
|
||||
|
||||
if (action == ACTION_STD_CONTEXT)
|
||||
{
|
||||
gui_synclist_scroll_stop(&list);
|
||||
MENUITEM_STRINGLIST(menu_items, ID2P(LANG_BOOKMARK_CONTEXT_MENU), NULL,
|
||||
ID2P(LANG_BOOKMARK_CONTEXT_RESUME),
|
||||
ID2P(LANG_DELETE));
|
||||
static const int menu_actions[] = {ACTION_STD_OK,
|
||||
ACTION_BMS_DELETE};
|
||||
MENUITEM_STRINGLIST(menu_items, ID2P(LANG_BOOKMARK_CONTEXT_MENU),
|
||||
NULL, ID2P(LANG_BOOKMARK_CONTEXT_RESUME),
|
||||
ID2P(LANG_DELETE));
|
||||
static const int menu_actions[] =
|
||||
{
|
||||
ACTION_STD_OK, ACTION_BMS_DELETE
|
||||
};
|
||||
int selection = do_menu(&menu_items, NULL, NULL, false);
|
||||
|
||||
refresh = true;
|
||||
|
||||
if (selection >= 0 && selection <=
|
||||
(int) (sizeof(menu_actions) / sizeof(menu_actions[0])))
|
||||
{
|
||||
action = menu_actions[selection];
|
||||
}
|
||||
}
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case ACTION_STD_OK:
|
||||
ret = BOOKMARK_SUCCESS;
|
||||
if (item >= 0)
|
||||
{
|
||||
talk_shutup();
|
||||
*selected_bookmark = bookmarks->items[item - bookmarks->start];
|
||||
/* fall through */
|
||||
return BOOKMARK_SUCCESS;
|
||||
}
|
||||
exit = true;
|
||||
ret = BOOKMARK_SUCCESS;
|
||||
break;
|
||||
|
||||
case ACTION_TREE_WPS:
|
||||
case ACTION_STD_CANCEL:
|
||||
exit = true;
|
||||
break;
|
||||
|
||||
case ACTION_BMS_DELETE:
|
||||
if (item < 0)
|
||||
break;
|
||||
if (confirm_delete_yesno("", str(LANG_BOOKMARK_CONTEXT_MENU)) == YESNO_YES)
|
||||
if (item >= 0)
|
||||
{
|
||||
delete_bookmark(bookmark_file_name, item);
|
||||
bookmarks->reload = true;
|
||||
if (confirm_delete_yesno("", str(LANG_BOOKMARK_CONTEXT_MENU)) == YESNO_YES)
|
||||
{
|
||||
delete_bookmark(bookmark_file_name, item);
|
||||
bookmarks->reload = true;
|
||||
}
|
||||
refresh = true;
|
||||
}
|
||||
refresh = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (default_event_handler(action) == SYS_USB_CONNECTED)
|
||||
{
|
||||
ret = BOOKMARK_USB_CONNECTED;
|
||||
exit = true;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
gui_synclist_scroll_stop(&list);
|
||||
|
||||
talk_shutup();
|
||||
*selected_bookmark = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2007 Nicolas Pennequin
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2007 Nicolas Pennequin
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2005-2007 Miika Pekkarinen
|
||||
* Copyright (C) 2007-2008 Nicolas Pennequin
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2005 Miika Pekkarinen
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2002 Björn Stenberg
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2020 by William Wilgus
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2020 by William Wilgus
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2007 Nicolas Pennequin, Jonathan Gordon
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2007 Nicolas Pennequin, Jonathan Gordon
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2002 Heikki Hannikainen
|
||||
*
|
||||
|
|
@ -218,22 +219,6 @@ static int dbg_threads_action_callback(int action, struct gui_synclist *lists)
|
|||
}
|
||||
#if LCD_WIDTH <= 128
|
||||
int *x_offset = ((int*) lists->data);
|
||||
#if CONFIG_CPU == AS3525v2
|
||||
if (action == ACTION_STD_MENU)
|
||||
{
|
||||
*x_offset += 1;
|
||||
action = ACTION_REDRAW;
|
||||
}
|
||||
else if (IS_SYSEVENT(action))
|
||||
{
|
||||
return ACTION_REDRAW;
|
||||
}
|
||||
else if (action == ACTION_STD_OK)
|
||||
{
|
||||
*x_offset = 0;
|
||||
action = ACTION_REDRAW;
|
||||
}
|
||||
#else
|
||||
if (action == ACTION_STD_OK)
|
||||
{
|
||||
*x_offset += 1;
|
||||
|
|
@ -247,7 +232,6 @@ static int dbg_threads_action_callback(int action, struct gui_synclist *lists)
|
|||
{
|
||||
*x_offset = 0;
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
(void) lists;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2002 Heikki Hannikainen
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2006 Michael Sevakis
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2006 Michael Sevakis
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2002 Björn Stenberg
|
||||
* Copyright (C) 2024 William Wilgus
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2002 Björn Stenberg
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2005 by Björn Stenberg
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2005 by Björn Stenberg
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2007 Jonathan Gordon
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2002 Henrik Backe
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2022 by Aidan MacDonald
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2022 Aidan MacDonald
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2006 Dave Chapman
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2006 Dave Chapman
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2011 by Jonathan Gordon
|
||||
*
|
||||
|
|
@ -43,7 +44,6 @@
|
|||
|
||||
static struct listitem_viewport_cfg *listcfg[NB_SCREENS] = {NULL};
|
||||
static struct gui_synclist *current_list;
|
||||
static bool needs_scrollbar[NB_SCREENS];
|
||||
|
||||
static int current_row;
|
||||
static int current_column;
|
||||
|
|
@ -56,7 +56,6 @@ void skinlist_set_cfg(enum screen_type screen,
|
|||
if (listcfg[screen])
|
||||
screens[screen].scroll_stop_viewport(&listcfg[screen]->selected_item_vp.vp);
|
||||
listcfg[screen] = cfg;
|
||||
needs_scrollbar[screen] = false;
|
||||
current_list = NULL;
|
||||
current_column = -1;
|
||||
current_row = -1;
|
||||
|
|
@ -146,6 +145,7 @@ int skinlist_get_line_count(enum screen_type screen, struct gui_synclist *list)
|
|||
|
||||
static int current_item;
|
||||
static int current_nbitems;
|
||||
static bool needs_scrollbar[NB_SCREENS];
|
||||
bool skinlist_needs_scrollbar(enum screen_type screen)
|
||||
{
|
||||
return needs_scrollbar[screen];
|
||||
|
|
@ -281,7 +281,7 @@ bool skinlist_draw(struct screen *display, struct gui_synclist *list)
|
|||
}
|
||||
current_column = -1;
|
||||
current_row = -1;
|
||||
skin_render_deferred(display, parent);
|
||||
current_drawing_line = list->selected_item;
|
||||
sb_skin_force_next_update(); /* update scroll bar */
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2007 by Jonathan Gordon
|
||||
*
|
||||
|
|
@ -445,6 +446,7 @@ void list_draw(struct screen *display, struct gui_synclist *list)
|
|||
|
||||
callback_draw_item(&list_info);
|
||||
}
|
||||
skin_render_deferred(display, parent);
|
||||
display->set_viewport(last_vp);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) Jonathan Gordon (2006)
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) Jonathan Gordon (2006)
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2007 Jonathan Gordon
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2005 by Kevin Ferrare
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2013 Thomas Martitz
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2013 Thomas Martitz
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2005 by Kevin Ferrare
|
||||
*
|
||||
|
|
@ -48,6 +49,8 @@
|
|||
void list_draw(struct screen *display, struct gui_synclist *list);
|
||||
|
||||
static long last_dirty_tick;
|
||||
static bool sb_title_is_dirty;
|
||||
static bool theme_enabled;
|
||||
static struct viewport parent[NB_SCREENS];
|
||||
static struct gui_synclist *current_lists;
|
||||
|
||||
|
|
@ -180,9 +183,6 @@ void gui_synclist_init(struct gui_synclist * gui_list,
|
|||
gui_list->data = data;
|
||||
gui_list->scroll_all = scroll_all;
|
||||
gui_list->selected_size = selected_size;
|
||||
if (selected_size != 1)
|
||||
FOR_NB_SCREENS(i)
|
||||
skinlist_set_cfg(i, NULL);
|
||||
gui_list->title = NULL;
|
||||
gui_list->title_icon = Icon_NOICON;
|
||||
|
||||
|
|
@ -221,11 +221,32 @@ int gui_list_get_item_offset(struct gui_synclist * gui_list,
|
|||
return item_offset;
|
||||
}
|
||||
|
||||
static void sb_title_cb(unsigned short id, void *data, void *userdata)
|
||||
{
|
||||
(void)id;
|
||||
(void)data;
|
||||
theme_enabled = true;
|
||||
gui_synclist_draw((struct gui_synclist *) userdata);
|
||||
}
|
||||
|
||||
/*
|
||||
* Force a full screen update.
|
||||
*/
|
||||
void gui_synclist_draw(struct gui_synclist *gui_list)
|
||||
{
|
||||
if (sb_title_is_dirty)
|
||||
{
|
||||
sb_title_is_dirty = theme_enabled = false;
|
||||
|
||||
/* tell skin engine to refresh, then call us back */
|
||||
add_event_ex(GUI_EVENT_NEED_UI_UPDATE, true, sb_title_cb, gui_list);
|
||||
send_event(GUI_EVENT_ACTIONUPDATE, (void*)1);
|
||||
remove_event_ex(GUI_EVENT_NEED_UI_UPDATE, sb_title_cb, gui_list);
|
||||
|
||||
/* sb_title_cb was only called if theme is enabled */
|
||||
if (theme_enabled)
|
||||
return;
|
||||
}
|
||||
if (list_is_dirty(gui_list))
|
||||
{
|
||||
list_init_viewports(gui_list);
|
||||
|
|
@ -237,7 +258,6 @@ void gui_synclist_draw(struct gui_synclist *gui_list)
|
|||
{
|
||||
if (!skinlist_draw(&screens[i], gui_list))
|
||||
list_draw(&screens[i], gui_list);
|
||||
skin_mark_dirty(i);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -441,7 +461,7 @@ void gui_synclist_set_title(struct gui_synclist * gui_list,
|
|||
gui_list->title_icon = icon;
|
||||
FOR_NB_SCREENS(i)
|
||||
sb_set_title_text(title, icon, i);
|
||||
send_event(GUI_EVENT_ACTIONREDRAW, (void*)1);
|
||||
sb_title_is_dirty = true;
|
||||
}
|
||||
|
||||
void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items)
|
||||
|
|
@ -932,7 +952,7 @@ bool simplelist_show_list(struct simplelist_info *info)
|
|||
|
||||
while(1)
|
||||
{
|
||||
list_do_action(CONTEXT_TREE|ALLOW_SOFTLOCK, info->timeout, &lists, &action);
|
||||
list_do_action(CONTEXT_LIST, info->timeout, &lists, &action);
|
||||
|
||||
/* We must yield in this case or no other thread can run */
|
||||
if (info->timeout == TIMEOUT_NOBLOCK)
|
||||
|
|
@ -958,11 +978,6 @@ bool simplelist_show_list(struct simplelist_info *info)
|
|||
info->selection = -1;
|
||||
break;
|
||||
}
|
||||
else if (action == ACTION_TREE_WPS)
|
||||
{
|
||||
info->selection = -2;
|
||||
break;
|
||||
}
|
||||
else if (action == ACTION_STD_OK)
|
||||
{
|
||||
info->selection = gui_synclist_get_sel_pos(&lists);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2005 by Kevin Ferrare
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2005 by Kevin Ferrare
|
||||
* Copyright (C) 2007 by Jonathan Gordon
|
||||
|
|
@ -532,7 +533,7 @@ bool option_screen(const struct settings_list *setting,
|
|||
if (!allow_wrap)
|
||||
lists.wraparound = false;
|
||||
|
||||
if (list_do_action(CONTEXT_LIST|ALLOW_SOFTLOCK, HZ, /* HZ so the status bar redraws */
|
||||
if (list_do_action(CONTEXT_LIST, HZ, /* HZ so the status bar redraws */
|
||||
&lists, &action))
|
||||
{
|
||||
/* setting changed */
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2005 by Kevin Ferrare
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2002 Björn Stenberg
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2008 Thomas Martitz
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2008 by Jonathan Gordon
|
||||
*
|
||||
|
|
@ -39,7 +40,6 @@
|
|||
#include "debug.h"
|
||||
#include "shortcuts.h"
|
||||
#include "appevents.h"
|
||||
#include "statusbar-skinned.h"
|
||||
|
||||
/* 1 top, 1 bottom, 2 on either side, 1 for the icons
|
||||
* if enough space, top and bottom have 2 lines */
|
||||
|
|
@ -233,7 +233,7 @@ static void quickscreen_draw(struct quickscreen *qs, enum screen_type screen)
|
|||
(vp_icons->width/2) - 4, vp_icons->height - 8, 7, 8);
|
||||
}
|
||||
|
||||
skin_mark_dirty(display->screen_type);
|
||||
skin_render_deferred(display, parent);
|
||||
display->set_viewport(last_vp);
|
||||
}
|
||||
|
||||
|
|
@ -418,11 +418,13 @@ static void quickscreen_run(struct quickscreen * qs)
|
|||
can_quit = true;
|
||||
else if (button == ACTION_QS_VOLUP) {
|
||||
adjust_volume(1);
|
||||
sb_skin_force_next_update();
|
||||
FOR_NB_SCREENS(i)
|
||||
skin_update(CUSTOM_STATUSBAR, i, SKIN_REFRESH_NON_STATIC);
|
||||
}
|
||||
else if (button == ACTION_QS_VOLDOWN) {
|
||||
adjust_volume(-1);
|
||||
sb_skin_force_next_update();
|
||||
FOR_NB_SCREENS(i)
|
||||
skin_update(CUSTOM_STATUSBAR, i, SKIN_REFRESH_NON_STATIC);
|
||||
}
|
||||
else if (button == ACTION_STD_CONTEXT)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2005 by Kevin Ferrare
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) Markus Braun (2002)
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2005 Kevin Ferrare
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2010 Jonathan Gordon
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2002-2007 Björn Stenberg
|
||||
* Copyright (C) 2007-2008 Nicolas Pennequin
|
||||
|
|
@ -70,20 +71,8 @@
|
|||
#include "statusbar-skinned.h"
|
||||
#include "skin_display.h"
|
||||
|
||||
static bool dirty[NB_SCREENS];
|
||||
|
||||
void skin_render(struct gui_wps *gwps, unsigned refresh_mode);
|
||||
|
||||
bool skin_is_dirty(enum screen_type screen)
|
||||
{
|
||||
return dirty[screen] && !(dirty[screen] = false);
|
||||
}
|
||||
|
||||
void skin_mark_dirty(enum screen_type screen)
|
||||
{
|
||||
dirty[screen] = true;
|
||||
}
|
||||
|
||||
/* update a skinned screen, update_type is WPS_REFRESH_* values.
|
||||
* Usually it should only be WPS_REFRESH_NON_STATIC
|
||||
* A full update will be done if required (skin_do_full_update() == true)
|
||||
|
|
@ -101,7 +90,6 @@ void skin_update(enum skinnable_screens skin, enum screen_type screen,
|
|||
|
||||
skin_render(gwps, skin_do_full_update(skin, screen) ?
|
||||
SKIN_REFRESH_ALL : update_type);
|
||||
skin_mark_dirty(screen);
|
||||
}
|
||||
|
||||
#ifdef AB_REPEAT_ENABLE
|
||||
|
|
@ -210,23 +198,6 @@ void draw_progressbar(struct gui_wps *gwps, struct skin_viewport* skin_viewport,
|
|||
length = 100;
|
||||
end = battery_level();
|
||||
}
|
||||
else if (pb->type == SKIN_TOKEN_PLAYLIST_PROGRESSBAR)
|
||||
{
|
||||
unsigned long pl_elapsed, pl_total;
|
||||
if (id3 && wps_get_playlist_percent(id3,
|
||||
id3->elapsed + state->ff_rewind_count,
|
||||
&pl_elapsed, &pl_total)
|
||||
&& pl_total > 0)
|
||||
{
|
||||
length = pl_total;
|
||||
end = pl_elapsed;
|
||||
}
|
||||
else
|
||||
{
|
||||
length = 1;
|
||||
end = 0;
|
||||
}
|
||||
}
|
||||
else if (pb->type == SKIN_TOKEN_PEAKMETER_LEFTBAR ||
|
||||
pb->type == SKIN_TOKEN_PEAKMETER_RIGHTBAR)
|
||||
{
|
||||
|
|
@ -426,17 +397,8 @@ void wps_display_images(struct gui_wps *gwps, struct viewport* vp)
|
|||
(void)vp;
|
||||
struct wps_data *data = gwps->data;
|
||||
struct screen *display = gwps->display;
|
||||
|
||||
/* Start with album art, as it may be drawn over by mask images */
|
||||
#ifdef HAVE_ALBUMART
|
||||
struct skin_albumart *aa = SKINOFFSETTOPTR(get_skin_buffer(data), data->albumart);
|
||||
if (aa && aa->draw_handle >= 0)
|
||||
{
|
||||
draw_album_art(gwps, aa->draw_handle, false);
|
||||
aa->draw_handle = -1;
|
||||
}
|
||||
#endif
|
||||
struct skin_token_list *list = SKINOFFSETTOPTR(get_skin_buffer(data), data->images);
|
||||
|
||||
while (list)
|
||||
{
|
||||
struct wps_token *token = SKINOFFSETTOPTR(get_skin_buffer(data), list->token);
|
||||
|
|
@ -458,6 +420,15 @@ void wps_display_images(struct gui_wps *gwps, struct viewport* vp)
|
|||
}
|
||||
list = SKINOFFSETTOPTR(get_skin_buffer(data), list->next);
|
||||
}
|
||||
#ifdef HAVE_ALBUMART
|
||||
/* now draw the AA */
|
||||
struct skin_albumart *aa = SKINOFFSETTOPTR(get_skin_buffer(data), data->albumart);
|
||||
if (aa && aa->draw_handle >= 0)
|
||||
{
|
||||
draw_album_art(gwps, aa->draw_handle, false);
|
||||
aa->draw_handle = -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
display->set_drawmode(DRMODE_SOLID);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2002-2007 Björn Stenberg
|
||||
* Copyright (C) 2007-2008 Nicolas Pennequin
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2010 Jonathan Gordon
|
||||
*
|
||||
|
|
@ -49,6 +50,9 @@ char* wps_default_skin(enum screen_type screen);
|
|||
char* default_radio_skin(enum screen_type screen);
|
||||
static bool skins_initialised = false;
|
||||
|
||||
static char* get_skin_filename(char *buf, size_t buf_size,
|
||||
enum skinnable_screens skin, enum screen_type screen);
|
||||
|
||||
struct gui_skin_helper {
|
||||
void (*process)(enum screen_type screen, struct wps_data *data, bool preprocess);
|
||||
char* (*default_skin)(enum screen_type screen);
|
||||
|
|
@ -149,6 +153,11 @@ void gui_sync_skin_init(void)
|
|||
}
|
||||
}
|
||||
|
||||
void skin_unload_all(void)
|
||||
{
|
||||
gui_sync_skin_init();
|
||||
}
|
||||
|
||||
static void skin_reset_buffers(int item, int screen)
|
||||
{
|
||||
skin_data_free_buflib_allocs(&skins[item][screen].data);
|
||||
|
|
@ -165,6 +174,7 @@ static void skin_reset_buffers(int item, int screen)
|
|||
void settings_apply_skins(void)
|
||||
{
|
||||
int i;
|
||||
char filename[MAX_PATH];
|
||||
|
||||
if (audio_status() & AUDIO_STATUS_PLAY)
|
||||
audio_stop();
|
||||
|
|
@ -187,6 +197,7 @@ void settings_apply_skins(void)
|
|||
{
|
||||
FOR_NB_SCREENS(j)
|
||||
{
|
||||
get_skin_filename(filename, MAX_PATH, i,j);
|
||||
gui_skin_reset(&skins[i][j]);
|
||||
skins[i][j].gui_wps.display = &screens[j];
|
||||
if (skin_helpers[i]->load_on_boot)
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2007 Nicolas Pennequin
|
||||
* Copyright (C) 2009 Jonathan Gordon
|
||||
|
|
@ -49,8 +50,12 @@ void skin_disarm_touchregions(struct gui_wps *gwps);
|
|||
/* Do a update_type update of the skinned screen */
|
||||
void skin_update(enum skinnable_screens skin, enum screen_type screen,
|
||||
unsigned int update_type);
|
||||
void skin_mark_dirty(enum screen_type screen);
|
||||
bool skin_is_dirty(enum screen_type screen);
|
||||
|
||||
/* Defer updates in skin_render */
|
||||
void skin_defer_rendering(bool deferred);
|
||||
/* Render viewport together with deferred updates */
|
||||
void skin_render_deferred(struct screen *display, struct viewport *vp);
|
||||
|
||||
bool skin_has_sbs(struct gui_wps *gwps);
|
||||
|
||||
|
||||
|
|
@ -78,6 +83,8 @@ void skin_load(enum skinnable_screens skin, enum screen_type screen,
|
|||
struct gui_wps *skin_get_gwps(enum skinnable_screens skin, enum screen_type screen);
|
||||
void gui_sync_skin_init(void);
|
||||
|
||||
void skin_unload_all(void);
|
||||
|
||||
bool skin_do_full_update(enum skinnable_screens skin, enum screen_type screen);
|
||||
void skin_request_full_update(enum skinnable_screens skin);
|
||||
void skin_request_update_locked(bool locked);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2007 Nicolas Pennequin, Dan Everton, Matthias Mohr
|
||||
* 2010 Jonathan Gordon
|
||||
|
|
@ -1234,13 +1235,6 @@ static int parse_progressbar_tag(struct skin_element* element,
|
|||
token->type = SKIN_TOKEN_VOLUMEBAR;
|
||||
else if (token->type == SKIN_TOKEN_BATTERY_PERCENT)
|
||||
token->type = SKIN_TOKEN_BATTERY_PERCENTBAR;
|
||||
else if (token->type == SKIN_TOKEN_PLAYLIST_ELAPSED_PERCENT)
|
||||
{
|
||||
#ifndef __PCTOOL__
|
||||
wps_playlist_percent_enable(); /* enable scanning track lengths */
|
||||
#endif
|
||||
token->type = SKIN_TOKEN_PLAYLIST_PROGRESSBAR;
|
||||
}
|
||||
else if (token->type == SKIN_TOKEN_TUNER_RSSI)
|
||||
token->type = SKIN_TOKEN_TUNER_RSSI_BAR;
|
||||
else if (token->type == SKIN_TOKEN_PEAKMETER_LEFT)
|
||||
|
|
@ -2423,7 +2417,6 @@ static int skin_element_callback(struct skin_element* element, void* data)
|
|||
case SKIN_TOKEN_PROGRESSBAR:
|
||||
case SKIN_TOKEN_VOLUME:
|
||||
case SKIN_TOKEN_BATTERY_PERCENT:
|
||||
case SKIN_TOKEN_PLAYLIST_ELAPSED_PERCENT:
|
||||
case SKIN_TOKEN_PLAYER_PROGRESSBAR:
|
||||
case SKIN_TOKEN_PEAKMETER_LEFT:
|
||||
case SKIN_TOKEN_PEAKMETER_RIGHT:
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id: skin_parser.c 26752 2010-06-10 21:22:16Z bieber $
|
||||
*
|
||||
* Copyright (C) 2010 Jonathan Gordon
|
||||
*
|
||||
|
|
@ -83,6 +84,8 @@ static void skin_render_playlistviewer(struct playlistviewer* viewer,
|
|||
unsigned long refresh_type);
|
||||
|
||||
static char* skin_buffer;
|
||||
static bool defer_rendering;
|
||||
static bool dirty[NB_SCREENS];
|
||||
|
||||
static inline struct skin_element*
|
||||
get_child(OFFSETTYPE(struct skin_element**) children, int child)
|
||||
|
|
@ -227,7 +230,6 @@ static bool do_non_text_tags(struct gui_wps *gwps, struct skin_draw_info *info,
|
|||
case SKIN_TOKEN_PLAYLIST_PERCENTBAR:
|
||||
case SKIN_TOKEN_SETTINGBAR:
|
||||
case SKIN_TOKEN_PROGRESSBAR:
|
||||
case SKIN_TOKEN_PLAYLIST_PROGRESSBAR:
|
||||
case SKIN_TOKEN_TUNER_RSSI_BAR:
|
||||
case SKIN_TOKEN_LIST_SCROLLBAR:
|
||||
{
|
||||
|
|
@ -841,6 +843,29 @@ void skin_render_viewport(struct skin_element* viewport, struct gui_wps *gwps,
|
|||
wps_display_images(gwps, &skin_viewport->vp);
|
||||
}
|
||||
|
||||
void skin_defer_rendering(bool deferred)
|
||||
{
|
||||
defer_rendering = deferred;
|
||||
}
|
||||
|
||||
void skin_render_deferred(struct screen *display, struct viewport *vp)
|
||||
{
|
||||
if (defer_rendering)
|
||||
return;
|
||||
|
||||
if (dirty[display->screen_type])
|
||||
{
|
||||
dirty[display->screen_type] = false;
|
||||
display->set_viewport(NULL);
|
||||
display->update();
|
||||
}
|
||||
else
|
||||
{
|
||||
display->set_viewport(vp);
|
||||
display->update_viewport();
|
||||
}
|
||||
}
|
||||
|
||||
void skin_render(struct gui_wps *gwps, unsigned refresh_mode)
|
||||
{
|
||||
const int vp_is_appearing = (VP_DRAW_WASHIDDEN|VP_DRAW_HIDEABLE);
|
||||
|
|
@ -932,14 +957,19 @@ void skin_render(struct gui_wps *gwps, unsigned refresh_mode)
|
|||
skin_backdrop_show(data->backdrop_id);
|
||||
#endif
|
||||
|
||||
dirty[display->screen_type] = defer_rendering;
|
||||
if (((refresh_mode&SKIN_REFRESH_ALL) == SKIN_REFRESH_ALL))
|
||||
{
|
||||
defer_rendering = true;
|
||||
/* If this is the UI viewport then let the UI know
|
||||
* to redraw itself */
|
||||
send_event(GUI_EVENT_NEED_UI_UPDATE, NULL);
|
||||
defer_rendering = dirty[display->screen_type];
|
||||
}
|
||||
/* Restore the default viewport */
|
||||
display->set_viewport_ex(NULL, VP_FLAG_VP_SET_CLEAN);
|
||||
if (!defer_rendering)
|
||||
display->update();
|
||||
}
|
||||
|
||||
static __attribute__((noinline))
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2002-2007 Björn Stenberg
|
||||
* Copyright (C) 2007-2008 Nicolas Pennequin
|
||||
|
|
@ -41,15 +42,10 @@
|
|||
#include "misc.h"
|
||||
#include "led.h"
|
||||
#include "peakmeter.h"
|
||||
#include "splash.h"
|
||||
/* Image stuff */
|
||||
#include "albumart.h"
|
||||
#include "playlist.h"
|
||||
#include "playback.h"
|
||||
#include "metadata.h"
|
||||
#include "crc32.h"
|
||||
#include "file.h"
|
||||
#include "core_alloc.h"
|
||||
#include "tdspeed.h"
|
||||
#include "viewport.h"
|
||||
#include "tagcache.h"
|
||||
|
|
@ -73,10 +69,6 @@
|
|||
#include "option_select.h"
|
||||
#include "wps.h"
|
||||
|
||||
#if (CONFIG_STORAGE & STORAGE_ATA)
|
||||
#include "ata.h" /* ata_disk_isssd() */
|
||||
#endif
|
||||
|
||||
#define NOINLINE __attribute__ ((noinline))
|
||||
|
||||
static const char* get_codectype(const struct mp3entry* id3)
|
||||
|
|
@ -207,167 +199,6 @@ const char *get_cuesheetid3_token(struct wps_token *token, struct mp3entry *id3,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/* Whole-playlist progress by time (%pX). if track count exceeds MAX_TRACKS
|
||||
* the tag falls back to position-based progress.
|
||||
* The cache is keyed on the track count and a crc of the
|
||||
* first, middle and last filenames, so a playlist change, same-length swap,
|
||||
* or reshuffle causes a reload of the length data. */
|
||||
#define PLPCT_MAX_TRACKS 500
|
||||
|
||||
static struct {
|
||||
uint32_t sig; /* signature of the playlist to detect changed playlist or reshuffle*/
|
||||
int amount;
|
||||
bool nomem; /* allocation failed -> position fallback */
|
||||
bool enabled; /* tag was parsed */
|
||||
uint16_t track_mins[PLPCT_MAX_TRACKS];
|
||||
unsigned long total_min;
|
||||
} plpct = { .amount = -1, .enabled = false };
|
||||
|
||||
static uint32_t plpct_sig(void)
|
||||
{
|
||||
struct playlist_info *pl = playlist_get_current();
|
||||
/* changes on any playlist swap or reshuffle */
|
||||
return pl->seed ^ pl->first_index ^ pl->amount ^ pl->last_insert_pos ^ pl->dirlen
|
||||
^ pl->created_tick ^ pl->max_playlist_size ^ pl->last_shuffled_start;
|
||||
}
|
||||
|
||||
/* Equal-weight estimate (every track the same length)
|
||||
scaled by 1000 as %pX is percent-only. */
|
||||
static void plpct_estimate(const struct mp3entry *id3, unsigned long elapsed_ms,
|
||||
int index, int amount,
|
||||
unsigned long *elapsed_s, unsigned long *total_s)
|
||||
{
|
||||
unsigned long frac = 0; /* 0..1000 through the current track */
|
||||
if (id3->length)
|
||||
frac = MIN(1000UL, 1000UL * elapsed_ms / id3->length);
|
||||
*elapsed_s = (unsigned long)(index - 1) * 1000 + frac;
|
||||
*total_s = (unsigned long)amount * 1000;
|
||||
}
|
||||
|
||||
void wps_playlist_percent_enable(void)
|
||||
{
|
||||
plpct.enabled = true;
|
||||
}
|
||||
|
||||
void wps_playlist_percent_prepare(void)
|
||||
{
|
||||
if (!plpct.enabled)
|
||||
return;
|
||||
|
||||
plpct.nomem = true;
|
||||
|
||||
int amount = playlist_amount();
|
||||
plpct.sig = plpct_sig();
|
||||
plpct.amount = amount;
|
||||
if (amount <= 0 || amount > PLPCT_MAX_TRACKS) /* too many tracks abort */
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
struct playlist_track_info info;
|
||||
|
||||
struct mp3entry *tmp = get_temp_mp3entry(NULL); /* shared scratch */
|
||||
|
||||
if (!tmp)
|
||||
return;
|
||||
#if (CONFIG_STORAGE & STORAGE_ATA) /* Harddrive estimate length based on filesize */
|
||||
unsigned int last_afmt = AFMT_UNKNOWN;
|
||||
uint32_t last_bps = 0;
|
||||
#endif
|
||||
for (int n = 0; n < amount; n++)
|
||||
{
|
||||
unsigned long secs = 0;
|
||||
uint16_t mins = 0;
|
||||
if (playlist_get_track_info(NULL, n, &info) < 0) /* couldn't get track filename abort */
|
||||
goto abort;
|
||||
|
||||
int slot = info.display_index - 1;
|
||||
if (slot < 0 || slot >= amount)
|
||||
goto abort;
|
||||
|
||||
#if (CONFIG_STORAGE & STORAGE_ATA) /* Harddrive */
|
||||
int fd = open(info.filename, O_RDONLY);
|
||||
if (fd >= 0)
|
||||
{
|
||||
unsigned int afmt = probe_file_format(info.filename);
|
||||
off_t size = filesize(fd);
|
||||
|
||||
if (size > 0)
|
||||
{
|
||||
if (afmt != last_afmt || last_bps == 0
|
||||
|| amount <= 50 || (amount <= 250 && ata_disk_isssd())) // TODO tune this for harddisk devices
|
||||
{
|
||||
if (get_metadata_afmt(tmp, fd, info.filename, afmt,
|
||||
METADATA_EXCLUDE_ID3_PATH | METADATA_EXCLUDE_NORMALIZE))
|
||||
{
|
||||
secs = tmp->length / 1000;
|
||||
last_bps = (uint32_t)((uint64_t)size * 1000 / tmp->length);
|
||||
last_afmt = afmt;
|
||||
}
|
||||
}
|
||||
else /* file size only -- no per-track metadata parse */
|
||||
{
|
||||
secs = (unsigned long)((uint64_t)size / last_bps);
|
||||
}
|
||||
mins = MIN(MAX(1, (secs + 30) / 60), 65535ul);/* minutes, rounded to nearest */
|
||||
}
|
||||
close(fd);
|
||||
}
|
||||
#else
|
||||
if (get_metadata_ex(tmp, -1, info.filename,
|
||||
METADATA_EXCLUDE_ID3_PATH | METADATA_EXCLUDE_NORMALIZE))
|
||||
{
|
||||
secs = tmp->length / 1000;
|
||||
mins = MIN(MAX(1, (secs + 30) / 60), 65535ul);/* minutes, rounded to nearest */
|
||||
}
|
||||
#endif
|
||||
/* unreadable tracks count as zero length */
|
||||
plpct.track_mins[slot] = mins;
|
||||
}
|
||||
|
||||
plpct.total_min = 0;
|
||||
for (int t = 0; t < plpct.amount; t++)
|
||||
plpct.total_min += plpct.track_mins[t];
|
||||
plpct.nomem = false;
|
||||
abort:
|
||||
get_temp_mp3entry(tmp); /* release scratch */
|
||||
}
|
||||
|
||||
bool wps_get_playlist_percent(struct mp3entry *id3, unsigned long elapsed_ms,
|
||||
unsigned long *elapsed_s, unsigned long *total_s)
|
||||
{
|
||||
int amount = playlist_amount();
|
||||
int index = playlist_get_display_index(); /* 1-based */
|
||||
|
||||
if (!id3 || amount <= 0 || index < 1 || index > amount)
|
||||
return false;
|
||||
|
||||
uint32_t sig = plpct_sig();
|
||||
if (amount != plpct.amount || sig != plpct.sig)
|
||||
{
|
||||
splashf(0, ID2P(LANG_WAIT));
|
||||
wps_playlist_percent_enable();
|
||||
wps_playlist_percent_prepare();
|
||||
}
|
||||
/* error parsing playlist or more than MAX_TRACKS fall back to
|
||||
position-based progress rather than blank */
|
||||
if (plpct.nomem)
|
||||
{
|
||||
plpct_estimate(id3, elapsed_ms, index, amount, elapsed_s, total_s);
|
||||
return true;
|
||||
}
|
||||
|
||||
unsigned long before_min = 0;
|
||||
for (int t = 0; t < index - 1; t++)
|
||||
before_min += plpct.track_mins[t];
|
||||
|
||||
*elapsed_s = before_min * 60 + elapsed_ms / 1000;
|
||||
*total_s = plpct.total_min * 60;
|
||||
if (*elapsed_s > *total_s)
|
||||
*elapsed_s = *total_s;
|
||||
return true;
|
||||
}
|
||||
|
||||
static const char* get_filename_token(struct wps_token *token, char* filename,
|
||||
char *buf, int buf_size)
|
||||
{
|
||||
|
|
@ -503,24 +334,6 @@ const char *get_id3_token(struct wps_token *token, struct mp3entry *id3,
|
|||
snprintf(buf, buf_size, "%lu", 100 * elapsed / length);
|
||||
return buf;
|
||||
|
||||
case SKIN_TOKEN_PLAYLIST_ELAPSED_PERCENT:
|
||||
{
|
||||
unsigned long pl_elapsed, pl_total;
|
||||
if (!wps_get_playlist_percent(id3, elapsed,
|
||||
&pl_elapsed, &pl_total)
|
||||
|| pl_total == 0)
|
||||
return NULL;
|
||||
|
||||
/* %pX always yields a value for a valid playlist now (the
|
||||
equal-weight estimate until the scan finishes, then the exact
|
||||
time-weighted figure), so it behaves like any percent tag;
|
||||
%?pX<...> is true whenever the tag applies (a sized playlist). */
|
||||
if (intval && limit == TOKEN_VALUE_ONLY)
|
||||
*intval = 100 * pl_elapsed / pl_total;
|
||||
snprintf(buf, buf_size, "%lu", 100 * pl_elapsed / pl_total);
|
||||
return buf;
|
||||
}
|
||||
|
||||
case SKIN_TOKEN_TRACK_STARTING:
|
||||
{
|
||||
unsigned long time = token->value.i * (HZ/TIMEOUT_UNIT);
|
||||
|
|
@ -697,7 +510,7 @@ const char *get_radio_token(struct wps_token *token, int preset_offset,
|
|||
if (preset < 0)
|
||||
preset += preset_count;
|
||||
if (token->type == SKIN_TOKEN_PRESET_NAME)
|
||||
radio_get_preset_name(preset, buf, buf_size);
|
||||
snprintf(buf, buf_size, "%s", radio_get_preset_name(preset));
|
||||
else if (token->type == SKIN_TOKEN_PRESET_FREQ)
|
||||
format_freq_MHz(radio_get_preset_freq(preset),
|
||||
region_data->freq_step, buf, buf_size);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2009 - Jonathan Gordon
|
||||
*
|
||||
|
|
@ -203,11 +204,24 @@ int skin_get_touchaction(struct gui_wps *gwps, int* edge_offset)
|
|||
if (!gwps->id3)
|
||||
break;
|
||||
|
||||
audio_pre_ff_rewind();
|
||||
gwps->id3->elapsed = gwps->id3->length / 1000 * (*edge_offset);
|
||||
|
||||
if (gevent.id == GESTURE_TAP || gevent.id == GESTURE_RELEASE)
|
||||
if (gevent.id == GESTURE_HOLD ||
|
||||
gevent.id == GESTURE_DRAGSTART ||
|
||||
gevent.id == GESTURE_DRAG)
|
||||
{
|
||||
audio_pre_ff_rewind();
|
||||
gwps->id3->elapsed = gwps->id3->length * (*edge_offset) / 1000;
|
||||
}
|
||||
else if (gevent.id == GESTURE_RELEASE)
|
||||
{
|
||||
audio_ff_rewind(gwps->id3->elapsed);
|
||||
}
|
||||
else
|
||||
{
|
||||
gwps->id3->elapsed = gwps->id3->length * (*edge_offset) / 1000;
|
||||
audio_pre_ff_rewind();
|
||||
audio_ff_rewind(gwps->id3->elapsed);
|
||||
}
|
||||
|
||||
} break;
|
||||
|
||||
case ACTION_TOUCH_VOLUME:
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2007 Nicolas Pennequin
|
||||
*
|
||||
|
|
@ -428,12 +429,6 @@ const char *get_cuesheetid3_token(struct wps_token *token, struct mp3entry *id3,
|
|||
int offset_tracks, char *buf, int buf_size);
|
||||
const char *get_id3_token(struct wps_token *token, struct mp3entry *id3,
|
||||
char *filename, char *buf, int buf_size, int limit, int *intval);
|
||||
/* whole-playlist progress backing %pX (number and bar forms) */
|
||||
bool wps_get_playlist_percent(struct mp3entry *id3, unsigned long elapsed_ms,
|
||||
unsigned long *elapsed_s, unsigned long *total_s);
|
||||
void wps_playlist_percent_enable(void);
|
||||
void wps_playlist_percent_prepare(void);
|
||||
|
||||
#if CONFIG_TUNER
|
||||
const char *get_radio_token(struct wps_token *token, int preset_offset,
|
||||
char *buf, int buf_size, int limit, int *intval);
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) Daniel Stenberg (2002)
|
||||
* Copyright (C) William Wilgus (2026)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
|
@ -39,235 +39,109 @@
|
|||
static long progress_next_tick, talked_tick;
|
||||
|
||||
#define MAXLINES (LCD_HEIGHT/6)
|
||||
|
||||
|
||||
#ifndef BOOTLOADER
|
||||
#if MEMORYSIZE > 8
|
||||
#define MAXBUFFER MAX(1024, (LCD_WIDTH/SYSFONT_WIDTH) * MAXLINES + 1)
|
||||
#else
|
||||
#define MAXBUFFER MAX(512, (LCD_WIDTH/SYSFONT_WIDTH) * MAXLINES + 1)
|
||||
#endif
|
||||
#else
|
||||
#define MAXBUFFER (512)
|
||||
#endif
|
||||
|
||||
#define MAXBUFFER 512
|
||||
#define RECT_SPACING 3
|
||||
#define SPLASH_MEMORY_INTERVAL (HZ)
|
||||
|
||||
/* splash_internal does the actual drawing of the splash box and text
|
||||
* each call to splash remembers the max size and will not shrink the splash box
|
||||
* until it is reset by an activity change or \f at the beginning of a string
|
||||
*
|
||||
* splash supports several escape sequences ("\n\t\f\r\v\b")
|
||||
* '\n' (new line) indicates the end of a line of text and starts a new one
|
||||
* ("\n\n" will end a line and create a blank line)
|
||||
* '\n' as the first character of the text will create a blank line
|
||||
*
|
||||
* '\t' (tab) starts a new line and adds several spaces to the beginning of the
|
||||
* new line it also left/right justifies the splash text box
|
||||
* (RTL languages will right justify)
|
||||
* '\t' as the last character of the text will left/right justify
|
||||
* without adding any tabs to the text output
|
||||
*
|
||||
* '\f' (form feed) as the first character of the text will reset the text box
|
||||
* width and height
|
||||
*
|
||||
* Others:
|
||||
* '\f', \r', '\v' '\b' will be treated as a breaking space character
|
||||
* they will not be displayed as output and multiple sequences will be
|
||||
* treated as a single character
|
||||
* eg. "\b\v\f\r" will break the line but only once and will not show as a space
|
||||
* where as "\n\n" will break a line and add a blank line
|
||||
* "\t\t" would break a line and add a total of 4 spaces to the next line
|
||||
*/
|
||||
static bool splash_internal(struct screen * screen, const char *fmt, va_list ap,
|
||||
struct viewport *vp, int addl_lines)
|
||||
{
|
||||
static const char matchstr[] = "\r\n\f\v\t\b";
|
||||
static int max_width[NB_SCREENS] = {0};
|
||||
static int max_height[NB_SCREENS] = {0};
|
||||
static int max_width[NB_SCREENS] = {2*RECT_SPACING};
|
||||
#ifndef BOOTLOADER
|
||||
static char splash_buf[MAXBUFFER] = {0};
|
||||
static enum current_activity last_act = ACTIVITY_UNKNOWN;
|
||||
enum current_activity act = get_current_activity();
|
||||
|
||||
if (last_act != act) /* changed activities reset width / height */
|
||||
if (last_act != act) /* changed activities reset max_width */
|
||||
{
|
||||
FOR_NB_SCREENS(i)
|
||||
{
|
||||
max_width[i] = 0;
|
||||
max_height[i] = 0;
|
||||
}
|
||||
max_width[i] = 2*RECT_SPACING;
|
||||
last_act = act;
|
||||
}
|
||||
#else /*def BOOTLOADER*/
|
||||
char splash_buf[MAXBUFFER] = {0}; /* on the stack for the bootloader */
|
||||
#endif
|
||||
|
||||
/* prevent screen artifacts by keeping the max width seen */
|
||||
int min_width = max_width[screen->screen_type];
|
||||
char splash_buf[MAXBUFFER];
|
||||
struct splash_lines {
|
||||
const char *str;
|
||||
uint16_t x;
|
||||
uint16_t len;
|
||||
size_t len;
|
||||
} lines[MAXLINES];
|
||||
memset(lines, 0, sizeof(lines));
|
||||
|
||||
char *buf = splash_buf;
|
||||
const char *next, *store;
|
||||
|
||||
bool has_tabs = false;
|
||||
const char *next;
|
||||
const char *lastbreak = NULL;
|
||||
const char *store = NULL;
|
||||
int line = 0;
|
||||
int x = 0, w = 0;
|
||||
int y;
|
||||
int space_w, chr_h;
|
||||
int width = vp->width - RECT_SPACING*2;
|
||||
int height = vp->height;
|
||||
|
||||
/* prevent screen artifacts by keeping the max width / height seen */
|
||||
int maxw = max_width[screen->screen_type];
|
||||
int maxh = max_height[screen->screen_type];
|
||||
int x = 0;
|
||||
int y, i;
|
||||
int space_w, w, chr_h;
|
||||
int width, height;
|
||||
int maxw = min_width - 2*RECT_SPACING;
|
||||
int fontnum = vp->font;
|
||||
|
||||
size_t next_len;
|
||||
|
||||
char lastbrkchr;
|
||||
size_t len, next_len;
|
||||
const char matchstr[] = "\r\n\f\v\t ";
|
||||
font_getstringsize(" ", &space_w, &chr_h, fontnum);
|
||||
y = (addl_lines * chr_h);
|
||||
y = chr_h + (addl_lines * chr_h);
|
||||
|
||||
int res = vsnprintf(splash_buf, sizeof(splash_buf), fmt, ap);
|
||||
vsnprintf(splash_buf, sizeof(splash_buf), fmt, ap);
|
||||
va_end(ap);
|
||||
|
||||
if (res <= 0 || width < space_w || height < chr_h)
|
||||
{
|
||||
#ifdef SIMULATOR
|
||||
if (res <= 0)
|
||||
printf("ERROR: %s %d\n", __func__, res);
|
||||
else
|
||||
printf("WARNING: %s vp too small\n", __func__);
|
||||
#endif
|
||||
/* break splash string into display lines, doing proper word wrap */
|
||||
next = strptokspn_r(splash_buf, matchstr, &next_len, &store);
|
||||
if (!next)
|
||||
return false; /* nothing to display */
|
||||
}
|
||||
|
||||
const char *lastbreak = splash_buf;
|
||||
if (*lastbreak == '\f') /* only as first character - Reset splash box size */
|
||||
lines[line].len = next_len;
|
||||
lines[line].str = next;
|
||||
while (true)
|
||||
{
|
||||
maxw = 0;
|
||||
maxh = 0;
|
||||
}
|
||||
|
||||
while(true) /* break splash string into display lines, doing proper word wrap */
|
||||
{
|
||||
#ifndef BOOTLOADER
|
||||
while (*lastbreak != '\0') /* handle escape chars*/
|
||||
w = font_getstringnsize(next, next_len, NULL, NULL, fontnum);
|
||||
if (lastbreak)
|
||||
{
|
||||
switch (*lastbreak) /* all chars in matchstr */
|
||||
{
|
||||
case '\t': /*fallthrough*/
|
||||
has_tabs = true; /* left justify (right justify for RTL)*/
|
||||
case '\n':
|
||||
len = next - lastbreak;
|
||||
int next_w = len * space_w;
|
||||
if (x + next_w + w > vp->width - RECT_SPACING*2 || lastbrkchr != ' ')
|
||||
{ /* too wide, or control character wrap */
|
||||
if (x > maxw)
|
||||
maxw = x;
|
||||
if ((y + chr_h * 2 > vp->height) || (line >= (MAXLINES-1)))
|
||||
break; /* screen full or out of lines */
|
||||
x = 0;
|
||||
y += chr_h;
|
||||
|
||||
/* split when it fits since we didn't find a valid token to break on */
|
||||
size_t nl = next_len;
|
||||
while (w > vp->width && --nl > 0)
|
||||
w = font_getstringnsize(next, nl, NULL, NULL, fontnum);
|
||||
|
||||
if (nl > 1 && nl != next_len)
|
||||
{
|
||||
if (lines[line].len > 0 || *lastbreak != '\t')
|
||||
{
|
||||
x += w;
|
||||
if (x > maxw)
|
||||
maxw = x;
|
||||
|
||||
x = 0;
|
||||
y += chr_h;
|
||||
if (y >= height || line >= MAXLINES-1)
|
||||
{
|
||||
break; /* out of lines */
|
||||
}
|
||||
line++;
|
||||
}
|
||||
/* /t as last char left justifies only */
|
||||
if (lastbreak[0] == '\t' && lastbreak[1] != '\0')
|
||||
{
|
||||
/* add offset for tab */
|
||||
lines[line].x += space_w * 2;
|
||||
x += space_w * 2;
|
||||
}
|
||||
break;
|
||||
next_len = nl;
|
||||
store = next + nl; /* move the start pos for the next token read */
|
||||
}
|
||||
case '\b': /*fallthrough*/
|
||||
case '\f': /*fallthrough*/
|
||||
case '\v': /*fallthrough*/
|
||||
case '\r':
|
||||
break; /* acts the same as a space character */
|
||||
default: /* No valid break chars */
|
||||
lastbreak = " "; /* exit */
|
||||
break;
|
||||
}
|
||||
lastbreak++;
|
||||
}
|
||||
#endif
|
||||
if (lines[line].len > 0)
|
||||
{
|
||||
x += w;
|
||||
if (x > maxw)
|
||||
maxw = x;
|
||||
x = 0;
|
||||
y += chr_h;
|
||||
if (y >= height || line >= MAXLINES-1)
|
||||
{
|
||||
if (y > maxh)
|
||||
maxh = y;
|
||||
break; /* out of lines */
|
||||
}
|
||||
line++;
|
||||
}
|
||||
|
||||
next = strptokspn_r(buf, matchstr, &next_len, &store);
|
||||
lines[++line].len = next_len;
|
||||
lines[line].str = next;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* restore & calculate spacing */
|
||||
lines[line].len += next_len + 1;
|
||||
x += next_w;
|
||||
}
|
||||
}
|
||||
x += w;
|
||||
|
||||
lastbreak = next + next_len;
|
||||
lastbrkchr = *lastbreak;
|
||||
|
||||
next = strptokspn_r(NULL, matchstr, &next_len, &store);
|
||||
|
||||
if (!next)
|
||||
{
|
||||
x += w;
|
||||
{ /* no more words */
|
||||
if (x > maxw)
|
||||
maxw = x;
|
||||
if (y > maxh)
|
||||
maxh = y;
|
||||
break;
|
||||
}
|
||||
buf = NULL; /* uses store for continuation */
|
||||
|
||||
lines[line].str = next;
|
||||
lines[line].len = next_len;
|
||||
|
||||
w = font_getstringnsize(next, next_len, NULL, NULL, fontnum);
|
||||
if (w > width)
|
||||
{
|
||||
const char *nxp, *nx = next;
|
||||
int nw, newlen;
|
||||
int oldlen = next_len;
|
||||
|
||||
while (nx - next < oldlen) /* try to split at a space char */
|
||||
{
|
||||
nxp = nx;
|
||||
nx++;
|
||||
if (*nxp != ' ' && *nx != '\0') /* split on space or EOL */
|
||||
continue;
|
||||
newlen = nxp - next;
|
||||
nw = font_getstringnsize(next, newlen, NULL, NULL, fontnum);
|
||||
|
||||
if (nw > width)
|
||||
{
|
||||
/* is next word larger than max width & room left on this line? */
|
||||
if (nw - w > width && w + space_w * 8 < width)
|
||||
w = nw;
|
||||
break;
|
||||
}
|
||||
w = nw;
|
||||
next_len = newlen;
|
||||
store = nx; /* we want to skip the space char */
|
||||
}
|
||||
if (w > width) /* split when it fits */
|
||||
{
|
||||
w = width;
|
||||
next_len = font_measurestring(next, oldlen, w, &w, NULL, fontnum);
|
||||
store = next + next_len;
|
||||
}
|
||||
|
||||
lines[line].len = next_len;
|
||||
}
|
||||
lastbreak = next + next_len;
|
||||
}
|
||||
|
||||
/* prepare viewport
|
||||
|
|
@ -277,25 +151,22 @@ static bool splash_internal(struct screen * screen, const char *fmt, va_list ap,
|
|||
screen->scroll_stop();
|
||||
|
||||
width = maxw + 2*RECT_SPACING;
|
||||
height = maxh + 2*RECT_SPACING;
|
||||
height = y + 2*RECT_SPACING;
|
||||
|
||||
if (width > vp->width)
|
||||
width = vp->width;
|
||||
if (height > vp->height)
|
||||
height = vp->height;
|
||||
|
||||
/* center the vp in the screen area */
|
||||
vp->x += (vp->width - width) / 2;
|
||||
vp->y += (vp->height - height) / 2;
|
||||
vp->width = width;
|
||||
vp->height = height;
|
||||
if (!has_tabs)
|
||||
vp->flags |= VP_FLAG_ALIGN_CENTER;
|
||||
|
||||
/* prevent artifacts by locking to max width & height observed on repeated calls */
|
||||
max_width[screen->screen_type] = width - 2*RECT_SPACING;
|
||||
max_height[screen->screen_type] = height - 2*RECT_SPACING;
|
||||
/* prevent artifacts by locking to max width observed on repeated calls */
|
||||
max_width[screen->screen_type] = width;
|
||||
|
||||
vp->flags |= VP_FLAG_ALIGN_CENTER;
|
||||
#if LCD_DEPTH > 1
|
||||
unsigned fg = 0, bg = 0;
|
||||
bool broken = false;
|
||||
|
|
@ -332,22 +203,11 @@ static bool splash_internal(struct screen * screen, const char *fmt, va_list ap,
|
|||
|
||||
screen->draw_border_viewport();
|
||||
|
||||
/* center y within the available splash box */
|
||||
if (y < maxh)
|
||||
y = (maxh - y) / 2;
|
||||
else
|
||||
y = RECT_SPACING;
|
||||
|
||||
/* print the message to screen */
|
||||
for(int i = 0; i < line && y < height; i++, y+= chr_h)
|
||||
for(i = 0, y = RECT_SPACING; i <= line; i++, y+= chr_h)
|
||||
{
|
||||
if (lines[i].len > 0)
|
||||
{
|
||||
x = lines[i].x;
|
||||
screen->putsxyf(x, y, "%.*s", lines[i].len, lines[i].str);
|
||||
}
|
||||
screen->putsxyf(0, y, "%.*s", lines[i].len, lines[i].str);
|
||||
}
|
||||
|
||||
return true; /* needs update */
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2005 by Kevin Ferrare
|
||||
*
|
||||
|
|
@ -28,9 +29,6 @@
|
|||
* Puts a splash message centered on all the screens for a given period
|
||||
* - ticks : how long the splash is displayed (in rb ticks)
|
||||
* - fmt : what to say *printf style
|
||||
* /f at the beginning of a string will reset the max width and height seen
|
||||
* /n will end a line /n/n will add a blank line
|
||||
* /t will start a new line and indent the string on that line
|
||||
*/
|
||||
extern void splashf(int ticks, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3);
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2009 Thomas Martitz
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2009 Thomas Martitz
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) Robert E. Hak (2002), Linus Nielsen Feltzing (2002)
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2005 by Kevin Ferrare
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2002 Björn Stenberg
|
||||
*
|
||||
|
|
@ -52,63 +53,55 @@
|
|||
#include "ata_mmc.h"
|
||||
#endif
|
||||
|
||||
struct usb_screen_vps_t
|
||||
{
|
||||
struct viewport parent;
|
||||
struct viewport logo;
|
||||
#ifndef USB_ENABLE_HID
|
||||
};
|
||||
#else
|
||||
struct viewport title;
|
||||
};
|
||||
|
||||
#ifdef USB_ENABLE_HID
|
||||
int usb_keypad_mode;
|
||||
static void draw_usb_keypad_mode(struct viewport *title)
|
||||
{
|
||||
struct screen *screen = &screens[SCREEN_MAIN];
|
||||
struct viewport *last_vp = screen->set_viewport(title);
|
||||
screen->clear_viewport();
|
||||
title->flags |= VP_FLAG_ALIGN_CENTER;
|
||||
if (title->width > 1)
|
||||
screen->puts_scroll(0, 0, str(keypad_mode_name_get(usb_keypad_mode)));
|
||||
screen->set_viewport(last_vp);
|
||||
}
|
||||
#endif /* USB_ENABLE_HID */
|
||||
static bool usb_hid;
|
||||
#endif
|
||||
|
||||
static void handle_usb_events(struct viewport *title)
|
||||
#ifndef SIMULATOR
|
||||
|
||||
static int handle_usb_events(void)
|
||||
{
|
||||
#if (CONFIG_STORAGE & STORAGE_MMC) && !defined(SIMULATOR)
|
||||
int next_update = 0;
|
||||
#if (CONFIG_STORAGE & STORAGE_MMC)
|
||||
int next_update=0;
|
||||
#endif /* STORAGE_MMC */
|
||||
int button;
|
||||
|
||||
/* Don't return until we get SYS_USB_DISCONNECTED */
|
||||
/* Don't return until we get SYS_USB_DISCONNECTED or SYS_TIMEOUT */
|
||||
while(1)
|
||||
{
|
||||
#ifndef USB_ENABLE_HID
|
||||
(void)title;
|
||||
#else
|
||||
if (global_settings.usb_hid)
|
||||
int button;
|
||||
#ifdef USB_ENABLE_HID
|
||||
if (usb_hid)
|
||||
{
|
||||
button = get_hid_usb_action();
|
||||
|
||||
/* On mode change, we need to refresh the screen */
|
||||
if (button == ACTION_USB_HID_MODE_SWITCH_NEXT ||
|
||||
button == ACTION_USB_HID_MODE_SWITCH_PREV)
|
||||
draw_usb_keypad_mode(title);
|
||||
button == ACTION_USB_HID_MODE_SWITCH_PREV)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
button = button_get_w_tmo(HZ/2);
|
||||
/* hid emits the event in get_action */
|
||||
send_event(GUI_EVENT_ACTIONUPDATE, NULL);
|
||||
button = button_get_w_tmo(HZ/2);
|
||||
}
|
||||
if (button == SYS_USB_DISCONNECTED)
|
||||
return;
|
||||
if (button == SYS_CHARGER_DISCONNECTED)
|
||||
reset_runtime();
|
||||
|
||||
/* USB-MMC bridge can report activity */
|
||||
#if (CONFIG_STORAGE & STORAGE_MMC) && !defined(SIMULATOR)
|
||||
switch(button)
|
||||
{
|
||||
case SYS_USB_DISCONNECTED:
|
||||
return 1;
|
||||
case SYS_CHARGER_DISCONNECTED:
|
||||
reset_runtime();
|
||||
break;
|
||||
case SYS_TIMEOUT:
|
||||
break;
|
||||
}
|
||||
|
||||
#if (CONFIG_STORAGE & STORAGE_MMC) /* USB-MMC bridge can report activity */
|
||||
if(TIME_AFTER(current_tick,next_update))
|
||||
{
|
||||
if(usb_inserted()) {
|
||||
|
|
@ -118,7 +111,21 @@ static void handle_usb_events(struct viewport *title)
|
|||
}
|
||||
#endif /* STORAGE_MMC */
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* SIMULATOR */
|
||||
|
||||
#define MODE_NAME_LEN 32
|
||||
|
||||
struct usb_screen_vps_t
|
||||
{
|
||||
struct viewport parent;
|
||||
struct viewport logo;
|
||||
#ifdef USB_ENABLE_HID
|
||||
struct viewport title;
|
||||
#endif
|
||||
};
|
||||
|
||||
static void usb_screen_fix_viewports(struct screen *screen,
|
||||
struct usb_screen_vps_t *usb_screen_vps)
|
||||
|
|
@ -171,7 +178,7 @@ static void usb_screen_fix_viewports(struct screen *screen,
|
|||
logo->height = logo_height;
|
||||
|
||||
#ifdef USB_ENABLE_HID
|
||||
if (global_settings.usb_hid)
|
||||
if (usb_hid)
|
||||
{
|
||||
struct viewport *title = &usb_screen_vps->title;
|
||||
int char_height = font_get(parent->font)->height;
|
||||
|
|
@ -204,9 +211,11 @@ static void usb_screens_draw(struct usb_screen_vps_t *usb_screen_vps_ar)
|
|||
&bm_remote_usblogo,
|
||||
#endif
|
||||
};
|
||||
|
||||
FOR_NB_SCREENS(i)
|
||||
{
|
||||
struct screen *screen = &screens[i];
|
||||
|
||||
struct usb_screen_vps_t *usb_screen_vps = &usb_screen_vps_ar[i];
|
||||
struct viewport *parent = &usb_screen_vps->parent;
|
||||
struct viewport *logo = &usb_screen_vps->logo;
|
||||
|
|
@ -214,14 +223,29 @@ static void usb_screens_draw(struct usb_screen_vps_t *usb_screen_vps_ar)
|
|||
last_vp = screen->set_viewport(parent);
|
||||
screen->clear_viewport();
|
||||
screen->backlight_on();
|
||||
|
||||
screen->set_viewport(logo);
|
||||
screen->bmp(logos[i], 0, 0);
|
||||
screen->set_viewport(last_vp);
|
||||
}
|
||||
if (i == SCREEN_MAIN)
|
||||
{
|
||||
#ifdef USB_ENABLE_HID
|
||||
if (global_settings.usb_hid)
|
||||
draw_usb_keypad_mode(&usb_screen_vps_ar[SCREEN_MAIN].title);
|
||||
#endif
|
||||
if (usb_hid)
|
||||
{
|
||||
char modestring[100];
|
||||
screen->set_viewport(&usb_screen_vps->title);
|
||||
usb_screen_vps->title.flags |= VP_FLAG_ALIGN_CENTER;
|
||||
snprintf(modestring, sizeof(modestring), "%s: %s",
|
||||
str(LANG_USB_KEYPAD_MODE),
|
||||
str(keypad_mode_name_get(usb_keypad_mode)));
|
||||
screen->puts_scroll(0, 0, modestring);
|
||||
}
|
||||
#endif /* USB_ENABLE_HID */
|
||||
}
|
||||
screen->set_viewport(parent);
|
||||
|
||||
screen->set_viewport(last_vp);
|
||||
screen->update_viewport();
|
||||
}
|
||||
}
|
||||
|
||||
void gui_usb_screen_run(bool early_usb, intptr_t seqnum)
|
||||
|
|
@ -234,7 +258,6 @@ void gui_usb_screen_run(bool early_usb, intptr_t seqnum)
|
|||
#endif
|
||||
|
||||
struct usb_screen_vps_t usb_screen_vps_ar[NB_SCREENS];
|
||||
struct viewport *title = NULL;
|
||||
#if defined HAVE_TOUCHSCREEN
|
||||
enum touchscreen_mode old_mode = touchscreen_get_mode();
|
||||
|
||||
|
|
@ -246,10 +269,8 @@ void gui_usb_screen_run(bool early_usb, intptr_t seqnum)
|
|||
push_current_activity(ACTIVITY_USBSCREEN);
|
||||
|
||||
#ifdef USB_ENABLE_HID
|
||||
usb_hid = global_settings.usb_hid;
|
||||
usb_keypad_mode = global_settings.usb_keypad_mode;
|
||||
title = &usb_screen_vps_ar[SCREEN_MAIN].title;
|
||||
#else
|
||||
title = NULL;
|
||||
#endif
|
||||
|
||||
FOR_NB_SCREENS(i)
|
||||
|
|
@ -275,13 +296,33 @@ void gui_usb_screen_run(bool early_usb, intptr_t seqnum)
|
|||
/* The font system leaves the .fnt fd's open, so we need for force close them all */
|
||||
font_disable_all();
|
||||
}
|
||||
|
||||
usb_acknowledge(SYS_USB_CONNECTED_ACK, seqnum);
|
||||
usb_screens_draw(usb_screen_vps_ar);
|
||||
handle_usb_events(title);
|
||||
|
||||
while (1)
|
||||
{
|
||||
usb_screens_draw(usb_screen_vps_ar);
|
||||
#ifdef SIMULATOR
|
||||
if (button_get_w_tmo(HZ/2))
|
||||
break;
|
||||
send_event(GUI_EVENT_ACTIONUPDATE, NULL);
|
||||
#else
|
||||
if (handle_usb_events())
|
||||
break;
|
||||
#endif /* SIMULATOR */
|
||||
}
|
||||
|
||||
FOR_NB_SCREENS(i)
|
||||
{
|
||||
const struct viewport* vp = NULL;
|
||||
|
||||
#if defined(USB_ENABLE_HID)
|
||||
if (global_settings.usb_hid)
|
||||
screens[SCREEN_MAIN].scroll_stop_viewport(title);
|
||||
vp = usb_hid ? &usb_screen_vps_ar[i].title : NULL;
|
||||
#endif
|
||||
if (vp)
|
||||
screens[i].scroll_stop_viewport(vp);
|
||||
}
|
||||
#ifdef USB_ENABLE_HID
|
||||
if (global_settings.usb_keypad_mode != usb_keypad_mode)
|
||||
{
|
||||
global_settings.usb_keypad_mode = usb_keypad_mode;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2002 Björn Stenberg
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2008 by Jonathan Gordon
|
||||
*
|
||||
|
|
@ -82,7 +83,7 @@ static void evt_toggle(bool enable, unsigned short id,
|
|||
|
||||
static void toggle_events(bool enable)
|
||||
{
|
||||
evt_toggle(enable, GUI_EVENT_ACTIONREDRAW, viewportmanager_redraw);
|
||||
evt_toggle(enable, GUI_EVENT_ACTIONUPDATE, viewportmanager_redraw);
|
||||
evt_toggle(enable, PLAYBACK_EVENT_TRACK_CHANGE, do_sbs_update_callback);
|
||||
evt_toggle(enable, PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, do_sbs_update_callback);
|
||||
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
|
||||
|
|
@ -112,14 +113,14 @@ static void toggle_theme(enum screen_type screen, bool force)
|
|||
if (!sb_get_persistent_title(i))
|
||||
sb_set_title_text(NULL, Icon_NOICON, i);
|
||||
}
|
||||
skinlist_set_cfg(screen, NULL);
|
||||
toggle_events(enable_event);
|
||||
|
||||
if (is_theme_enabled(screen))
|
||||
{
|
||||
last_vp = screens[screen].set_viewport(NULL);
|
||||
bool first_boot = theme_stack_top[screen] == 0;
|
||||
/* Remove the left overs from the previous screen */
|
||||
/* remove the left overs from the previous screen.
|
||||
* could cause a tiny flicker. Redo your screen code if that happens */
|
||||
#ifdef HAVE_BACKDROP_IMAGE
|
||||
skin_backdrop_show(sb_get_backdrop(screen));
|
||||
#endif
|
||||
|
|
@ -153,7 +154,9 @@ static void toggle_theme(enum screen_type screen, bool force)
|
|||
}
|
||||
intptr_t force = first_boot?0:1;
|
||||
|
||||
send_event(GUI_EVENT_ACTIONREDRAW, (void*)force);
|
||||
skin_defer_rendering(true);
|
||||
send_event(GUI_EVENT_ACTIONUPDATE, (void*)force);
|
||||
skin_defer_rendering(false);
|
||||
if (!first_boot)
|
||||
sb_skin_force_next_update();
|
||||
}
|
||||
|
|
@ -163,7 +166,7 @@ static void toggle_theme(enum screen_type screen, bool force)
|
|||
screens[screen].backdrop_show(NULL);
|
||||
#endif
|
||||
screens[screen].scroll_stop();
|
||||
skin_is_dirty(screen); /* remove dirty flag */
|
||||
skinlist_set_cfg(screen, NULL);
|
||||
}
|
||||
/* let list initialize viewport in case viewport dimensions is changed. */
|
||||
send_event(GUI_EVENT_THEME_CHANGED, NULL);
|
||||
|
|
@ -216,16 +219,10 @@ static void viewportmanager_redraw(unsigned short id, void* data)
|
|||
{
|
||||
(void)id;
|
||||
FOR_NB_SCREENS(i)
|
||||
{
|
||||
if (is_theme_enabled(i))
|
||||
sb_skin_update(i, NULL != data);
|
||||
}
|
||||
|
||||
static void viewportmanager_update(unsigned short id, void* data)
|
||||
{
|
||||
viewportmanager_redraw(id, data);
|
||||
FOR_NB_SCREENS(i)
|
||||
if (skin_is_dirty(i))
|
||||
screens[i].update();
|
||||
}
|
||||
}
|
||||
|
||||
void viewportmanager_init(void)
|
||||
|
|
@ -236,7 +233,6 @@ void viewportmanager_init(void)
|
|||
/* We always want the theme enabled by default... */
|
||||
viewportmanager_theme_enable(i, true, NULL);
|
||||
}
|
||||
add_event(GUI_EVENT_ACTIONUPDATE, viewportmanager_update);
|
||||
}
|
||||
|
||||
void viewportmanager_theme_changed(const int which)
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2008 by Jonathan Gordon
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2002 Jerome Kuptz
|
||||
*
|
||||
|
|
@ -532,7 +533,11 @@ static void gwps_leave_wps(bool theme_enabled)
|
|||
viewports drawn by the WPS. May need further thought... */
|
||||
struct wps_data *sbs = skin_get_gwps(CUSTOM_STATUSBAR, i)->data;
|
||||
if (gwps->data->use_extra_framebuffer && sbs->use_extra_framebuffer)
|
||||
{
|
||||
skin_defer_rendering(true);
|
||||
skin_update(CUSTOM_STATUSBAR, i, SKIN_REFRESH_ALL);
|
||||
skin_defer_rendering(false);
|
||||
}
|
||||
#endif
|
||||
viewportmanager_theme_undo(i, skin_has_sbs(gwps));
|
||||
}
|
||||
|
|
@ -594,7 +599,11 @@ static void gwps_enter_wps(bool theme_enabled)
|
|||
skin_backdrop_show(gwps->data->backdrop_id);
|
||||
#endif
|
||||
display->clear_display();
|
||||
if (skin_has_sbs(gwps))
|
||||
skin_defer_rendering(true);
|
||||
skin_update(WPS, i, SKIN_REFRESH_ALL);
|
||||
skin_defer_rendering(false);
|
||||
|
||||
}
|
||||
#ifdef HAVE_TOUCHSCREEN
|
||||
gwps = skin_get_gwps(WPS, SCREEN_MAIN);
|
||||
|
|
@ -602,7 +611,7 @@ static void gwps_enter_wps(bool theme_enabled)
|
|||
if (gwps->data->touchregions < 0)
|
||||
touchscreen_set_mode(TOUCHSCREEN_BUTTON);
|
||||
#endif
|
||||
/* Screen was cleared, so redraw SBS if enabled, and update screen */
|
||||
/* force statusbar/skin update since we just cleared the whole screen */
|
||||
send_event(GUI_EVENT_ACTIONUPDATE, (void*)1);
|
||||
}
|
||||
|
||||
|
|
@ -797,10 +806,9 @@ long gui_wps_show(void)
|
|||
case ACTION_WPS_HOTKEY:
|
||||
{
|
||||
hotkey = true;
|
||||
int act = HK_CTX_GET(0, global_settings.context_wps);
|
||||
if (act == HOTKEY_OFF)
|
||||
if (!global_settings.hotkey_wps)
|
||||
break;
|
||||
if (get_hotkey(act)->flags & HOTKEY_FLAG_NOSBS)
|
||||
if (get_hotkey(global_settings.hotkey_wps)->flags & HOTKEY_FLAG_NOSBS)
|
||||
{
|
||||
/* leave WPS without re-enabling theme */
|
||||
theme_enabled = false;
|
||||
|
|
@ -836,7 +844,7 @@ long gui_wps_show(void)
|
|||
{
|
||||
restore_theme();
|
||||
theme_enabled = false;
|
||||
open_plugin_run(ID2P(LANG_ONPLAY_MENU_TITLE));
|
||||
open_plugin_run(ID2P(LANG_OPEN_PLUGIN_SET_WPS_CONTEXT_PLUGIN));
|
||||
}
|
||||
|
||||
restore = true;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2002 Björn Stenberg
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2005 by Kevin Ferrare
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2005 by Kevin Ferrare
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2010 Jonathan Gordon
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2010 Thomas Martitz
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2010 Thomas Martitz
|
||||
*
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue