diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/gui/skin_engine/skin_display.c | 23 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 1 | ||||
-rw-r--r-- | apps/radio/presets.c | 27 | ||||
-rw-r--r-- | apps/radio/radio.h | 1 |
4 files changed, 45 insertions, 7 deletions
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c index d0e94c7041..4b1c747706 100644 --- a/apps/gui/skin_engine/skin_display.c +++ b/apps/gui/skin_engine/skin_display.c | |||
@@ -185,17 +185,26 @@ static void draw_progressbar(struct gui_wps *gwps, | |||
185 | gui_scrollbar_draw(display, pb->x, y, pb->width, height, | 185 | gui_scrollbar_draw(display, pb->x, y, pb->width, height, |
186 | length, 0, elapsed, HORIZONTAL); | 186 | length, 0, elapsed, HORIZONTAL); |
187 | 187 | ||
188 | if (pb->type == WPS_TOKEN_PROGRESSBAR && id3 && id3->length) | 188 | if (pb->type == WPS_TOKEN_PROGRESSBAR) |
189 | { | 189 | { |
190 | if (id3 && id3->length) | ||
191 | { | ||
190 | #ifdef AB_REPEAT_ENABLE | 192 | #ifdef AB_REPEAT_ENABLE |
191 | if (ab_repeat_mode_enabled()) | 193 | if (ab_repeat_mode_enabled()) |
192 | ab_draw_markers(display, id3->length, | 194 | ab_draw_markers(display, id3->length, |
193 | pb->x, y, pb->width, height); | 195 | pb->x, y, pb->width, height); |
194 | #endif | 196 | #endif |
195 | 197 | ||
196 | if (id3->cuesheet) | 198 | if (id3->cuesheet) |
197 | cue_draw_markers(display, id3->cuesheet, id3->length, | 199 | cue_draw_markers(display, id3->cuesheet, id3->length, |
198 | pb->x, y+1, pb->width, height-2); | 200 | pb->x, y+1, pb->width, height-2); |
201 | } | ||
202 | #if CONFIG_TUNER | ||
203 | else if (in_radio_screen() || (get_radio_status() != FMRADIO_OFF)) | ||
204 | { | ||
205 | presets_draw_markers(display, pb->x, y, pb->width, height); | ||
206 | } | ||
207 | #endif | ||
199 | } | 208 | } |
200 | } | 209 | } |
201 | 210 | ||
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index 932c3baf6b..158f2eb7b7 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c | |||
@@ -1211,6 +1211,7 @@ static int parse_progressbar(const char *wps_bufptr, | |||
1211 | pb->y = -line_num - 1; /* Will be computed during the rendering */ | 1211 | pb->y = -line_num - 1; /* Will be computed during the rendering */ |
1212 | if (token->type == WPS_TOKEN_VOLUME || token->type == WPS_TOKEN_BATTERY_PERCENT) | 1212 | if (token->type == WPS_TOKEN_VOLUME || token->type == WPS_TOKEN_BATTERY_PERCENT) |
1213 | return 0; /* dont add it, let the regular token handling do the work */ | 1213 | return 0; /* dont add it, let the regular token handling do the work */ |
1214 | pb->type = token->type; | ||
1214 | add_to_ll_chain(&wps_data->progressbars, item); | 1215 | add_to_ll_chain(&wps_data->progressbars, item); |
1215 | return 0; | 1216 | return 0; |
1216 | } | 1217 | } |
diff --git a/apps/radio/presets.c b/apps/radio/presets.c index d272d3472e..ea1d4022da 100644 --- a/apps/radio/presets.c +++ b/apps/radio/presets.c | |||
@@ -612,3 +612,30 @@ void presets_save(void) | |||
612 | else | 612 | else |
613 | radio_save_presets(); | 613 | radio_save_presets(); |
614 | } | 614 | } |
615 | |||
616 | #ifdef HAVE_LCD_BITMAP | ||
617 | static inline void draw_veritcal_line_mark(struct screen * screen, | ||
618 | int x, int y, int h) | ||
619 | { | ||
620 | screen->set_drawmode(DRMODE_COMPLEMENT); | ||
621 | screen->vline(x, y, y+h-1); | ||
622 | } | ||
623 | |||
624 | /* draw the preset markers for a track of length "tracklen", | ||
625 | between (x,y) and (x+w,y) */ | ||
626 | void presets_draw_markers(struct screen *screen, | ||
627 | int x, int y, int w, int h) | ||
628 | { | ||
629 | int i,xi; | ||
630 | const struct fm_region_data *region_data = | ||
631 | &(fm_region_data[global_settings.fm_region]); | ||
632 | int len = region_data->freq_max - region_data->freq_min; | ||
633 | for (i=0; i < radio_preset_count(); i++) | ||
634 | { | ||
635 | int freq = radio_get_preset(i)->frequency; | ||
636 | int diff = freq - region_data->freq_min; | ||
637 | xi = x + (w * diff)/len; | ||
638 | draw_veritcal_line_mark(screen, xi, y, h); | ||
639 | } | ||
640 | } | ||
641 | #endif | ||
diff --git a/apps/radio/radio.h b/apps/radio/radio.h index f61ad026f3..01afdc5a25 100644 --- a/apps/radio/radio.h +++ b/apps/radio/radio.h | |||
@@ -65,6 +65,7 @@ struct fmstation | |||
65 | char name[MAX_FMPRESET_LEN+1]; | 65 | char name[MAX_FMPRESET_LEN+1]; |
66 | }; | 66 | }; |
67 | const char* radio_get_preset_name(int preset); | 67 | const char* radio_get_preset_name(int preset); |
68 | void presets_draw_markers(struct screen *screen, int x, int y, int w, int h); | ||
68 | 69 | ||
69 | #ifdef HAVE_ALBUMART | 70 | #ifdef HAVE_ALBUMART |
70 | void radioart_init(bool entering_screen); | 71 | void radioart_init(bool entering_screen); |