Compare commits

..

No commits in common. "7ab521cba681f16fdf6112929e4b3c6ed3185ad0" and "8ac866a749f262cf79d81e228960e8273705ad43" have entirely different histories.

331 changed files with 1293 additions and 12694 deletions

View file

@ -28,7 +28,6 @@
#if !defined(BOOTLOADER)
#include "language.h"
#include "skin_engine/skin_engine.h"
#endif
#include "appevents.h"
@ -938,20 +937,19 @@ static inline void do_softlock(action_last_t *last, action_cur_t *cur)
if (notify_user)
{
#ifndef BOOTLOADER
skin_request_update_locked(last->keys_locked);
#endif
action_handle_backlight(true, false);
#ifdef HAVE_BACKLIGHT
/* If we don't wait for a moment for the backlight queue to process,
* the user will never see the message
*/
if (!is_backlight_on(false))
{
sleep(HZ/2);
}
#endif
if (!has_flag(last->softlock_mask, SEL_ACTION_ALLNONOTIFY))
{
#ifdef HAVE_BACKLIGHT
/* If we don't wait for a moment for the backlight queue to process,
* the user will never see the message
*/
if (!is_backlight_on(false))
sleep(HZ/2);
#endif
if (last->keys_locked)
{
splash(HZ/2, ID2P(LANG_KEYLOCK_ON));
@ -1442,9 +1440,6 @@ bool is_keys_locked(void)
void set_selective_softlock_actions(bool selective, unsigned int mask)
{
action_last.keys_locked = false;
#if defined(HAVE_TOUCHPAD) || defined(HAVE_TOUCHSCREEN)
button_enable_touch(true);
#endif
if (selective)
{
action_last.softlock_mask = mask | SEL_ACTION_ENABLED;

View file

@ -50,11 +50,3 @@ $(BUILDDIR)/apps/bitmaps/remote_mono/%.c: $(ROOTDIR)/apps/bitmaps/remote_mono/%.
$(BUILDDIR)/apps/bitmaps/remote_native/%.c: $(ROOTDIR)/apps/bitmaps/remote_native/%.bmp $(TOOLSDIR)/bmp2rb
$(SILENT)mkdir -p $(dir $@) $(BMPINCDIR)
$(call PRINTS,BMP2RB $(<F))$(BMP2RB_REMOTENATIVE) -b -h $(BMPINCDIR) $< > $@
ifdef APP_TYPE
# Bitmaps must be explicitly Position independent to avoid linker warnings
$(BUILDDIR)/apps/bitmaps/native/%.o: CFLAGS += -fPIC
$(BUILDDIR)/apps/bitmaps/mono/%.o: CFLAGS += -fPIC
$(BUILDDIR)/apps/bitmaps/remote_mono/%.o: CFLAGS += -fPIC
$(BUILDDIR)/apps/bitmaps/remote_native/%.o: CFLAGS += -fPIC
endif

View file

@ -43,7 +43,6 @@
#include "file.h"
#include "pathfuncs.h"
#include "playlist_menu.h"
#include "iap-usb.h"
/*#define LOGF_ENABLE*/
#include "logf.h"
@ -1126,9 +1125,7 @@ static bool play_bookmark(const char* bookmark)
if (parse_bookmark(fnamebuf, sizeof(fnamebuf), bookmark, &resume_info, true))
{
global_settings.repeat_mode = resume_info.repeat_mode;
iap_on_repeat_state(global_settings.repeat_mode);
global_settings.playlist_shuffle = resume_info.shuffle;
iap_on_shuffle_state(global_settings.playlist_shuffle);
#if defined(HAVE_PITCHCONTROL)
sound_set_pitch(resume_info.pitch);
dsp_set_timestretch(resume_info.speed);

View file

@ -50,7 +50,6 @@
#include "splash.h"
#include "general.h"
#include "rbpaths.h"
#include "panic.h"
#define LOGF_ENABLE
#include "logf.h"
@ -151,7 +150,6 @@ struct codec_api ci = {
/* new stuff at the end, sort into place next time
the API gets incompatible */
panicf,
};

View file

@ -46,8 +46,7 @@ static bool search_for_cuesheet(const char *path, struct cuesheet_file *cue_file
{
size_t len;
char cuepath[MAX_PATH];
char *dot, *slash_cuepath;
const char *slash;
char *dot, *slash, *slash_cuepath;
cue_file->pos = 0;
cue_file->size = 0;
@ -282,7 +281,7 @@ bool parse_cuesheet(struct cuesheet_file *cue_file, struct cuesheet *cue)
}
s = skip_whitespace(line);
/* RECOGNIZED TAGS ***********************
/* RECOGNIZED TAGS ***********************
* eCS_TRACK = 0, eCS_INDEX_01, eCS_TITLE,
* eCS_PERFORMER, eCS_SONGWRITER, eCS_FILE,
*/
@ -307,7 +306,7 @@ bool parse_cuesheet(struct cuesheet_file *cue_file, struct cuesheet *cue)
cue->tracks[cue->track_count-1].offset = parse_cue_index(s);
#endif
}
else if (option != eCS_NOTFOUND)
else if (option != eCS_NOTFOUND)
{
char *dest = NULL;
char *string = get_string(s);

View file

@ -316,7 +316,3 @@ lto
#if defined(USB_ENABLE_AUDIO)
usbdac
#endif
#if defined(UTF8PROC_EXPORTS)
utf8proc
#endif

View file

@ -525,7 +525,7 @@ static void read_config_init(int fd)
static int file_find_extension(const char* file)
{
const char *extension = strrchr(file, '.');
char *extension = strrchr(file, '.');
if (extension)
extension++;
return find_extension(extension);
@ -704,7 +704,7 @@ int filetype_load_plugin(const char* plugin, const char* file)
{
int i;
char plugin_name[MAX_PATH];
const char *s;
char *s;
for (i=1;i<filetype_count;i++)
{

View file

@ -163,7 +163,7 @@ void skinlist_get_scrollbar(int* nb_item, int* first_shown, int* last_shown)
{
*nb_item = current_item;
*first_shown = 0;
*last_shown = current_nbitems - 1;
*last_shown = current_nbitems;
}
}
@ -281,7 +281,8 @@ bool skinlist_draw(struct screen *display, struct gui_synclist *list)
}
current_column = -1;
current_row = -1;
skin_render_deferred(display, parent);
display->set_viewport(parent);
display->update_viewport();
current_drawing_line = list->selected_item;
return true;
}

View file

@ -446,7 +446,8 @@ void list_draw(struct screen *display, struct gui_synclist *list)
callback_draw_item(&list_info);
}
skin_render_deferred(display, parent);
display->set_viewport(parent);
display->update_viewport();
display->set_viewport(last_vp);
}

View file

@ -49,8 +49,6 @@
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;
@ -59,17 +57,17 @@ static bool list_is_dirty(struct gui_synclist *list)
return TIME_BEFORE(list->dirty_tick, last_dirty_tick);
}
static void list_force_reinit(unsigned short id, void *param)
static void list_force_reinit(unsigned short id, void *param, void *last_dirty_tick)
{
(void)id;
(void)param;
last_dirty_tick = current_tick;
*(int *)last_dirty_tick = current_tick;
}
void list_init(void)
{
last_dirty_tick = current_tick;
add_event(GUI_EVENT_THEME_CHANGED, list_force_reinit);
add_event_ex(GUI_EVENT_THEME_CHANGED, false, list_force_reinit, &last_dirty_tick);
}
static void list_init_viewports(struct gui_synclist *list)
@ -83,7 +81,7 @@ static void list_init_viewports(struct gui_synclist *list)
gui_synclist_set_viewport_defaults(list->parent[i], i);
}
}
list->dirty_tick = last_dirty_tick;
list->dirty_tick = current_tick;
}
static int list_nb_lines(struct gui_synclist *list, enum screen_type screen)
@ -187,6 +185,7 @@ void gui_synclist_init(struct gui_synclist * gui_list,
gui_list->title_icon = Icon_NOICON;
gui_list->scheduled_talk_tick = gui_list->last_talked_tick = 0;
gui_list->dirty_tick = current_tick;
#ifdef HAVE_LCD_COLOR
gui_list->title_color = -1;
@ -221,32 +220,11 @@ 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);
@ -461,7 +439,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);
sb_title_is_dirty = true;
send_event(GUI_EVENT_ACTIONUPDATE, (void*)1);
}
void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items)

View file

@ -50,25 +50,33 @@
#define MARGIN 10
#define CENTER_ICONAREA_SIZE (MARGIN+8*2)
struct quickscreen
struct gui_quickscreen
{
const struct settings_list *items[QUICKSCREEN_ITEM_COUNT];
struct viewport parent[NB_SCREENS];
struct viewport vps[NB_SCREENS][QUICKSCREEN_ITEM_COUNT];
struct viewport vp_icons[NB_SCREENS];
int button_enter;
enum quickscreen_return result;
};
static void quickscreen_fix_viewports(struct quickscreen *qs, enum screen_type screen)
static bool redraw;
static void quickscreen_update_callback(unsigned short id,
void *data, void *userdata)
{
(void)id;
(void)data;
(void)userdata;
redraw = true;
}
static void quickscreen_fix_viewports(struct gui_quickscreen *qs,
struct screen *display,
struct viewport *parent,
struct viewport
vps[QUICKSCREEN_ITEM_COUNT],
struct viewport *vp_icons)
{
int char_height, width, pad = 0;
int left_width = 0, right_width = 0, vert_lines;
unsigned char *s;
struct screen *display = &screens[screen];
struct viewport *parent = &qs->parent[screen];
struct viewport *vps = qs->vps[screen];
struct viewport *vp_icons = &qs->vp_icons[screen];
int nb_lines = viewport_get_nb_lines(parent);
/* nb_lines only returns the number of fully visible lines, small screens
@ -173,15 +181,16 @@ static void quickscreen_fix_viewports(struct quickscreen *qs, enum screen_type s
vps[QUICKSCREEN_RIGHT].flags |= VP_FLAG_ALIGN_RIGHT;
}
static void quickscreen_draw(struct quickscreen *qs, enum screen_type screen)
static void gui_quickscreen_draw(const struct gui_quickscreen *qs,
struct screen *display,
struct viewport *parent,
struct viewport vps[QUICKSCREEN_ITEM_COUNT],
struct viewport *vp_icons)
{
int temp, i;
int i;
char buf[MAX_PATH];
unsigned const char *title, *value;
struct screen *display = &screens[screen];
struct viewport *parent = &qs->parent[screen];
struct viewport *vps = qs->vps[screen];
struct viewport *vp_icons = &qs->vp_icons[screen];
int temp;
struct viewport *last_vp = display->set_viewport(parent);
display->clear_viewport();
@ -195,12 +204,12 @@ static void quickscreen_draw(struct quickscreen *qs, enum screen_type screen)
title = P2STR(ID2P(qs->items[i]->lang_id));
temp = option_value_as_int(qs->items[i]);
value = option_get_valuestring(qs->items[i],
buf, sizeof buf, temp);
buf, MAX_PATH, temp);
if (viewport_get_nb_lines(vp) < 2)
{
char text[MAX_PATH];
snprintf(text, sizeof text, "%s: %s", title, value);
snprintf(text, MAX_PATH, "%s: %s", title, value);
display->puts_scroll(0, 0, text);
}
else
@ -233,19 +242,11 @@ static void quickscreen_draw(struct quickscreen *qs, enum screen_type screen)
(vp_icons->width/2) - 4, vp_icons->height - 8, 7, 8);
}
skin_render_deferred(display, parent);
display->set_viewport(parent);
display->update_viewport();
display->set_viewport(last_vp);
}
static void quickscreen_draw_cb(unsigned short id, void *data, void *userdata)
{
(void)id;
(void)data;
FOR_NB_SCREENS(i)
quickscreen_draw((struct quickscreen *) userdata, i);
}
static void talk_qs_option(const struct settings_list *opt, bool enqueue)
{
if (!global_settings.talk_menu || !opt)
@ -262,7 +263,7 @@ static void talk_qs_option(const struct settings_list *opt, bool enqueue)
* - button : the key we are going to analyse
* returns : true if the button corresponded to an action, false otherwise
*/
static bool quickscreen_do_button(struct quickscreen * qs, int button)
static bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button)
{
int item;
bool previous = false;
@ -342,27 +343,13 @@ static int quickscreen_touchscreen_button(void)
}
#endif
static void cleanup(void *parameter)
{
struct quickscreen *qs = (struct quickscreen *) parameter;
remove_event_ex(GUI_EVENT_NEED_UI_UPDATE, quickscreen_draw_cb, qs);
FOR_NB_SCREENS(i)
{
for (int j = 0; j < QUICKSCREEN_ITEM_COUNT; j++)
screens[i].scroll_stop_viewport(&qs->vps[i][j]);
viewportmanager_theme_undo(i, !(qs->result & QUICKSCREEN_GOTO_SHORTCUTS_MENU));
}
/* Eliminate flashing of parent during transition to Shortcuts */
if (qs->result & QUICKSCREEN_GOTO_SHORTCUTS_MENU)
pop_current_activity_without_refresh();
else
pop_current_activity();
}
static void quickscreen_run(struct quickscreen * qs)
static int gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter, bool *usb)
{
int button;
struct viewport parent[NB_SCREENS];
struct viewport vps[NB_SCREENS][QUICKSCREEN_ITEM_COUNT];
struct viewport vp_icons[NB_SCREENS];
int ret = QUICKSCREEN_OK;
/* To quit we need either :
* - a second press on the button that made us enter
* - an action taken while pressing the enter button,
@ -371,14 +358,17 @@ static void quickscreen_run(struct quickscreen * qs)
push_current_activity(ACTIVITY_QUICKSCREEN);
add_event_ex(GUI_EVENT_NEED_UI_UPDATE, false, quickscreen_update_callback, NULL);
FOR_NB_SCREENS(i)
{
screens[i].set_viewport(NULL);
screens[i].scroll_stop();
viewportmanager_theme_enable(i, true, &qs->parent[i]);
quickscreen_fix_viewports(qs, i);
quickscreen_draw(qs, i);
viewportmanager_theme_enable(i, true, &parent[i]);
quickscreen_fix_viewports(qs, &screens[i], &parent[i], vps[i], &vp_icons[i]);
gui_quickscreen_draw(qs, &screens[i], &parent[i], vps[i], &vp_icons[i]);
}
*usb = false;
/* Announce current selection on entering this screen. This is all
queued up, but can be interrupted as soon as a setting is
changed. */
@ -393,28 +383,31 @@ static void quickscreen_run(struct quickscreen * qs)
#ifdef HAVE_TOUCHSCREEN
action_gesture_reset();
#endif
add_event_ex(GUI_EVENT_NEED_UI_UPDATE, false, quickscreen_draw_cb, qs);
while (true)
{
while (true) {
if (redraw)
{
redraw = false;
FOR_NB_SCREENS(i)
gui_quickscreen_draw(qs, &screens[i], &parent[i],
vps[i], &vp_icons[i]);
}
button = get_action(CONTEXT_QUICKSCREEN, HZ/5);
#ifdef HAVE_TOUCHSCREEN
if (button == ACTION_TOUCHSCREEN)
button = quickscreen_touchscreen_button();
#endif
if (default_event_handler_ex(button, cleanup, qs)
== SYS_USB_CONNECTED)
if (default_event_handler(button) == SYS_USB_CONNECTED)
{
qs->result |= QUICKSCREEN_IN_USB;
return;
*usb = true;
break;
}
if (quickscreen_do_button(qs, button))
if (gui_quickscreen_do_button(qs, button))
{
qs->result |= QUICKSCREEN_CHANGED;
ret |= QUICKSCREEN_CHANGED;
can_quit = true;
FOR_NB_SCREENS(i)
quickscreen_draw(qs, i);
redraw = true;
}
else if (button == qs->button_enter)
else if (button == button_enter)
can_quit = true;
else if (button == ACTION_QS_VOLUP) {
adjust_volume(1);
@ -428,10 +421,10 @@ static void quickscreen_run(struct quickscreen * qs)
}
else if (button == ACTION_STD_CONTEXT)
{
qs->result |= QUICKSCREEN_GOTO_SHORTCUTS_MENU;
ret |= QUICKSCREEN_GOTO_SHORTCUTS_MENU;
break;
}
if ((button == qs->button_enter) && can_quit)
if ((button == button_enter) && can_quit)
break;
if (button == ACTION_STD_CANCEL)
@ -439,14 +432,27 @@ static void quickscreen_run(struct quickscreen * qs)
}
/* Notify that we're exiting this screen */
cond_talk_ids_fq(VOICE_OK);
cleanup(qs);
FOR_NB_SCREENS(i)
{ /* stop scrolling before exiting */
for (int j = 0; j < QUICKSCREEN_ITEM_COUNT; j++)
screens[i].scroll_stop_viewport(&vps[i][j]);
viewportmanager_theme_undo(i, !(ret & QUICKSCREEN_GOTO_SHORTCUTS_MENU));
}
if (ret & QUICKSCREEN_GOTO_SHORTCUTS_MENU) /* Eliminate flashing of parent during */
pop_current_activity_without_refresh(); /* transition to Shortcuts */
else
pop_current_activity();
remove_event_ex(GUI_EVENT_NEED_UI_UPDATE, quickscreen_update_callback, NULL);
return ret;
}
int quick_screen_quick(int button_enter)
{
struct quickscreen qs;
qs.button_enter = button_enter;
qs.result = QUICKSCREEN_OK;
struct gui_quickscreen qs;
bool usb = false;
for (int i = 0; i < 4; ++i)
{
@ -456,12 +462,13 @@ int quick_screen_quick(int button_enter)
qs.items[i] = NULL;
}
quickscreen_run(&qs);
if (qs.result & QUICKSCREEN_CHANGED)
int ret = gui_syncquickscreen_run(&qs, button_enter, &usb);
if (ret & QUICKSCREEN_CHANGED)
settings_save();
return qs.result & ~QUICKSCREEN_CHANGED;
if (usb)
return QUICKSCREEN_IN_USB;
return ret & QUICKSCREEN_GOTO_SHORTCUTS_MENU ? QUICKSCREEN_GOTO_SHORTCUTS_MENU :
QUICKSCREEN_OK;
}
/* stuff to make the quickscreen configurable */

View file

@ -180,7 +180,7 @@ void settings_apply_skins(void)
audio_stop();
bool first_run = skin_backdrop_init();
if (!first_run)
{
/* Make sure all skins unloaded */
@ -342,23 +342,6 @@ void skin_request_full_update(enum skinnable_screens skin)
skins[skin][i].needs_full_update = true;
}
/* Request skin update for lock state change */
void skin_request_update_locked(bool locked)
{
if (get_current_activity() == ACTIVITY_WPS)
return;
sb_skin_force_next_update();
/* fix themes that draw on top of the UI viewport when locked */
if (!locked)
skin_request_full_update(CUSTOM_STATUSBAR);
#ifdef HAS_BUTTON_HOLD
button_queue_post(BUTTON_NONE, 0);
#endif
}
bool dbg_skin_engine(void)
{
struct simplelist_info info;

View file

@ -51,11 +51,6 @@ void skin_disarm_touchregions(struct gui_wps *gwps);
void skin_update(enum skinnable_screens skin, enum screen_type screen,
unsigned int update_type);
/* 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);
@ -87,7 +82,6 @@ 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);
bool dbg_skin_engine(void);

View file

@ -2676,7 +2676,7 @@ bool skin_data_load(enum screen_type screen, struct wps_data *wps_data,
if (isfile)
{
/* get the bitmap dir */
const char *dot = strrchr(buf, '.');
char *dot = strrchr(buf, '.');
strmemccpy(bmpdir, buf, dot - buf + 1);
}
else

View file

@ -84,8 +84,6 @@ 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)
@ -297,7 +295,7 @@ static bool do_non_text_tags(struct gui_wps *gwps, struct skin_draw_info *info,
{
struct skin_albumart *aa = SKINOFFSETTOPTR(skin_buffer, data->albumart);
if (aa)
{
{
int handle = playback_current_aa_hid(data->playback_aa_slot);
#if CONFIG_TUNER
if (in_radio_screen() || (get_radio_status() != FMRADIO_OFF))
@ -843,29 +841,6 @@ 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);
@ -957,19 +932,15 @@ 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();
display->update();
}
static __attribute__((noinline))

View file

@ -34,7 +34,6 @@
#include "playlist.h"
#include "dsp_misc.h"
#include "playback.h"
#include "iap-usb.h"
/** Disarms all touchregions. */
void skin_disarm_touchregions(struct gui_wps *gwps)
@ -345,7 +344,6 @@ int skin_get_touchaction(struct gui_wps *gwps, int* edge_offset)
case ACTION_TOUCH_SHUFFLE:
global_settings.playlist_shuffle = !global_settings.playlist_shuffle;
iap_on_shuffle_state(global_settings.playlist_shuffle);
replaygain_update();
if (global_settings.playlist_shuffle)
playlist_randomise(NULL, current_tick, true);
@ -360,7 +358,6 @@ int skin_get_touchaction(struct gui_wps *gwps, int* edge_offset)
const struct settings_list *rep_setting =
find_setting(&global_settings.repeat_mode);
option_select_next_val(rep_setting, false, true);
iap_on_repeat_state(global_settings.repeat_mode);
audio_flush_and_reload_tracks();
action = ACTION_REDRAW;
} break;

View file

@ -182,18 +182,17 @@ int sb_get_backdrop(enum screen_type screen)
return -1;
}
#endif
static bool force_waiting[NB_SCREENS];
static bool force_waiting = false;
void sb_skin_update(enum screen_type screen, bool force)
{
struct wps_data *data = skin_get_gwps(CUSTOM_STATUSBAR, screen)->data;
static long next_update[NB_SCREENS];
static long next_update[NB_SCREENS] = {0};
int i = screen;
if (!data->wps_loaded)
return;
if (TIME_AFTER(current_tick, next_update[i]) || force ||
force_waiting[i])
if (TIME_AFTER(current_tick, next_update[i]) || force || force_waiting)
{
force_waiting[i] = false;
force_waiting = false;
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
/* currently, all remotes are readable without backlight
* so still update those */
@ -215,8 +214,7 @@ void do_sbs_update_callback(unsigned short id, void *param)
/* the WPS handles changing the actual id3 data in the id3 pointers
* we imported, we just want a full update */
skin_request_full_update(CUSTOM_STATUSBAR);
FOR_NB_SCREENS(i)
force_waiting[i] = true;
force_waiting = true;
/* force timeout in wps main loop, so that the update is instantly */
button_queue_post(BUTTON_NONE, 0);
}
@ -226,12 +224,6 @@ void sb_skin_set_update_delay(int delay)
update_delay = delay;
}
void sb_skin_force_next_update(void)
{
FOR_NB_SCREENS(i)
force_waiting[i] = true;
}
/* This creates and loads a ".sbs" based on the user settings for:
* - regular statusbar
* - colours

View file

@ -38,7 +38,6 @@ struct viewport *sb_skin_get_info_vp(enum screen_type screen);
void sb_skin_update(enum screen_type screen, bool force);
void sb_skin_set_update_delay(int delay);
void sb_skin_force_next_update(void);
bool sb_set_title_text(const char* title, enum themable_icons icon, enum screen_type screen);
bool sb_set_persistent_title(const char* title, enum themable_icons icon,
enum screen_type screen);

View file

@ -331,6 +331,7 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw, struct vi
}
#endif
display->setfont(FONT_UI);
display->update_viewport();
display->set_viewport(last_vp);
bar->lastinfo = bar->info;
}

View file

@ -91,12 +91,13 @@ static void toggle_events(bool enable)
#endif
}
static void set_clear_valid_vp(enum screen_type screen, struct viewport *vp)
static void set_clear_update_valid_vp(enum screen_type screen, struct viewport *vp)
{
if (vp->width && vp->height)
{
screens[screen].set_viewport(vp);
screens[screen].clear_viewport();
screens[screen].update_viewport();
}
}
@ -134,31 +135,27 @@ static void toggle_theme(enum screen_type screen, bool force)
deadspace.y = 0;
deadspace.width = screens[screen].lcdwidth;
deadspace.height = user.y;
set_clear_valid_vp(screen, &deadspace);
set_clear_update_valid_vp(screen, &deadspace);
/* below */
deadspace.y = user.y + user.height;
deadspace.height = screens[screen].lcdheight - deadspace.y;
set_clear_valid_vp(screen, &deadspace);
set_clear_update_valid_vp(screen, &deadspace);
/* left */
deadspace.x = 0;
deadspace.y = 0;
deadspace.width = user.x;
deadspace.height = screens[screen].lcdheight;
set_clear_valid_vp(screen, &deadspace);
set_clear_update_valid_vp(screen, &deadspace);
/* below */
deadspace.x = user.x + user.width;
deadspace.width = screens[screen].lcdwidth - deadspace.x;
set_clear_valid_vp(screen, &deadspace);
set_clear_update_valid_vp(screen, &deadspace);
screens[screen].set_viewport(last_vp);
}
intptr_t force = first_boot?0:1;
skin_defer_rendering(true);
send_event(GUI_EVENT_ACTIONUPDATE, (void*)force);
skin_defer_rendering(false);
if (!first_boot)
sb_skin_force_next_update();
}
else
{

View file

@ -533,11 +533,7 @@ 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));
}
@ -599,10 +595,7 @@ 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

View file

@ -129,10 +129,6 @@ static const struct button_mapping button_context_quickscreen[] = {
{ ACTION_QS_LEFT, BUTTON_SCROLL_BACK, BUTTON_NONE },
{ ACTION_QS_DOWN, BUTTON_NEXT|BUTTON_REL, BUTTON_NONE },
{ ACTION_QS_DOWN, BUTTON_NEXT|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_QS_VOLUP, BUTTON_VOL_UP, BUTTON_NONE },
{ ACTION_QS_VOLUP, BUTTON_VOL_UP|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_QS_VOLDOWN, BUTTON_VOL_DOWN, BUTTON_NONE },
{ ACTION_QS_VOLDOWN, BUTTON_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE },
{ ACTION_STD_CANCEL, BUTTON_BACK, BUTTON_NONE },
{ ACTION_STD_CONTEXT,BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },

View file

@ -14676,7 +14676,7 @@
user: core
<source>
*: "Press LEFT to cancel."
android,hifietma*: "Press BACK to cancel."
android,hifietma*,zenvision: "Press BACK to cancel."
cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
ihifi760,ihifi960: "Double tap RETURN to cancel."
ihifi770,ihifi770c,ihifi800: "Press HOME to cancel."
@ -14691,7 +14691,7 @@
</source>
<dest>
*: "请按LEFT键取消。"
android,hifietma*: "请按BACK键取消。"
android,hifietma*,zenvision: "请按BACK键取消。"
cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "请按POWER键取消。"
ihifi760,ihifi960: "双击RETURN键取消。"
ihifi770,ihifi770c,ihifi800: "请按HOME键取消。"
@ -14707,7 +14707,7 @@
</dest>
<voice>
*: "请按LEFT键取消"
android,hifietma*: "请按BACK键取消"
android,hifietma*,zenvision: "请按BACK键取消"
cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "请按POWER键取消"
ihifi760,ihifi960: "双击RETURN键取消"
ihifi770,ihifi770c,ihifi800: "请按HOME键取消"
@ -15202,7 +15202,7 @@
</phrase>
<phrase>
id: LANG_VOICED_DATE_FORMAT
desc: format string for how dates will be read back. Y == 4-digit year (grouped), y == 4-digit year (numeric), A == month name, m == numeric month, d == numeric day. For example, for 2021-01-05, "AdY" will be voiced as "January 5 twenty twenty-one" and "dmy" will be voiced as "5 1 two thousand twenty one
desc: format string for how dates will be read back. Y == 4-digit year, A == month name, m == numeric month, d == numeric day. For example, "AdY" will read "January 21 2021"
user: core
<source>
*: "dAY"
@ -15811,16 +15811,16 @@
</phrase>
<phrase>
id: LANG_DEFAULT_BROWSER
desc: deprecated
desc: in Settings
user: core
<source>
*: ""
*: "Default Browser"
</source>
<dest>
*: ""
*: "默认浏览器"
</dest>
<voice>
*: ""
*: "默认浏览器"
</voice>
</phrase>
<phrase>
@ -16967,143 +16967,3 @@
*: "~U S B"
</voice>
</phrase>
<phrase>
id: LANG_ANNOUNCE_STATUS
desc: announnnce_status plugin
user: core
<source>
*: "Announce Status"
</source>
<dest>
*: "播报状态"
</dest>
<voice>
*: "播报状态"
</voice>
</phrase>
<phrase>
id: LANG_KEEP_DIRECTORY
desc: file browser setting
user: core
<source>
*: "Always remember last folder"
</source>
<dest>
*: "总是记住上次的文件夹"
</dest>
<voice>
*: "总是记住上次的文件夹"
</voice>
</phrase>
<phrase>
id: LANG_FILE_NOT_FOUND
desc: When file does not exist
user: core
<source>
*: "File not found"
</source>
<dest>
*: "找不到文件"
</dest>
<voice>
*: "找不到文件"
</voice>
</phrase>
<phrase>
id: LANG_SHOW_IN_FILES
desc: Reveal item in File Browser
user: core
<source>
*: "Show in Files"
</source>
<dest>
*: "按文件展示"
</dest>
<voice>
*: "按文件展示"
</voice>
</phrase>
<phrase>
id: LANG_CHANNEL_SWAP
desc: in sound_settings
user: core
<source>
*: "Swap Left & Right"
</source>
<dest>
*: "切换左&右"
</dest>
<voice>
*: "切换左右"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_SET
desc: countdown_timer plugin - header shown on the setup screen where the user enters the countdown duration
user: core
<source>
*: "SET TIMER"
</source>
<dest>
*: "设定计时器"
</dest>
<voice>
*: "设定计时器"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_RUNNING
desc: countdown_timer plugin - status label shown while the countdown is active
user: core
<source>
*: "RUNNING"
</source>
<dest>
*: "运行中"
</dest>
<voice>
*: "运行中"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_PAUSED
desc: countdown_timer plugin - status label shown while the countdown is paused
user: core
<source>
*: "PAUSED"
</source>
<dest>
*: "暂停"
</dest>
<voice>
*: "暂停"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_OVERTIME
desc: countdown_timer plugin - status label shown when the countdown has passed zero and is counting up
user: core
<source>
*: "OVERTIME"
</source>
<dest>
*: "超时"
</dest>
<voice>
*: "超时"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_FINISHED
desc: countdown_timer plugin - status label shown at the moment the countdown expires
user: core
<source>
*: "FINISHED"
</source>
<dest>
*: "完成"
</dest>
<voice>
*: "完成"
</voice>
</phrase>

View file

@ -15822,16 +15822,16 @@
</phrase>
<phrase>
id: LANG_DEFAULT_BROWSER
desc: deprecated
desc: in Settings
user: core
<source>
*: ""
*: "Default Browser"
</source>
<dest>
*: ""
*: "Standardbrowser"
</dest>
<voice>
*: ""
*: "Standardbrowser"
</voice>
</phrase>
<phrase>
@ -17006,115 +17006,3 @@
*: "~U S B"
</voice>
</phrase>
<phrase>
id: LANG_FILE_NOT_FOUND
desc: When file does not exist
user: core
<source>
*: "File not found"
</source>
<dest>
*: "Datei nicht gefunden"
</dest>
<voice>
*: "Datei nicht gefunden"
</voice>
</phrase>
<phrase>
id: LANG_SHOW_IN_FILES
desc: Reveal item in File Browser
user: core
<source>
*: "Show in Files"
</source>
<dest>
*: "Zeige in Dateien"
</dest>
<voice>
*: "Zeige in Dateien"
</voice>
</phrase>
<phrase>
id: LANG_CHANNEL_SWAP
desc: in sound_settings
user: core
<source>
*: "Swap Left & Right"
</source>
<dest>
*: "Rechts & Links tauschen"
</dest>
<voice>
*: "Rechts und Links tauschen"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_SET
desc: countdown_timer plugin - header shown on the setup screen where the user enters the countdown duration
user: core
<source>
*: "SET TIMER"
</source>
<dest>
*: "Timer stellen"
</dest>
<voice>
*: "Timer stellen"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_RUNNING
desc: countdown_timer plugin - status label shown while the countdown is active
user: core
<source>
*: "RUNNING"
</source>
<dest>
*: "LÄUFT"
</dest>
<voice>
*: "Läuft"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_PAUSED
desc: countdown_timer plugin - status label shown while the countdown is paused
user: core
<source>
*: "PAUSED"
</source>
<dest>
*: "ANGEHALTEN"
</dest>
<voice>
*: "Angehalten"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_OVERTIME
desc: countdown_timer plugin - status label shown when the countdown has passed zero and is counting up
user: core
<source>
*: "OVERTIME"
</source>
<dest>
*: "ÜBERZEIT"
</dest>
<voice>
*: "Überzeit"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_FINISHED
desc: countdown_timer plugin - status label shown at the moment the countdown expires
user: core
<source>
*: "FINISHED"
</source>
<dest>
*: "BEENDET"
</dest>
<voice>
*: "Beendet"
</voice>
</phrase>

View file

@ -78,7 +78,7 @@
# tools/voice-corrections.txt for further details.
#
# To validate the contents of a translation, you can use the Rockbox
# translation site at https://www.rockbox.org/translate/ Alternatively, you
# translation site at https://translate.rockbox.org. Alternatively, you
# can use the command-line 'updatelang' tool as follows:
#
# tools/updatelang apps/lang/english.lang path/to/translation.lang path/to/updated.lang

View file

@ -15804,16 +15804,16 @@
</phrase>
<phrase>
id: LANG_DEFAULT_BROWSER
desc: deprecated
desc: in Settings
user: core
<source>
*: ""
*: "Default Browser"
</source>
<dest>
*: ""
*: "Browser Predefinito"
</dest>
<voice>
*: ""
*: "Browser Predefinito"
</voice>
</phrase>
<phrase>
@ -16988,115 +16988,3 @@
*: "~U S B"
</voice>
</phrase>
<phrase>
id: LANG_FILE_NOT_FOUND
desc: When file does not exist
user: core
<source>
*: "File not found"
</source>
<dest>
*: "File non trovato"
</dest>
<voice>
*: "File non trovato"
</voice>
</phrase>
<phrase>
id: LANG_SHOW_IN_FILES
desc: Reveal item in File Browser
user: core
<source>
*: "Show in Files"
</source>
<dest>
*: "Mostra nei file"
</dest>
<voice>
*: "Mostra nei file"
</voice>
</phrase>
<phrase>
id: LANG_CHANNEL_SWAP
desc: in sound_settings
user: core
<source>
*: "Swap Left & Right"
</source>
<dest>
*: "Scambia sinistro & destro"
</dest>
<voice>
*: "Scambia sinistro e destro"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_SET
desc: countdown_timer plugin - header shown on the setup screen where the user enters the countdown duration
user: core
<source>
*: "SET TIMER"
</source>
<dest>
*: "IMPOSTA TIMER"
</dest>
<voice>
*: "Imposta timer"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_RUNNING
desc: countdown_timer plugin - status label shown while the countdown is active
user: core
<source>
*: "RUNNING"
</source>
<dest>
*: "IN CORSO"
</dest>
<voice>
*: "In corso"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_PAUSED
desc: countdown_timer plugin - status label shown while the countdown is paused
user: core
<source>
*: "PAUSED"
</source>
<dest>
*: "IN PAUSA"
</dest>
<voice>
*: "In pausa"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_OVERTIME
desc: countdown_timer plugin - status label shown when the countdown has passed zero and is counting up
user: core
<source>
*: "OVERTIME"
</source>
<dest>
*: "TEMPO SUPPLEMENTARE"
</dest>
<voice>
*: "Tempo supplementare"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_FINISHED
desc: countdown_timer plugin - status label shown at the moment the countdown expires
user: core
<source>
*: "FINISHED"
</source>
<dest>
*: "TERMINATO"
</dest>
<voice>
*: "Terminato"
</voice>
</phrase>

View file

@ -14781,7 +14781,7 @@
user: core
<source>
*: "Press LEFT to cancel."
android,hifietma*: "Press BACK to cancel."
android,hifietma*,zenvision: "Press BACK to cancel."
cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
ihifi760,ihifi960: "Double tap RETURN to cancel."
ihifi770,ihifi770c,ihifi800: "Press HOME to cancel."
@ -14796,7 +14796,7 @@
</source>
<dest>
*: "Nospiediet LEFT, lai atceltu."
android,hifietma*: "Nospiediet BACK, lai atceltu."
android,hifietma*,zenvision: "Nospiediet BACK, lai atceltu."
cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Nospiediet POWER, lai atceltu."
ihifi760,ihifi960: "Divreiz pieskarieties RETURN, lai atceltu."
ihifi770,ihifi770c,ihifi800: "Nospiediet HOME, lai atceltu."
@ -14811,7 +14811,7 @@
</dest>
<voice>
*: "Nospiediet LEFT, lai atceltu."
android,hifietma*: "Nospiediet BACK, lai atceltu."
android,hifietma*,zenvision: "Nospiediet BACK, lai atceltu."
cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Nospiediet POWER, lai atceltu."
ihifi760,ihifi960: "Divreiz pieskarieties RETURN, lai atceltu."
ihifi770,ihifi770c,ihifi800: "Nospiediet HOME, lai atceltu."
@ -15306,13 +15306,13 @@
</phrase>
<phrase>
id: LANG_VOICED_DATE_FORMAT
desc: format string for how dates will be read back. Y == 4-digit year (grouped), y == 4-digit year (numeric), A == month name, m == numeric month, d == numeric day. For example, for 2021-01-05, "AdY" will be voiced as "January 5 twenty twenty-one" and "dmy" will be voiced as "5 1 two thousand twenty one
desc: format string for how dates will be read back. Y == 4-digit year, A == month name, m == numeric month, d == numeric day. For example, "AdY" will read "January 21 2021"
user: core
<source>
*: "dAY"
</source>
<dest>
*: "dAy"
*: "dAY"
</dest>
<voice>
*: ""
@ -15915,16 +15915,16 @@
</phrase>
<phrase>
id: LANG_DEFAULT_BROWSER
desc: deprecated
desc: in Settings
user: core
<source>
*: ""
*: "Default Browser"
</source>
<dest>
*: ""
*: "Noklusējuma pārlūks"
</dest>
<voice>
*: ""
*: "Noklusējuma pārlūks"
</voice>
</phrase>
<phrase>
@ -16973,129 +16973,3 @@
*: "Ju es bī"
</voice>
</phrase>
<phrase>
id: LANG_KEEP_DIRECTORY
desc: file browser setting
user: core
<source>
*: "Always remember last folder"
</source>
<dest>
*: "Vienmēr atcerēties pēdējo mapi"
</dest>
<voice>
*: "Vienmēr atcerēties pēdējo mapi"
</voice>
</phrase>
<phrase>
id: LANG_FILE_NOT_FOUND
desc: When file does not exist
user: core
<source>
*: "File not found"
</source>
<dest>
*: "Fails nav atrasts"
</dest>
<voice>
*: "Fails nav atrasts"
</voice>
</phrase>
<phrase>
id: LANG_SHOW_IN_FILES
desc: Reveal item in File Browser
user: core
<source>
*: "Show in Files"
</source>
<dest>
*: "Rādīt failu pārlūkā"
</dest>
<voice>
*: "Rādīt failu pārlūkā"
</voice>
</phrase>
<phrase>
id: LANG_CHANNEL_SWAP
desc: in sound_settings
user: core
<source>
*: "Swap Left & Right"
</source>
<dest>
*: "Apmainīt kanālus vietām"
</dest>
<voice>
*: "Apmainīt kanālus vietām"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_SET
desc: countdown_timer plugin - header shown on the setup screen where the user enters the countdown duration
user: core
<source>
*: "SET TIMER"
</source>
<dest>
*: "IESTATĪT TAIMERI"
</dest>
<voice>
*: "Iestatīt taimeri"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_RUNNING
desc: countdown_timer plugin - status label shown while the countdown is active
user: core
<source>
*: "RUNNING"
</source>
<dest>
*: "DARBOJAS"
</dest>
<voice>
*: "Darbojas"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_PAUSED
desc: countdown_timer plugin - status label shown while the countdown is paused
user: core
<source>
*: "PAUSED"
</source>
<dest>
*: "APTURĒTS"
</dest>
<voice>
*: "Apturēts"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_OVERTIME
desc: countdown_timer plugin - status label shown when the countdown has passed zero and is counting up
user: core
<source>
*: "OVERTIME"
</source>
<dest>
*: "PAPILDLAIKS"
</dest>
<voice>
*: "Papildlaiks"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_FINISHED
desc: countdown_timer plugin - status label shown at the moment the countdown expires
user: core
<source>
*: "FINISHED"
</source>
<dest>
*: "BEIDZIES"
</dest>
<voice>
*: "Beidzies"
</voice>
</phrase>

View file

@ -14780,7 +14780,7 @@
user: core
<source>
*: "Press LEFT to cancel."
android,hifietma*: "Press BACK to cancel."
android,hifietma*,zenvision: "Press BACK to cancel."
cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Press POWER to cancel."
ihifi760,ihifi960: "Double tap RETURN to cancel."
ihifi770,ihifi770c,ihifi800: "Press HOME to cancel."
@ -14795,7 +14795,7 @@
</source>
<dest>
*: "Притисните LEFT за прекид."
android,hifietma*: "Притисните BACK за прекид."
android,hifietma*,zenvision: "Притисните BACK за прекид."
cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Притисните POWER за прекид."
ihifi760,ihifi960: "Дупли тап RETURN за прекид."
ihifi770,ihifi770c,ihifi800: "Притисните HOME за прекид."
@ -14810,7 +14810,7 @@
</dest>
<voice>
*: "Притисните LEFT за прекид."
android,hifietma*: "Притисните BACK за прекид."
android,hifietma*,zenvision: "Притисните BACK за прекид."
cowond2,creativezenxfi2,ibassodx50,ibassodx90,mrobe500,ondavx747: "Притисните POWER за прекид."
ihifi760,ihifi960: "Дупли тап RETURN за прекид."
ihifi770,ihifi770c,ihifi800: "Притисните HOME за прекид."
@ -15305,7 +15305,7 @@
</phrase>
<phrase>
id: LANG_VOICED_DATE_FORMAT
desc: format string for how dates will be read back. Y == 4-digit year (grouped), y == 4-digit year (numeric), A == month name, m == numeric month, d == numeric day. For example, for 2021-01-05, "AdY" will be voiced as "January 5 twenty twenty-one" and "dmy" will be voiced as "5 1 two thousand twenty one
desc: format string for how dates will be read back. Y == 4-digit year, A == month name, m == numeric month, d == numeric day. For example, "AdY" will read "January 21 2021"
user: core
<source>
*: "dAY"
@ -15914,16 +15914,16 @@
</phrase>
<phrase>
id: LANG_DEFAULT_BROWSER
desc: deprecated
desc: in Settings
user: core
<source>
*: ""
*: "Default Browser"
</source>
<dest>
*: ""
*: "Подраз. прегледач"
</dest>
<voice>
*: ""
*: "Подраз. прегледач"
</voice>
</phrase>
<phrase>
@ -16972,129 +16972,3 @@
*: "У Ес Бе"
</voice>
</phrase>
<phrase>
id: LANG_KEEP_DIRECTORY
desc: file browser setting
user: core
<source>
*: "Always remember last folder"
</source>
<dest>
*: "Увек памти последњи фолдер"
</dest>
<voice>
*: "Увек памти последњи фолдер"
</voice>
</phrase>
<phrase>
id: LANG_FILE_NOT_FOUND
desc: When file does not exist
user: core
<source>
*: "File not found"
</source>
<dest>
*: "Фајл није пронађен"
</dest>
<voice>
*: "Фајл није пронађен"
</voice>
</phrase>
<phrase>
id: LANG_SHOW_IN_FILES
desc: Reveal item in File Browser
user: core
<source>
*: "Show in Files"
</source>
<dest>
*: "Прикажи у фајловима"
</dest>
<voice>
*: "Прикажи у фајловима"
</voice>
</phrase>
<phrase>
id: LANG_CHANNEL_SWAP
desc: in sound_settings
user: core
<source>
*: "Swap Left & Right"
</source>
<dest>
*: "Замени леви и десни"
</dest>
<voice>
*: "Замени леви и десни"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_SET
desc: countdown_timer plugin - header shown on the setup screen where the user enters the countdown duration
user: core
<source>
*: "SET TIMER"
</source>
<dest>
*: "ПОСТАВИ ТАЈМЕР"
</dest>
<voice>
*: "Постави тајмер"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_RUNNING
desc: countdown_timer plugin - status label shown while the countdown is active
user: core
<source>
*: "RUNNING"
</source>
<dest>
*: "ОДБРОЈАВАЊЕ"
</dest>
<voice>
*: "Одбројавање"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_PAUSED
desc: countdown_timer plugin - status label shown while the countdown is paused
user: core
<source>
*: "PAUSED"
</source>
<dest>
*: "ПАУЗИРАНО"
</dest>
<voice>
*: "Паузирано"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_OVERTIME
desc: countdown_timer plugin - status label shown when the countdown has passed zero and is counting up
user: core
<source>
*: "OVERTIME"
</source>
<dest>
*: "ИСТЕКЛО ВРЕМЕ"
</dest>
<voice>
*: "Истекло време"
</voice>
</phrase>
<phrase>
id: LANG_COUNTDOWN_TIMER_FINISHED
desc: countdown_timer plugin - status label shown at the moment the countdown expires
user: core
<source>
*: "FINISHED"
</source>
<dest>
*: "ГОТОВО"
</dest>
<voice>
*: "Готово"
</voice>
</phrase>

View file

@ -442,10 +442,13 @@ enum eq_type {
HIGH_SHELF
};
/* Size of just the slider/srollbar */
#define SCROLLBAR_SIZE 6
/* Draw the UI for a whole EQ band */
static int draw_eq_slider(struct screen * screen, int x, int y,
int width, int cutoff, int q, int gain, bool selected,
enum eq_slider_mode mode, int band, int scrollbar_size)
enum eq_slider_mode mode, int band)
{
char buf[26];
int steps, min_item, max_item;
@ -531,14 +534,14 @@ static int draw_eq_slider(struct screen * screen, int x, int y,
screen->putsxy(x1, y1, buf);
/* Draw selection box */
total_height = 3 + h + 1 + scrollbar_size + 3;
total_height = 3 + h + 1 + SCROLLBAR_SIZE + 3;
screen->set_drawmode(DRMODE_SOLID);
if (selected) {
screen->drawrect(x, y, width, total_height);
}
/* Draw horizontal slider. Reuse scrollbar for this */
gui_scrollbar_draw(screen, x + 3, y1 + h + 1, width - 6, scrollbar_size,
gui_scrollbar_draw(screen, x + 3, y1 + h + 1, width - 6, SCROLLBAR_SIZE,
steps, min_item, max_item, HORIZONTAL);
return total_height;
@ -547,7 +550,7 @@ static int draw_eq_slider(struct screen * screen, int x, int y,
/* Draw's all the EQ sliders. Returns the total height of the sliders drawn */
static void draw_eq_sliders(struct screen * screen, int x, int y,
int nb_eq_sliders, int start_item,
int current_band, enum eq_slider_mode mode, int scrollbar_size)
int current_band, enum eq_slider_mode mode)
{
int height = y;
@ -565,14 +568,14 @@ static void draw_eq_sliders(struct screen * screen, int x, int y,
if (i >= start_item) {
height += draw_eq_slider(screen, x, height, screen->lcdwidth - x - 1,
cutoff, q, gain, i == current_band, mode,
i, scrollbar_size);
i);
/* add a margin */
height++;
}
}
if (nb_eq_sliders != EQ_NUM_BANDS)
gui_scrollbar_draw(screen, 0, y, scrollbar_size - 1,
gui_scrollbar_draw(screen, 0, y, SCROLLBAR_SIZE - 1,
screen->lcdheight - y, EQ_NUM_BANDS,
start_item, start_item + nb_eq_sliders,
VERTICAL);
@ -590,23 +593,20 @@ int eq_menu_graphical(void)
int current_band, x, y, step, fast_step, min, max;
enum eq_slider_mode mode;
int h, height, start_item, nb_eq_sliders[NB_SCREENS];
int scrollbar_size[NB_SCREENS];
FOR_NB_SCREENS(i)
viewportmanager_theme_enable(i, false, NULL);
FOR_NB_SCREENS(i) {
screens[i].set_viewport(NULL);
screens[i].setfont(FONT_SYSFIXED);
screens[i].clear_display();
/* Figure out how many sliders can be drawn on the screen */
h = screens[i].getcharheight();
scrollbar_size[i] = h * 3 / 4;
if (scrollbar_size[i] < 6)
scrollbar_size[i] = 6;
/* Total height includes margins (1), text, slider, and line selector (1) */
height = 3 + h + 1 + scrollbar_size[i] + 3;
height = 3 + h + 1 + SCROLLBAR_SIZE + 3;
nb_eq_sliders[i] = screens[i].lcdheight / height;
/* Make sure the "Edit Mode" text fits too */
@ -675,14 +675,14 @@ int eq_menu_graphical(void)
} else {
start_item = current_band - 1;
}
x = scrollbar_size[i];
x = SCROLLBAR_SIZE;
} else {
x = 1;
start_item = 0;
}
/* Draw equalizer band details */
draw_eq_sliders(&screens[i], x, y, nb_eq_sliders[i], start_item,
current_band, mode, scrollbar_size[i]);
current_band, mode);
screens[i].update();
}
@ -761,6 +761,7 @@ int eq_menu_graphical(void)
/* Reset screen settings */
FOR_NB_SCREENS(i)
{
screens[i].setfont(FONT_UI);
screens[i].clear_display();
screens[i].set_viewport(NULL);
viewportmanager_theme_undo(i, false);

View file

@ -29,7 +29,6 @@
#include "system.h"
#include "lcd.h"
#include "language.h" /* is_lang_rtl() */
#include "iap-usb.h"
#ifdef HAVE_DIRCACHE
#include "dircache.h"
@ -65,7 +64,6 @@
#include "list.h"
#include "fixedpoint.h"
#include "open_plugin.h"
#include "statusbar-skinned.h"
#include "debug.h"
@ -872,7 +870,6 @@ void check_bootfile(bool do_rolo)
void setvol(void)
{
sound_set_volume(global_status.volume);
iap_on_volume(global_status.volume);
global_status.last_volume_change = current_tick;
status_save(false);
}
@ -1796,14 +1793,8 @@ static void push_current_activity_refresh(enum current_activity screen, bool ref
{
skinlist_set_cfg(i, NULL);
if (refresh)
{
skin_defer_rendering(true);
skin_update(CUSTOM_STATUSBAR, i, SKIN_REFRESH_ALL);
skin_defer_rendering(false);
}
}
if (refresh)
sb_skin_force_next_update();
}
static void pop_current_activity_refresh(bool refresh)
@ -1813,14 +1804,8 @@ static void pop_current_activity_refresh(bool refresh)
{
skinlist_set_cfg(i, NULL);
if (refresh)
{
skin_defer_rendering(true);
skin_update(CUSTOM_STATUSBAR, i, SKIN_REFRESH_ALL);
skin_defer_rendering(false);
}
}
if (refresh)
sb_skin_force_next_update();
}
void push_current_activity(enum current_activity screen)

View file

@ -1287,7 +1287,6 @@ static int hotkey_tree_run_plugin(void *param)
return ONPLAY_RELOAD_DIR;
}
static int hotkey_run_menu(void); /* display hotkey items as a menu */
static int hotkey_wps_run_plugin(void)
{
open_plugin_run(ID2P(LANG_HOTKEY_WPS));
@ -1298,7 +1297,6 @@ static int hotkey_wps_run_plugin(void)
/* Any desired hotkey functions go here, in the enum in onplay.h,
and in the settings menu in settings_list.c. The order here
is not important. */
static const struct hotkey_assignment hotkey_items[] = {
[0]{ .action = HOTKEY_OFF,
.lang_id = LANG_OFF,
@ -1362,18 +1360,6 @@ static const struct hotkey_assignment hotkey_items[] = {
.func = HOTKEY_FUNC(hotkey_tree_run_plugin, (void *)"properties"),
.return_code = ONPLAY_FUNC_RETURN,
.flags = HOTKEY_FLAG_TREE },
{ .action = HOTKEY_CONTEXT_MENU,
.lang_id = LANG_ONPLAY_MENU_TITLE,
.func = HOTKEY_FUNC(hotkey_run_menu, NULL),
.return_code = ONPLAY_FUNC_RETURN,
.flags = HOTKEY_FLAG_WPS | HOTKEY_FLAG_TREE },
#ifdef HAVE_ALBUMART
{ .action = HOTKEY_ALBUMART,
.lang_id = LANG_VIEW_ALBUMART,
.func = HOTKEY_FUNC(view_album_art, NULL),
.return_code = ONPLAY_OK,
.flags = HOTKEY_FLAG_WPS | HOTKEY_FLAG_NOSBS },
#endif
#ifdef HAVE_TAGCACHE
{ .action = HOTKEY_PICTUREFLOW,
.lang_id = LANG_ONPLAY_PICTUREFLOW,
@ -1394,8 +1380,11 @@ const struct hotkey_assignment *get_hotkey(int action)
}
/* Execute the hotkey function, if listed */
static int execute_hotkey(int action)
static int execute_hotkey(bool is_wps)
{
const int action = (is_wps ? global_settings.hotkey_wps :
global_settings.hotkey_tree);
/* search assignment struct for a match for the hotkey setting */
const struct hotkey_assignment *this_item = get_hotkey(action);
@ -1416,60 +1405,6 @@ static int execute_hotkey(int action)
return func_return; /* Use value returned by function */
return return_code; /* or return the associated value */
}
static const char* hotkey_get_name(int selected_item, void * data,
char * buffer, size_t buffer_len)
{
(void)buffer; (void)buffer_len;
const struct hotkey_assignment **hk_menu = (const struct hotkey_assignment **)data;
return ID2P(hk_menu[selected_item + 1]->lang_id); /* +1 to skip HOTKEY_OFF */
}
static int hotkey_get_talk(int selected_item, void * data)
{
if (global_settings.talk_menu)
{
const struct hotkey_assignment **hk_menu = (const struct hotkey_assignment **)data;
talk_id(hk_menu[selected_item + 1]->lang_id, false); /* +1 to skip HOTKEY_OFF */
}
return 0;
}
static int hotkey_run_menu(void)
{
intptr_t flag = HOTKEY_FLAG_WPS;
if (selected_file.context != CONTEXT_WPS)
flag = HOTKEY_FLAG_TREE;
const struct hotkey_assignment *hk_menu[ARRAYLEN(hotkey_items)];
struct simplelist_info info;
int count = 0;
for (size_t i = 0; i < ARRAYLEN(hotkey_items); i++)
{
hk_menu[i] = NULL; /*clear all the hk_menu entries prior to setting them */
if ((hotkey_items[i].flags & flag) == flag)
{
if (hotkey_items[i].action != HOTKEY_CONTEXT_MENU)
{
hk_menu[count++] = &hotkey_items[i];
}
}
}
/* count -1 don't display HOTKEY_OFF item */
simplelist_info_init(&info, str(LANG_ONPLAY_MENU_TITLE), count - 1, (void*)&hk_menu);
info.get_name = hotkey_get_name;
info.get_icon = NULL;
info.get_talk = hotkey_get_talk;
simplelist_show_list(&info);
if (info.selection >= 0) /* run user selected hotkey item */
{
return execute_hotkey(hk_menu[info.selection + 1]->action);
}
return ONPLAY_RELOAD_DIR;
}
#endif /* HOTKEY */
int onplay(char* file, int attr, int from_context, bool hotkey, int customaction)
@ -1506,8 +1441,7 @@ int onplay(char* file, int attr, int from_context, bool hotkey, int customaction
#ifdef HAVE_HOTKEY
if (hotkey)
return execute_hotkey((from_context == CONTEXT_WPS ?
global_settings.hotkey_wps : global_settings.hotkey_tree));
return execute_hotkey(from_context == CONTEXT_WPS);
#else
(void)hotkey;
#endif

View file

@ -63,8 +63,6 @@ enum hotkey_action {
HOTKEY_INSERT,
HOTKEY_INSERT_SHUFFLED,
HOTKEY_BOOKMARK_LIST,
HOTKEY_ALBUMART,
HOTKEY_CONTEXT_MENU, /* shows / executes above actions in a menu */
};
enum hotkey_flags {
HOTKEY_FLAG_NONE = 0x0,

View file

@ -35,7 +35,7 @@
static const uint32_t open_plugin_csum = OPEN_PLUGIN_CHECKSUM;
#define OP_ENTRY_SZ (sizeof(struct open_plugin_entry_t))
static const int op_entry_sz = sizeof(struct open_plugin_entry_t);
static const char* strip_rockbox_root(const char *path)
{
@ -49,7 +49,7 @@ static inline void op_clear_entry(struct open_plugin_entry_t *entry)
{
if (entry == NULL)
return;
memset(entry, 0, OP_ENTRY_SZ);
memset(entry, 0, op_entry_sz);
entry->lang_id = OPEN_PLUGIN_LANG_INVALID;
}
@ -78,7 +78,7 @@ static int op_find_entry(int fd, struct open_plugin_entry_t *entry,
{
logf("OP find_entry *Searching* hash: %x lang_id: %d", hash, lang_id);
while (read(fd, entry, OP_ENTRY_SZ) == OP_ENTRY_SZ)
while (read(fd, entry, op_entry_sz) == op_entry_sz)
{
if (entry->lang_id == lang_id || entry->hash == hash ||
(lang_id == OPEN_PLUGIN_LANG_IGNOREALL))/* return first entry found */
@ -167,9 +167,9 @@ static int op_update_dat(struct open_plugin_entry_t *entry, bool clear)
lseek(fd, 0-hlc_sz, SEEK_CUR);/* back to the start of record */
break;
}
lseek(fd, OP_ENTRY_SZ - hlc_sz, SEEK_CUR); /* finish record */
lseek(fd, op_entry_sz - hlc_sz, SEEK_CUR); /* finish record */
}
write(fd, entry, OP_ENTRY_SZ);
write(fd, entry, op_entry_sz);
close(fd);
#else /* Everyone else make a temp file */
logf("OP update *Copying entries* %s", OPEN_PLUGIN_DAT ".tmp");
@ -177,18 +177,18 @@ static int op_update_dat(struct open_plugin_entry_t *entry, bool clear)
if (fd < 0)
return OPEN_PLUGIN_NOT_FOUND;
write(fd, entry, OP_ENTRY_SZ);
write(fd, entry, op_entry_sz);
int fd1 = open(OPEN_PLUGIN_DAT, O_RDONLY);
if (fd1 >= 0)
{
/* copy non-duplicate entries back from original */
while (read(fd1, entry, OP_ENTRY_SZ) == OP_ENTRY_SZ)
while (read(fd1, entry, op_entry_sz) == op_entry_sz)
{
if (entry->hash != hash && entry->lang_id != lang_id &&
op_entry_checksum(entry) > 0)
{
write(fd, entry, OP_ENTRY_SZ);
write(fd, entry, op_entry_sz);
}
}
close(fd1);
@ -529,13 +529,41 @@ static bool op_entry_read(int fd, int selected_item, off_t data_sz, struct open_
{
op_clear_entry(op_entry);
return ((selected_item >= 0) && (fd >= 0) &&
(lseek(fd, selected_item * OP_ENTRY_SZ, SEEK_SET) >= 0) &&
(lseek(fd, selected_item * op_entry_sz, SEEK_SET) >= 0) &&
(read(fd, op_entry, data_sz) == data_sz) && op_entry_checksum(op_entry) > 0);
}
void open_plugin_import(const char *cfg_file)
void open_plugin_import(char *strdat)
{
plugin_load(VIEWERS_DIR"/open_plugins.rock", cfg_file);
/* Note: Destroys strdat */
char *vect[5];
/* expected openplugin strdat: "englishid", "name", "path", "param" */
if (split_string(strdat, ',', vect, 5) == 4)
{
/* Space for 5 values so we will fail if excess arguments or too few */
for(int i = 0; i < 4; i++)
{
vect[i] = skip_whitespace(vect[i]);
int eos = ((int)strlen(vect[i]))-2;
/* Failure if string is not quoted */
if (vect[i][0] != '"' || eos < 0 || vect[i][eos + 1] != '"')
{
logf("%s[%d] error: quoted string expected\n", __func__, i);
return;
}
vect[i]++; /* skip first " */
vect[i][eos] = '\0'; /* skip other " */
}
char *key = vect[1];
int lang_id = lang_english_to_id(vect[0]);
if (lang_id >= 0)
key = ID2P(lang_id);
/* if key exists it will be overwritten */
open_plugin_add_path(key, vect[2], vect[3]);
return;
}
logf("%s error: importing entries", __func__);
}
void open_plugin_export(int cfg_fd)
@ -556,7 +584,7 @@ void open_plugin_export(int cfg_fd)
logf("%s error: opening %s", __func__, OPEN_PLUGIN_DAT);
return; /* OPEN_PLUGIN_NOT_FOUND */
}
while (op_entry_read(fd, index++, OP_ENTRY_SZ, op_entry))
while (op_entry_read(fd, index++, op_entry_sz, op_entry))
{
/* don't save the LANG_OPEN_PLUGIN entry -- it is for internal use */
if (op_entry->lang_id == LANG_OPEN_PLUGIN)
@ -568,16 +596,8 @@ void open_plugin_export(int cfg_fd)
else
lang_name = "[USER]"; /* needs to be an invalid lang string */
bool dblquote = strchr(op_entry->name, '"') != NULL ||
strchr(op_entry->param, '"') != NULL;
const char* fmtstr = "%s: \"%s\", \"%s\", \"%s\", \"%s\"\n";
if (dblquote) /* if using double quotes export with single quotes */
{
fmtstr = "%s: '%s', '%s', '%s', '%s'\n";
}
fdprintf(cfg_fd, fmtstr, OPEN_PLUGIN_CFGNAME,
lang_name, op_entry->name, op_entry->path, op_entry->param);
fdprintf(cfg_fd,"%s: \"%s\", \"%s\", \"%s\", \"%s\"\n",
"openplugin", lang_name, op_entry->name, op_entry->path, op_entry->param);
logf("openplugin[%d]: \"%s\", \"%s\", \"%s\", \"%s\"\n lang id: %d hash: %x, csum: %x\n",
index, lang_name, op_entry->name, op_entry->path, op_entry->param,

View file

@ -35,7 +35,6 @@
#define OPEN_RBPLUGIN_DAT PLUGIN_DIR "/rb_plugins.dat"
#define OPEN_PLUGIN_BUFSZ MAX_PATH
#define OPEN_PLUGIN_NAMESZ 32
#define OPEN_PLUGIN_CFGNAME "openplugin"
enum {
OPEN_PLUGIN_LANG_INVALID = (-1),
@ -85,7 +84,7 @@ int open_plugin_load_entry(const char *key);
void open_plugin_browse(const char *key);
int open_plugin_run(const char *key);
void open_plugin_cache_flush(void); /* flush to disk */
void open_plugin_import(const char *cfg_file);
void open_plugin_import(char *strdat);
void open_plugin_export(int cfg_fd);
#endif

View file

@ -48,7 +48,6 @@
#include "settings.h"
#include "audiohw.h"
#include "general.h"
#include "iap-usb.h"
#include <stdio.h>
#ifdef HAVE_TAGCACHE
@ -179,11 +178,7 @@ struct audio_resume_info
static struct mutex id3_mutex SHAREDBSS_ATTR; /* (A,O)*/
/** For album art support **/
#if defined(USB_ENABLE_IAP)
#define MAX_MULTIPLE_AA (SKINNABLE_SCREENS_COUNT + 1)
#else
#define MAX_MULTIPLE_AA SKINNABLE_SCREENS_COUNT
#endif
#ifdef HAVE_ALBUMART
static int albumart_mode = -1;
@ -1412,7 +1407,6 @@ static void audio_playlist_track_change(void)
{
send_track_event(PLAYBACK_EVENT_TRACK_CHANGE,
track_event_flags, id3);
iap_on_track_playback_index(playlist_get_display_index() - 1, false);
}
position_key = pcmbuf_get_position_key();
@ -2321,8 +2315,6 @@ static int audio_finish_load_track(struct track_info *infop)
by the time PLAYBACK_EVENT_TRACK_CHANGE is sent */
send_track_event(PLAYBACK_EVENT_CUR_TRACK_READY, 0,
id3_get(PLAYING_ID3));
/* Also send pending notification */
iap_on_track_playback_index(playlist_get_display_index() - 1, true);
}
#ifdef HAVE_CODEC_BUFFERING
@ -2750,7 +2742,6 @@ static void audio_finalise_track_change(void)
if (pause_on_track_change || single_mode_do_pause(info.id3_hid))
{
play_status = PLAY_PAUSED;
iap_on_play_status(play_status);
pcmbuf_pause(true);
pause_on_track_change = false;
}
@ -3084,7 +3075,6 @@ static void audio_start_playback(const struct audio_resume_info *resume_info,
/* Update our state */
play_status = PLAY_PLAYING;
iap_on_play_status(play_status);
}
/* Codec's position should be available as soon as it knows it */
@ -3172,7 +3162,6 @@ static void audio_stop_playback(void)
/* Update our state */
ff_rw_mode = false;
play_status = PLAY_STOPPED;
iap_on_play_status(play_status);
wipe_track_metadata(true);
#ifdef HAVE_ALBUMART
@ -3194,7 +3183,6 @@ static void audio_on_pause(bool pause)
return;
play_status = pause ? PLAY_PAUSED : PLAY_PLAYING;
iap_on_play_status(play_status);
if (!pause && codec_skip_pending)
{
@ -3836,7 +3824,6 @@ void audio_pcmbuf_position_callback(unsigned long elapsed, off_t offset,
struct mp3entry *id3 = id3_get(PLAYING_ID3);
id3->elapsed = elapsed;
id3->offset = offset;
iap_on_track_time_position(elapsed);
}
}
@ -4247,22 +4234,12 @@ void audio_set_crossfade(int enable)
static unsigned long audio_guess_frequency(struct mp3entry *id3)
{
const struct pcm_sink_caps* caps = pcm_sink_caps(pcm_current_sink());
bool have_44 = false;
bool have_48 = false;
for (size_t i = 0; i < caps->num_samprs; i += 1)
{
if (caps->samprs[i] == SAMPR_44)
have_44 = true;
if (caps->samprs[i] == SAMPR_48)
have_48 = true;
if (id3->frequency == caps->samprs[i])
return id3->frequency;
}
unsigned long fallback = (id3->frequency % 4000) ? SAMPR_44 : SAMPR_48;
if ((fallback == SAMPR_44 && have_44) || (fallback == SAMPR_48 && have_48))
return fallback;
else
return caps->samprs[caps->default_freq];
return (id3->frequency % 4000) ? SAMPR_44 : SAMPR_48;
}
static bool audio_auto_change_frequency(struct mp3entry *id3, bool play)

View file

@ -107,7 +107,6 @@
#include "rbunicode.h"
#include "root_menu.h"
#include "plugin.h" /* To borrow a temp buffer to rewrite a .m3u8 file */
#include "iap-usb.h"
#include "logdiskf.h"
#ifdef HAVE_DIRCACHE
#include "dircache.h"
@ -316,7 +315,7 @@ static void pl_close_control(struct playlist_info *playlist)
/* Check if the filename suggests M3U or M3U8 format. */
static bool is_m3u8_name(const char* filename)
{
const char *dot = strrchr(filename, '.');
char *dot = strrchr(filename, '.');
/* Default to M3U8 unless explicitly told otherwise. */
return (!dot || strcasecmp(dot, ".m3u") != 0);
@ -1218,8 +1217,6 @@ static int remove_all_tracks_unlocked(struct playlist_info *playlist)
playlist->amount = 1;
playlist->indices[0] |= PLAYLIST_QUEUED;
playlist->flags = 0; /* Reset dirplay and modified flags */
if (playlist == &current_playlist)
iap_on_tracks_count(playlist->amount);
if (playlist->last_insert_pos == 0)
playlist->last_insert_pos = -1;
@ -1427,8 +1424,6 @@ static int add_track_to_playlist_unlocked(struct playlist_info* playlist,
dc_init_filerefs(playlist, insert_position, 1);
playlist->amount++;
if (playlist == &current_playlist)
iap_on_tracks_count(playlist->amount);
return insert_position;
}
@ -1511,9 +1506,6 @@ static void find_and_set_playlist_index_unlocked(struct playlist_info* playlist,
{
playlist->index = playlist->first_index = i;
if (playlist == &current_playlist)
iap_on_track_playback_index(rotate_index(playlist, playlist->index), true);
break;
}
}
@ -2957,7 +2949,6 @@ int playlist_next(int steps)
sort_playlist_unlocked(playlist, false, false);
randomise_playlist_unlocked(playlist, current_tick, false, true);
global_settings.playlist_shuffle = true;
iap_on_shuffle_state(global_settings.playlist_shuffle);
playlist->started = true;
playlist->index = 0;
@ -3546,9 +3537,8 @@ int playlist_resume(void)
}
}
if (global_status.resume_index != -1) {
if (global_status.resume_index != -1)
playlist->index = global_status.resume_index;
}
out:
playlist_write_unlock(playlist);
@ -4057,10 +4047,8 @@ static int pl_save_update_control(struct playlist_info* playlist,
/* Reset shuffle seed */
playlist->seed = 0;
if (playlist == &current_playlist) {
if (playlist == &current_playlist)
global_settings.playlist_shuffle = false;
iap_on_shuffle_state(global_settings.playlist_shuffle);
}
pl_close_control(playlist);
close(old_fd);

View file

@ -52,10 +52,6 @@
#include "yesno.h"
#include "playback.h"
#if defined (HAVE_TAGCACHE) && defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE)
#include "tagcache.h"
#endif
/* Maximum number of tracks we can have loaded at one time */
#define MAX_PLAYLIST_ENTRIES 200
@ -128,8 +124,6 @@ struct playlist_viewer {
struct playlist_buffer buffer;
struct mp3entry *id3;
bool allow_view_text_plugin;
unsigned long loading_tick;
bool is_open;
};
struct playlist_search_data
@ -220,13 +214,6 @@ static void playlist_buffer_load_entries(struct playlist_buffer *pb, int index,
for (i = 0; i < num_entries; i++)
{
/* provide UI feedback if opening Playlist Viewer is taking too long */
if (!viewer.is_open && TIME_AFTER(current_tick, viewer.loading_tick))
{
viewer.loading_tick += HZ*10;
splash(0, ID2P(LANG_WAIT));
}
int len = playlist_entry_load(&(pb->tracks[i]), index, p, remaining);
if (len < 0)
{
@ -289,15 +276,9 @@ static bool retrieve_id3_tags(const int index, const char* name, struct mp3entry
copy_mp3entry(id3, audio_current_track()); /* retrieve id3 from RAM */
id3_retrieval_successful = true;
}
#if defined (HAVE_TAGCACHE) && defined(HAVE_TC_RAMCACHE) && defined(HAVE_DIRCACHE)
else if (flags & METADATA_EXCLUDE_ID3_PATH)
/* retrieve id3 from database */
id3_retrieval_successful = tagcache_fill_tags(id3, name);
#endif
if (!id3_retrieval_successful)
else
{
/* Read from disk: retrieves frequency, file size, and codec */
/* Read from disk, the database, doesn't store frequency, file size or codec (g4470) ChrisS*/
id3_retrieval_successful = get_metadata_ex(id3, -1, name, flags);
}
return id3_retrieval_successful;
@ -516,7 +497,7 @@ static void format_name(char* dest, const char* src, size_t bufsz)
default:
{
/* Only display the filename */
const char* p = strrchr(src, '/');
char* p = strrchr(src, '/');
strlcpy(dest, p+1, bufsz);
/* Remove the extension */
strrsplt(dest, '.');
@ -682,7 +663,6 @@ static void close_playlist_viewer(void)
}
playlist_close(viewer.playlist);
}
viewer.is_open = false;
}
#if defined(HAVE_HOTKEY) || defined(HAVE_TAGCACHE)
@ -980,12 +960,9 @@ static bool open_playlist_viewer(const char* filename,
struct gui_synclist *playlist_lists,
bool reload, int *most_recent_selection)
{
viewer.loading_tick = current_tick + HZ/3;
push_current_activity(ACTIVITY_PLAYLISTVIEWER);
if (playlist_viewer_init(&viewer, filename, reload, most_recent_selection))
viewer.is_open = true;
else
if (!playlist_viewer_init(&viewer, filename, reload, most_recent_selection))
return false;
update_gui(playlist_lists, true);

View file

@ -49,7 +49,6 @@
#include "core_keymap.h"
#include "language.h"
#include "statusbar-skinned.h"
#include "panic.h"
#if CONFIG_CHARGING
#include "power.h"
@ -871,10 +870,6 @@ static const struct plugin_api rockbox_api = {
/* new stuff at the end, sort into place next time
the API gets incompatible */
panicf,
gui_synclist_scroll_stop,
add_event_ex,
remove_event_ex,
};
static int plugin_buffer_handle;
@ -895,9 +890,7 @@ int plugin_load(const char* plugin, const void* parameter)
!strcmp("playing_time.rock", sepch + 1) ||
!strcmp("main_menu_config.rock", sepch + 1) ||
!strcmp("text_viewer.rock", sepch + 1) ||
!strcmp("view_text.rock", sepch + 1) ||
!strcmp("disktidy.rock", sepch + 1) ||
!strcmp("open_plugins.rock", sepch + 1));
!strcmp("disktidy.rock", sepch + 1));
if (current_plugin_handle)
{
@ -1022,11 +1015,8 @@ int plugin_load(const char* plugin, const void* parameter)
pop_current_activity_without_refresh();
if (get_current_activity() != ACTIVITY_WPS)
{
skin_defer_rendering(true);
FOR_NB_SCREENS(i)
skin_update(CUSTOM_STATUSBAR, i, SKIN_REFRESH_ALL);
skin_defer_rendering(false);
sb_skin_force_next_update();
}
if (!pfn_tsr_exit)

View file

@ -45,8 +45,6 @@
#undef strcmp
#undef strncmp
#undef strchr
#undef strstr
#undef strrchr
#undef strtok_r
#ifdef __APPLE__
#undef strncpy
@ -1026,18 +1024,6 @@ struct plugin_api {
/* new stuff at the end, sort into place next time
the API gets incompatible */
void (*panicf)(const char *msg, ...);
void (*gui_synclist_scroll_stop)(struct gui_synclist *lists);
bool (*add_event_ex)(unsigned short id, bool oneshot,
void (*handler)(unsigned short id,
void *event_data,
void *user_data),
void *user_data);
void (*remove_event_ex)(unsigned short id,
void (*handler)(unsigned short id,
void *event_data,
void *user_data),
void *user_data);
};
/* plugin header */

View file

@ -58,12 +58,4 @@ $(BUILDDIR)/apps/plugins/bitmaps/remote_native/%.c: $(ROOTDIR)/apps/plugins/bitm
$(SILENT)mkdir -p $(dir $@) $(PBMPINCDIR)
$(call PRINTS,BMP2RB $(<F))$(BMP2RB_REMOTENATIVE) -b -h $(PBMPINCDIR) $< > $@
ifdef APP_TYPE
# Bitmaps must be explicitly Position independent to avoid linker warnings
$(BUILDDIR)/apps/plugins/bitmaps/native/%.o: CFLAGS += -fPIC
$(BUILDDIR)/apps/plugins/bitmaps/mono/%.o: CFLAGS += -fPIC
$(BUILDDIR)/apps/plugins/bitmaps/remote_mono/%.o: CFLAGS += -fPIC
$(BUILDDIR)/apps/plugins/bitmaps/remote_native/%.o: CFLAGS += -fPIC
endif
endif

View file

@ -519,7 +519,6 @@ F3: equal to "="
#define CALCULATOR_DOWN BUTTON_DOWN
#define CALCULATOR_QUIT BUTTON_POWER
#define CALCULATOR_INPUT BUTTON_PLAY
#define CALCULATOR_INPUT2 (BUTTON_SELECT|BUTTON_REL)
#define CALCULATOR_CALC BUTTON_MENU
#define CALCULATOR_CLEAR BUTTON_BACK
@ -1939,9 +1938,6 @@ Handle buttons on basic screen
----------------------------------------------------------------------- */
static void basicButtonsProcess(void){
switch (btn) {
#ifdef CALCULATOR_INPUT2
case CALCULATOR_INPUT2: /*fallthrough*/
#endif
case CALCULATOR_INPUT:
if (calStatus == cal_error && (CAL_BUTTON != btn_C) ) break;
flashButton();
@ -2045,9 +2041,6 @@ Handle buttons on scientific screen
----------------------------------------------------------------------- */
static void sciButtonsProcess(void){
switch (btn) {
#ifdef CALCULATOR_INPUT2
case CALCULATOR_INPUT2: /*fallthrough*/
#endif
case CALCULATOR_INPUT:
if (calStatus == cal_error && (CAL_BUTTON != sci_sci) ) break;
flashButton();
@ -2140,9 +2133,6 @@ static int handleButton(int button){
break;
/* no unconditional break; here! */
#endif
#ifdef CALCULATOR_INPUT2 /* bypass pre button */
case CALCULATOR_INPUT2: /*fallthrough*/
#endif
#ifdef CALCULATOR_OPERATORS
case CALCULATOR_OPERATORS:
#endif

View file

@ -19,7 +19,7 @@ ifeq ($(findstring YES, $(call preprocess, $(APPSDIR)/plugins/BUILD_OVERLAY)), Y
### lowmem targets
ROCKS += $(CHESSBOX_OBJDIR)/chessbox.ovl
CHESSBOX_OUTLDS = $(CHESSBOX_OBJDIR)/chessbox.link
CHESSBOX_OVLFLAGS = -T$(CHESSBOX_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(basename $@).map $(GLOBAL_LDOPTS)
CHESSBOX_OVLFLAGS = -T$(CHESSBOX_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(basename $@).map
else
ROCKS += $(CHESSBOX_OBJDIR)/chessbox.rock
endif

View file

@ -103,18 +103,18 @@ static void aes_decrypt(void* data, uint32_t size)
static void calc_hash(uint32_t* data, uint32_t size, uint32_t* result)
{
uint32_t ptr, i;
uint32_t config = SHA1_CONFIG_GO;
uint32_t config = 2;
PWRCONEXT &= ~0x4;
for (ptr = 0; ptr < (size >> 2); ptr += 0x10)
{
for (i = 0; i < 0x10; i++) SHA1_DATA[i] = data[ptr + i];
SHA1_CONFIG = config;
config = SHA1_CONFIG_CONT | SHA1_CONFIG_GO;
while ((SHA1_CONFIG & SHA1_CONFIG_BUSY) != 0);
for (i = 0; i < 0x10; i++) SHA1DATAIN[i] = data[ptr + i];
SHA1CONFIG = config;
config = 0xA;
while ((SHA1CONFIG & 1) != 0);
}
for (i = 0; i < 5; i ++) result[i] = SHA1_RESULT[i];
for (i = 0; i < 5; i ++) result[i] = SHA1RESULT[i];
PWRCONEXT |= 0x4;
}

View file

@ -9,7 +9,7 @@
#define BUTTON_COLS 5
#define REC_HEIGHT (int)(LCD_HEIGHT / (BUTTON_ROWS + 1))
#define REC_WIDTH (int)(LCD_WIDTH / BUTTON_COLS)
#define REC_WIDTH (int)(LCD_WIDTH / BUTTON_COLS)
#define Y_7_POS (LCD_HEIGHT) /* Leave room for the border */
#define Y_6_POS (Y_7_POS - REC_HEIGHT) /* y6 = 63 */
@ -48,7 +48,6 @@
#define NUM_PLAYERS 2
#define MAX_UNDO 100
#define CENTRE_X (LCD_WIDTH/2)
static const struct button_mapping *plugin_contexts[] = {pla_main_ctx};
@ -73,12 +72,12 @@ static bool loaded = false; /* has a save been loaded? */
int btn_row, btn_col; /* current position index for button */
int prev_btn_row, prev_btn_col; /* previous cursor position */
unsigned char *buttonChar[6][5] = {
{"", "x1", "x2", "x3", ""},
{"", "Single", "Double", "Triple", ""},
{"1", "2", "3", "4", "5"},
{"6", "7", "8", "9", "10"},
{"11", "12", "13", "14", "15"},
{"16", "17", "18", "19", "20"},
{"", "Miss", "Bull", "Undo", ""}};
{"", "Missed", "Bull", "Undo", ""}};
int modifier;
static int do_dart_scorer_pause_menu(void);
@ -147,34 +146,22 @@ static void draw(void)
{
rb->lcd_clear_display();
unsigned int w,h;
char buf[16];
char buf[32];
char *turn_marker;
/* player 1 score */
turn_marker = (0 == settings.turn) ? "*" : "";
#if LCD_HEIGHT <= 64 || LCD_WIDTH <= 96
rb->snprintf(buf, sizeof(buf), "%sP1 %d", turn_marker, settings.scores[0]);
#else
rb->snprintf(buf, sizeof(buf), "%sPlayer 1: %d", turn_marker, settings.scores[0]);
#endif
rb->lcd_putsxy(0, 10, buf);
/* player 2 score */
turn_marker = (1 == settings.turn) ? "*" : "";
#if LCD_HEIGHT <= 64 || LCD_WIDTH <= 96
rb->snprintf(buf, sizeof(buf), "%sP2 %d", turn_marker, settings.scores[1]);
#else
rb->snprintf(buf, sizeof(buf), "%sPlayer 2: %d", turn_marker, settings.scores[1]);
#endif
rb->lcd_getstringsize(buf, &w, &h);
rb->lcd_putsxy(LCD_WIDTH - w, 10, buf);
int throws_x = CENTRE_X - 5;
int x = 5;
int y = 10;
for (int i = 0; i < NUM_PLAYERS; ++i, x = x + 95)
{
char *turn_marker = (i == settings.turn) ? "*" : "";
rb->snprintf(buf, sizeof(buf), "%sPlayer %d: %d", turn_marker, i + 1, settings.scores[i]);
rb->lcd_putsxy(x, y, buf);
}
int throws_x = (LCD_WIDTH / 2) - 10;
char throws_buf[3];
for (int i = 0; i < settings.throws; ++i, throws_x += 5)
{
rb->lcd_putsxy(throws_x, 10, "|");
rb->strcat(throws_buf, "1");
rb->lcd_putsxy(throws_x, y, "|");
}
drawButtons();
@ -337,11 +324,11 @@ static enum plugin_status do_game(bool newgame)
switch (button)
{
case DARTS_SELECT:
if ((!rb->strcmp(selected, "")) || (!rb->strcmp(selected, "x1")))
if ((!rb->strcmp(selected, "")) || (!rb->strcmp(selected, "Single")))
modifier = 1;
else if (!rb->strcmp(selected, "x2"))
else if (!rb->strcmp(selected, "Double"))
modifier = 2;
else if (!rb->strcmp(selected, "x3"))
else if (!rb->strcmp(selected, "Triple"))
modifier = 3;
else if (!rb->strcmp(selected, "Undo"))
{

View file

@ -474,7 +474,6 @@ void I_SubmitSound(void)
void I_ShutdownSound(void)
{
rb->pcmbuf_fade(false, false); /* Mute channel */
rb->mixer_channel_stop(PCM_MIXER_CHAN_PLAYBACK);
rb->mixer_set_frequency(HW_SAMPR_DEFAULT);
}
@ -509,7 +508,6 @@ void I_InitSound()
rb->audio_set_output_source(AUDIO_SRC_PLAYBACK);
#endif
rb->mixer_set_frequency(samplerate);
rb->pcmbuf_fade(false, true); /* Be sure channel is audible */
vol_lookup=malloc(128*256*sizeof(int));

View file

@ -276,8 +276,7 @@ static int get_image(struct image_info *info, int frame, int ds)
buf_images += size;
buf_images_size -= size;
if (!iv->settings->hide_info &&
!iv->running_slideshow)
if (!iv->running_slideshow)
{
rb->lcd_putsf(0, 3, "resizing %d*%d", info->width, info->height);
rb->lcd_update();

View file

@ -246,32 +246,28 @@ static bool set_option_dithering(void)
return false;
}
MENUITEM_FUNCTION(grayscale_item, 0, ID2P(LANG_GRAYSCALE),
set_option_grayscale, NULL, Icon_NOICON);
MENUITEM_FUNCTION(dithering_item, 0, ID2P(LANG_DITHERING),
set_option_dithering, NULL, Icon_NOICON);
#endif /* HAVE_LCD_COLOR */
static bool set_option_hide_info(void)
{
rb->set_bool(rb->str(LANG_HIDE_INFO), &settings.hide_info);
return false;
}
MENUITEM_FUNCTION(grayscale_item, 0, ID2P(LANG_GRAYSCALE),
set_option_grayscale, NULL, Icon_NOICON);
MENUITEM_FUNCTION(dithering_item, 0, ID2P(LANG_DITHERING),
set_option_dithering, NULL, Icon_NOICON);
MENUITEM_FUNCTION(hide_info_item, 0, ID2P(LANG_HIDE_INFO),
set_option_hide_info, NULL, Icon_NOICON);
MAKE_MENU(display_menu, ID2P(LANG_MENU_DISPLAY_OPTIONS), NULL, Icon_NOICON,
#ifdef HAVE_LCD_COLOR
&grayscale_item,
&dithering_item,
#endif /* HAVE_LCD_COLOR */
&hide_info_item);
static void display_options(void)
{
rb->do_menu(&display_menu, NULL, NULL, false);
}
#endif /* HAVE_LCD_COLOR */
static int show_menu(void) /* return 1 to quit */
{
@ -285,7 +281,9 @@ static int show_menu(void) /* return 1 to quit */
#ifdef USE_PLUG_BUF
MIID_SHOW_PLAYBACK_MENU,
#endif
#ifdef HAVE_LCD_COLOR
MIID_DISPLAY_OPTIONS,
#endif
MIID_QUIT,
};
@ -296,7 +294,9 @@ static int show_menu(void) /* return 1 to quit */
#ifdef USE_PLUG_BUF
ID2P(LANG_PLAYBACK_CONTROL),
#endif
#ifdef HAVE_LCD_COLOR
ID2P(LANG_MENU_DISPLAY_OPTIONS),
#endif
ID2P(LANG_MENU_QUIT));
static const struct opt_items slideshow[2] = {
@ -332,9 +332,11 @@ static int show_menu(void) /* return 1 to quit */
}
break;
#endif
#ifdef HAVE_LCD_COLOR
case MIID_DISPLAY_OPTIONS:
display_options();
break;
#endif
case MIID_QUIT:
return 1;
break;
@ -359,6 +361,12 @@ static int show_menu(void) /* return 1 to quit */
}
}
#endif
#if LCD_DEPTH > 1
rb->lcd_set_backdrop(NULL);
rb->lcd_set_foreground(LCD_WHITE);
rb->lcd_set_background(LCD_BLACK);
#endif
rb->lcd_clear_display();
return 0;
}
@ -768,22 +776,9 @@ static int scroll_bmp(struct image_info *info, bool initial_frame)
#ifdef USEGSLIB
grey_show(false); /* switch off greyscale overlay */
#endif
FOR_NB_SCREENS(i)
rb->viewportmanager_theme_enable(i, true, NULL);
int ret = show_menu();
FOR_NB_SCREENS(i)
rb->viewportmanager_theme_undo(i, false);
if (ret == 1)
if (show_menu() == 1)
return PLUGIN_OK;
#if LCD_DEPTH > 1
rb->lcd_set_backdrop(NULL);
rb->lcd_set_foreground(LCD_WHITE);
rb->lcd_set_background(LCD_BLACK);
#endif
rb->lcd_clear_display();
#ifdef USEGSLIB
grey_show(true); /* switch on greyscale overlay */
#else

View file

@ -34,15 +34,6 @@ void __aeabi_ldiv0(void) __attribute__((alias("__div0")));
#endif
#endif
#if defined(USE_STACK_PROTECTOR)
const uint32_t __stack_chk_guard = 0x3BADC0DE;
void __stack_chk_fail(void)
{
rb->panicf("plugin smashed stack");
}
#endif
void *memcpy(void *dest, const void *src, size_t n)
{
return rb->memcpy(dest, src, n);

View file

@ -29,16 +29,13 @@
struct view_info {
struct font* pf;
struct viewport scrollbar_vp; /* viewport for scrollbar */
struct viewport title_vp;
struct viewport vp;
bool sbs_has_title; /* SBS comes with custom title area */
const char *title;
const char *text; /* displayed text */
int display_lines; /* number of lines can be displayed */
int line_count; /* number of lines */
int line; /* current first line */
int start; /* possition of first line in text */
bool ui_update_cb;
};
static bool isbrchr(const unsigned char *str, int len)
@ -96,19 +93,17 @@ static void calc_line_count(struct view_info *info)
{
ptr = get_next_line(ptr, info);
i++;
if (!scrollbar && i > info->display_lines &&
rb->global_settings->scrollbar != SCROLLBAR_OFF)
if (!scrollbar && i > info->display_lines)
{
ptr = info->text;
i = 0;
info->scrollbar_vp = info->vp;
info->scrollbar_vp.width = rb->global_settings->scrollbar_width + 1;
info->scrollbar_vp.height = info->display_lines * info->pf->height;
info->scrollbar_vp.width = rb->global_settings->scrollbar_width;
info->vp.width -= info->scrollbar_vp.width;
if (rb->global_settings->scrollbar == SCROLLBAR_RIGHT)
info->scrollbar_vp.x = info->vp.x + info->vp.width;
if (rb->global_settings->scrollbar != SCROLLBAR_RIGHT)
info->vp.x = info->scrollbar_vp.width;
else
info->vp.x += info->scrollbar_vp.width;
info->scrollbar_vp.x = info->vp.width;
scrollbar = true;
}
}
@ -142,14 +137,8 @@ static void calc_first_line(struct view_info *info, int line)
static int init_view(struct view_info *info,
const char *title, const char *text)
{
struct screen* display = rb->screens[SCREEN_MAIN];
int ui_font = display->getuifont();
display->set_viewport(&info->vp);
display->clear_viewport();
info->pf = rb->font_get(ui_font);
info->vp.font = ui_font;
rb->viewport_set_defaults(&info->vp, SCREEN_MAIN);
info->pf = rb->font_get(rb->screens[SCREEN_MAIN]->getuifont());
info->display_lines = info->vp.height / info->pf->height;
info->title = title;
@ -157,23 +146,17 @@ static int init_view(struct view_info *info,
info->line_count = 0;
info->line = 0;
info->start = 0;
info->ui_update_cb = false;
if (!info->sbs_has_title)
/* no title for small screens. */
if (info->display_lines < 4)
{
/* no title for small screens. */
if (info->display_lines < 4)
info->title = NULL;
else
{
info->display_lines--;
info->title_vp = info->vp;
info->title_vp.height = info->pf->height;
info->vp.height -= info->title_vp.height;
info->vp.y += info->title_vp.height;
}
info->title = NULL;
}
else
{
info->display_lines--;
info->vp.y += info->pf->height;
info->vp.height -= info->pf->height;
}
calc_line_count(info);
@ -188,19 +171,20 @@ static void draw_text(struct view_info *info)
int max_show, line;
struct screen* display = rb->screens[SCREEN_MAIN];
/* clear screen */
display->clear_display();
if (info->title && !info->sbs_has_title)
/* display title. */
if(info->title)
{
display->set_viewport(&info->title_vp);
display->set_viewport(NULL);
display->puts(0, 0, info->title);
}
display->set_viewport(&info->vp);
display->clear_viewport();
max_show = MIN(info->line_count - info->line, info->display_lines);
text = info->text + info->start;
display->set_viewport(&info->vp);
for (line = 0; line < max_show; line++)
{
int len;
@ -213,21 +197,17 @@ static void draw_text(struct view_info *info)
display->puts(0, line, output);
text = ptr;
}
if (info->line_count > info->display_lines &&
rb->global_settings->scrollbar != SCROLLBAR_OFF)
if (info->line_count > info->display_lines)
{
display->set_viewport(&info->scrollbar_vp);
int margin = info->scrollbar_vp.width > 2 ? 2 : 0;
int x = rb->global_settings->scrollbar == SCROLLBAR_RIGHT ? margin : 0;
rb->gui_scrollbar_draw(display, x, 0,
info->scrollbar_vp.width - margin, info->scrollbar_vp.height,
info->line_count, info->line, info->line + max_show, VERTICAL);
rb->gui_scrollbar_draw(display, (info->scrollbar_vp.width? 0: 1), 0,
info->scrollbar_vp.width - 1, info->scrollbar_vp.height,
info->line_count, info->line, info->line + max_show,
VERTICAL);
}
display->set_viewport(NULL);
if (!info->ui_update_cb)
display->update();
info->ui_update_cb = false;
display->update();
}
static void scroll_up(struct view_info *info, int n)
@ -268,22 +248,6 @@ static void scroll_to_bottom(struct view_info *info)
draw_text(info);
}
static void ui_update_cb(unsigned short id, void* param, void* user_data)
{
(void)id;
(void)param;
struct view_info *info = (struct view_info *) user_data;
info->ui_update_cb = true;
draw_text(info);
}
static void cleanup(void *parameter)
{
struct view_info *info = (struct view_info *) parameter;
rb->remove_event_ex(GUI_EVENT_NEED_UI_UPDATE, ui_update_cb, info);
rb->viewportmanager_theme_undo(SCREEN_MAIN, false);
}
int view_text(const char *title, const char *text)
{
struct view_info info;
@ -292,24 +256,13 @@ int view_text(const char *title, const char *text)
};
int button;
info.sbs_has_title = rb->sb_set_persistent_title(title, Icon_NOICON, SCREEN_MAIN);
rb->viewportmanager_theme_enable(SCREEN_MAIN, true, &info.vp);
init_view(&info, title, text);
/* handle themes that draw over the UI viewport */
rb->add_event_ex(GUI_EVENT_NEED_UI_UPDATE, false, ui_update_cb, &info);
/* skin engine needs to render title and redraw screen */
if (info.sbs_has_title)
rb->send_event(GUI_EVENT_ACTIONUPDATE, (void*)1);
else
draw_text(&info);
draw_text(&info);
/* wait for keypress */
while(1)
{
/* don't block, so the skin engine can redraw */
button = pluginlib_getaction(HZ/4, view_contexts,
button = pluginlib_getaction(TIMEOUT_BLOCK, view_contexts,
ARRAYLEN(view_contexts));
switch (button)
{
@ -317,7 +270,7 @@ int view_text(const char *title, const char *text)
#if (CONFIG_KEYPAD == IPOD_1G2G_PAD) \
|| (CONFIG_KEYPAD == IPOD_3G_PAD) \
|| (CONFIG_KEYPAD == IPOD_4G_PAD)
goto out;
return PLUGIN_OK;
#endif
case PLA_UP_REPEAT:
#ifdef HAVE_SCROLLWHEEL
@ -338,7 +291,7 @@ int view_text(const char *title, const char *text)
#if (CONFIG_KEYPAD == IPOD_1G2G_PAD) \
|| (CONFIG_KEYPAD == IPOD_3G_PAD) \
|| (CONFIG_KEYPAD == IPOD_4G_PAD)
goto out;
return PLUGIN_OK;
#endif
scroll_up(&info, info.display_lines);
break;
@ -354,14 +307,13 @@ int view_text(const char *title, const char *text)
case PLA_SELECT:
case PLA_EXIT:
case PLA_CANCEL:
goto out;
return PLUGIN_OK;
default:
if ((rb->default_event_handler_ex(button, cleanup,
&info) == SYS_USB_CONNECTED))
if (rb->default_event_handler(button) == SYS_USB_CONNECTED)
return PLUGIN_USB_CONNECTED;
break;
}
}
out:
cleanup(&info);
return PLUGIN_OK;
}

View file

@ -51,10 +51,6 @@ int splash_scroller(int timeout, const char* str);
#define floor lfloor
#define pow lpow
/* Just in case */
#undef memchr
#undef strstr
/* Simple substitutions */
#define malloc tlsf_malloc
#define realloc tlsf_realloc

View file

@ -349,7 +349,7 @@ static struct rocklua_image* rli_checktype(lua_State *L, int arg)
} /* rli_checktype */
static struct rocklua_image * alloc_rlimage(lua_State *L, bool alloc_data,
int width, int height, size_t *allocd)
int width, int height)
{
/* rliimage is pushed on the stack it is up to you to pop it */
struct rocklua_image *img;
@ -365,24 +365,10 @@ static struct rocklua_image * alloc_rlimage(lua_State *L, bool alloc_data,
n_elems = (size_t)(w_native * h_native);
if(alloc_data)
{/* if this a new image we need space for image data */
/* need even rows (see lcd-16bit-common.c for details) */
sz_data = BM_SIZE(width,height,FORMAT_NATIVE,false);
#if LCD_DEPTH > 24 /* account for possible 4bit alpha per pixel */
sz_data += ALIGN_UP(width, 2) * height / 2;
#endif
if(alloc_data) /* if this a new image we need space for image data */
sz_data = n_elems * sizeof(fb_data);
#if (LCD_DEPTH > 1) && defined(HAVE_BMP_SCALING)
if (width > BM_MAX_WIDTH)
sz_data += width*4;
#endif
sz_data = MAX(n_elems * sizeof(fb_data), sz_data);
}
if (allocd)
*allocd = sz_data;
/* newuserdata pushes the userdata onto the stack */
/*DEBUGF("rli alloc %d\n", sz_header + sz_data);*/
img = (struct rocklua_image *) lua_newuserdata(L, sz_header + sz_data);
luaL_getmetatable(L, ROCKLUA_IMAGE);
@ -400,15 +386,15 @@ static struct rocklua_image * alloc_rlimage(lua_State *L, bool alloc_data,
static inline void rli_wrap(lua_State *L, fb_data *src, int width, int height)
{
/* rliimage is pushed on the stack it is up to you to pop it */
struct rocklua_image *a = alloc_rlimage(L, false, width, height, NULL);
struct rocklua_image *a = alloc_rlimage(L, false, width, height);
a->data = src;
} /* rli_wrap */
static inline fb_data* rli_alloc(lua_State *L, int width, int height, size_t *allocd)
static inline fb_data* rli_alloc(lua_State *L, int width, int height)
{
/* rliimage is pushed on the stack it is up to you to pop it */
struct rocklua_image *a = alloc_rlimage(L, true, width, height, allocd);
struct rocklua_image *a = alloc_rlimage(L, true, width, height);
a->data = &a->dummy[0][0]; /* ref to beginning of alloc'd img data */
@ -1009,7 +995,7 @@ RLI_LUA rli_new(lua_State *L)
luaL_argcheck(L, width > 0 && height > 0, (width <= 0) ? 1 : 2, ERR_IDX_RANGE);
rli_alloc(L, width, height, NULL);
rli_alloc(L, width, height);
return 1;
}
@ -1918,13 +1904,10 @@ RB_WRAP(read_bmp_file)
int result = rb->read_bmp_file(filename, &bm, 0, format | FORMAT_RETURN_SIZE, NULL);
/*DEBUGF("read_bmp wants %d %d\n", result, BM_SIZE(bm.width, bm.height, format, false));*/
if(result > 0)
{
size_t sz_data;
bm.data = (unsigned char*) rli_alloc(L, bm.width, bm.height, &sz_data);
if(rb->read_bmp_file(filename, &bm, sz_data, format, NULL) < 0)
bm.data = (unsigned char*) rli_alloc(L, bm.width, bm.height);
if(rb->read_bmp_file(filename, &bm, result, format, NULL) < 0)
{
/* Error occured, drop newly allocated image from stack */
lua_pop(L, 1);

View file

@ -274,11 +274,11 @@ function bounce_image(img)
if IS_COLOR_TARGET then
if bit.band(loops, 128) == 128 then
_lcd:copy(imgn, x, y, 1, 1, -fx, -fy, false, _blit.BOR)
_lcd:copy(imgn, x, y, 1, 1, fx, fy, false, _blit.BOR)
_lcd:copy(screen_img, x, y, x, y, imgn:width(), imgn:height(),
false, _blit.BDEQC, imgn:get(1,1))
else
_lcd:copy(imgn, x, y, 1, 1, -fx, -fy, false, _blit.BSNEC, imgn:get(1,1))
_lcd:copy(imgn, x, y, 1, 1, fx, fy, false, _blit.BSNEC, imgn:get(1,1))
end
else
local blitop
@ -289,7 +289,7 @@ function bounce_image(img)
blitop = _blit.BXOR
end
_lcd:copy(imgn, x, y, 1, 1, -fx, -fy, false, blitop, WHITE)
_lcd:copy(imgn, x, y, 1, 1, fx, fy, false, blitop, WHITE)
end
if hold < 1 then
@ -674,7 +674,6 @@ end -- rotate_image
function flip_image(img)
local blitop = _blit.BOR
local i = 1
local d = 0
local x, y, w, h
@ -690,7 +689,7 @@ function flip_image(img)
--[[--Profiling code
local timer = _timer.start()]]
while d >= 0 and img do
while d >= 0 do
-- copy our flipped image onto the background
if d == 0 then
_lcd:copy(img, x, y, 1, 1, w, h, false, blitop)
@ -758,7 +757,7 @@ end -- draw_x
function random_img(img)
local min = _clr.set(0, 0, 0, 0)
local max = _clr.set(-1, 255, 255, 255)
--math.randomseed(rb.current_tick())
math.randomseed(rb.current_tick())
for x = 1, img:width() do
for y = 1, img:height() do
img:set(x, y, math.random(min, max))
@ -897,13 +896,9 @@ function main_menu()
[10] = long_text,
[11] = function(RAINB)
rainbow_img(_lcd()); _lcd:update(); rb.sleep(rb.HZ)
if rb.file_exists == nil or not rb.file_exists("/rainbow.bmp") then
_img_save(_LCD, "/rainbow.bmp")
end
end,
[12] = function(RANDM)
random_img(_lcd()); _lcd:update(); rb.sleep(rb.HZ)
_img_save(_LCD, "/random.bmp")
end,
[13] = function(CLEAR) _lcd:clear(BLACK); rock_lua() end,
[14] = function(SAVEI) _LCD:invert(); _img_save(_LCD, "/rocklua.bmp") end,
@ -932,8 +927,6 @@ _timer("main") -- keep track of how long the program ran
-- Clear the screen
_lcd:clear(BLACK)
math.randomseed(rb.current_tick())
if LCD_DEPTH > 1 then
--draw a gradient using available colors
if IS_COLOR_TARGET == true then

View file

@ -787,6 +787,7 @@ static bool beating = false; /* A beat is/was playing and count needs to increas
static int display_state = 0; /* Current display state code. */
static bool display_trigger = false; /* Draw display on next occasion */
static bool sound_active = false;
static bool sound_paused = true;
/* global static buffer for messages in any situation */
@ -1167,7 +1168,7 @@ static void timer_callback(void)
if(minitick >= period)
{
minitick = 0;
if(!sound_paused && !tap_count)
if(!sound_active && !sound_paused && !tap_count)
{
sound_trigger = true;
rb->reset_poweroff_timer();
@ -1212,7 +1213,6 @@ static void cleanup(void)
if(fd >= 0) rb->close(fd);
metronome_pause();
rb->pcmbuf_fade(false, false); /* Mute channel */
rb->mixer_channel_stop(PCM_MIXER_CHAN_PLAYBACK);
tweak_volume(0);
rb->led(0);
@ -1561,7 +1561,6 @@ enum plugin_status plugin_start(const void* file)
rb->audio_set_output_source(AUDIO_SRC_PLAYBACK);
#endif
rb->mixer_set_frequency(SAMPR_44);
rb->pcmbuf_fade(false, true); /* Be sure channel is audible */
if(file)
{

View file

@ -8,7 +8,7 @@ libmpeg2/slice.c
libmpeg2/idct_coldfire.S
libmpeg2/motion_comp_coldfire_c.c
libmpeg2/motion_comp_coldfire_s.S
#elif defined CPU_ARM_CLASSIC
#elif defined CPU_ARM
#if ARM_ARCH >= 6
libmpeg2/idct_armv6.S
#else

View file

@ -33,7 +33,7 @@
#include "attributes.h"
#include "mpeg2_internal.h"
#if defined(CPU_COLDFIRE) || defined (CPU_ARM_CLASSIC)
#if defined(CPU_COLDFIRE) || defined (CPU_ARM)
#define IDCT_ASM
#endif

View file

@ -31,14 +31,6 @@
* with the parameters previously supplied
*/
#if defined(DEBUG) || defined(SIMULATOR)
#define logf(...) rb->debugf(__VA_ARGS__); rb->debugf("\n")
#elif defined(ROCKBOX_HAS_LOGF)
#define logf rb->logf
#else
#define logf(...) do { } while(0)
#endif
#include "plugin.h"
#include "lang_enum.h"
#include "../open_plugin.h"
@ -54,77 +46,16 @@
#define MENU_ID_MAIN "0"
#define MENU_ID_EDIT "1"
#define MAX_ENTRIES 128
static int fd_dat = -1;
static int fd_dat;
static struct gui_synclist lists;
static struct open_plugin_entry_t op_entry;
struct open_plugin_entry_t op_entry;
static const uint32_t open_plugin_csum = OPEN_PLUGIN_CHECKSUM;
static const off_t op_entry_sz = sizeof(struct open_plugin_entry_t);
/* we only need the names for the first menu so don't bother reading paths yet */
const off_t op_name_sz = OPEN_PLUGIN_NAMESZ + (op_entry.name - (char*)&op_entry);
/*static char op_names[MAX_ENTRIES][OPEN_PLUGIN_NAMESZ + 1] = {0};*/
/* Forward declarations*/
static uint32_t op_entry_add_path(const char *key, const char *plugin, const char *parameter, bool use_key);
static int import_from_config(const char* cfgfile);
static int export_to_config(const char* cfgfile);
static bool hash_exists(uint32_t hash, bool remove)
{
/* keeps track of hash entries
* supply hash = 0, remove = true to erase all entries
* supply hash = 0, remove = false; returns true if empty entries are available
* supply a hash, remove = false; returns false if the hash does not exist & adds hash to the db
* supply a hash, remove = true; returns true and removes the hash from the db
* returns false if hash is unique
*/
static uint32_t seen_hashes[MAX_ENTRIES] = {0};
int i;
if (hash == 0)
{
if (remove)
{
logf("removing all hashes");
for(i = 0; i < MAX_ENTRIES; i++)
seen_hashes[i] = 0;
}
return seen_hashes[MAX_ENTRIES - 1] == 0; /* true if empty entries exist */
}
for(i = 0; i < MAX_ENTRIES; i++)
{
uint32_t current_hash = seen_hashes[i];
if (current_hash == 0 && !remove)
{
logf("(%d) added new hash: %x", i, hash);
seen_hashes[i] = hash;
break;
}
if (current_hash == hash)
{
if (remove)
{
logf("(%d) remove hash: %x", i, hash);
for (int j = i + 1; j < MAX_ENTRIES; j++, i++)
{
/* move everything above down 1*/
uint32_t next_hash = seen_hashes[j];
seen_hashes[i] = next_hash;
if (next_hash == 0)
break;
}
if (i + 1 == MAX_ENTRIES) /* handle last entry */
{
seen_hashes[i] = 0;
}
}
return true;
}
}
return false; /* hash is unique */
}
static bool _yesno_pop(const char* text)
{
@ -156,7 +87,6 @@ static size_t pathbasename(const char *name, const char **nameptr)
*nameptr = q;
return r - q;
}
static int op_entry_checksum(void)
{
if (op_entry.checksum != open_plugin_csum +
@ -204,36 +134,7 @@ static int op_entry_read_opx(const char *path)
return ret;
}
static void op_entry_config_export(void)
{
int i = 0;
int len;
char buf[MAX_PATH + 1];
do
{
i++;
rb->snprintf(buf, sizeof(buf), "%s/%s%d%s", ROCKBOX_DIR, "open_plugins", i, ".cfg");
} while (i < 100 && rb->file_exists(buf));
if( rb->kbd_input(buf, MAX_PATH, NULL ) == 0 )
{
len = rb->strlen(buf);
if(len > 4 && buf[len] != PATH_SEPCH &&
rb->strcasecmp(&((buf)[len-4]), ".cfg") != 0)
{
rb->strcat(buf, ".cfg");
}
if (export_to_config(buf) > 0)
return;
}
rb->splashf( 2*HZ, "Save Failed (%s)", buf );
}
static void op_entry_export_opx(int selection)
static void op_entry_export(int selection)
{
int len;
int fd = -1;
@ -356,43 +257,19 @@ static void op_entry_set_param(void)
rb->strlcpy(op_entry.param, tmp_buf, OPEN_PLUGIN_BUFSZ);
}
static int op_et_exclude_invalid(struct open_plugin_entry_t *op_entry, int item, void *data)
{
(void)item;
(void)data;
if (op_entry->hash == 0 || op_entry->name[0] == '\0')
{
logf("Exclude entry %d - Bad hash", item);
return 0;
}
if (op_entry->checksum != open_plugin_csum +
(op_entry->lang_id <= OPEN_PLUGIN_LANG_INVALID ? 0 : LANG_LAST_INDEX_IN_ARRAY))
{
logf("Exclude entry %d - Bad csum", item);
return 0;
}
if (!rb->file_exists(op_entry->path))
{
logf("Exclude entry %d - Bad path '%s'", item, op_entry->path);
return 0;
}
logf("%s Include entry %d %s - hash %x", __func__, item,
(op_entry->lang_id >= 0 ? "[Builtin]" : "[User]"), op_entry->hash);
return 1;
}
static int op_et_exclude_hash(struct open_plugin_entry_t *op_entry, int item, void *data)
{
(void)item;
if (op_entry->hash == 0 || op_entry->name[0] == '\0')
return 0;
if (data)
{
uint32_t *hash = data;
if (op_entry->hash != *hash)
return op_et_exclude_invalid(op_entry, item, data);
return 1;
}
logf("Exclude entry %d - hash %x", item, op_entry->hash);
return 0;
}
@ -402,12 +279,11 @@ static int op_et_exclude_builtin(struct open_plugin_entry_t *op_entry, int item,
(void)data;
if (op_entry->lang_id >= 0)
{
logf("Exclude entry %d - Builtin", item);
return 0;
}
else if(op_entry->hash == 0 || op_entry->name[0] == '\0')
return 0;
return op_et_exclude_invalid(op_entry, item, data);
return 1;
}
static int op_et_exclude_user(struct open_plugin_entry_t *op_entry, int item, void *data)
@ -416,11 +292,11 @@ static int op_et_exclude_user(struct open_plugin_entry_t *op_entry, int item, vo
(void)data;
if (op_entry->lang_id < 0)
{
logf("Exclude entry %d - User", item);
return 0;
}
return op_et_exclude_invalid(op_entry, item, data);
else if (op_entry->hash == 0 || op_entry->name[0] == '\0')
return 0;
return 1;
}
static int op_entry_transfer(int fd, int fd_tmp,
@ -428,82 +304,21 @@ static int op_entry_transfer(int fd, int fd_tmp,
void *data)
{
int entries = -1;
int skipped = 0;
if (fd_tmp >= 0 && fd >= 0 && rb->lseek(fd, 0, SEEK_SET) == 0)
{
entries = 0;
while (rb->read(fd, &op_entry, op_entry_sz) == op_entry_sz)
{
if (compfn && compfn(&op_entry, entries + skipped, data) > 0 && op_entry_checksum() > 0)
if (compfn && compfn(&op_entry, entries, data) > 0 && op_entry_checksum() > 0)
{
rb->write(fd_tmp, &op_entry, op_entry_sz);
entries++;
}
else
skipped++;
}
logf("%s %d entries %d skipped", __func__, entries, skipped);
}
else
{
logf("%s Error: fd %d, fd_tmp %d, seekfd: %d", __func__,
fd, fd_tmp, (int) rb->lseek(fd, 0, SEEK_SET));
}
return entries + 1;
}
#if 0
static int op_entry_exists(int fd)
{
logf("%s? %s - %s", __func__, op_entry.name, op_entry.path);
/* returns index of the entry that already exists if not found returns -1 */
static struct open_plugin_entry_t op_entry_rd;
int entries = 0;
if (fd >= 0 && rb->lseek(fd, 0, SEEK_SET) == 0)
{
while (rb->read(fd, &op_entry_rd, op_entry_sz) == op_entry_sz)
{
logf("rd: %s - %s", op_entry_rd.name, op_entry_rd.path);
if (rb->memcmp(&op_entry_rd, &op_entry, op_entry_sz) == 0)
{
logf("%s entry exists @ %d", op_entry_rd.name, entries);
return entries;
}
entries++;
}
}
logf("%s is unique in %d entries", op_entry.name, entries);
return -1;
}
#endif
static bool browse_configs(void)
{
int entries = 0;
char tmp_buf[MAX_PATH+1];
struct browse_context browse = {
.dirfilter = SHOW_CFG,
.flags = BROWSE_SELECTONLY | BROWSE_DIRFILTER,
.title = rb->str(LANG_CUSTOM_CFG),
.icon = Icon_Plugin,
.root = ROCKBOX_DIR,
.buf = tmp_buf,
.bufsize = sizeof(tmp_buf),
};
if (rb->rockbox_browse(&browse) == GO_TO_PREVIOUS)
{
logf("import from %s\n", tmp_buf);
if(rb->filetype_get_attr(tmp_buf) == FILE_ATTR_CFG)
{
entries = import_from_config(tmp_buf);
rb->splashf(HZ *2, "Imported %d entries", entries);
}
}
return (entries > 0);
}
static uint32_t op_entry_add_path(const char *key, const char *plugin, const char *parameter, bool use_key)
{
char buf[MAX_PATH];
@ -543,6 +358,8 @@ static uint32_t op_entry_add_path(const char *key, const char *plugin, const cha
if (op_entry.name[0] == '\0' || op_entry.lang_id >= 0)
rb->strlcpy(op_entry.name, pos, OPEN_PLUGIN_NAMESZ);
if ((!parameter || parameter[0] == '\0') && fattr != FILE_ATTR_ROCK && fattr != FILE_ATTR_OPX)
{
rb->strlcpy(op_entry.param, plugin, OPEN_PLUGIN_BUFSZ);
@ -579,28 +396,16 @@ static uint32_t op_entry_add_path(const char *key, const char *plugin, const cha
}
else if (parameter != op_entry.param)
rb->strlcpy(op_entry.param, parameter, OPEN_PLUGIN_BUFSZ);
}
/* hash on the parameter path if it is a file */
if (op_entry.lang_id <0 && (key == op_entry.path || key == NULL) &&
rb->file_exists(op_entry.param))
{
open_plugin_get_hash(op_entry.param, &newhash);
op_entry.hash = newhash;
}
}
op_entry_set_checksum();
if (!use_key)
{
if (op_entry.lang_id <0)
{
open_plugin_get_hash(op_entry.name, &hash);
op_entry.hash = hash;
}
if (hash_exists(op_entry.hash, false) &&
_yesno_pop(ID2P(LANG_REALLY_OVERWRITE)) == false)
{
logf("%s error: duplicate key exists: '%s' lang id: %d hash: %x",
__func__, key, op_entry.lang_id, op_entry.hash);
rb->close(fd_tmp);
rb->remove(OPEN_PLUGIN_DAT ".tmp");
return op_entry.hash;
}
}
rb->write(fd_tmp, &op_entry, op_entry_sz); /* add new entry first */
}
else if(op_entry_read_opx(plugin) == op_entry_sz)
@ -609,23 +414,13 @@ static uint32_t op_entry_add_path(const char *key, const char *plugin, const cha
if (fd_tmp < 0)
return 0;
if (op_entry.lang_id <0)
{
open_plugin_get_hash(op_entry.name, &hash);
}
if (op_entry.lang_id <0 && rb->file_exists(op_entry.param))
open_plugin_get_hash(op_entry.param, &hash);
else
open_plugin_get_hash(op_entry.path, &hash);
op_entry.hash = hash;
op_entry_set_checksum();
if (hash_exists(op_entry.hash, false))
{
logf("%s error: duplicate key exists: '%s' lang id: %d hash: %x",
__func__, key, op_entry.lang_id, op_entry.hash);
rb->close(fd_tmp);
rb->remove(OPEN_PLUGIN_DAT ".tmp");
return op_entry.hash;
}
rb->write(fd_tmp, &op_entry, op_entry_sz); /* add new entry first */
}
else
@ -636,7 +431,6 @@ static uint32_t op_entry_add_path(const char *key, const char *plugin, const cha
}
}
/*logf("OP add key: '%s' lang id: %d hash: %x", op_entry.name, op_entry.lang_id, op_entry.hash);*/
if (op_entry_transfer(fd_dat, fd_tmp, op_et_exclude_hash, &hash) > 0)
{
rb->close(fd_tmp);
@ -657,7 +451,6 @@ static uint32_t op_entry_add_path(const char *key, const char *plugin, const cha
void op_entry_browse_add(int selection)
{
logf("%s", __func__);
char* key;
op_entry_read(fd_dat, selection, op_entry_sz);
if (op_entry_set_path() > 0)
@ -673,6 +466,7 @@ void op_entry_browse_add(int selection)
static void op_entry_remove(int selection)
{
int entries = rb->lseek(fd_dat, 0, SEEK_END) / op_entry_sz;
int32_t hash = 0;
int lang_id = -1;
@ -692,7 +486,6 @@ static void op_entry_remove(int selection)
rb->global_settings->start_in_screen = GO_TO_ROOT + 2; /* default */
}
}
hash_exists(op_entry.hash, true);
rb->memset(&op_entry, 0, op_entry_sz);
op_entry.lang_id = lang_id;
op_entry.hash = hash;
@ -892,9 +685,9 @@ static int context_menu_cb(int action,
/*Run, Edit, Remove, Export, Blank, Import, Add, Back*/
switch(selection)
{
case 0:case 1:case 2:case 3:case 4:case 5:case 7:
case 0:case 1:case 2:case 3:case 5:
return ACTION_STD_OK;
case 6: /*blank*/
case 4: /*blank*/
break;
default:
return ACTION_STD_CANCEL;
@ -916,9 +709,6 @@ static void edit_menu(int selection)
if (!op_entry_read(fd_dat, selection, op_entry_sz))
return;
if (op_entry.hash != 0) /* remove old hash */
hash_exists(op_entry.hash, true);
uint32_t crc = rb->crc_32(&op_entry, op_entry_sz, 0xffffffff);
synclist_set(MENU_ID_EDIT, 2, 8, 2);
@ -972,8 +762,6 @@ static void edit_menu(int selection)
op_entry_add_path(NULL, op_entry.path, param, false);
fd_dat = rb->open(OPEN_PLUGIN_DAT, O_RDWR, 0666);
}
else
hash_exists(op_entry.hash, false);
}
static int context_menu(int selection)
@ -983,11 +771,9 @@ static int context_menu(int selection)
{
MENUITEM_STRINGLIST(menu, op_entry.name, context_menu_cb,
ID2P(LANG_RUN), ID2P(LANG_EDIT), ID2P(LANG_REMOVE), ID2P(LANG_EXPORT),
ID2P(LANG_SAVE_SETTINGS), ID2P(LANG_CUSTOM_CFG), ID2P(VOICE_BLANK),
ID2P(LANG_ADD), ID2P(LANG_BACK));
ID2P(VOICE_BLANK), ID2P(LANG_ADD), ID2P(LANG_BACK));
selected_item = rb->do_menu(&menu, 0, NULL, false);
logf("%s %d", __func__, selected_item);
switch (selected_item)
{
case 0: /*run*/
@ -999,20 +785,11 @@ static int context_menu(int selection)
op_entry_remove(selection);
break;
case 3: /*export*/
op_entry_export_opx(selection);
op_entry_export(selection);
break;
case 4: /* export to cfg */
op_entry_config_export();
case 5: /*import from cfg*/
if (browse_configs())
{
rb->plugin_open(rb->plugin_get_current_filename(), "\0");
return OP_PLUGIN_RESTART;
}
case 4: /*blank*/
break;
case 6: /*blank*/
break;
case 7: /*add*/
case 5: /*add*/
op_entry_browse_add(-1);
rb->plugin_open(rb->plugin_get_current_filename(), "\0");
return OP_PLUGIN_RESTART;
@ -1025,296 +802,6 @@ static int context_menu(int selection)
return PLUGIN_ERROR;
}
/* Read up to buffer_size chars from a quoted string
* within fd into buffer and return number of bytes read.
* A string starts with a quote character (single or double quote)
* and ends with a matching closing quote. Neither opening or closing quotes
* are stored in buffer. Too small buf or no opening and closing quote is an error.
* If an error occurs, -1 is returned (and buffer is cleared).
* If buffer too small file will still be advanced to the closing quote/LF/EOF
*/
static int read_quoted_string(int fd, char* buffer, int buffer_size)
{
int pos = 0;
char ch;
char quote = '\0';
/*logf("%s fd: %d bufsz: %d", __func__, fd, buffer_size);*/
while (rb->read(fd, &ch, 1) == 1)
{
if (ch == '\n') /*LF marks end of line*/
{
rb->lseek(fd, -1, SEEK_CUR);/*back up cursor to LF so calling fn sees it*/
break; /* fail */
}
if (quote == '\0' &&
(ch == '\'' || ch == '"')) /*handle single or double quotes*/
{
quote = ch;
}
else if (quote != '\0')
{
if (ch == quote)
{
if (pos < buffer_size)
{
buffer[pos] = '\0'; /*end quote*/
return pos + 1;
}
break; /*fail*/
}
if (pos < buffer_size)
{
buffer[pos] = ch; /*inside quote*/
pos++;
}
}
}
/*fail*/
/*logf("Error %s", __func__);*/
buffer[0] = '\0';
return -1;
}
static int lang_english_to_id(const char *english)
{
int i;
unsigned char *ptr;
size_t ptrlen, len = rb->strlen(english);
for (i = 0; i < LANG_LAST_INDEX_IN_ARRAY; i++) {
ptr = rb->language_strings[i];
ptrlen = rb->strlen((char *)ptr);
if ((ptrlen == len) && rb->memcmp(ptr, english, ptrlen) == 0)
return i;
}
return -1;
}
static bool op_entry_config_import(int cfg_fd, int fd_tmp)
{
/* NOTE: assumes cfg_fd is valid */
/*"key", "name", "path", "param"*/
/*"Start Screen", "logo.rock", "/.rockbox/rocks/demos/logo.rock", ""*/
/*"[USER]", "text_viewer.rock", "/.rockbox/rocks/viewers/text_viewer.rock", "/text.txt"*/
rb->memset(&op_entry, 0, op_entry_sz);
static char errmsg[MAX_PATH];
static char keybuf[MAX_PATH];
int32_t lang_id;
uint32_t hash;
if (read_quoted_string(cfg_fd, keybuf, sizeof(keybuf)) < 0)
{
logf("%s error: importing key entry @ %d", __func__, 0);
rb->snprintf(errmsg, sizeof(errmsg), "importing key entry @ %d", 1);
rb->splashf(HZ*2, ID2P(LANG_ERROR_FORMATSTR), errmsg);
return false; /* fail */
}
lang_id = lang_english_to_id(keybuf);
if (lang_id < 0)
{
int rd = read_quoted_string(cfg_fd, keybuf, sizeof(keybuf)); /* grab name field */
if(rd < 0)
{
logf("%s error: importing key entry @ %d", __func__, 1);
rb->snprintf(errmsg, sizeof(errmsg), "importing key entry @ %d", 1);
rb->splashf(HZ*2, ID2P(LANG_ERROR_FORMATSTR), errmsg);
return false; /* fail */
}
rb->lseek(cfg_fd, -(rd+2), SEEK_CUR); /* restore position to read name again */
}
int i, bufsz;
char *field[3] = {op_entry.name, op_entry.path, op_entry.param};
for (i = 0, bufsz = OPEN_PLUGIN_NAMESZ; i < (int)ARRAYLEN(field); i++)
{
if (read_quoted_string(cfg_fd, field[i], bufsz) < 0)
{
logf("%s error: importing entry @ %d", __func__, i);
logf("OP import key: '%s' name: '%s' '%s' '%s'", keybuf,
op_entry.name, op_entry.path, op_entry.param);
rb->memset(&op_entry, 0, op_entry_sz);
rb->snprintf(errmsg, sizeof(errmsg), "importing entry %s @ %d", keybuf, i);
rb->splashf(HZ*2, ID2P(LANG_ERROR_FORMATSTR), errmsg);
return false; /* fail */
}
bufsz = OPEN_PLUGIN_BUFSZ;
}
if (!rb->file_exists(op_entry.path))
{
logf("%s error: '%s' '%s' does not exist", __func__, keybuf, op_entry.path);
rb->splashf(HZ*2, ID2P(LANG_PLUGIN_CANT_OPEN), op_entry.path);
return false; /* fail */
}
if (lang_id <0)
{
open_plugin_get_hash(op_entry.name, &hash);
}
else
{
open_plugin_get_hash(keybuf, &hash);
}
op_entry.hash = hash;
op_entry.lang_id = lang_id;
/*logf("OP import key: '%s' name: '%s' '%s' '%s'", keybuf,
op_entry.name, op_entry.path, op_entry.param);*/
op_entry_set_checksum();
if (fd_tmp >= 0 && fd_dat >= 0)
{
if (hash_exists(op_entry.hash, false))
{
logf("%s error: duplicate key exists: '%s' lang id: %d hash: %x",
__func__, keybuf, lang_id, hash);
return false;
}
logf("writing to tmp: %s - %s", op_entry.name, op_entry.path);
if (rb->write(fd_tmp, &op_entry, op_entry_sz) != op_entry_sz)/* add new entry */
return false;
}
else
{
logf("%s error: bad fd dat: %d tmp: %d", __func__, fd_dat, fd_tmp);
return false;
}
return true;
}
static int import_from_config(const char* cfgfile)
{
logf("%s() %s\r\n", __func__, cfgfile);
int fd;
char ch;
int entries = 0;
static char line[sizeof("openplugin:")];
fd = rb->open_utf8(cfgfile, O_RDONLY);
if (fd < 0)
return -1;
int fd_tmp = rb->open(OPEN_PLUGIN_DAT ".tmp", O_WRONLY | O_CREAT | O_TRUNC, 0666);
if (fd_tmp < 0)
{
logf("%s error: can not open '%s'", __func__, OPEN_PLUGIN_DAT ".tmp");
return -1;
}
while ((rb->read(fd, line, sizeof line) - 1) == sizeof(line) - 1)
{
if (rb->strncasecmp(line, "openplugin:", sizeof("openplugin:") -1) == 0)
{
if (op_entry_config_import(fd, fd_tmp))
entries++;
}
while (rb->read(fd, &ch, 1) == 1) /* continue reading till EOL */
{
if (ch == '\n')
break;
}
} /* while(...) */
rb->close(fd);
#if 1
if (entries > 0 && op_entry_transfer(fd_dat, fd_tmp, &op_et_exclude_user, NULL) > 0 &&
op_entry_transfer(fd_dat, fd_tmp, &op_et_exclude_builtin, NULL) > 0)
#else
if (entries > 0 && op_entry_transfer(fd_dat, fd_tmp, op_et_exclude_invalid, 0) >= 0)
#endif
{
logf("%s imported %d entries", __func__, entries);
rb->close(fd_tmp);
rb->close(fd_dat);
fd_dat = -1;
rb->remove(OPEN_PLUGIN_DAT);
rb->rename(OPEN_PLUGIN_DAT ".tmp", OPEN_PLUGIN_DAT);
}
else
{
logf("%s error: can not transfer entries", __func__);
if (entries > 0)
{
logf("%s error: can not transfer entries to '%s'", __func__, OPEN_PLUGIN_DAT ".tmp");
entries = -1;
}
rb->close(fd_tmp);
rb->remove(OPEN_PLUGIN_DAT ".tmp");
}
return entries;
}
static int export_to_config(const char* cfgfile)
{
logf("%s() %s\r\n", __func__, cfgfile);
int cfg_fd;
char *lang_name;
int fd;
int index = 0;
cfg_fd = rb->open_utf8(cfgfile, O_WRONLY | O_CREAT | O_TRUNC);
if (cfg_fd < 0)
return index;
fd = rb->open_utf8(OPEN_PLUGIN_DAT, O_RDONLY);
if (fd < 0)
{
logf("%s error: opening %s", __func__, OPEN_PLUGIN_DAT);
rb->close(cfg_fd);
rb->remove(cfgfile);
return index; /* OPEN_PLUGIN_NOT_FOUND */
}
while (op_entry_read(fd, index, op_entry_sz))
{
index++;
/* don't save the LANG_OPEN_PLUGIN entry -- it is for internal use */
if (op_entry.lang_id == LANG_OPEN_PLUGIN)
{
continue;
}
if (op_entry.lang_id >=0)
lang_name = rb->str(op_entry.lang_id);
else
lang_name = "[USER]"; /* needs to be an invalid lang string */
bool dblquote = rb->strchr(op_entry.name, '"') != NULL ||
rb->strchr(op_entry.param, '"') != NULL;
const char* fmtstr = "%s: \"%s\", \"%s\", \"%s\", \"%s\"\n";
if (dblquote) /* if using double quotes export with single quotes */
{
fmtstr = "%s: '%s', '%s', '%s', '%s'\n";
}
rb->fdprintf(cfg_fd,fmtstr, OPEN_PLUGIN_CFGNAME,
lang_name, op_entry.name, op_entry.path, op_entry.param);
logf("openplugin[%d]: \"%s\", \"%s\", \"%s\", \"%s\"\n lang id: %d hash: %x, csum: %x\n",
index, lang_name, op_entry.name, op_entry.path, op_entry.param,
op_entry.lang_id, op_entry.hash, op_entry.checksum);
}
rb->close(fd);
rb->close(cfg_fd);
logf("%s exported %d entries", __func__, index);
if (index == 0)
{
/* Nothing to export */
rb->remove(cfgfile);
}
return index;
}
enum plugin_status plugin_start(const void* parameter)
{
int ret = PLUGIN_OK;
@ -1330,20 +817,11 @@ enum plugin_status plugin_start(const void* parameter)
const int creat_flags = O_RDWR | O_CREAT;
reopen_datfile:
fd_dat = rb->open(OPEN_PLUGIN_DAT, creat_flags, 0666);
hash_exists(0, true);
while (rb->read(fd_dat, &op_entry, op_entry_sz) == op_entry_sz)
{
hash_exists(op_entry.hash, false);
}
if (!fd_dat)
exit = true;
items = rb->lseek(fd_dat, 0, SEEK_END) / op_entry_sz;
if (parameter)
{
path = (char*)parameter;
@ -1355,18 +833,13 @@ reopen_datfile:
parameter = NULL;
op_entry_browse_add(-1);
rb->close(fd_dat);
fd_dat = -1;
goto reopen_datfile;
}
if(rb->filetype_get_attr(path) == FILE_ATTR_CFG)
{
int ret = import_from_config(path);
rb->close(fd_dat);
if (ret >= 0)
return PLUGIN_OK;
return PLUGIN_ERROR;
}
}
if (parameter)
{
path = (char*)parameter;
res = op_entry_read_opx(path);
if (res >= 0)
{
@ -1437,7 +910,6 @@ reopen_datfile:
if (op_entry_add_path(rb->str(LANG_ADD), cur_filename, "-add", true))
{
rb->close(fd_dat);
fd_dat = -1;
parameter = NULL;
goto reopen_datfile;
}
@ -1445,6 +917,8 @@ reopen_datfile:
return PLUGIN_ERROR;
}
if (!exit)
{
synclist_set(MENU_ID_MAIN, selection, items, 1);
@ -1473,7 +947,7 @@ reopen_datfile:
rb->gui_synclist_draw(&lists);
break;
}
/* fallthrough */
/* Inentional fallthrough */
case ACTION_STD_OK:
if (op_entry_read(fd_dat, selection, op_entry_sz))
{
@ -1488,14 +962,6 @@ reopen_datfile:
exit = true;
break;
}
default:
if (rb->default_event_handler(action) == SYS_USB_CONNECTED)
{
op_entry_remove_empty();
rb->close(fd_dat);
return PLUGIN_USB_CONNECTED;
}
break;
}
}
op_entry_remove_empty();

View file

@ -411,7 +411,6 @@ static void start_sound(void)
.get_more = get_more,
};
rb->mixer_set_frequency(caps->samprs[sr_index]);
rb->pcmbuf_fade(false, true); /* Be sure channel is audible */
rb->mixer_channel_play_data(PCM_MIXER_CHAN_PLAYBACK, &cbs, NULL, 0);
sound_playing = true;
@ -425,7 +424,6 @@ static void stop_sound(void)
if (!sound_playing)
return;
rb->pcmbuf_fade(false, false); /* Mute channel */
rb->mixer_channel_stop(PCM_MIXER_CHAN_PLAYBACK);
rb->mixer_set_frequency(HW_SAMPR_DEFAULT);

View file

@ -65,9 +65,6 @@ void rockbox_open_audio(int rate)
/* Set sample rate of the audio buffer. */
rb->mixer_set_frequency(rate);
/* Be sure channel is audible */
rb->pcmbuf_fade(false, true);
/* Initialize output buffer. */
for(i = 0; i < OUTBUFSIZE; i++)
outbuf[i].fill = 0;
@ -80,9 +77,6 @@ void rockbox_open_audio(int rate)
/* Close audio. */
void rockbox_close_audio(void)
{
/* Mute channel */
rb->pcmbuf_fade(false, false);
/* Stop playback. */
rb->mixer_channel_stop(PCM_MIXER_CHAN_PLAYBACK);

View file

@ -1106,9 +1106,9 @@ int gui_syncpitchscreen_run(void)
/* when needed */
new_speed = 0;
}
rb->yield();
}
//rb->pcmbuf_set_low_latency(false);
//pop_current_activity();
/* Clean up */
@ -1215,7 +1215,6 @@ enum plugin_status plugin_start(const void* parameter)
* -s=90 sets speed to 90% if timestrech is enabled
* -k=true -k1 enables time stretch -k0 -kf-kn disables
*/
enum plugin_status ret = PLUGIN_OK;
bool gui = false;
rb->pcmbuf_set_low_latency(true);
@ -1275,7 +1274,7 @@ enum plugin_status plugin_start(const void* parameter)
}
if (gui && gui_syncpitchscreen_run() == 1)
ret = PLUGIN_USB_CONNECTED;
return PLUGIN_USB_CONNECTED;
rb->pcmbuf_set_low_latency(false);
return ret;
return PLUGIN_OK;
}

View file

@ -187,8 +187,7 @@ static int browse_file_or_dir(struct dir_stats *stats)
continue;
switch(button)
{
case ACTION_STD_OK:
rb->gui_synclist_scroll_stop(&properties_lists);
case ACTION_STD_OK:;
int sel_pos = rb->gui_synclist_get_sel_pos(&properties_lists);
/* "Show Track Info..." selected? */
@ -198,10 +197,17 @@ static int browse_file_or_dir(struct dir_stats *stats)
return -1;
else
{
const unsigned char* const *props = (props_type == PROPS_DIR) ?
props_dir : props_file;
/* Display field in fullscreen */
view_text((char *) p2str(props[sel_pos]), props[sel_pos + 1]);
FOR_NB_SCREENS(i)
rb->viewportmanager_theme_enable(i, false, NULL);
if (props_type == PROPS_DIR)
view_text((char *) p2str(props_dir[sel_pos]),
(char *) props_dir[sel_pos + 1]);
else
view_text((char *) p2str(props_file[sel_pos]),
(char *) props_file[sel_pos + 1]);
FOR_NB_SCREENS(i)
rb->viewportmanager_theme_undo(i, false);
rb->gui_synclist_set_title(&properties_lists,
rb->str(props_type == PROPS_DIR ?
@ -329,8 +335,6 @@ enum plugin_status plugin_start(const void* parameter)
{
static struct dir_stats stats;
const char *file = parameter;
static struct viewport ui_vp;
#ifdef HAVE_TOUCHSCREEN
rb->touchscreen_set_mode(rb->global_settings->touch_mode);
#endif
@ -342,17 +346,6 @@ enum plugin_status plugin_start(const void* parameter)
return PLUGIN_OK;
}
/* erase background behind progress bar to prevent glitches
for themes adjusting viewport for context menu activity */
if (props_type != PROPS_DIR)
{
struct screen* display = rb->screens[SCREEN_MAIN];
rb->viewport_set_defaults(&ui_vp, SCREEN_MAIN);
struct viewport *last_vp = display->set_viewport(&ui_vp);
display->clear_viewport();
display->set_viewport(last_vp);
}
if (props_type == PROPS_MUL_ID3)
ret = assemble_track_info(NULL, NULL);
else if (props_type != PROPS_ID3)

View file

@ -3066,7 +3066,6 @@ static void tune_input(const char *name)
"Signpost",
"Slide",
"Untangle",
NULL
};
input_settings.sticky_mouse = string_in_list(name, sticky_mouse_games);

View file

@ -56,14 +56,12 @@ void rockboy_pcm_init(void)
#endif
rb->mixer_set_frequency(pcm.hz); /* 44100 22050 11025 */
rb->pcmbuf_fade(false, true); /* Be sure channel is audible */
}
void rockboy_pcm_close(void)
{
memset(&pcm, 0, sizeof pcm);
newly_started = true;
rb->pcmbuf_fade(false, false); /* Mute channel */
rb->mixer_channel_stop(PCM_MIXER_CHAN_PLAYBACK);
rb->mixer_set_frequency(HW_SAMPR_DEFAULT);
}

View file

@ -19,7 +19,7 @@ ifeq ($(findstring YES, $(call preprocess, $(APPSDIR)/plugins/BUILD_OVERLAY)), Y
## lowmem targets
ROCKS += $(ROCKBOY_OBJDIR)/rockboy.ovl
ROCKBOY_OUTLDS = $(ROCKBOY_OBJDIR)/rockboy.link
ROCKBOY_OVLFLAGS = -T$(ROCKBOY_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(basename $@).map $(GLOBAL_LDOPTS)
ROCKBOY_OVLFLAGS = -T$(ROCKBOY_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(basename $@).map
else
ROCKS += $(ROCKBOY_OBJDIR)/rockboy.rock
endif

View file

@ -286,7 +286,7 @@ static SDL_RWops *LoadWAVStream (SDL_RWops *src, SDL_AudioSpec *spec,
/* WAV magic header */
Uint32 RIFFchunk;
Uint32 wavelen;
// Uint32 wavelen;
Uint32 WAVEmagic;
/* FMT chunk */
@ -296,12 +296,8 @@ static SDL_RWops *LoadWAVStream (SDL_RWops *src, SDL_AudioSpec *spec,
/* Check the magic header */
RIFFchunk = SDL_ReadLE32(src);
wavelen = SDL_ReadLE32(src);
// wavelen = SDL_ReadLE32(src);
WAVEmagic = SDL_ReadLE32(src);
/* Unused */
(void)wavelen;
if ( (RIFFchunk != RIFF) || (WAVEmagic != WAVE) ) {
Mix_SetError("Unrecognized file type (not WAVE)");
was_error = 1;

View file

@ -548,7 +548,7 @@ void Draw_ConsoleBackground (int lines)
conback = Draw_CachePic ("gfx/conback.lmp");
dest = conback->data + 320 - 43 + 320*186;
snprintf (ver, sizeof(ver), "%.2f", (float)VERSION);
sprintf (ver, "%.2f", (float)VERSION);
for (x=0 ; x<strlen(ver) ; x++)
Draw_CharToConback (ver[x], dest+(x<<3));

View file

@ -78,7 +78,7 @@ $(SDL_OBJDIR)/duke3d.ovl: $(SDL_OBJ) $(DUKE3D_OBJ) $(TLSFLIB) $(DUKE3D_OUTLDS)
$(filter %.o, $^) \
$(filter %.a, $+) \
-lgcc -T$(DUKE3D_OUTLDS) $(SDL_OVLFLAGS)
$(call PRINTS,LD $(@F))$(call objcopy_plugin,$(basename $@).elf,$@)
$(call PRINTS,LD $(@F))$(call objcopy,$(basename $@).elf,$@)
# Wolf3D

View file

@ -215,7 +215,6 @@ static Uint8 *ROCKBOXAUD_GetAudioBuf(_THIS)
static void ROCKBOXAUD_CloseAudio(_THIS)
{
rb->pcmbuf_fade(false, false); /* Mute channel */
rb->mixer_channel_stop(PCM_MIXER_CHAN_PLAYBACK);
if ( this->hidden->mixbuf != NULL ) {
SDL_FreeAudioMem(this->hidden->mixbuf);
@ -261,7 +260,6 @@ static int ROCKBOXAUD_OpenAudio(_THIS, SDL_AudioSpec *spec)
LOGF("samplerate %d", spec->freq);
rb->mixer_set_frequency(spec->freq);
rb->pcmbuf_fade(false, true); /* Be sure channel is audible */
/* Allocate mixing buffer */
this->hidden->mixlen = spec->size;

View file

@ -214,7 +214,6 @@ static void play_tone(bool volume_set)
#if INPUT_SRC_CAPS != 0
/* Select playback */
rb->audio_set_input_source(AUDIO_SRC_PLAYBACK, SRCF_PLAYBACK);
rb->audio_set_output_source(AUDIO_SRC_PLAYBACK);
#endif
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
@ -222,7 +221,11 @@ static void play_tone(bool volume_set)
#endif
rb->mixer_set_frequency(hw_sampr);
rb->pcmbuf_fade(false, true); /* Be sure channel is audible */
#if INPUT_SRC_CAPS != 0
/* Recordable targets can play back from other sources */
rb->audio_set_output_source(AUDIO_SRC_PLAYBACK);
#endif
gen_quit = false;
output_clear();
@ -260,7 +263,6 @@ static void play_tone(bool volume_set)
rb->thread_wait(gen_thread_id);
rb->pcmbuf_fade(false, false); /* Mute channel */
rb->mixer_channel_stop(PCM_MIXER_CHAN_PLAYBACK);
#ifdef HAVE_ADJUSTABLE_CPU_FREQ

View file

@ -257,9 +257,6 @@ bool syssnd_init(void)
rb->mixer_set_frequency(HW_FREQ_44);
/* Be sure channel is audible */
rb->pcmbuf_fade(false, true);
rb->memset(channels, 0, sizeof(channels));
rb->memset(mixBuffers, 0, sizeof(mixBuffers));
@ -283,9 +280,6 @@ void syssnd_shutdown(void)
return;
}
/* Mute channel */
rb->pcmbuf_fade(false, false);
/* Stop playback. */
rb->mixer_channel_stop(PCM_MIXER_CHAN_PLAYBACK);

View file

@ -1032,14 +1032,12 @@ void sys_startAudio(struct System* sys, AudioCallback callback, void *param)
static const struct mixer_play_cbs cbs = {
.get_more = get_more,
};
rb->pcmbuf_fade(false, true); /* Be sure channel is audible */
rb->mixer_channel_play_data(PCM_MIXER_CHAN_PLAYBACK, &cbs, NULL, 0);
}
void sys_stopAudio(struct System* sys)
{
(void) sys;
rb->pcmbuf_fade(false, false); /* Mute channel */
rb->mixer_channel_stop(PCM_MIXER_CHAN_PLAYBACK);
}

View file

@ -112,14 +112,12 @@ static void open_snd(void)
rb->audio_set_output_source(AUDIO_SRC_PLAYBACK);
#endif
rb->mixer_set_frequency(SAMPR_44);
rb->pcmbuf_fade(false, true); /* Be sure channel is audible */
}
static void close_snd(int normal)
{
(void)normal;
sound_avail = 0;
rb->pcmbuf_fade(false, false); /* Mute channel */
rb->mixer_channel_stop(PCM_MIXER_CHAN_PLAYBACK);
}

View file

@ -827,7 +827,6 @@ refresh_info:
{
if (key == ACTION_STD_OK)
{
gui_synclist_scroll_stop(&id3_lists);
int header_id = id3_headers[info.info_id[id3_lists.selected_item/2]];
char* title_and_text[2];
title_and_text[0] = str(header_id);
@ -836,7 +835,13 @@ refresh_info:
title_and_text[1] = (char*)id3_get_or_speak_info(id3_lists.selected_item+1,&info, buffer, sizeof(buffer), false);
if (view_text)
{
FOR_NB_SCREENS(i)
viewportmanager_theme_enable(i, false, NULL);
view_text(title_and_text[0], title_and_text[1]);
FOR_NB_SCREENS(i)
viewportmanager_theme_undo(i, false);
}
else
plugin_load(VIEWERS_DIR"/view_text.rock", title_and_text);
gui_synclist_set_title(&id3_lists, str(LANG_TRACK_INFO), NOICON);

View file

@ -405,7 +405,7 @@ bool settings_load_config(const char* file, bool apply)
int fd;
char line[128];
bool theme_changed = false;
bool import_open_plugins = false;
fd = open_utf8(file, O_RDONLY);
if (fd < 0)
return false;
@ -418,25 +418,17 @@ bool settings_load_config(const char* file, bool apply)
if (!string_to_cfg(name, value, &theme_changed))
{
#ifndef __PCTOOL__
/* if we are here then name was not a valid setting */
if (strcmp(name, OPEN_PLUGIN_CFGNAME) == 0)
if (!strcmp(name, "openplugin"))
{
import_open_plugins = true;
char ch;
while (read(fd, &ch, 1) == 1 && ch != '\n'){};
open_plugin_import(value);
}
#endif
}
} /* while(...) */
close(fd);
#ifndef __PCTOOL__
if (import_open_plugins)
open_plugin_import(file);
#else
(void) import_open_plugins;
#endif
if (apply)
{
settings_save();

View file

@ -67,7 +67,6 @@
#endif
#include "playlist.h"
#include "tree.h"
#include "iap-usb.h"
#include "voice_thread.h"
@ -791,17 +790,15 @@ static void shuffle_playlist_callback(bool shuffle)
}
}
}
iap_on_shuffle_state(shuffle);
}
static void repeat_mode_callback(int repeat)
{
(void)repeat;
if ((audio_status() & AUDIO_STATUS_PLAY) == AUDIO_STATUS_PLAY)
{
audio_flush_and_reload_tracks();
}
iap_on_repeat_state(repeat);
(void)repeat;
}
static void treesort_callback(int value)
@ -2340,38 +2337,30 @@ const struct settings_list settings[] = {
#endif
#ifdef HAVE_HOTKEY
/* WPS HOTKEY */
TABLE_SETTING(F_CB_ON_SELECT_ONLY, hotkey_wps,
LANG_HOTKEY_WPS, HOTKEY_VIEW_PLAYLIST, "hotkey wps",
"off,view playlist,show track info,pitchscreen,open with,delete,bookmark,plugin,bookmark list"
#ifdef HAVE_ALBUMART
",show_album_art,context menu"
,UNIT_INT, hotkey_formatter, hotkey_getlang, hotkey_callback,11,
#else
",context menu"
,UNIT_INT, hotkey_formatter, hotkey_getlang, hotkey_callback,10,
#endif
HOTKEY_OFF, HOTKEY_VIEW_PLAYLIST, HOTKEY_SHOW_TRACK_INFO, HOTKEY_PITCHSCREEN,
HOTKEY_OPEN_WITH, HOTKEY_DELETE, HOTKEY_BOOKMARK, HOTKEY_PLUGIN, HOTKEY_BOOKMARK_LIST,
#ifdef HAVE_ALBUMART
HOTKEY_ALBUMART,
#endif
HOTKEY_CONTEXT_MENU),
/* TREE HOTKEY */
,UNIT_INT, hotkey_formatter, hotkey_getlang, hotkey_callback,9, HOTKEY_OFF,
HOTKEY_VIEW_PLAYLIST, HOTKEY_SHOW_TRACK_INFO, HOTKEY_PITCHSCREEN,
HOTKEY_OPEN_WITH, HOTKEY_DELETE, HOTKEY_BOOKMARK, HOTKEY_PLUGIN, HOTKEY_BOOKMARK_LIST),
TABLE_SETTING(0, hotkey_tree,
LANG_HOTKEY_FILE_BROWSER, HOTKEY_OFF, "hotkey tree",
#ifdef HAVE_TAGCACHE
"off,properties,pictureflow,open with,delete,insert,insert shuffled,context menu",
UNIT_INT, hotkey_formatter, hotkey_getlang, NULL, 8,
"off,properties,pictureflow,open with,delete,insert,insert shuffled",
#else
"off,properties,open with,delete,insert,insert shuffled,context menu",
UNIT_INT, hotkey_formatter, hotkey_getlang, NULL, 7,
"off,properties,open with,delete,insert,insert shuffled",
#endif
UNIT_INT, hotkey_formatter, hotkey_getlang, NULL,
#ifdef HAVE_TAGCACHE
7,
#else
6,
#endif
HOTKEY_OFF,HOTKEY_PROPERTIES,
#ifdef HAVE_TAGCACHE
HOTKEY_PICTUREFLOW,
#endif
HOTKEY_OPEN_WITH, HOTKEY_DELETE, HOTKEY_INSERT, HOTKEY_INSERT_SHUFFLED, HOTKEY_CONTEXT_MENU),
HOTKEY_OPEN_WITH, HOTKEY_DELETE, HOTKEY_INSERT, HOTKEY_INSERT_SHUFFLED),
#endif /* HAVE_HOTKEY */
INT_SETTING(F_TIME_SETTING, resume_rewind, LANG_RESUME_REWIND, 0,

View file

@ -413,9 +413,6 @@ static int update_dir(void)
const bool id3db = false;
#endif
/* Ensure that list is initialized before update_dir returns */
gui_synclist_init(list, &tree_get_filename, &tc, false, 1, NULL);
#ifdef HAVE_TAGCACHE
/* Checks for changes */
if (id3db) {
@ -464,6 +461,8 @@ static int update_dir(void)
}
}
gui_synclist_init(list, &tree_get_filename, &tc, false, 1, NULL);
#ifdef HAVE_TAGCACHE
if (id3db)
{

View file

@ -957,20 +957,6 @@ usbstack/usb_charging_only.c
#ifdef USB_ENABLE_HID
usbstack/usb_hid.c
#endif
#ifdef USB_ENABLE_IAP
usbstack/iap/audio.c
usbstack/iap/buffer.c
usbstack/iap/debug.c
usbstack/iap/libiap/debug.c
usbstack/iap/libiap/fid-token-values.c
usbstack/iap/libiap/hid.c
usbstack/iap/libiap/iap.c
usbstack/iap/libiap/notification.c
usbstack/iap/libiap/span.c
usbstack/iap/notification.c
usbstack/iap/platform.c
usbstack/usb_iap.c
#endif
#if CONFIG_USBOTG == USBOTG_M66591
drivers/m66591.c
#elif CONFIG_USBOTG == USBOTG_ARC

View file

@ -65,7 +65,3 @@ lcd-as-memframe.c
#endif /* CPU_ARM */
#endif /* LCD_DEPTH */
#endif
#if defined(USE_STACK_PROTECTOR)
stack-protector.c
#endif

View file

@ -19,6 +19,9 @@
*
****************************************************************************/
#define MIXER_OPTIMIZED_WRITE_SAMPLES
#define MIXER_OPTIMIZED_MIX_SAMPLES
/* Mix channels' samples and apply gain factors */
static FORCE_INLINE void mix_samples(void *out,
const void *src0,

View file

@ -19,6 +19,9 @@
*
****************************************************************************/
#define MIXER_OPTIMIZED_WRITE_SAMPLES
#define MIXER_OPTIMIZED_MIX_SAMPLES
/* Mix channels' samples and apply gain factors */
static FORCE_INLINE void mix_samples(void *out,
const void *src0,

View file

@ -18,6 +18,8 @@
* KIND, either express or implied.
*
****************************************************************************/
#define MIXER_OPTIMIZED_MIX_SAMPLES
#define MIXER_OPTIMIZED_WRITE_SAMPLES
/* Mix channels' samples and apply gain factors */
static FORCE_INLINE void mix_samples(void *out,

View file

@ -19,6 +19,8 @@
*
****************************************************************************/
#define MIXER_OPTIMIZED_MIX_SAMPLES
#define MIXER_OPTIMIZED_WRITE_SAMPLES
static struct emac_context
{
unsigned long saved;

View file

@ -1,29 +0,0 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2026 by Aidan MacDonald
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied
*
****************************************************************************/
#include "panic.h"
#include <stdint.h>
const uint32_t __stack_chk_guard = 0x1BADC0DE;
void __stack_chk_fail(void)
{
panicf("stack smashing detected");
}

View file

@ -24,7 +24,6 @@
#if !defined(BOOTLOADER)
#include "settings.h"
#include "action.h"
#include "../apps/gui/skin_engine/skin_engine.h"
#endif
#include <stdlib.h>
#include "cpu.h"
@ -888,9 +887,6 @@ void backlight_set_timeout_plugged(int value)
/* Hold button change event handler. */
void backlight_hold_changed(bool hold_button)
{
#ifndef BOOTLOADER
skin_request_update_locked(hold_button);
#endif
if (!hold_button || (backlight_on_button_hold > 0))
{
/* if unlocked or override in effect */

View file

@ -44,10 +44,6 @@
#define O_NOISODECODE 0
#endif
#ifdef UTF8PROC_EXPORTS
#include "utf8proc.h"
#endif
#define getle16(p) (p[0] | (p[1] << 8))
#define getbe16(p) ((p[0] << 8) | p[1])
@ -63,9 +59,8 @@
#define open_noiso_internal open
#endif /* !APPLICATION */
#include "mutex.h"
#if 0 /* not needed just now (will probably end up a spinlock) */
#include "mutex.h"
static struct mutex cp_mutex SHAREDBSS_ATTR;
#define cp_lock_init() mutex_init(&cp_mutex)
#define cp_lock_enter() mutex_lock(&cp_mutex)
@ -656,32 +651,9 @@ const char * get_codepage_name(int cp)
return cp_info[cp].name;
}
#ifdef UTF8PROC_EXPORTS
static utf8proc_int32_t normbuf[2048];
static struct mutex norm_mutex SHAREDBSS_ATTR;
void utf8_normalize(char *string)
{
utf8proc_ssize_t result, orig;
if (!string || !*string)
return;
mutex_lock(&norm_mutex);
orig = strlen(string);
result = utf8proc_decompose(string, 0, normbuf, sizeof(normbuf)/4 -1, UTF8PROC_NULLTERM);
if (result > 0) {
result = utf8proc_reencode(normbuf, result, UTF8PROC_NULLTERM|UTF8PROC_COMPOSE|UTF8PROC_STABLE);
if (result > 0 && result <= orig && strcmp((char*)normbuf, string))
strcpy(string, (char*)normbuf);
}
mutex_unlock(&norm_mutex);
}
#if 0 /* not needed just now */
void unicode_init(void)
{
cp_lock_init();
mutex_init(&norm_mutex);
}
#endif

View file

@ -626,17 +626,18 @@ void usb_drv_cancel_all_transfers(void)
endpoints[i].halt[0] = endpoints[i].halt[1] = 1;
}
void usb_drv_ep_init(const struct usb_drv_ep_alloc_ctx* ctx, int ep)
int usb_drv_init_endpoint(int endpoint, int type, int max_packet_size)
{
/* FIXME: support max packet size override */
(void)ctx;
(void)ep;
(void)max_packet_size; /* FIXME: support max packet size override */
(void)type;
(void)endpoint;
return 0;
}
void usb_drv_ep_deinit(const struct usb_drv_ep_alloc_ctx* ctx, int ep)
int usb_drv_deinit_endpoint(int endpoint)
{
(void)ctx;
(void)ep;
(void)endpoint;
return 0;
}
static void bus_reset(void)

View file

@ -640,11 +640,8 @@ void usb_drv_set_test_mode(int mode) {
M66591_TESTMODE |= mode;
}
void usb_drv_ep_init(const struct usb_drv_ep_alloc_ctx* ctx, int ep) {
/* FIXME: support max packet size override */
const int epnum = EP_NUM(ep);
const int epdir = EP_DIR(ep);
const int type = ctx->type[epnum][epdir];
int usb_drv_init_endpoint(int endpoint, int type, int max_packet_size) {
(void)max_packet_size; /* FIXME: support max packet size override */
int pipecfg = 0;
@ -654,38 +651,41 @@ void usb_drv_ep_init(const struct usb_drv_ep_alloc_ctx* ctx, int ep) {
} else if(type == USB_ENDPOINT_XFER_BULK) {
pipecfg |= 1<<13;
} else {
panicf("mxx: unsupported type %d", type);
/* Not a supported type */
return -1;
}
if (epdir == DIR_IN) {
int num = endpoint & USB_ENDPOINT_NUMBER_MASK;
int dir = endpoint & USB_ENDPOINT_DIR_MASK;
if (dir == USB_DIR_IN) {
pipecfg |= (1<<4);
}
M66591_eps[epnum].dir = epdir == DIR_IN ? USB_DIR_IN : USB_DIR_OUT;
M66591_eps[num].dir = dir;
M66591_PIPE_CFGSEL = epnum;
M66591_PIPE_CFGSEL=num;
/* Enable pipe (15) */
pipecfg |= 1<<15;
pipe_handshake(epnum, PIPE_SHAKE_NAK);
pipe_handshake(num, PIPE_SHAKE_NAK);
/* Setup the flags */
M66591_PIPE_CFGWND=pipecfg;
pipe_init(epnum);
pipe_init(num);
logf("mxx: ep req ep#: %d config: 0x%04x", epnum, M66591_PIPE_CFGWND);
logf("mxx: ep req ep#: %d config: 0x%04x", num, M66591_PIPE_CFGWND);
return 0;
}
/* Used by stack to tell the helper functions that the pipe is not in use */
void usb_drv_ep_deinit(const struct usb_drv_ep_alloc_ctx* ctx, int ep) {
(void)ctx;
int num = ep & USB_ENDPOINT_NUMBER_MASK;
int usb_drv_deinit_endpoint(int endpoint) {
int num = endpoint & USB_ENDPOINT_NUMBER_MASK;
if (num < 1 || num > USB_NUM_ENDPOINTS) {
return;
return -1;
}
int flags = disable_irq_save();
@ -695,6 +695,8 @@ void usb_drv_ep_deinit(const struct usb_drv_ep_alloc_ctx* ctx, int ep) {
M66591_eps[num].dir = -1;
restore_irq(flags);
return 0;
}
/* Periodically called to check if a cable was plugged into the device */

View file

@ -24,8 +24,6 @@
#include <inttypes.h>
#include <string.h>
#include "usb-designware.h"
#include "config.h"
#include "cpu.h"
#include "system.h"
@ -37,6 +35,8 @@
#include "usb_ch9.h"
#include "usb_core.h"
#include "usb-designware.h"
/* Define LOGF_ENABLE to enable logf output in this file */
/*#define LOGF_ENABLE*/
#include "logf.h"
@ -155,6 +155,9 @@ struct usb_dw_ep0
struct usb_ctrlrequest pending_req;
};
struct usb_drv_ep_spec usb_drv_ep_specs[USB_NUM_ENDPOINTS]; /* filled in usb_drv_init */
uint8_t usb_drv_ep_specs_flags = 0;
static const char* const dw_dir_str[USB_DW_NUM_DIRS] =
{
[USB_DW_EPDIR_IN] = "IN",
@ -192,6 +195,7 @@ static uint32_t usb_endpoints; /* available EPs mask */
(usually 1), otherwise it is the number of dedicated Tx FIFOs
(not counting NPTX FIFO that is always dedicated for IN0). */
static int n_ptxfifos;
static uint16_t ptxfifo_usage;
static uint32_t hw_maxbytes;
static uint32_t hw_maxpackets;
@ -668,28 +672,47 @@ static void usb_dw_unconfigure_ep(int epnum, enum usb_dw_epdir epdir)
#endif
ep_periodic_msk &= ~(1 << epnum);
#endif
ptxfifo_usage &= ~(1 << GET_DTXFNUM(epnum));
}
usb_dw_flush_endpoint(epnum, epdir);
DWC_EPCTL(epnum, epdir) = epctl;
}
static void usb_dw_configure_ep(const struct usb_drv_ep_alloc_ctx* ctx, int epnum, enum usb_dw_epdir epdir, int type, int maxpktsize)
static int usb_dw_configure_ep(int epnum,
enum usb_dw_epdir epdir, int type, int maxpktsize)
{
uint32_t epctl = SETD0PIDEF|EPTYP(type)|USBAEP|maxpktsize;
if (epdir == USB_DW_EPDIR_IN && ctx->assigned_txfifos[epnum] > 0)
if (epdir == USB_DW_EPDIR_IN)
{
/*
* If the hardware has dedicated fifos, we must give each
* IN EP a unique tx-fifo even if it is non-periodic.
*/
#ifdef USB_DW_SHARED_FIFO
ep_periodic_msk |= (1 << epnum);
#ifndef USB_DW_ARCH_SLAVE
epctl |= DWC_DIEPCTL(epnum) & NEXTEP(0xf);
#endif
if (type == USB_ENDPOINT_XFER_INT)
#endif
epctl |= DTXFNUM(ctx->assigned_txfifos[epnum]);
{
int fnum;
for (fnum = 1; fnum <= n_ptxfifos; fnum++)
if (~ptxfifo_usage & (1 << fnum))
break;
if (fnum > n_ptxfifos)
return -1; /* no available fifos */
ptxfifo_usage |= (1 << fnum);
epctl |= DTXFNUM(fnum);
#ifdef USB_DW_SHARED_FIFO
ep_periodic_msk |= (1 << epnum);
#endif
}
}
DWC_EPCTL(epnum, epdir) = epctl;
return 0; /* ok */
}
static void usb_dw_reset_endpoints(void)
@ -730,6 +753,7 @@ static void usb_dw_reset_endpoints(void)
usb_dw_unconfigure_ep(ep, USB_DW_EPDIR_IN);
}
ptxfifo_usage = 0;
#ifdef USB_DW_SHARED_FIFO
ep_periodic_msk = 0;
#endif
@ -1485,6 +1509,17 @@ static void usb_dw_init(void)
/* Soft reconnect */
udelay(3000);
DWC_DCTL &= ~SDIS;
/* Fill endpoint spec table FIXME: should be done in usb_drv_startup() */
usb_drv_ep_specs[0].type[DIR_OUT] = USB_ENDPOINT_XFER_CONTROL;
usb_drv_ep_specs[0].type[DIR_IN] = USB_ENDPOINT_XFER_CONTROL;
for(int i = 1; i < USB_NUM_ENDPOINTS; i += 1) {
bool out_avail = usb_endpoints & (1 << (i + USB_DW_DIR_OFF(USB_DW_EPDIR_OUT)));
usb_drv_ep_specs[i].type[DIR_OUT] = out_avail ? USB_ENDPOINT_TYPE_ANY : USB_ENDPOINT_TYPE_NONE;
bool in_avail = usb_endpoints & (1 << (i + USB_DW_DIR_OFF(USB_DW_EPDIR_IN)));
usb_drv_ep_specs[i].type[DIR_IN] = in_avail ? USB_ENDPOINT_TYPE_ANY : USB_ENDPOINT_TYPE_NONE;
}
}
static void usb_dw_exit(void)
@ -1582,95 +1617,50 @@ void INT_USB_FUNC(void)
usb_dw_irq();
}
void usb_drv_ep_reset_alloc_ctx(struct usb_drv_ep_alloc_ctx* ctx)
int usb_drv_init_endpoint(int endpoint, int type, int max_packet_size)
{
memset(ctx, 0, sizeof(*ctx));
}
(void)max_packet_size; /* FIXME: support max packet size override */
bool usb_drv_ep_allocate(struct usb_drv_ep_alloc_ctx* ctx, int ep, int type, int max_packet_size)
{
const uint8_t epnum = EP_NUM(ep);
const uint8_t epdir = EP_DIR(ep);
enum usb_dw_epdir epdir = (EP_DIR(endpoint) == DIR_IN) ? USB_DW_EPDIR_IN : USB_DW_EPDIR_OUT;
struct usb_dw_ep* dw_ep = usb_dw_get_ep(EP_NUM(endpoint), epdir);
if(ep == EP_CONTROL)
int maxpktsize;
if(type == EPTYP_ISOCHRONOUS)
{
return false;
maxpktsize = 1023;
}
enum usb_dw_epdir dwdir = epdir == DIR_IN ? USB_DW_EPDIR_IN : USB_DW_EPDIR_OUT;
if(!(usb_endpoints & (1 << (epnum + USB_DW_DIR_OFF(dwdir)))))
else
{
return false;
}
bool need_fifo = epdir == DIR_IN;
#ifdef USB_DW_SHARED_FIFO
/* in shared fifo mode, only periodic endpoints need dedicated fifo */
need_fifo &= type == USB_ENDPOINT_XFER_ISOC || type == USB_ENDPOINT_XFER_INT;
#endif
if(!need_fifo)
{
goto ok;
}
for (int fnum = 1; fnum <= n_ptxfifos; fnum++)
{
if (~ctx->txfifo_usage & (1 << fnum))
{
ctx->txfifo_usage |= 1 << fnum;
ctx->assigned_txfifos[epnum] = fnum;
goto ok;
}
}
return false;
ok:
ctx->type[epnum][epdir] = type;
ctx->max_packet_size[epnum][epdir] = max_packet_size;
return true;
}
void usb_drv_ep_init(const struct usb_drv_ep_alloc_ctx* ctx, int ep)
{
const int epnum = EP_NUM(ep);
const int epdir_ = EP_DIR(ep);
const int type = ctx->type[epnum][epdir_];
enum usb_dw_epdir epdir = (epdir_ == DIR_IN) ? USB_DW_EPDIR_IN : USB_DW_EPDIR_OUT;
struct usb_dw_ep* dw_ep = usb_dw_get_ep(EP_NUM(ep), epdir);
int mps = ctx->max_packet_size[epnum][epdir_];
if(mps == -1)
{
if(type == EPTYP_ISOCHRONOUS)
{
mps = 1023;
}
else
{
mps = usb_drv_port_speed() ? 512 : 64;
}
maxpktsize = usb_drv_port_speed() ? 512 : 64;
}
usb_dw_target_disable_irq();
usb_dw_configure_ep(ctx, epnum, epdir, type, mps);
int res = usb_dw_configure_ep(EP_NUM(endpoint), epdir, type, maxpktsize);
usb_dw_target_enable_irq();
dw_ep->active = true;
if(res >= 0)
{
dw_ep->active = true;
return 0;
}
else
{
return -1;
}
}
void usb_drv_ep_deinit(const struct usb_drv_ep_alloc_ctx* ctx, int ep)
int usb_drv_deinit_endpoint(int endpoint)
{
(void)ctx;
enum usb_dw_epdir epdir = (EP_DIR(ep) == DIR_IN) ? USB_DW_EPDIR_IN : USB_DW_EPDIR_OUT;
struct usb_dw_ep* dw_ep = usb_dw_get_ep(EP_NUM(ep), epdir);
enum usb_dw_epdir epdir = (EP_DIR(endpoint) == DIR_IN) ? USB_DW_EPDIR_IN : USB_DW_EPDIR_OUT;
struct usb_dw_ep* dw_ep = usb_dw_get_ep(EP_NUM(endpoint), epdir);
usb_dw_target_disable_irq();
usb_dw_unconfigure_ep(EP_NUM(ep), epdir);
usb_dw_unconfigure_ep(EP_NUM(endpoint), epdir);
usb_dw_target_enable_irq();
dw_ep->active = false;
return 0;
}
int usb_drv_recv_nonblocking(int endpoint, void* ptr, int length)

View file

@ -25,7 +25,6 @@
#include "config.h"
#include <stdbool.h>
#include <stdint.h>
#include <limits.h>
/* ADC channels */
#define AXP2101_ADC_VBAT_VOLTAGE 0

View file

@ -25,7 +25,6 @@
#include "config.h"
#include <stdbool.h>
#include <stdint.h>
#include <limits.h>
/* ADC channels */
#define ADC_ACIN_VOLTAGE 0

View file

@ -1396,14 +1396,6 @@ Lyre prototype 1 */
#define USB_ENABLE_AUDIO
#endif
#if defined(USB_HAS_INTERRUPT) && defined(USB_HAS_ISOCHRONOUS) && USB_VENDOR_ID == 0x05ac
#define USB_ENABLE_IAP
#endif
#if defined(USB_ENABLE_IAP)
#define HAVE_MULTIMEDIA_KEYS
#endif
#endif /* BOOTLOADER */
#endif /* HAVE_USBSTACK */

View file

@ -1,39 +0,0 @@
#pragma once
#include <stdbool.h>
#include <stdint.h>
#include "config.h"
#ifdef USB_ENABLE_IAP
/* usbstack/iap/notification.c */
void iap_on_track_time_position(uint32_t pos_ms);
void iap_on_track_playback_index(uint32_t index, bool track_ready);
void iap_on_tracks_count(uint32_t count);
void iap_on_play_status(int status /* AUDIO_STATUS_* */);
void iap_on_volume(int volume);
void iap_on_shuffle_state(bool state);
void iap_on_repeat_state(int state);
#else
static inline void iap_on_track_time_position(uint32_t pos_ms) {
(void)pos_ms;
}
static inline void iap_on_track_playback_index(uint32_t index, bool track_ready) {
(void)index;
(void)track_ready;
}
static inline void iap_on_tracks_count(uint32_t count) {
(void)count;
}
static inline void iap_on_play_status(int status) {
(void)status;
}
static inline void iap_on_volume(int volume) {
(void)volume;
}
static inline void iap_on_shuffle_state(bool state) {
(void)state;
}
static inline void iap_on_repeat_state(int state) {
(void)state;
}
#endif

View file

@ -64,7 +64,6 @@ bool pcm_is_initialized(void);
enum pcm_sink_ids pcm_current_sink(void);
const struct pcm_sink_caps* pcm_sink_caps(enum pcm_sink_ids sink);
bool pcm_switch_sink(enum pcm_sink_ids sink);
/* shortcut for plugins */
const struct pcm_sink_caps* pcm_current_sink_caps(void);

View file

@ -23,8 +23,6 @@
#define PCM_MIXER_H
#include <sys/types.h>
#include "pcm.h"
#include "pcm_sink.h"
/** Simple config **/
@ -113,9 +111,6 @@ void mixer_channel_play_pause(enum pcm_mixer_channel channel, bool play);
/* Stop playback on a channel */
void mixer_channel_stop(enum pcm_mixer_channel channel);
/* Switch playback sink */
bool mixer_switch_sink(enum pcm_sink_ids sink);
/* Set channel's amplitude factor */
void mixer_channel_set_amplitude(enum pcm_mixer_channel channel,
unsigned int amplitude);

View file

@ -21,8 +21,6 @@
#include <stddef.h>
#include <stdint.h>
#include "config.h"
struct pcm_sink_caps {
const unsigned long* samprs;
uint16_t num_samprs;
@ -54,10 +52,6 @@ struct pcm_sink {
enum pcm_sink_ids {
PCM_SINK_BUILTIN = 0,
#ifdef USB_ENABLE_IAP
PCM_SINK_IAP,
#endif
PCM_SINK_NUM
};
/* defined in each platform pcm source */

View file

@ -22,9 +22,7 @@
#ifndef __REGGEN_H__
#define __REGGEN_H__
#ifndef __ASSEMBLER__
#include <stdint.h>
#endif
#define __REGGEN_VAR_OR1(p, s1) \
((p ## s1))

View file

@ -26,10 +26,9 @@
#include <stdint.h>
#endif
#define REG_BIT(x) (1 << (x))
#define REG16_PTR_T volatile uint16_t *
#define REG32_PTR_T volatile uint32_t *
#define VOID_PTR_PTR_T void* volatile*
#define REG16_PTR_T volatile uint16_t *
#define REG32_PTR_T volatile uint32_t *
#define VOID_PTR_PTR_T void* volatile*
#if CONFIG_CPU==S5L8700 || CONFIG_CPU==S5L8701
#define CACHEALIGN_BITS (4) /* 2^4 = 16 bytes */
@ -1613,30 +1612,19 @@ Information for them was gathered solely by reverse-engineering Apple's firmware
#define SHA1_BASE 0x38000000
#endif
#define SHA1_CONFIG (*((REG32_PTR_T)(SHA1_BASE)))
#define SHA1_SWRESET (*((REG32_PTR_T)(SHA1_BASE + 0x04)))
#define SHA1_INT_SRC (*((REG32_PTR_T)(SHA1_BASE + 0x08)))
#define SHA1_INT_MASK (*((REG32_PTR_T)(SHA1_BASE + 0x0C)))
#define SHA1_ENDIAN (*((REG32_PTR_T)(SHA1_BASE + 0x10)))
#define SHA1CONFIG (*((REG32_PTR_T)(SHA1_BASE)))
#define SHA1RESET (*((REG32_PTR_T)(SHA1_BASE + 0x04)))
// Result is 20 bytes (160 bits) 0x20-0x33
#define SHA1_RESULT ((REG32_PTR_T)(SHA1_BASE + 0x20))
#if CONFIG_CPU == S5L8720
#define SHA1UNK10 (*((REG32_PTR_T)(SHA1_BASE + 0x10)))
#endif
// Input is 64 bytes (512 bits) 0x40-0x7F
#define SHA1_DATA ((REG32_PTR_T)(SHA1_BASE + 0x40))
#define SHA1RESULT ((REG32_PTR_T)(SHA1_BASE + 0x20))
#define SHA1DATAIN ((REG32_PTR_T)(SHA1_BASE + 0x40))
#define SHA1_MASTER_MODE (*((REG32_PTR_T)(SHA1_BASE + 0x80)))
#define SHA1_MS_START_ADDR (*((REG32_PTR_T)(SHA1_BASE + 0x84)))
#define SHA1_VERSION (*((REG32_PTR_T)(SHA1_BASE + 0x88)))
#define SHA1_MS_SIZE (*((REG32_PTR_T)(SHA1_BASE + 0x8C)))
#define SHA1_FIFO_PARAM (*((REG32_PTR_T)(SHA1_BASE + 0x90)))
#define SHA1_FIFO_CMD (*((REG32_PTR_T)(SHA1_BASE + 0x94)))
#define SHA1_TX_FIFO_STAT (*((REG32_PTR_T)(SHA1_BASE + 0x98)))
#define SHA1_TX_FIFO (*((REG32_PTR_T)(SHA1_BASE + 0xA0)))
#define SHA1_CONFIG_BUSY REG_BIT(0)
#define SHA1_CONFIG_GO REG_BIT(1)
#define SHA1_CONFIG_CONT REG_BIT(3)
#if CONFIG_CPU == S5L8720
#define SHA1UNK80 (*((REG32_PTR_T)(SHA1_BASE + 0x80)))
#endif
/* Clickwheel controller - S5L8701+ */
#if CONFIG_CPU==S5L8701 || CONFIG_CPU==S5L8702 || CONFIG_CPU==S5L8720

View file

@ -266,10 +266,8 @@ static inline void cpu_boost_unlock(void)
#endif
#endif
/*
* ARM and MIPS ABIs generally require 8-byte stack alignment.
*/
#if defined(CPU_ARM) || defined(CPU_MIPS)
/* ARM ABIs generally require 8-byte stack alignment */
#ifdef CPU_ARM
#define MIN_STACK_ALIGN 8
#endif

View file

@ -24,9 +24,7 @@
#define __USB_DESIGNWARE_H__
#include <inttypes.h>
#include <stdbool.h>
#include "config.h"
#include "cpu.h"
#ifndef REG32_PTR_T
#define REG32_PTR_T volatile uint32_t *
@ -290,15 +288,4 @@ extern void usb_dw_target_enable_irq(void);
extern void usb_dw_target_disable_irq(void);
extern void usb_dw_target_clear_irq(void);
/* endpoint allocation */
struct usb_drv_ep_alloc_ctx_dw
{
int8_t type[USB_NUM_ENDPOINTS][2];
int max_packet_size[USB_NUM_ENDPOINTS][2];
uint16_t txfifo_usage;
uint8_t assigned_txfifos[USB_NUM_ENDPOINTS];
};
#define usb_drv_ep_alloc_ctx usb_drv_ep_alloc_ctx_dw
#endif /* __USB_DESIGNWARE_H__ */

View file

@ -172,9 +172,6 @@ enum {
#endif
#ifdef USB_ENABLE_AUDIO
USB_DRIVER_AUDIO,
#endif
#ifdef USB_ENABLE_IAP
USB_DRIVER_IAP,
#endif
USB_NUM_DRIVERS
};

View file

@ -62,42 +62,19 @@ enum usb_control_response {
USB_CONTROL_RECEIVE,
};
/* endpoint allocation:
* there are two ways to implement endpoint allocation.
* 1. define usb_drv_ep_specs and usb_drv_ep_specs_flags in the driver.
* this is the simplest option when the types accepted by each endpoint are mutually independent.
* these variables are set only once during driver initialization and should not be modified afterward.
* 2. define usb_drv_ep_alloc_ctx and implement usb_drv_ep_reset_alloc_ctx and usb_drv_ep_allocate in the driver.
* if the available endpoint types change based on allocation status,
* these functions can be overridden to allow the driver to track the endpoint state.
* */
#ifndef usb_drv_ep_alloc_ctx
/* option 1 */
#define USB_ENDPOINT_TYPE_ANY (-1)
#define USB_ENDPOINT_TYPE_NONE (-2)
struct usb_drv_ep_spec {
int8_t type[2]; /* USB_ENDPOINT_TYPE_{ANY,NONE} USB_ENDPOINT_XFER_* */
};
extern struct usb_drv_ep_spec usb_drv_ep_specs[USB_NUM_ENDPOINTS];
#define USB_ENDPOINT_SPEC_FORCE_IO_TYPE_MATCH (1 << 0)
#define USB_ENDPOINT_SPEC_IO_EXCLUSIVE (1 << 1)
extern uint8_t usb_drv_ep_specs_flags;
struct usb_drv_ep_alloc_ctx {
int8_t type[USB_NUM_ENDPOINTS][2];
int max_packet_size[USB_NUM_ENDPOINTS][2];
};
#else
/* option 2 */
void usb_drv_ep_reset_alloc_ctx(struct usb_drv_ep_alloc_ctx* ctx);
bool usb_drv_ep_allocate(struct usb_drv_ep_alloc_ctx* ctx, int ep, int type, int max_packet_size);
#endif
void usb_drv_ep_init(const struct usb_drv_ep_alloc_ctx* ctx, int ep);
void usb_drv_ep_deinit(const struct usb_drv_ep_alloc_ctx* ctx, int ep);
/* one-time initialisation of the USB driver */
void usb_drv_startup(void);
void usb_drv_int_enable(bool enable); /* Target implemented */
@ -121,6 +98,8 @@ int usb_drv_port_speed(void);
void usb_drv_cancel_all_transfers(void);
void usb_drv_set_test_mode(int mode);
bool usb_drv_connected(void);
int usb_drv_init_endpoint(int endpoint, int type, int max_packet_size);
int usb_drv_deinit_endpoint(int endpoint);
#ifdef USB_HAS_ISOCHRONOUS
/* returns the last received frame number (the 11-bit number contained in the last SOF):
* - full-speed: the host sends one SOF every 1ms (so 1000 SOF/s)

Some files were not shown because too many files have changed in this diff Show more