diff options
author | Andrew Mahone <andrew.mahone@gmail.com> | 2009-01-17 22:53:12 +0000 |
---|---|---|
committer | Andrew Mahone <andrew.mahone@gmail.com> | 2009-01-17 22:53:12 +0000 |
commit | 0b41f0599f62ec9099197bbe6f4dd7144cebe0df (patch) | |
tree | 927f23ea1a943777baa0e7cf1f8070608c3847d7 /apps/plugins/pictureflow.c | |
parent | 2fecb713ea07f06b5219a75c95909b986c2468a5 (diff) | |
download | rockbox-0b41f0599f62ec9099197bbe6f4dd7144cebe0df.tar.gz rockbox-0b41f0599f62ec9099197bbe6f4dd7144cebe0df.zip |
unify pointers to value for configfile, and add TYPE_BOOL type, used by
pictureflow
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19786 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/pictureflow.c')
-rw-r--r-- | apps/plugins/pictureflow.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/apps/plugins/pictureflow.c b/apps/plugins/pictureflow.c index 807ba19e7e..b107227e40 100644 --- a/apps/plugins/pictureflow.c +++ b/apps/plugins/pictureflow.c | |||
@@ -203,22 +203,25 @@ static int slide_spacing = (LCD_WIDTH - DISPLAY_WIDTH) / 8; | |||
203 | static int center_margin = (LCD_WIDTH - DISPLAY_WIDTH) / 16; | 203 | static int center_margin = (LCD_WIDTH - DISPLAY_WIDTH) / 16; |
204 | static int num_slides = 4; | 204 | static int num_slides = 4; |
205 | static int zoom = 100; | 205 | static int zoom = 100; |
206 | static int show_fps = false; | 206 | static bool show_fps = false; |
207 | static int resize = true; | 207 | static bool resize = true; |
208 | static int cache_version = 0; | 208 | static int cache_version = 0; |
209 | static int show_album_name = album_name_top; | 209 | static int show_album_name = album_name_top; |
210 | 210 | ||
211 | static struct configdata config[] = | 211 | static struct configdata config[] = |
212 | { | 212 | { |
213 | { TYPE_INT, 0, MAX_SPACING, &slide_spacing, "slide spacing", NULL, NULL }, | 213 | { TYPE_INT, 0, MAX_SPACING, { .int_p = &slide_spacing }, "slide spacing", |
214 | { TYPE_INT, 0, MAX_MARGIN, ¢er_margin, "center margin", NULL, NULL }, | 214 | NULL }, |
215 | { TYPE_INT, 0, MAX_SLIDES_COUNT, &num_slides, "slides count", NULL, NULL }, | 215 | { TYPE_INT, 0, MAX_MARGIN, { .int_p = ¢er_margin }, "center margin", |
216 | { TYPE_INT, 0, 300, &zoom, "zoom", NULL, NULL }, | 216 | NULL }, |
217 | { TYPE_INT, 0, 1, &show_fps, "show fps", NULL, NULL }, | 217 | { TYPE_INT, 0, MAX_SLIDES_COUNT, { .int_p = &num_slides }, "slides count", |
218 | { TYPE_INT, 0, 1, &resize, "resize", NULL, NULL }, | 218 | NULL }, |
219 | { TYPE_INT, 0, 100, &cache_version, "cache version", NULL, NULL }, | 219 | { TYPE_INT, 0, 300, { .int_p = &zoom }, "zoom", NULL }, |
220 | { TYPE_ENUM, 0, 2, &show_album_name, "show album name", | 220 | { TYPE_BOOL, 0, 1, { .bool_p = &show_fps }, "show fps", NULL }, |
221 | show_album_name_conf, NULL } | 221 | { TYPE_BOOL, 0, 1, { .bool_p = &resize }, "resize", NULL }, |
222 | { TYPE_INT, 0, 100, { .int_p = &cache_version }, "cache version", NULL }, | ||
223 | { TYPE_ENUM, 0, 2, { .int_p = &show_album_name }, "show album name", | ||
224 | show_album_name_conf } | ||
222 | }; | 225 | }; |
223 | 226 | ||
224 | #define CONFIG_NUM_ITEMS (sizeof(config) / sizeof(struct configdata)) | 227 | #define CONFIG_NUM_ITEMS (sizeof(config) / sizeof(struct configdata)) |
@@ -1555,7 +1558,6 @@ int settings_menu(void) | |||
1555 | { | 1558 | { |
1556 | int selection = 0; | 1559 | int selection = 0; |
1557 | bool old_val; | 1560 | bool old_val; |
1558 | bool new_val; | ||
1559 | 1561 | ||
1560 | MENUITEM_STRINGLIST(settings_menu, "PictureFlow Settings", NULL, "Show FPS", | 1562 | MENUITEM_STRINGLIST(settings_menu, "PictureFlow Settings", NULL, "Show FPS", |
1561 | "Spacing", "Center margin", "Number of slides", "Zoom", | 1563 | "Spacing", "Center margin", "Number of slides", "Zoom", |
@@ -1565,9 +1567,7 @@ int settings_menu(void) | |||
1565 | selection=rb->do_menu(&settings_menu,&selection, NULL, false); | 1567 | selection=rb->do_menu(&settings_menu,&selection, NULL, false); |
1566 | switch(selection) { | 1568 | switch(selection) { |
1567 | case 0: | 1569 | case 0: |
1568 | new_val = show_fps; | 1570 | rb->set_bool("Show FPS", &show_fps); |
1569 | rb->set_bool("Show FPS", &new_val); | ||
1570 | show_fps = new_val; | ||
1571 | reset_track_list(); | 1571 | reset_track_list(); |
1572 | break; | 1572 | break; |
1573 | 1573 | ||
@@ -1607,10 +1607,9 @@ int settings_menu(void) | |||
1607 | reset_slides(); | 1607 | reset_slides(); |
1608 | break; | 1608 | break; |
1609 | case 6: | 1609 | case 6: |
1610 | old_val = new_val = resize; | 1610 | old_val = resize; |
1611 | rb->set_bool("Resize Covers", &new_val); | 1611 | rb->set_bool("Resize Covers", &resize); |
1612 | resize = new_val; | 1612 | if (old_val == resize) /* changed? */ |
1613 | if (old_val == new_val) /* changed? */ | ||
1614 | break; | 1613 | break; |
1615 | /* fallthrough if changed, since cache needs to be rebuilt */ | 1614 | /* fallthrough if changed, since cache needs to be rebuilt */ |
1616 | case 7: | 1615 | case 7: |