forked from len0rd/rockbox
(Hopefully) Revert the quickscreen changes. Many fixes need to be made,
and the exact implementation needs discussion. We apologize for the inconvenience and hope to bring an improved quickscreen to you soon. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16224 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
2b6d35854d
commit
f7c938a7b7
12 changed files with 399 additions and 378 deletions
|
@ -56,7 +56,6 @@
|
||||||
#include "cuesheet.h"
|
#include "cuesheet.h"
|
||||||
#include "ata_idle_notify.h"
|
#include "ata_idle_notify.h"
|
||||||
#include "root_menu.h"
|
#include "root_menu.h"
|
||||||
#include "quickscreen.h"
|
|
||||||
|
|
||||||
#if (LCD_DEPTH > 1) || (defined(HAVE_LCD_REMOTE) && (LCD_REMOTE_DEPTH > 1))
|
#if (LCD_DEPTH > 1) || (defined(HAVE_LCD_REMOTE) && (LCD_REMOTE_DEPTH > 1))
|
||||||
#include "backdrop.h"
|
#include "backdrop.h"
|
||||||
|
|
|
@ -60,7 +60,7 @@ static const char *unit_strings[] =
|
||||||
/* these two vars are needed so arbitrary values can be added to the
|
/* these two vars are needed so arbitrary values can be added to the
|
||||||
TABLE_SETTING settings if the F_ALLOW_ARBITRARY_VALS flag is set */
|
TABLE_SETTING settings if the F_ALLOW_ARBITRARY_VALS flag is set */
|
||||||
static int table_setting_oldval = 0, table_setting_array_position = 0;
|
static int table_setting_oldval = 0, table_setting_array_position = 0;
|
||||||
char *option_get_valuestring(struct settings_list *setting,
|
static char *option_get_valuestring(struct settings_list *setting,
|
||||||
char *buffer, int buf_len,
|
char *buffer, int buf_len,
|
||||||
intptr_t temp_var)
|
intptr_t temp_var)
|
||||||
{
|
{
|
||||||
|
@ -210,21 +210,19 @@ static int option_talk(int selected_item, void * data)
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
#ifdef HAVE_QUICKSCREEN /* only the quickscreen uses this so far */
|
int option_select_next_val(struct settings_list *setting,
|
||||||
void option_select_next_val(struct settings_list *setting)
|
intptr_t temp_var)
|
||||||
{
|
{
|
||||||
int val = 0;
|
int val = 0;
|
||||||
int *value = setting->setting;
|
|
||||||
if ((setting->flags & F_BOOL_SETTING) == F_BOOL_SETTING)
|
if ((setting->flags & F_BOOL_SETTING) == F_BOOL_SETTING)
|
||||||
{
|
{
|
||||||
*(bool*)value = !*(bool*)value;
|
val = (bool)temp_var ? 0 : 1;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else if ((setting->flags & F_INT_SETTING) == F_INT_SETTING)
|
else if ((setting->flags & F_INT_SETTING) == F_INT_SETTING)
|
||||||
{
|
{
|
||||||
struct int_setting *info = (struct int_setting *)setting->int_setting;
|
struct int_setting *info = setting->int_setting;
|
||||||
val = *value + info->step;
|
val = (int)temp_var + info->step;
|
||||||
if (val > info->max)
|
if (val > info->max)
|
||||||
val = info->min;
|
val = info->min;
|
||||||
}
|
}
|
||||||
|
@ -234,18 +232,53 @@ void option_select_next_val(struct settings_list *setting)
|
||||||
int steps = sound_steps(setting_id);
|
int steps = sound_steps(setting_id);
|
||||||
int min = sound_min(setting_id);
|
int min = sound_min(setting_id);
|
||||||
int max = sound_max(setting_id);
|
int max = sound_max(setting_id);
|
||||||
val = *value + steps;
|
val = (int)temp_var + steps;
|
||||||
if (val >= max)
|
if (val > max)
|
||||||
val = min;
|
val = min;
|
||||||
}
|
}
|
||||||
else if ((setting->flags & F_CHOICE_SETTING) == F_CHOICE_SETTING)
|
else if ((setting->flags & F_CHOICE_SETTING) == F_CHOICE_SETTING)
|
||||||
{
|
{
|
||||||
struct choice_setting *info = (struct choice_setting *)setting->choice_setting;
|
struct choice_setting *info = setting->choice_setting;
|
||||||
val = *value + 1;
|
val = (int)temp_var;
|
||||||
if (val >= info->count)
|
if (val > info->count)
|
||||||
val = 0;
|
val = 0;
|
||||||
}
|
}
|
||||||
*value = val;
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
int option_select_prev_val(struct settings_list *setting,
|
||||||
|
intptr_t temp_var)
|
||||||
|
{
|
||||||
|
int val = 0;
|
||||||
|
if ((setting->flags & F_BOOL_SETTING) == F_BOOL_SETTING)
|
||||||
|
{
|
||||||
|
val = (bool)temp_var ? 0 : 1;
|
||||||
|
}
|
||||||
|
else if ((setting->flags & F_INT_SETTING) == F_INT_SETTING)
|
||||||
|
{
|
||||||
|
struct int_setting *info = setting->int_setting;
|
||||||
|
val = (int)temp_var - info->step;
|
||||||
|
if (val < info->min)
|
||||||
|
val = info->max;
|
||||||
|
}
|
||||||
|
else if ((setting->flags & F_T_SOUND) == F_T_SOUND)
|
||||||
|
{
|
||||||
|
int setting_id = setting->sound_setting->setting;
|
||||||
|
int steps = sound_steps(setting_id);
|
||||||
|
int min = sound_min(setting_id);
|
||||||
|
int max = sound_max(setting_id);
|
||||||
|
val = (int)temp_var -+ steps;
|
||||||
|
if (val < min)
|
||||||
|
val = max;
|
||||||
|
}
|
||||||
|
else if ((setting->flags & F_CHOICE_SETTING) == F_CHOICE_SETTING)
|
||||||
|
{
|
||||||
|
struct choice_setting *info = setting->choice_setting;
|
||||||
|
val = (int)temp_var;
|
||||||
|
if (val < 0)
|
||||||
|
val = info->count - 1;
|
||||||
|
}
|
||||||
|
return val;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -65,9 +65,4 @@ extern void option_select_next(struct option_select * opt);
|
||||||
*/
|
*/
|
||||||
extern void option_select_prev(struct option_select * opt);
|
extern void option_select_prev(struct option_select * opt);
|
||||||
|
|
||||||
|
|
||||||
void option_select_next_val(struct settings_list *setting);
|
|
||||||
char *option_get_valuestring(struct settings_list *setting,
|
|
||||||
char *buffer, int buf_len,
|
|
||||||
intptr_t temp_var);
|
|
||||||
#endif /* _GUI_OPTION_SELECT_H_ */
|
#endif /* _GUI_OPTION_SELECT_H_ */
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
* \/ \/ \/ \/ \/
|
* \/ \/ \/ \/ \/
|
||||||
* $Id$
|
* $Id$
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008 by Jonathan Gordon
|
* Copyright (C) 2005 by Kevin Ferrare
|
||||||
*
|
*
|
||||||
* All files in this archive are subject to the GNU General Public License.
|
* All files in this archive are subject to the GNU General Public License.
|
||||||
* See the file COPYING in the source tree root for full license agreement.
|
* See the file COPYING in the source tree root for full license agreement.
|
||||||
|
@ -30,198 +30,109 @@
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "statusbar.h"
|
#include "statusbar.h"
|
||||||
#include "action.h"
|
#include "action.h"
|
||||||
#include "settings_list.h"
|
|
||||||
#include "lang.h"
|
|
||||||
#include "option_select.h"
|
|
||||||
|
|
||||||
static struct viewport vps[NB_SCREENS][QUICKSCREEN_ITEM_COUNT];
|
void gui_quickscreen_init(struct gui_quickscreen * qs,
|
||||||
|
struct option_select *left_option,
|
||||||
static void quickscreen_fix_viewports(struct gui_quickscreen *qs,
|
struct option_select *bottom_option,
|
||||||
struct screen *display,
|
struct option_select *right_option,
|
||||||
struct viewport *parent)
|
quickscreen_callback callback)
|
||||||
{
|
{
|
||||||
int height, i, count=0, top;
|
qs->left_option=left_option;
|
||||||
int nb_lines = parent->height/display->char_height;
|
qs->bottom_option=bottom_option;
|
||||||
bool single_line_bottom = false;
|
qs->right_option=right_option;
|
||||||
|
qs->callback=callback;
|
||||||
for(i=0; i<QUICKSCREEN_ITEM_COUNT; i++)
|
|
||||||
{
|
|
||||||
if (qs->items[i])
|
|
||||||
count++;
|
|
||||||
vps[display->screen_type][i] = *parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* special handling when there is only enough room for 2 items.
|
|
||||||
discard the top and bottom items, so only show the 2 side ones */
|
|
||||||
if (nb_lines < 4)
|
|
||||||
{
|
|
||||||
qs->items[QUICKSCREEN_TOP] = NULL;
|
|
||||||
qs->items[QUICKSCREEN_BOTTOM] = NULL;
|
|
||||||
vps[display->screen_type][QUICKSCREEN_RIGHT].y = parent->y;
|
|
||||||
vps[display->screen_type][QUICKSCREEN_LEFT].height = parent->height/2;
|
|
||||||
vps[display->screen_type][QUICKSCREEN_RIGHT].y = parent->y+parent->height/2;
|
|
||||||
vps[display->screen_type][QUICKSCREEN_RIGHT].height = parent->height/2;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if (nb_lines < 5 && count == 4) /* drop the top item */
|
|
||||||
{
|
|
||||||
qs->items[QUICKSCREEN_TOP] = NULL;
|
|
||||||
single_line_bottom = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
height = display->char_height*2;
|
|
||||||
if (nb_lines > 8 ||
|
|
||||||
(nb_lines > 5 && qs->items[QUICKSCREEN_TOP] == NULL))
|
|
||||||
height += display->char_height;
|
|
||||||
/* Top item */
|
|
||||||
if (qs->items[QUICKSCREEN_TOP])
|
|
||||||
{
|
|
||||||
vps[display->screen_type][QUICKSCREEN_TOP].y = parent->y;
|
|
||||||
vps[display->screen_type][QUICKSCREEN_TOP].height = height;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
vps[display->screen_type][QUICKSCREEN_TOP].height = 0;
|
|
||||||
}
|
|
||||||
/* bottom item */
|
|
||||||
if (qs->items[QUICKSCREEN_BOTTOM])
|
|
||||||
{
|
|
||||||
if (single_line_bottom)
|
|
||||||
height = display->char_height;
|
|
||||||
vps[display->screen_type][QUICKSCREEN_BOTTOM].y = parent->y+parent->height - height;
|
|
||||||
vps[display->screen_type][QUICKSCREEN_BOTTOM].height = height;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
vps[display->screen_type][QUICKSCREEN_BOTTOM].height = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* side items */
|
|
||||||
height = parent->height -
|
|
||||||
vps[display->screen_type][QUICKSCREEN_BOTTOM].height -
|
|
||||||
vps[display->screen_type][QUICKSCREEN_TOP].height ;
|
|
||||||
top = parent->y+vps[display->screen_type][QUICKSCREEN_TOP].height;
|
|
||||||
vps[display->screen_type][QUICKSCREEN_LEFT].y = top;
|
|
||||||
vps[display->screen_type][QUICKSCREEN_RIGHT].y = top;
|
|
||||||
vps[display->screen_type][QUICKSCREEN_LEFT].height = height;
|
|
||||||
vps[display->screen_type][QUICKSCREEN_RIGHT].height = height;
|
|
||||||
|
|
||||||
vps[display->screen_type][QUICKSCREEN_RIGHT].x = parent->x+parent->width/2;
|
|
||||||
|
|
||||||
vps[display->screen_type][QUICKSCREEN_LEFT].width = parent->width/2;
|
|
||||||
vps[display->screen_type][QUICKSCREEN_RIGHT].width = parent->width/2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void quickscreen_draw_text(char *s, int item, bool title,
|
/*
|
||||||
struct screen *display, struct viewport *vp)
|
* Draws the quickscreen on a given screen
|
||||||
|
* - qs : the quickscreen
|
||||||
|
* - display : the screen to draw on
|
||||||
|
*/
|
||||||
|
static void gui_quickscreen_draw(struct gui_quickscreen * qs, struct screen * display)
|
||||||
{
|
{
|
||||||
int nb_lines = vp->height/display->char_height;
|
const unsigned char *option;
|
||||||
int w, line = 0, x=0;
|
const unsigned char *title;
|
||||||
display->getstringsize(s, &w, NULL);
|
int w, font_h;
|
||||||
switch (item)
|
bool statusbar = global_settings.statusbar;
|
||||||
|
#ifdef HAS_BUTTONBAR
|
||||||
|
display->has_buttonbar=false;
|
||||||
|
#endif
|
||||||
|
gui_textarea_clear(display);
|
||||||
|
if (display->height / display->char_height < 7) /* we need at leats 7 lines */
|
||||||
{
|
{
|
||||||
case QUICKSCREEN_TOP:
|
display->setfont(FONT_SYSFIXED);
|
||||||
if (nb_lines > 2)
|
|
||||||
{
|
|
||||||
if (title)
|
|
||||||
{
|
|
||||||
display->mono_bitmap(bitmap_icons_7x8[Icon_UpArrow],
|
|
||||||
(vp->width/2)-4, 0, 7, 8);
|
|
||||||
line = 1;
|
|
||||||
}
|
}
|
||||||
else
|
display->getstringsize("A", NULL, &font_h);
|
||||||
line = 2;
|
|
||||||
}
|
/* do these calculations once */
|
||||||
else
|
const unsigned int puts_center = display->height/2/font_h;
|
||||||
line = title?0:1;
|
const unsigned int puts_bottom = display->height/font_h;
|
||||||
x = (vp->width - w)/2;
|
const unsigned int putsxy_center = display->height/2;
|
||||||
break;
|
const unsigned int putsxy_bottom = display->height;
|
||||||
case QUICKSCREEN_BOTTOM:
|
|
||||||
if (title && nb_lines > 2 && item == QUICKSCREEN_BOTTOM)
|
/* Displays the first line of text */
|
||||||
{
|
option=(unsigned char *)option_select_get_text(qs->left_option);
|
||||||
display->mono_bitmap(bitmap_icons_7x8[Icon_DownArrow],
|
title=(unsigned char *)qs->left_option->title;
|
||||||
(vp->width/2)-4, vp->height-8, 7, 8);
|
display->puts_scroll(2, puts_center-4+!statusbar, title);
|
||||||
}
|
display->puts_scroll(2, puts_center-3+!statusbar, option);
|
||||||
line = title?0:1;
|
|
||||||
x = (vp->width - w)/2;
|
|
||||||
break;
|
|
||||||
case QUICKSCREEN_LEFT:
|
|
||||||
if (nb_lines > 1)
|
|
||||||
{
|
|
||||||
line = nb_lines/2;
|
|
||||||
if (title)
|
|
||||||
line--;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
line = 0;
|
|
||||||
if (title)
|
|
||||||
display->mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], 1,
|
display->mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], 1,
|
||||||
line*display->char_height+display->char_height/2, 7, 8);
|
putsxy_center-(font_h*3), 7, 8);
|
||||||
x = 12;
|
|
||||||
break;
|
/* Displays the second line of text */
|
||||||
case QUICKSCREEN_RIGHT:
|
option=(unsigned char *)option_select_get_text(qs->right_option);
|
||||||
line = nb_lines/2;
|
title=(unsigned char *)qs->right_option->title;
|
||||||
if (title == false)
|
display->getstringsize(title, &w, NULL);
|
||||||
line++;
|
if(w > display->width - 8)
|
||||||
if (title)
|
{
|
||||||
display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward],
|
display->puts_scroll(2, puts_center-2+!statusbar, title);
|
||||||
vp->width - 8,
|
display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward], 1,
|
||||||
line*display->char_height+display->char_height/2, 7, 8);
|
putsxy_center-font_h, 7, 8);
|
||||||
x = vp->width - w - 12;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
if (w>vp->width)
|
|
||||||
display->puts_scroll(0,line,s);
|
|
||||||
else
|
else
|
||||||
display->putsxy(x, line*display->char_height, s);
|
{
|
||||||
|
display->putsxy(display->width - w - 12, putsxy_center-font_h, title);
|
||||||
|
display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward],
|
||||||
|
display->width - 8, putsxy_center-font_h, 7, 8);
|
||||||
|
}
|
||||||
|
display->getstringsize(option, &w, NULL);
|
||||||
|
if(w > display->width)
|
||||||
|
display->puts_scroll(0, puts_center-1+!statusbar, option);
|
||||||
|
else
|
||||||
|
display->putsxy(display->width -w-12, putsxy_center, option);
|
||||||
|
|
||||||
|
/* Displays the third line of text */
|
||||||
|
option=(unsigned char *)option_select_get_text(qs->bottom_option);
|
||||||
|
title=(unsigned char *)qs->bottom_option->title;
|
||||||
|
|
||||||
|
display->getstringsize(title, &w, NULL);
|
||||||
|
if(w > display->width)
|
||||||
|
display->puts_scroll(0, puts_bottom-4+!statusbar, title);
|
||||||
|
else
|
||||||
|
display->putsxy(display->width/2-w/2, putsxy_bottom-(font_h*3), title);
|
||||||
|
|
||||||
|
display->getstringsize(option, &w, NULL);
|
||||||
|
if(w > display->width)
|
||||||
|
display->puts_scroll(0, puts_bottom-3+!statusbar, option);
|
||||||
|
else
|
||||||
|
display->putsxy(display->width/2-w/2, putsxy_bottom-(font_h*2), option);
|
||||||
|
display->mono_bitmap(bitmap_icons_7x8[Icon_DownArrow], display->width/2-4,
|
||||||
|
putsxy_bottom-font_h, 7, 8);
|
||||||
|
|
||||||
|
gui_textarea_update(display);
|
||||||
|
display->setfont(FONT_UI);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gui_quickscreen_draw(struct gui_quickscreen *qs,
|
/*
|
||||||
struct screen *display,
|
* Draws the quickscreen on all available screens
|
||||||
struct viewport *parent)
|
* - qs : the quickscreen
|
||||||
|
*/
|
||||||
|
static void gui_syncquickscreen_draw(struct gui_quickscreen * qs)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
char buf[MAX_PATH];
|
FOR_NB_SCREENS(i)
|
||||||
unsigned char *title, *value;
|
gui_quickscreen_draw(qs, &screens[i]);
|
||||||
void *setting;
|
|
||||||
int temp;
|
|
||||||
display->set_viewport(parent);
|
|
||||||
display->clear_viewport();
|
|
||||||
for (i=0; i<QUICKSCREEN_ITEM_COUNT; i++)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (!qs->items[i])
|
|
||||||
continue;
|
|
||||||
display->set_viewport(&vps[display->screen_type][i]);
|
|
||||||
display->scroll_stop(&vps[display->screen_type][i]);
|
|
||||||
|
|
||||||
title = P2STR(ID2P(qs->items[i]->lang_id));
|
|
||||||
setting = qs->items[i]->setting;
|
|
||||||
if (qs->items[i]->flags&F_T_BOOL)
|
|
||||||
temp = *(bool*)setting?1:0;
|
|
||||||
else
|
|
||||||
temp = *(int*)setting;
|
|
||||||
value = option_get_valuestring((struct settings_list*)qs->items[i], buf, MAX_PATH, temp);
|
|
||||||
|
|
||||||
if (vps[display->screen_type][i].height < display->char_height*2)
|
|
||||||
{
|
|
||||||
char text[MAX_PATH];
|
|
||||||
snprintf(text, MAX_PATH, "%s: %s", title, value);
|
|
||||||
quickscreen_draw_text(text, i, true, display, &vps[display->screen_type][i]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
quickscreen_draw_text(title, i, true, display, &vps[display->screen_type][i]);
|
|
||||||
quickscreen_draw_text(value, i, false, display, &vps[display->screen_type][i]);
|
|
||||||
}
|
|
||||||
display->update_viewport();
|
|
||||||
}
|
|
||||||
display->set_viewport(parent);
|
|
||||||
display->update_viewport();
|
|
||||||
display->set_viewport(NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Does the actions associated to the given button if any
|
* Does the actions associated to the given button if any
|
||||||
* - qs : the quickscreen
|
* - qs : the quickscreen
|
||||||
|
@ -230,26 +141,23 @@ static void gui_quickscreen_draw(struct gui_quickscreen *qs,
|
||||||
*/
|
*/
|
||||||
static bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button)
|
static bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button)
|
||||||
{
|
{
|
||||||
|
|
||||||
switch(button)
|
switch(button)
|
||||||
{
|
{
|
||||||
case ACTION_QS_LEFT:
|
case ACTION_QS_LEFT:
|
||||||
if (qs->items[QUICKSCREEN_LEFT])
|
option_select_next(qs->left_option);
|
||||||
option_select_next_val((struct settings_list *)qs->items[QUICKSCREEN_LEFT]);
|
|
||||||
return(true);
|
return(true);
|
||||||
|
|
||||||
case ACTION_QS_DOWN:
|
case ACTION_QS_DOWN:
|
||||||
if (qs->items[QUICKSCREEN_BOTTOM])
|
option_select_next(qs->bottom_option);
|
||||||
option_select_next_val((struct settings_list *)qs->items[QUICKSCREEN_BOTTOM]);
|
|
||||||
return(true);
|
return(true);
|
||||||
|
|
||||||
case ACTION_QS_RIGHT:
|
case ACTION_QS_RIGHT:
|
||||||
if (qs->items[QUICKSCREEN_RIGHT])
|
option_select_next(qs->right_option);
|
||||||
option_select_next_val((struct settings_list *)qs->items[QUICKSCREEN_RIGHT]);
|
|
||||||
return(true);
|
return(true);
|
||||||
|
|
||||||
case ACTION_QS_DOWNINV:
|
case ACTION_QS_DOWNINV:
|
||||||
if (qs->items[QUICKSCREEN_TOP])
|
option_select_prev(qs->bottom_option);
|
||||||
option_select_next_val((struct settings_list *)qs->items[QUICKSCREEN_TOP]);
|
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
return(false);
|
return(false);
|
||||||
|
@ -257,50 +165,24 @@ static bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button)
|
||||||
|
|
||||||
bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter)
|
bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter)
|
||||||
{
|
{
|
||||||
int button, i;
|
int button;
|
||||||
bool changed = false;
|
|
||||||
struct viewport vp[NB_SCREENS];
|
|
||||||
/* To quit we need either :
|
/* To quit we need either :
|
||||||
* - a second press on the button that made us enter
|
* - a second press on the button that made us enter
|
||||||
* - an action taken while pressing the enter button,
|
* - an action taken while pressing the enter button,
|
||||||
* then release the enter button*/
|
* then release the enter button*/
|
||||||
bool can_quit=false;
|
bool can_quit=false;
|
||||||
|
gui_syncquickscreen_draw(qs);
|
||||||
gui_syncstatusbar_draw(&statusbars, true);
|
gui_syncstatusbar_draw(&statusbars, true);
|
||||||
FOR_NB_SCREENS(i)
|
|
||||||
{
|
|
||||||
screens[i].set_viewport(NULL);
|
|
||||||
screens[i].scroll_stop(NULL);
|
|
||||||
vp[i].x = 0;
|
|
||||||
vp[i].width = screens[i].width;
|
|
||||||
vp[i].y = STATUSBAR_HEIGHT;
|
|
||||||
vp[i].height = screens[i].height - STATUSBAR_HEIGHT;
|
|
||||||
#ifdef HAVE_LCD_COLOR
|
|
||||||
if (screens[i].is_color)
|
|
||||||
{
|
|
||||||
vp[i].fg_pattern = global_settings.fg_color;
|
|
||||||
vp[i].bg_pattern = global_settings.bg_color;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
vp[i].xmargin = 0;
|
|
||||||
vp[i].ymargin = 0;
|
|
||||||
vp[i].font = FONT_UI;
|
|
||||||
vp[i].drawmode = STYLE_DEFAULT;
|
|
||||||
quickscreen_fix_viewports(qs, &screens[i], &vp[i]);
|
|
||||||
gui_quickscreen_draw(qs, &screens[i], &vp[i]);
|
|
||||||
}
|
|
||||||
while (true) {
|
while (true) {
|
||||||
button = get_action(CONTEXT_QUICKSCREEN,TIMEOUT_BLOCK);
|
button = get_action(CONTEXT_QUICKSCREEN,TIMEOUT_BLOCK);
|
||||||
if(default_event_handler(button) == SYS_USB_CONNECTED)
|
if(default_event_handler(button) == SYS_USB_CONNECTED)
|
||||||
return(true);
|
return(true);
|
||||||
if(gui_quickscreen_do_button(qs, button))
|
if(gui_quickscreen_do_button(qs, button))
|
||||||
{
|
{
|
||||||
changed = true;
|
|
||||||
can_quit=true;
|
can_quit=true;
|
||||||
if (button == ACTION_QS_DOWNINV &&
|
if(qs->callback)
|
||||||
!qs->items[QUICKSCREEN_TOP])
|
qs->callback(qs);
|
||||||
break;
|
gui_syncquickscreen_draw(qs);
|
||||||
FOR_NB_SCREENS(i)
|
|
||||||
gui_quickscreen_draw(qs, &screens[i], &vp[i]);
|
|
||||||
}
|
}
|
||||||
else if(button==button_enter)
|
else if(button==button_enter)
|
||||||
can_quit=true;
|
can_quit=true;
|
||||||
|
@ -313,36 +195,8 @@ bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter)
|
||||||
|
|
||||||
gui_syncstatusbar_draw(&statusbars, false);
|
gui_syncstatusbar_draw(&statusbars, false);
|
||||||
}
|
}
|
||||||
if (changed)
|
|
||||||
settings_apply();
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool quick_screen_quick(int button_enter)
|
|
||||||
{
|
|
||||||
struct gui_quickscreen qs;
|
|
||||||
qs.items[QUICKSCREEN_LEFT] = find_setting_from_string(global_settings.quickscreen_left, NULL);
|
|
||||||
qs.items[QUICKSCREEN_RIGHT] = find_setting_from_string(global_settings.quickscreen_right,NULL);
|
|
||||||
qs.items[QUICKSCREEN_BOTTOM] = find_setting_from_string(global_settings.quickscreen_bottom, NULL);
|
|
||||||
qs.items[QUICKSCREEN_TOP] = find_setting_from_string(global_settings.quickscreen_top,NULL);
|
|
||||||
qs.callback = NULL;
|
|
||||||
gui_syncquickscreen_run(&qs, button_enter);
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef BUTTON_F3
|
|
||||||
bool quick_screen_f3(int button_enter)
|
|
||||||
{
|
|
||||||
struct gui_quickscreen qs;
|
|
||||||
qs.items[QUICKSCREEN_LEFT] = find_setting(&global_settings.scrollbar, NULL);
|
|
||||||
qs.items[QUICKSCREEN_RIGHT] = find_setting(&global_settings.statusbar, NULL);
|
|
||||||
qs.items[QUICKSCREEN_BOTTOM] = find_setting(&global_settings.flip_display, NULL);
|
|
||||||
qs.items[QUICKSCREEN_TOP] = NULL;
|
|
||||||
qs.callback = NULL;
|
|
||||||
gui_syncquickscreen_run(&qs, button_enter);
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
#endif /* BUTTON_F3 */
|
|
||||||
|
|
||||||
#endif /* HAVE_QUICKSCREEN */
|
#endif /* HAVE_QUICKSCREEN */
|
||||||
|
|
||||||
|
|
|
@ -27,30 +27,45 @@
|
||||||
#include "option_select.h"
|
#include "option_select.h"
|
||||||
#include "screen_access.h"
|
#include "screen_access.h"
|
||||||
|
|
||||||
enum QUICKSCREEN_ITEM {
|
struct gui_quickscreen;
|
||||||
QUICKSCREEN_LEFT = 0,
|
/*
|
||||||
QUICKSCREEN_RIGHT,
|
* Callback function called each time the quickscreen gets modified
|
||||||
QUICKSCREEN_TOP,
|
* - qs : the quickscreen that did the modification
|
||||||
QUICKSCREEN_BOTTOM,
|
*/
|
||||||
QUICKSCREEN_ITEM_COUNT,
|
typedef void (quickscreen_callback)(struct gui_quickscreen * qs);
|
||||||
};
|
|
||||||
|
|
||||||
struct gui_quickscreen
|
struct gui_quickscreen
|
||||||
{
|
{
|
||||||
const struct settings_list *items[QUICKSCREEN_ITEM_COUNT];
|
struct option_select *left_option;
|
||||||
void (*callback)(struct gui_quickscreen * qs);
|
struct option_select *bottom_option;
|
||||||
|
struct option_select *right_option;
|
||||||
|
quickscreen_callback *callback;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Initializes a quickscreen
|
||||||
|
* - qs : the quickscreen
|
||||||
|
* - left_option, bottom_option, right_option : a list of choices
|
||||||
|
* for each option
|
||||||
|
* - left_right_title : the 2nd line of the title
|
||||||
|
* on the left and on the right
|
||||||
|
* - callback : a callback function called each time the quickscreen
|
||||||
|
* gets modified
|
||||||
|
*/
|
||||||
|
void gui_quickscreen_init(struct gui_quickscreen * qs,
|
||||||
|
struct option_select *left_option,
|
||||||
|
struct option_select *bottom_option,
|
||||||
|
struct option_select *right_option,
|
||||||
|
quickscreen_callback *callback);
|
||||||
|
|
||||||
struct gui_quickscreen;
|
|
||||||
|
/*
|
||||||
|
* Runs the quickscreen on all available screens, if button_enter is released, quits
|
||||||
|
* - qs : the quickscreen
|
||||||
|
* - button_enter : button pressed at the same time the quickscreen is displayed
|
||||||
|
* returns : true if usb was connected, false otherwise
|
||||||
|
*/
|
||||||
bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter);
|
bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter);
|
||||||
|
|
||||||
|
|
||||||
#ifdef BUTTON_F3
|
|
||||||
extern bool quick_screen_f3(int button_enter);
|
|
||||||
#endif
|
|
||||||
extern bool quick_screen_quick(int button_enter);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /*_GUI_QUICK_SCREEN_H_*/
|
#endif /*_GUI_QUICK_SCREEN_H_*/
|
||||||
#endif /* HAVE_QUICKSCREEN */
|
#endif /* HAVE_QUICKSCREEN */
|
||||||
|
|
|
@ -10087,53 +10087,53 @@
|
||||||
</phrase>
|
</phrase>
|
||||||
<phrase>
|
<phrase>
|
||||||
id: LANG_SYSFONT_SET_BOOL_YES
|
id: LANG_SYSFONT_SET_BOOL_YES
|
||||||
desc: deprecated
|
desc: bool true representation
|
||||||
user:
|
user:
|
||||||
<source>
|
<source>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Yes"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Yes"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Yes"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
<phrase>
|
<phrase>
|
||||||
id: LANG_SYSFONT_SET_BOOL_NO
|
id: LANG_SYSFONT_SET_BOOL_NO
|
||||||
desc: deprecated
|
desc: bool false representation
|
||||||
user:
|
user:
|
||||||
<source>
|
<source>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "No"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "No"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "No"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
<phrase>
|
<phrase>
|
||||||
id: LANG_SYSFONT_ON
|
id: LANG_SYSFONT_ON
|
||||||
desc: deprecated
|
desc: Used in a lot of places
|
||||||
user:
|
user:
|
||||||
<source>
|
<source>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "On"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "On"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "On"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
<phrase>
|
<phrase>
|
||||||
|
@ -10206,206 +10206,206 @@
|
||||||
</phrase>
|
</phrase>
|
||||||
<phrase>
|
<phrase>
|
||||||
id: LANG_SYSFONT_SHUFFLE
|
id: LANG_SYSFONT_SHUFFLE
|
||||||
desc: deprecated
|
desc: in settings_menu
|
||||||
user:
|
user:
|
||||||
<source>
|
<source>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Shuffle"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Shuffle"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Shuffle"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
<phrase>
|
<phrase>
|
||||||
id: LANG_SYSFONT_REPEAT
|
id: LANG_SYSFONT_REPEAT
|
||||||
desc: deprecated
|
desc: in settings_menu
|
||||||
user:
|
user:
|
||||||
<source>
|
<source>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Repeat"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Repeat"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Repeat"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
<phrase>
|
<phrase>
|
||||||
id: LANG_SYSFONT_ALL
|
id: LANG_SYSFONT_ALL
|
||||||
desc: deprecated
|
desc: repeat playlist once all songs have completed
|
||||||
user:
|
user:
|
||||||
<source>
|
<source>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "All"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "All"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "All"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
<phrase>
|
<phrase>
|
||||||
id: LANG_SYSFONT_REPEAT_ONE
|
id: LANG_SYSFONT_REPEAT_ONE
|
||||||
desc: deprecated
|
desc: repeat one song
|
||||||
user:
|
user:
|
||||||
<source>
|
<source>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "One"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "One"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "One"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
<phrase>
|
<phrase>
|
||||||
id: LANG_SYSFONT_REPEAT_AB
|
id: LANG_SYSFONT_REPEAT_AB
|
||||||
desc: deprecated
|
desc: repeat range from point A to B
|
||||||
user:
|
user:
|
||||||
<source>
|
<source>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "A-B"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "A-B"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "A-B"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
<phrase>
|
<phrase>
|
||||||
id: LANG_SYSFONT_FILTER
|
id: LANG_SYSFONT_FILTER
|
||||||
desc: deprecated
|
desc: setting name for dir filter
|
||||||
user:
|
user:
|
||||||
<source>
|
<source>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Show Files"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Show Files"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Show Files"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
<phrase>
|
<phrase>
|
||||||
id: LANG_SYSFONT_FILTER_SUPPORTED
|
id: LANG_SYSFONT_FILTER_SUPPORTED
|
||||||
desc: deprecated
|
desc: show all file types supported by Rockbox
|
||||||
user:
|
user:
|
||||||
<source>
|
<source>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Supported"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Supported"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Supported"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
<phrase>
|
<phrase>
|
||||||
id: LANG_SYSFONT_FILTER_MUSIC
|
id: LANG_SYSFONT_FILTER_MUSIC
|
||||||
desc: deprecated
|
desc: show only music-related files
|
||||||
user:
|
user:
|
||||||
<source>
|
<source>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Music"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Music"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Music"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
<phrase>
|
<phrase>
|
||||||
id: LANG_SYSFONT_FILTER_PLAYLIST
|
id: LANG_SYSFONT_FILTER_PLAYLIST
|
||||||
desc: deprecated
|
desc: show only playlist
|
||||||
user:
|
user:
|
||||||
<source>
|
<source>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Playlists"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Playlists"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Playlists"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
<phrase>
|
<phrase>
|
||||||
id: LANG_SYSFONT_FLIP_DISPLAY
|
id: LANG_SYSFONT_FLIP_DISPLAY
|
||||||
desc: deprecated
|
desc: in settings_menu, option to turn display+buttos by 180 degreed
|
||||||
user:
|
user:
|
||||||
<source>
|
<source>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Upside Down"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Upside Down"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Upside Down"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
<phrase>
|
<phrase>
|
||||||
id: LANG_SYSFONT_SCROLL_BAR
|
id: LANG_SYSFONT_SCROLL_BAR
|
||||||
desc: deprecated
|
desc: display menu, F3 substitute
|
||||||
user:
|
user:
|
||||||
<source>
|
<source>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Scroll Bar"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Scroll Bar"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Scroll Bar"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
<phrase>
|
<phrase>
|
||||||
id: LANG_SYSFONT_STATUS_BAR
|
id: LANG_SYSFONT_STATUS_BAR
|
||||||
desc: deprecated
|
desc: display menu, F3 substitute
|
||||||
user:
|
user:
|
||||||
<source>
|
<source>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Status Bar"
|
||||||
</source>
|
</source>
|
||||||
<dest>
|
<dest>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Status Bar"
|
||||||
</dest>
|
</dest>
|
||||||
<voice>
|
<voice>
|
||||||
*: none
|
*: none
|
||||||
lcd_bitmap: ""
|
lcd_bitmap: "Status Bar"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</phrase>
|
||||||
<phrase>
|
<phrase>
|
||||||
|
|
152
apps/screens.c
152
apps/screens.c
|
@ -636,6 +636,158 @@ bool pitch_screen(void)
|
||||||
}
|
}
|
||||||
#endif /* HAVE_PITCHSCREEN */
|
#endif /* HAVE_PITCHSCREEN */
|
||||||
|
|
||||||
|
#ifdef HAVE_QUICKSCREEN
|
||||||
|
|
||||||
|
#define bool_to_int(b)\
|
||||||
|
b?1:0
|
||||||
|
#define int_to_bool(i)\
|
||||||
|
i==0?false:true
|
||||||
|
|
||||||
|
static void quick_screen_quick_apply(struct gui_quickscreen *qs)
|
||||||
|
{
|
||||||
|
global_settings.playlist_shuffle=int_to_bool(qs->left_option->option);
|
||||||
|
global_settings.dirfilter=qs->bottom_option->option;
|
||||||
|
global_settings.repeat_mode=qs->right_option->option;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool quick_screen_quick(int button_enter)
|
||||||
|
{
|
||||||
|
bool res, oldshuffle;
|
||||||
|
struct option_select left_option;
|
||||||
|
struct option_select bottom_option;
|
||||||
|
struct option_select right_option;
|
||||||
|
int oldrepeat, old_x_margin, old_y_margin;
|
||||||
|
|
||||||
|
static const struct opt_items left_items[] = {
|
||||||
|
[0]={ STR(LANG_SYSFONT_OFF) },
|
||||||
|
[1]={ STR(LANG_SYSFONT_ON) }
|
||||||
|
};
|
||||||
|
static const struct opt_items bottom_items[] = {
|
||||||
|
[SHOW_ALL]={ STR(LANG_SYSFONT_ALL) },
|
||||||
|
[SHOW_SUPPORTED]={ STR(LANG_SYSFONT_FILTER_SUPPORTED) },
|
||||||
|
[SHOW_MUSIC]={ STR(LANG_SYSFONT_FILTER_MUSIC) },
|
||||||
|
[SHOW_PLAYLIST]={ STR(LANG_SYSFONT_FILTER_PLAYLIST) },
|
||||||
|
};
|
||||||
|
static const struct opt_items right_items[] = {
|
||||||
|
[REPEAT_OFF]={ STR(LANG_SYSFONT_OFF) },
|
||||||
|
[REPEAT_ALL]={ STR(LANG_SYSFONT_ALL) },
|
||||||
|
[REPEAT_ONE]={ STR(LANG_SYSFONT_REPEAT_ONE) },
|
||||||
|
[REPEAT_SHUFFLE]={ STR(LANG_SYSFONT_SHUFFLE) },
|
||||||
|
#ifdef AB_REPEAT_ENABLE
|
||||||
|
[REPEAT_AB]={ STR(LANG_SYSFONT_REPEAT_AB) }
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
struct gui_quickscreen qs;
|
||||||
|
|
||||||
|
old_x_margin = lcd_getxmargin();
|
||||||
|
old_y_margin = lcd_getymargin();
|
||||||
|
lcd_setmargins(0, 0);
|
||||||
|
|
||||||
|
option_select_init_items(&left_option,
|
||||||
|
(char *)str(LANG_SYSFONT_SHUFFLE),
|
||||||
|
bool_to_int(global_settings.playlist_shuffle),
|
||||||
|
left_items,
|
||||||
|
2);
|
||||||
|
option_select_init_items(&bottom_option,
|
||||||
|
(char *)str(LANG_SYSFONT_FILTER),
|
||||||
|
global_settings.dirfilter,
|
||||||
|
bottom_items,
|
||||||
|
sizeof(bottom_items)/sizeof(struct opt_items));
|
||||||
|
option_select_init_items(&right_option,
|
||||||
|
(char *)str(LANG_SYSFONT_REPEAT),
|
||||||
|
global_settings.repeat_mode,
|
||||||
|
right_items,
|
||||||
|
sizeof(right_items)/sizeof(struct opt_items));
|
||||||
|
|
||||||
|
gui_quickscreen_init(&qs, &left_option, &bottom_option, &right_option,
|
||||||
|
&quick_screen_quick_apply);
|
||||||
|
oldrepeat=global_settings.repeat_mode;
|
||||||
|
oldshuffle=global_settings.playlist_shuffle;
|
||||||
|
res=gui_syncquickscreen_run(&qs, button_enter);
|
||||||
|
if(!res)
|
||||||
|
{
|
||||||
|
if ( oldrepeat != global_settings.repeat_mode &&
|
||||||
|
(audio_status() & AUDIO_STATUS_PLAY) )
|
||||||
|
audio_flush_and_reload_tracks();
|
||||||
|
if(oldshuffle != global_settings.playlist_shuffle
|
||||||
|
&& audio_status() & AUDIO_STATUS_PLAY)
|
||||||
|
{
|
||||||
|
#if CONFIG_CODEC == SWCODEC
|
||||||
|
dsp_set_replaygain();
|
||||||
|
#endif
|
||||||
|
if (global_settings.playlist_shuffle)
|
||||||
|
playlist_randomise(NULL, current_tick, true);
|
||||||
|
else
|
||||||
|
playlist_sort(NULL, true);
|
||||||
|
}
|
||||||
|
settings_save();
|
||||||
|
}
|
||||||
|
lcd_setmargins(old_x_margin, old_y_margin);
|
||||||
|
return(res);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef BUTTON_F3
|
||||||
|
static void quick_screen_f3_apply(struct gui_quickscreen *qs)
|
||||||
|
{
|
||||||
|
global_settings.scrollbar=int_to_bool(qs->left_option->option);
|
||||||
|
|
||||||
|
global_settings.flip_display=int_to_bool(qs->bottom_option->option);
|
||||||
|
button_set_flip(global_settings.flip_display);
|
||||||
|
lcd_set_flip(global_settings.flip_display);
|
||||||
|
|
||||||
|
global_settings.statusbar=int_to_bool(qs->right_option->option);
|
||||||
|
gui_syncstatusbar_draw(&statusbars, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool quick_screen_f3(int button_enter)
|
||||||
|
{
|
||||||
|
bool res;
|
||||||
|
struct option_select left_option;
|
||||||
|
struct option_select bottom_option;
|
||||||
|
struct option_select right_option;
|
||||||
|
int old_x_margin, old_y_margin;
|
||||||
|
|
||||||
|
static const struct opt_items onoff_items[] = {
|
||||||
|
[0]={ STR(LANG_SYSFONT_OFF) },
|
||||||
|
[1]={ STR(LANG_SYSFONT_ON) }
|
||||||
|
};
|
||||||
|
static const struct opt_items yesno_items[] = {
|
||||||
|
[0]={ STR(LANG_SYSFONT_SET_BOOL_NO) },
|
||||||
|
[1]={ STR(LANG_SYSFONT_SET_BOOL_YES) }
|
||||||
|
};
|
||||||
|
|
||||||
|
struct gui_quickscreen qs;
|
||||||
|
|
||||||
|
old_x_margin = lcd_getxmargin();
|
||||||
|
old_y_margin = lcd_getymargin();
|
||||||
|
lcd_setmargins(0, 0);
|
||||||
|
|
||||||
|
option_select_init_items(&left_option,
|
||||||
|
str(LANG_SYSFONT_SCROLL_BAR),
|
||||||
|
bool_to_int(global_settings.scrollbar),
|
||||||
|
onoff_items,
|
||||||
|
2);
|
||||||
|
option_select_init_items(&bottom_option,
|
||||||
|
str(LANG_SYSFONT_FLIP_DISPLAY),
|
||||||
|
bool_to_int(global_settings.flip_display),
|
||||||
|
yesno_items,
|
||||||
|
2);
|
||||||
|
option_select_init_items(&right_option,
|
||||||
|
str(LANG_SYSFONT_STATUS_BAR),
|
||||||
|
bool_to_int(global_settings.statusbar),
|
||||||
|
onoff_items,
|
||||||
|
2);
|
||||||
|
gui_quickscreen_init(&qs, &left_option, &bottom_option, &right_option,
|
||||||
|
&quick_screen_f3_apply);
|
||||||
|
res=gui_syncquickscreen_run(&qs, button_enter);
|
||||||
|
if(!res)
|
||||||
|
settings_save();
|
||||||
|
lcd_setmargins(old_x_margin, old_y_margin);
|
||||||
|
return(res);
|
||||||
|
}
|
||||||
|
#endif /* BUTTON_F3 */
|
||||||
|
#endif /* CONFIG_KEYPAD in (RECORDER_PAD |IRIVER_H100_PAD | IRIVER_H300_PAD) */
|
||||||
|
|
||||||
#if CONFIG_CHARGING
|
#if CONFIG_CHARGING
|
||||||
void charging_splash(void)
|
void charging_splash(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,6 +40,11 @@ int mmc_remove_request(void);
|
||||||
bool pitch_screen(void);
|
bool pitch_screen(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef BUTTON_F3
|
||||||
|
extern bool quick_screen_f3(int button_enter);
|
||||||
|
#endif
|
||||||
|
extern bool quick_screen_quick(int button_enter);
|
||||||
|
|
||||||
#if CONFIG_RTC
|
#if CONFIG_RTC
|
||||||
bool set_time_screen(const char* title, struct tm *tm);
|
bool set_time_screen(const char* title, struct tm *tm);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1000,20 +1000,7 @@ const struct settings_list* find_setting(void* variable, int *id)
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
const struct settings_list* find_setting_from_string(char* setting, int *id)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
for(i=0;i<nb_settings;i++)
|
|
||||||
{
|
|
||||||
if (settings[i].cfg_name && !strcmp(setting, settings[i].cfg_name))
|
|
||||||
{
|
|
||||||
if (id)
|
|
||||||
*id = i;
|
|
||||||
return &settings[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
void talk_setting(void *global_settings_variable)
|
void talk_setting(void *global_settings_variable)
|
||||||
{
|
{
|
||||||
const struct settings_list *setting;
|
const struct settings_list *setting;
|
||||||
|
|
|
@ -224,7 +224,6 @@ void settings_display(void);
|
||||||
enum optiontype { INT, BOOL };
|
enum optiontype { INT, BOOL };
|
||||||
|
|
||||||
const struct settings_list* find_setting(void* variable, int *id);
|
const struct settings_list* find_setting(void* variable, int *id);
|
||||||
const struct settings_list* find_setting_from_string(char* setting, int *id);
|
|
||||||
bool cfg_int_to_string(int setting_id, int val, char* buf, int buf_len);
|
bool cfg_int_to_string(int setting_id, int val, char* buf, int buf_len);
|
||||||
void talk_setting(void *global_settings_variable);
|
void talk_setting(void *global_settings_variable);
|
||||||
bool set_sound(const unsigned char * string,
|
bool set_sound(const unsigned char * string,
|
||||||
|
@ -726,13 +725,6 @@ struct user_settings
|
||||||
int keyclick_repeats; /* keyclick on repeats */
|
int keyclick_repeats; /* keyclick on repeats */
|
||||||
#endif
|
#endif
|
||||||
unsigned char playlist_catalog_dir[MAX_FILENAME+1];
|
unsigned char playlist_catalog_dir[MAX_FILENAME+1];
|
||||||
|
|
||||||
#ifdef HAVE_QUICKSCREEN
|
|
||||||
unsigned char quickscreen_left[MAX_FILENAME+1];
|
|
||||||
unsigned char quickscreen_right[MAX_FILENAME+1];
|
|
||||||
unsigned char quickscreen_top[MAX_FILENAME+1];
|
|
||||||
unsigned char quickscreen_bottom[MAX_FILENAME+1];
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** global variables **/
|
/** global variables **/
|
||||||
|
|
|
@ -1189,16 +1189,6 @@ const struct settings_list settings[] = {
|
||||||
#endif /* CONFIG_CODEC == SWCODEC */
|
#endif /* CONFIG_CODEC == SWCODEC */
|
||||||
FILENAME_SETTING(0, playlist_catalog_dir, "playlist catalog directory",
|
FILENAME_SETTING(0, playlist_catalog_dir, "playlist catalog directory",
|
||||||
PLAYLIST_CATALOG_DEFAULT_DIR, NULL, NULL, MAX_FILENAME+1),
|
PLAYLIST_CATALOG_DEFAULT_DIR, NULL, NULL, MAX_FILENAME+1),
|
||||||
#ifdef HAVE_QUICKSCREEN
|
|
||||||
FILENAME_SETTING(0, quickscreen_left, "quickscreen left",
|
|
||||||
"shuffle", NULL, NULL, MAX_FILENAME+1),
|
|
||||||
FILENAME_SETTING(0, quickscreen_right, "quickscreen right",
|
|
||||||
"repeat", NULL, NULL, MAX_FILENAME+1),
|
|
||||||
FILENAME_SETTING(0, quickscreen_top, "quickscreen top",
|
|
||||||
"", NULL, NULL, MAX_FILENAME+1),
|
|
||||||
FILENAME_SETTING(0, quickscreen_bottom, "quickscreen bottom",
|
|
||||||
"show files", NULL, NULL, MAX_FILENAME+1),
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const int nb_settings = sizeof(settings)/sizeof(*settings);
|
const int nb_settings = sizeof(settings)/sizeof(*settings);
|
||||||
|
|
|
@ -77,7 +77,6 @@
|
||||||
#include "buttonbar.h"
|
#include "buttonbar.h"
|
||||||
#include "textarea.h"
|
#include "textarea.h"
|
||||||
#include "action.h"
|
#include "action.h"
|
||||||
#include "quickscreen.h"
|
|
||||||
|
|
||||||
#include "root_menu.h"
|
#include "root_menu.h"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue