summaryrefslogtreecommitdiff
path: root/apps/gui/gwps-common.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-11-18 09:03:25 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-11-18 09:03:25 +0000
commit09fce707c117aa4006ca30a5a0bf9eb7a89e2caa (patch)
tree9345d5f6d7d06e122520347a3d9fa3127d3bd4fe /apps/gui/gwps-common.c
parentfe2c40aedb514126605d5c370ad9792cceadac57 (diff)
downloadrockbox-09fce707c117aa4006ca30a5a0bf9eb7a89e2caa.tar.gz
rockbox-09fce707c117aa4006ca30a5a0bf9eb7a89e2caa.zip
Missing file headers put back. Code within 80 cols. Code policed indenting
and style. Simplified struct levels. #if 0'ed unused functions. Made private stuff static. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7954 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/gwps-common.c')
-rw-r--r--apps/gui/gwps-common.c213
1 files changed, 126 insertions, 87 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index d9b40807f7..d24ce05707 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -1,3 +1,21 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 Björn Stenberg
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
1#include "gwps-common.h" 19#include "gwps-common.h"
2#include "gwps.h" 20#include "gwps.h"
3#include "font.h" 21#include "font.h"
@@ -186,7 +204,8 @@ static char* get_tag(struct wps_data* wps_data,
186 return id3_get_genre(id3); 204 return id3_get_genre(id3);
187 205
188 case 'v': /* id3 version */ 206 case 'v': /* id3 version */
189 switch (id3->id3version) { 207 switch (id3->id3version)
208 {
190 case ID3_VER_1_0: 209 case ID3_VER_1_0:
191 return "1"; 210 return "1";
192 211
@@ -275,7 +294,8 @@ static char* get_tag(struct wps_data* wps_data,
275 case 'b': /* progress bar */ 294 case 'b': /* progress bar */
276 *flags |= WPS_REFRESH_PLAYER_PROGRESS; 295 *flags |= WPS_REFRESH_PLAYER_PROGRESS;
277#ifdef HAVE_LCD_CHARCELLS 296#ifdef HAVE_LCD_CHARCELLS
278 snprintf(buf, buf_size, "%c", wps_data->wps_progress_pat[0]); 297 snprintf(buf, buf_size, "%c",
298 wps_data->wps_progress_pat[0]);
279 wps_data->full_line_progressbar=0; 299 wps_data->full_line_progressbar=0;
280 return buf; 300 return buf;
281#else 301#else
@@ -300,7 +320,8 @@ static char* get_tag(struct wps_data* wps_data,
300#endif 320#endif
301 case 'p': /* Playlist Position */ 321 case 'p': /* Playlist Position */
302 *flags |= WPS_REFRESH_STATIC; 322 *flags |= WPS_REFRESH_STATIC;
303 snprintf(buf, buf_size, "%d", playlist_get_display_index()); 323 snprintf(buf, buf_size, "%d",
324 playlist_get_display_index());
304 return buf; 325 return buf;
305 326
306 case 'n': /* Playlist Name (without path) */ 327 case 'n': /* Playlist Name (without path) */
@@ -321,7 +342,8 @@ static char* get_tag(struct wps_data* wps_data,
321 case 'r': /* Remaining Time in Song */ 342 case 'r': /* Remaining Time in Song */
322 *flags |= WPS_REFRESH_DYNAMIC; 343 *flags |= WPS_REFRESH_DYNAMIC;
323 gui_wps_format_time(buf, buf_size, 344 gui_wps_format_time(buf, buf_size,
324 id3->length - id3->elapsed - wps_state.ff_rewind_count); 345 id3->length - id3->elapsed -
346 wps_state.ff_rewind_count);
325 return buf; 347 return buf;
326 348
327 case 't': /* Total Time */ 349 case 't': /* Total Time */
@@ -397,7 +419,8 @@ static char* get_tag(struct wps_data* wps_data,
397 419
398 case 'b': /* battery info */ 420 case 'b': /* battery info */
399 *flags |= WPS_REFRESH_DYNAMIC; 421 *flags |= WPS_REFRESH_DYNAMIC;
400 switch (tag[1]) { 422 switch (tag[1])
423 {
401 case 'l': /* battery level */ 424 case 'l': /* battery level */
402 { 425 {
403 int l = battery_level(); 426 int l = battery_level();
@@ -493,17 +516,17 @@ static char* get_tag(struct wps_data* wps_data,
493 break; 516 break;
494 case 'r': /* Runtime database Information */ 517 case 'r': /* Runtime database Information */
495 switch(tag[1]) 518 switch(tag[1])
496 { 519 {
497 case 'p': /* Playcount */ 520 case 'p': /* Playcount */
498 *flags |= WPS_REFRESH_STATIC; 521 *flags |= WPS_REFRESH_STATIC;
499 snprintf(buf, buf_size, "%ld", cid3->playcount); 522 snprintf(buf, buf_size, "%ld", cid3->playcount);
500 return buf; 523 return buf;
501 case 'r': /* Rating */ 524 case 'r': /* Rating */
502 *flags |= WPS_REFRESH_STATIC; 525 *flags |= WPS_REFRESH_STATIC;
503 *intval = cid3->rating+1; 526 *intval = cid3->rating+1;
504 snprintf(buf, buf_size, "%d", cid3->rating); 527 snprintf(buf, buf_size, "%d", cid3->rating);
505 return buf; 528 return buf;
506 } 529 }
507 break; 530 break;
508 } 531 }
509 return NULL; 532 return NULL;
@@ -513,7 +536,8 @@ static char* get_tag(struct wps_data* wps_data,
513/* clears the area where the image was shown */ 536/* clears the area where the image was shown */
514static void clear_image_pos(struct gui_wps *gwps, int n) 537static void clear_image_pos(struct gui_wps *gwps, int n)
515{ 538{
516 if(!gwps) return; 539 if(!gwps)
540 return;
517 struct wps_data *data = gwps->data; 541 struct wps_data *data = gwps->data;
518 gwps->display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); 542 gwps->display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
519 gwps->display->fillrect(data->img[n].x, data->img[n].y, 543 gwps->display->fillrect(data->img[n].x, data->img[n].y,
@@ -521,6 +545,7 @@ static void clear_image_pos(struct gui_wps *gwps, int n)
521 gwps->display->set_drawmode(DRMODE_SOLID); 545 gwps->display->set_drawmode(DRMODE_SOLID);
522} 546}
523#endif 547#endif
548
524/* Skip to the end of the current %? conditional. 549/* Skip to the end of the current %? conditional.
525 * 550 *
526 * fmt - string to skip it. Should point to somewhere after the leading 551 * fmt - string to skip it. Should point to somewhere after the leading
@@ -529,15 +554,17 @@ static void clear_image_pos(struct gui_wps *gwps, int n)
529 * 554 *
530 * Returns the new position in fmt. 555 * Returns the new position in fmt.
531 */ 556 */
532static const char* skip_conditional(struct gui_wps *gwps, const char* fmt, int num) 557static const char* skip_conditional(struct gui_wps *gwps, const char* fmt,
558 int num)
533{ 559{
534 int level = 1; 560 int level = 1;
535 int count = num; 561 int count = num;
536 const char *last_alternative = NULL; 562 const char *last_alternative = NULL;
537#ifdef HAVE_LCD_BITMAP 563#ifdef HAVE_LCD_BITMAP
538 struct wps_data *data = NULL; 564 struct wps_data *data = NULL;
539 if(gwps) data = gwps->data;
540 int last_x=-1, last_y=-1, last_w=-1, last_h=-1; 565 int last_x=-1, last_y=-1, last_w=-1, last_h=-1;
566 if(gwps)
567 data = gwps->data;
541#else 568#else
542 (void)gwps; 569 (void)gwps;
543#endif 570#endif
@@ -556,7 +583,7 @@ static const char* skip_conditional(struct gui_wps *gwps, const char* fmt, int n
556 if(n >= 'A' && n <= 'Z') 583 if(n >= 'A' && n <= 'Z')
557 n = n - 'A' + 26; 584 n = n - 'A' + 26;
558 if(last_x != data->img[n].x || last_y != data->img[n].y 585 if(last_x != data->img[n].x || last_y != data->img[n].y
559 || last_w != data->img[n].w || last_h != data->img[n].h) 586 || last_w != data->img[n].w || last_h != data->img[n].h)
560 { 587 {
561 last_x = data->img[n].x; 588 last_x = data->img[n].x;
562 last_y = data->img[n].y; 589 last_y = data->img[n].y;
@@ -639,13 +666,13 @@ static const char* skip_conditional(struct gui_wps *gwps, const char* fmt, int n
639 * flags - returns the type of the line. See constants i wps-display.h 666 * flags - returns the type of the line. See constants i wps-display.h
640 */ 667 */
641static void format_display(struct gui_wps *gwps, char* buf, 668static void format_display(struct gui_wps *gwps, char* buf,
642 int buf_size, 669 int buf_size,
643 struct mp3entry* id3, 670 struct mp3entry* id3,
644 struct mp3entry* nid3, /* next song's id3 */ 671 struct mp3entry* nid3, /* next song's id3 */
645 const char* fmt, 672 const char* fmt,
646 struct align_pos* align, 673 struct align_pos* align,
647 unsigned short* subline_time_mult, 674 unsigned short* subline_time_mult,
648 unsigned char* flags) 675 unsigned char* flags)
649{ 676{
650 char temp_buf[128]; 677 char temp_buf[128];
651 char* buf_start = buf; 678 char* buf_start = buf;
@@ -774,9 +801,9 @@ static void format_display(struct gui_wps *gwps, char* buf,
774 801
775 case '?': 802 case '?':
776 fmt++; 803 fmt++;
777 value = get_tag(gwps->data, id3, nid3, fmt, temp_buf, sizeof(temp_buf), 804 value = get_tag(gwps->data, id3, nid3, fmt, temp_buf,
778 &tag_length, subline_time_mult, flags, 805 sizeof(temp_buf),&tag_length,
779 &intval); 806 subline_time_mult, flags, &intval);
780 807
781 while (*fmt && ('<' != *fmt)) 808 while (*fmt && ('<' != *fmt))
782 fmt++; 809 fmt++;
@@ -796,9 +823,9 @@ static void format_display(struct gui_wps *gwps, char* buf,
796 break; 823 break;
797 824
798 default: 825 default:
799 value = get_tag(gwps->data, id3, nid3, fmt, temp_buf, sizeof(temp_buf), 826 value = get_tag(gwps->data, id3, nid3, fmt, temp_buf,
800 &tag_length, subline_time_mult, flags, 827 sizeof(temp_buf), &tag_length,
801 &intval); 828 subline_time_mult, flags,&intval);
802 fmt += tag_length; 829 fmt += tag_length;
803 830
804 if (value) 831 if (value)
@@ -882,9 +909,9 @@ void fade(bool fade_in)
882} 909}
883 910
884/* Set format string to use for WPS, splitting it into lines */ 911/* Set format string to use for WPS, splitting it into lines */
885void gui_wps_format(struct wps_data *data, const char *bmpdir, size_t bmpdirlen) 912void gui_wps_format(struct wps_data *data, const char *bmpdir,
913 size_t bmpdirlen)
886{ 914{
887 if(!data) return;
888 char* buf = data->format_buffer; 915 char* buf = data->format_buffer;
889 char* start_of_line = data->format_buffer; 916 char* start_of_line = data->format_buffer;
890 int line = 0; 917 int line = 0;
@@ -894,10 +921,13 @@ void gui_wps_format(struct wps_data *data, const char *bmpdir, size_t bmpdirlen)
894 (void)bmpdir; 921 (void)bmpdir;
895 (void)bmpdirlen; 922 (void)bmpdirlen;
896#else 923#else
897 unsigned char* img_buf_ptr = data->img_buf; /* where are in image buffer? */ 924 unsigned char* img_buf_ptr = data->img_buf; /* where in image buffer */
898 925
899 int img_buf_free = IMG_BUFSIZE; /* free space in image buffer */ 926 int img_buf_free = IMG_BUFSIZE; /* free space in image buffer */
900#endif 927#endif
928 if(!data)
929 return;
930
901 for (line=0; line<WPS_MAX_LINES; line++) 931 for (line=0; line<WPS_MAX_LINES; line++)
902 { 932 {
903 for (subline=0; subline<WPS_MAX_SUBLINES; subline++) 933 for (subline=0; subline<WPS_MAX_SUBLINES; subline++)
@@ -1095,9 +1125,10 @@ static void wps_display_images(struct gui_wps *gwps)
1095 display->set_drawmode(DRMODE_SOLID); 1125 display->set_drawmode(DRMODE_SOLID);
1096 1126
1097 display->mono_bitmap(data->img[n].ptr, data->img[n].x, 1127 display->mono_bitmap(data->img[n].ptr, data->img[n].x,
1098 data->img[n].y, data->img[n].w, data->img[n].h); 1128 data->img[n].y, data->img[n].w,
1129 data->img[n].h);
1099 display->update_rect(data->img[n].x, data->img[n].y, 1130 display->update_rect(data->img[n].x, data->img[n].y,
1100 data->img[n].w, data->img[n].h); 1131 data->img[n].w, data->img[n].h);
1101 } 1132 }
1102 } 1133 }
1103 display->set_drawmode(DRMODE_SOLID); 1134 display->set_drawmode(DRMODE_SOLID);
@@ -1106,9 +1137,11 @@ static void wps_display_images(struct gui_wps *gwps)
1106 1137
1107void gui_wps_reset(struct gui_wps *gui_wps) 1138void gui_wps_reset(struct gui_wps *gui_wps)
1108{ 1139{
1109 if(!gui_wps || !gui_wps->data) return; 1140 if(!gui_wps || !gui_wps->data)
1141 return;
1110 gui_wps->data->wps_loaded = false; 1142 gui_wps->data->wps_loaded = false;
1111 memset(&gui_wps->data->format_buffer, 0, sizeof (gui_wps->data->format_buffer)); 1143 memset(&gui_wps->data->format_buffer, 0,
1144 sizeof(gui_wps->data->format_buffer));
1112} 1145}
1113 1146
1114bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset, 1147bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset,
@@ -1125,7 +1158,8 @@ bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset,
1125 struct wps_data *data = gwps->data; 1158 struct wps_data *data = gwps->data;
1126 struct wps_state *state = gwps->state; 1159 struct wps_state *state = gwps->state;
1127 struct screen *display = gwps->display; 1160 struct screen *display = gwps->display;
1128 if(!gwps || !data || !state || !display){ 1161 if(!gwps || !data || !state || !display)
1162 {
1129 return false; 1163 return false;
1130 } 1164 }
1131#ifdef HAVE_LCD_BITMAP 1165#ifdef HAVE_LCD_BITMAP
@@ -1263,13 +1297,15 @@ bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset,
1263 { 1297 {
1264#define PROGRESS_BAR_HEIGHT 6 /* this should probably be defined elsewhere; config-*.h perhaps? */ 1298#define PROGRESS_BAR_HEIGHT 6 /* this should probably be defined elsewhere; config-*.h perhaps? */
1265 int sby = i*h + offset + (h > 7 ? (h - 6) / 2 : 1); 1299 int sby = i*h + offset + (h > 7 ? (h - 6) / 2 : 1);
1266 gui_scrollbar_draw(display, 0, sby, display->width, PROGRESS_BAR_HEIGHT, 1300 gui_scrollbar_draw(display, 0, sby, display->width,
1267 state->id3->length?state->id3->length:1, 0, 1301 PROGRESS_BAR_HEIGHT,
1268 state->id3->length?state->id3->elapsed + state->ff_rewind_count:0, 1302 state->id3->length?state->id3->length:1, 0,
1269 HORIZONTAL); 1303 state->id3->length?state->id3->elapsed + state->ff_rewind_count:0,
1304 HORIZONTAL);
1270#ifdef AB_REPEAT_ENABLE 1305#ifdef AB_REPEAT_ENABLE
1271 if ( ab_repeat_mode_enabled() ) 1306 if ( ab_repeat_mode_enabled() )
1272 ab_draw_markers(state->id3->length, 0, sby, LCD_WIDTH, PROGRESS_BAR_HEIGHT); 1307 ab_draw_markers(state->id3->length, 0, sby, LCD_WIDTH,
1308 PROGRESS_BAR_HEIGHT);
1273#endif 1309#endif
1274 update_line = true; 1310 update_line = true;
1275 } 1311 }
@@ -1553,6 +1589,7 @@ static bool draw_player_progress(struct gui_wps *gwps)
1553 int songpos = 0; 1589 int songpos = 0;
1554 int i,j; 1590 int i,j;
1555 struct wps_state *state = gwps->state; 1591 struct wps_state *state = gwps->state;
1592 struct screen *display = gwps->display;
1556 if (!state->id3) 1593 if (!state->id3)
1557 return false; 1594 return false;
1558 1595
@@ -1579,7 +1616,7 @@ static bool draw_player_progress(struct gui_wps *gwps)
1579 player_progressbar[i] += binline[i*5+j]; 1616 player_progressbar[i] += binline[i*5+j];
1580 } 1617 }
1581 } 1618 }
1582 gwps->display->define_pattern(gwps->data->wps_progress_pat[0], player_progressbar); 1619 display->define_pattern(gwps->data->wps_progress_pat[0], player_progressbar);
1583 return true; 1620 return true;
1584} 1621}
1585 1622
@@ -1622,6 +1659,8 @@ static void draw_player_fullbar(struct gui_wps *gwps, char* buf, int buf_size)
1622 char timestr[7]; 1659 char timestr[7];
1623 1660
1624 struct wps_state *state = gwps->state; 1661 struct wps_state *state = gwps->state;
1662 struct screen *display = gwps->display;
1663 struct wps_data *data = gwps->data;
1625 1664
1626 for (i=0; i < buf_size; i++) 1665 for (i=0; i < buf_size; i++)
1627 buf[i] = ' '; 1666 buf[i] = ' ';
@@ -1683,8 +1722,9 @@ static void draw_player_fullbar(struct gui_wps *gwps, char* buf, int buf_size)
1683 } 1722 }
1684 } 1723 }
1685 1724
1686 gwps->display->define_pattern(gwps->data->wps_progress_pat[lcd_char_pos+1],player_progressbar); 1725 display->define_pattern(data->wps_progress_pat[lcd_char_pos+1],
1687 buf[lcd_char_pos]=gwps->data->wps_progress_pat[lcd_char_pos+1]; 1726 player_progressbar);
1727 buf[lcd_char_pos]=data->wps_progress_pat[lcd_char_pos+1];
1688 1728
1689 } 1729 }
1690 1730
@@ -1714,9 +1754,9 @@ static void draw_player_fullbar(struct gui_wps *gwps, char* buf, int buf_size)
1714 } 1754 }
1715 } 1755 }
1716 1756
1717 gwps->display->define_pattern(gwps->data->wps_progress_pat[7],player_progressbar); 1757 display->define_pattern(data->wps_progress_pat[7],player_progressbar);
1718 1758
1719 buf[songpos/5]=gwps->data->wps_progress_pat[7]; 1759 buf[songpos/5]=data->wps_progress_pat[7];
1720 } 1760 }
1721} 1761}
1722#endif 1762#endif
@@ -1735,11 +1775,11 @@ bool setvol(void)
1735 gui_syncstatusbar_draw(&statusbars, false); 1775 gui_syncstatusbar_draw(&statusbars, false);
1736 int i; 1776 int i;
1737 FOR_NB_SCREENS(i) 1777 FOR_NB_SCREENS(i)
1738 gui_wps_refresh(&gui_syncwps.gui_wps[i], 0, WPS_REFRESH_NON_STATIC); 1778 gui_wps_refresh(&gui_wps[i], 0, WPS_REFRESH_NON_STATIC);
1739 settings_save(); 1779 settings_save();
1740#ifdef HAVE_LCD_CHARCELLS 1780#ifdef HAVE_LCD_CHARCELLS
1741 gui_syncsplash(0, false, "Vol: %d %% ", 1781 gui_syncsplash(0, false, "Vol: %d %% ",
1742 sound_val2phys(SOUND_VOLUME, global_settings.volume)); 1782 sound_val2phys(SOUND_VOLUME, global_settings.volume));
1743 return true; 1783 return true;
1744#endif 1784#endif
1745 return false; 1785 return false;
@@ -1763,8 +1803,10 @@ bool ffwd_rew(int button)
1763 bool usb = false; 1803 bool usb = false;
1764 int i = 0; 1804 int i = 0;
1765 1805
1766 while (!exit) { 1806 while (!exit)
1767 switch ( button ) { 1807 {
1808 switch ( button )
1809 {
1768 case WPS_FFWD: 1810 case WPS_FFWD:
1769#ifdef WPS_RC_FFWD 1811#ifdef WPS_RC_FFWD
1770 case WPS_RC_FFWD: 1812 case WPS_RC_FFWD:
@@ -1779,8 +1821,9 @@ bool ffwd_rew(int button)
1779 if (direction == 1) 1821 if (direction == 1)
1780 { 1822 {
1781 /* fast forwarding, calc max step relative to end */ 1823 /* fast forwarding, calc max step relative to end */
1782 max_step = 1824 max_step = (wps_state.id3->length -
1783 (wps_state.id3->length - (wps_state.id3->elapsed + ff_rewind_count)) * 1825 (wps_state.id3->elapsed +
1826 ff_rewind_count)) *
1784 FF_REWIND_MAX_PERCENT / 100; 1827 FF_REWIND_MAX_PERCENT / 100;
1785 } 1828 }
1786 else 1829 else
@@ -1814,7 +1857,7 @@ bool ffwd_rew(int button)
1814 audio_pause(); 1857 audio_pause();
1815#if CONFIG_KEYPAD == PLAYER_PAD 1858#if CONFIG_KEYPAD == PLAYER_PAD
1816 FOR_NB_SCREENS(i) 1859 FOR_NB_SCREENS(i)
1817 gui_syncwps.gui_wps[i].display->stop_scroll(); 1860 gui_wps[i].display->stop_scroll();
1818#endif 1861#endif
1819 if (direction > 0) 1862 if (direction > 0)
1820 status_set_ffmode(STATUS_FASTFORWARD); 1863 status_set_ffmode(STATUS_FASTFORWARD);
@@ -1833,26 +1876,22 @@ bool ffwd_rew(int button)
1833 } 1876 }
1834 1877
1835 if (direction > 0) { 1878 if (direction > 0) {
1836 if ((wps_state.id3->elapsed + ff_rewind_count) > wps_state.id3->length) 1879 if ((wps_state.id3->elapsed + ff_rewind_count) >
1837 ff_rewind_count = wps_state.id3->length - wps_state.id3->elapsed; 1880 wps_state.id3->length)
1881 ff_rewind_count = wps_state.id3->length -
1882 wps_state.id3->elapsed;
1838 } 1883 }
1839 else { 1884 else {
1840 if ((int)(wps_state.id3->elapsed + ff_rewind_count) < 0) 1885 if ((int)(wps_state.id3->elapsed + ff_rewind_count) < 0)
1841 ff_rewind_count = -wps_state.id3->elapsed; 1886 ff_rewind_count = -wps_state.id3->elapsed;
1842 } 1887 }
1843 1888
1844 if(wps_state.wps_time_countup == false){ 1889 FOR_NB_SCREENS(i)
1845 FOR_NB_SCREENS(i) 1890 gui_wps_refresh(&gui_wps[i],
1846 gui_wps_refresh(&gui_syncwps.gui_wps[i], ff_rewind_count, 1891 (wps_state.wps_time_countup == false)?
1847 WPS_REFRESH_PLAYER_PROGRESS | 1892 ff_rewind_count:-ff_rewind_count,
1848 WPS_REFRESH_DYNAMIC); 1893 WPS_REFRESH_PLAYER_PROGRESS |
1849 } 1894 WPS_REFRESH_DYNAMIC);
1850 else{
1851 FOR_NB_SCREENS(i)
1852 gui_wps_refresh(&gui_syncwps.gui_wps[i], -ff_rewind_count,
1853 WPS_REFRESH_PLAYER_PROGRESS |
1854 WPS_REFRESH_DYNAMIC);
1855 }
1856 1895
1857 break; 1896 break;
1858 1897
@@ -1889,7 +1928,7 @@ bool ffwd_rew(int button)
1889 /* let audio thread update id3->elapsed before calling wps_refresh */ 1928 /* let audio thread update id3->elapsed before calling wps_refresh */
1890 yield(); 1929 yield();
1891 FOR_NB_SCREENS(i) 1930 FOR_NB_SCREENS(i)
1892 gui_wps_refresh(&gui_syncwps.gui_wps[i], 0, WPS_REFRESH_ALL); 1931 gui_wps_refresh(&gui_wps[i], 0, WPS_REFRESH_ALL);
1893 return usb; 1932 return usb;
1894} 1933}
1895 1934
@@ -1911,13 +1950,14 @@ bool gui_wps_display(void)
1911 { 1950 {
1912 FOR_NB_SCREENS(i) 1951 FOR_NB_SCREENS(i)
1913 { 1952 {
1914 gui_syncwps.gui_wps[i].display->clear_display(); 1953 gui_wps[i].display->clear_display();
1915 if (!gui_syncwps.gui_wps[i].data->wps_loaded) { 1954 if (!gui_wps[i].data->wps_loaded) {
1916 if ( !gui_syncwps.gui_wps[i].data->format_buffer[0] ) { 1955 if ( !gui_wps[i].data->format_buffer[0] ) {
1917 /* set the default wps for the main-screen */ 1956 /* set the default wps for the main-screen */
1918 if(i == 0){ 1957 if(i == 0)
1958 {
1919#ifdef HAVE_LCD_BITMAP 1959#ifdef HAVE_LCD_BITMAP
1920 wps_data_load(gui_syncwps.gui_wps[i].data, 1960 wps_data_load(gui_wps[i].data,
1921 "%s%?it<%?in<%in. |>%it|%fn>\n" 1961 "%s%?it<%?in<%in. |>%it|%fn>\n"
1922 "%s%?ia<%ia|%?d2<%d2|(root)>>\n" 1962 "%s%?ia<%ia|%?d2<%d2|(root)>>\n"
1923 "%s%?id<%id|%?d1<%d1|(root)>> %?iy<(%iy)|>\n" 1963 "%s%?id<%id|%?d1<%d1|(root)>> %?iy<(%iy)|>\n"
@@ -1927,7 +1967,7 @@ bool gui_wps_display(void)
1927 "%pb\n" 1967 "%pb\n"
1928 "%pm\n", false, false); 1968 "%pm\n", false, false);
1929#else 1969#else
1930 wps_data_load(gui_syncwps.gui_wps[i].data, 1970 wps_data_load(gui_wps[i].data,
1931 "%s%pp/%pe: %?it<%it|%fn> - %?ia<%ia|%d2> - %?id<%id|%d1>\n" 1971 "%s%pp/%pe: %?it<%it|%fn> - %?ia<%ia|%d2> - %?id<%id|%d1>\n"
1932 "%pc%?ps<*|/>%pt\n", false, false); 1972 "%pc%?ps<*|/>%pt\n", false, false);
1933#endif 1973#endif
@@ -1936,7 +1976,7 @@ bool gui_wps_display(void)
1936 /* set the default wps for the remote-screen */ 1976 /* set the default wps for the remote-screen */
1937 else if(i == 1) 1977 else if(i == 1)
1938 { 1978 {
1939 wps_data_load(gui_syncwps.gui_wps[i].data, 1979 wps_data_load(gui_wps[i].data,
1940 "%s%?ia<%ia|%?d2<%d2|(root)>>\n" 1980 "%s%?ia<%ia|%?d2<%d2|(root)>>\n"
1941 "%s%?it<%?in<%in. |>%it|%fn>\n" 1981 "%s%?it<%?in<%in. |>%it|%fn>\n"
1942 "%al%pc/%pt%ar[%pp:%pe]\n" 1982 "%al%pc/%pt%ar[%pp:%pe]\n"
@@ -1950,13 +1990,13 @@ bool gui_wps_display(void)
1950 } 1990 }
1951 yield(); 1991 yield();
1952 FOR_NB_SCREENS(i) 1992 FOR_NB_SCREENS(i)
1953 gui_wps_refresh(&gui_syncwps.gui_wps[i], 0, WPS_REFRESH_ALL); 1993 gui_wps_refresh(&gui_wps[i], 0, WPS_REFRESH_ALL);
1954 gui_syncstatusbar_draw(&statusbars, true); 1994 gui_syncstatusbar_draw(&statusbars, true);
1955 FOR_NB_SCREENS(i) 1995 FOR_NB_SCREENS(i)
1956 { 1996 {
1957#ifdef HAVE_LCD_BITMAP 1997#ifdef HAVE_LCD_BITMAP
1958 wps_display_images(&gui_syncwps.gui_wps[i]); 1998 wps_display_images(&gui_wps[i]);
1959 gui_syncwps.gui_wps[i].display->update(); 1999 gui_wps[i].display->update();
1960#endif 2000#endif
1961 } 2001 }
1962 return false; 2002 return false;
@@ -1980,12 +2020,11 @@ bool update(struct gui_wps *gwps)
1980 2020
1981 if (gwps->state->id3) 2021 if (gwps->state->id3)
1982 memcpy(gwps->state->current_track_path, gwps->state->id3->path, 2022 memcpy(gwps->state->current_track_path, gwps->state->id3->path,
1983 sizeof(gwps->state->current_track_path)); 2023 sizeof(gwps->state->current_track_path));
1984 } 2024 }
1985 2025
1986 if (gwps->state->id3){ 2026 if (gwps->state->id3)
1987 gui_wps_refresh(gwps, 0, WPS_REFRESH_NON_STATIC); 2027 gui_wps_refresh(gwps, 0, WPS_REFRESH_NON_STATIC);
1988 }
1989 2028
1990 gui_syncstatusbar_draw(&statusbars, false); 2029 gui_syncstatusbar_draw(&statusbars, false);
1991 2030
@@ -1998,7 +2037,7 @@ void display_keylock_text(bool locked)
1998 char* s; 2037 char* s;
1999 int i; 2038 int i;
2000 FOR_NB_SCREENS(i) 2039 FOR_NB_SCREENS(i)
2001 gui_syncwps.gui_wps[i].display->stop_scroll(); 2040 gui_wps[i].display->stop_scroll();
2002 2041
2003#ifdef HAVE_LCD_CHARCELLS 2042#ifdef HAVE_LCD_CHARCELLS
2004 if(locked) 2043 if(locked)