draw markers on the FM frequency bar for presets (like cuesheet markers in the WPS).
seems nice but if it ends up looking crap we can revert.. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26429 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
5b4a9b5e35
commit
22b12cafbb
4 changed files with 45 additions and 7 deletions
|
@ -185,17 +185,26 @@ static void draw_progressbar(struct gui_wps *gwps,
|
|||
gui_scrollbar_draw(display, pb->x, y, pb->width, height,
|
||||
length, 0, elapsed, HORIZONTAL);
|
||||
|
||||
if (pb->type == WPS_TOKEN_PROGRESSBAR && id3 && id3->length)
|
||||
if (pb->type == WPS_TOKEN_PROGRESSBAR)
|
||||
{
|
||||
if (id3 && id3->length)
|
||||
{
|
||||
#ifdef AB_REPEAT_ENABLE
|
||||
if (ab_repeat_mode_enabled())
|
||||
ab_draw_markers(display, id3->length,
|
||||
pb->x, y, pb->width, height);
|
||||
if (ab_repeat_mode_enabled())
|
||||
ab_draw_markers(display, id3->length,
|
||||
pb->x, y, pb->width, height);
|
||||
#endif
|
||||
|
||||
if (id3->cuesheet)
|
||||
cue_draw_markers(display, id3->cuesheet, id3->length,
|
||||
pb->x, y+1, pb->width, height-2);
|
||||
if (id3->cuesheet)
|
||||
cue_draw_markers(display, id3->cuesheet, id3->length,
|
||||
pb->x, y+1, pb->width, height-2);
|
||||
}
|
||||
#if CONFIG_TUNER
|
||||
else if (in_radio_screen() || (get_radio_status() != FMRADIO_OFF))
|
||||
{
|
||||
presets_draw_markers(display, pb->x, y, pb->width, height);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1211,6 +1211,7 @@ static int parse_progressbar(const char *wps_bufptr,
|
|||
pb->y = -line_num - 1; /* Will be computed during the rendering */
|
||||
if (token->type == WPS_TOKEN_VOLUME || token->type == WPS_TOKEN_BATTERY_PERCENT)
|
||||
return 0; /* dont add it, let the regular token handling do the work */
|
||||
pb->type = token->type;
|
||||
add_to_ll_chain(&wps_data->progressbars, item);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -612,3 +612,30 @@ void presets_save(void)
|
|||
else
|
||||
radio_save_presets();
|
||||
}
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
static inline void draw_veritcal_line_mark(struct screen * screen,
|
||||
int x, int y, int h)
|
||||
{
|
||||
screen->set_drawmode(DRMODE_COMPLEMENT);
|
||||
screen->vline(x, y, y+h-1);
|
||||
}
|
||||
|
||||
/* draw the preset markers for a track of length "tracklen",
|
||||
between (x,y) and (x+w,y) */
|
||||
void presets_draw_markers(struct screen *screen,
|
||||
int x, int y, int w, int h)
|
||||
{
|
||||
int i,xi;
|
||||
const struct fm_region_data *region_data =
|
||||
&(fm_region_data[global_settings.fm_region]);
|
||||
int len = region_data->freq_max - region_data->freq_min;
|
||||
for (i=0; i < radio_preset_count(); i++)
|
||||
{
|
||||
int freq = radio_get_preset(i)->frequency;
|
||||
int diff = freq - region_data->freq_min;
|
||||
xi = x + (w * diff)/len;
|
||||
draw_veritcal_line_mark(screen, xi, y, h);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -65,6 +65,7 @@ struct fmstation
|
|||
char name[MAX_FMPRESET_LEN+1];
|
||||
};
|
||||
const char* radio_get_preset_name(int preset);
|
||||
void presets_draw_markers(struct screen *screen, int x, int y, int w, int h);
|
||||
|
||||
#ifdef HAVE_ALBUMART
|
||||
void radioart_init(bool entering_screen);
|
||||
|
|
Loading…
Reference in a new issue