summaryrefslogtreecommitdiffstats
path: root/apps/radio
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-05-31 11:12:15 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-05-31 11:12:15 +0000
commit22b12cafbb7aa4463170ad5752edcf2093b20c7b (patch)
tree88bcc32aa322c39b30aec5f8a949f55690105952 /apps/radio
parent5b4a9b5e35594eafea7e0981a9fab9cd266debb1 (diff)
downloadrockbox-22b12cafbb7aa4463170ad5752edcf2093b20c7b.tar.gz
rockbox-22b12cafbb7aa4463170ad5752edcf2093b20c7b.tar.bz2
rockbox-22b12cafbb7aa4463170ad5752edcf2093b20c7b.zip
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
Diffstat (limited to 'apps/radio')
-rw-r--r--apps/radio/presets.c27
-rw-r--r--apps/radio/radio.h1
2 files changed, 28 insertions, 0 deletions
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)
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
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
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);