diff options
Diffstat (limited to 'apps/wps.c')
-rw-r--r-- | apps/wps.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/apps/wps.c b/apps/wps.c index 3af73d15ed..e134535bff 100644 --- a/apps/wps.c +++ b/apps/wps.c | |||
@@ -45,12 +45,6 @@ | |||
45 | #endif | 45 | #endif |
46 | 46 | ||
47 | #ifdef HAVE_LCD_BITMAP | 47 | #ifdef HAVE_LCD_BITMAP |
48 | #define LINE_Y (global_settings.statusbar ? 1 : 0) /* Y position the entry-list starts at */ | ||
49 | #else /* HAVE_LCD_BITMAP */ | ||
50 | #define LINE_Y 0 /* Y position the entry-list starts at */ | ||
51 | #endif /* HAVE_LCD_BITMAP */ | ||
52 | |||
53 | #ifdef HAVE_LCD_BITMAP | ||
54 | #define PLAY_DISPLAY_2LINEID3 0 | 48 | #define PLAY_DISPLAY_2LINEID3 0 |
55 | #define PLAY_DISPLAY_FILENAME_SCROLL 1 | 49 | #define PLAY_DISPLAY_FILENAME_SCROLL 1 |
56 | #define PLAY_DISPLAY_TRACK_TITLE 2 | 50 | #define PLAY_DISPLAY_TRACK_TITLE 2 |
@@ -82,7 +76,6 @@ static void draw_screen(struct mp3entry* id3) | |||
82 | font_height = 8; | 76 | font_height = 8; |
83 | #endif | 77 | #endif |
84 | 78 | ||
85 | |||
86 | lcd_clear_display(); | 79 | lcd_clear_display(); |
87 | if(!id3) | 80 | if(!id3) |
88 | { | 81 | { |
@@ -117,14 +110,14 @@ static void draw_screen(struct mp3entry* id3) | |||
117 | strncpy(szArtist,szTok,sizeof(szArtist)); | 110 | strncpy(szArtist,szTok,sizeof(szArtist)); |
118 | szArtist[sizeof(szArtist)-1] = 0; | 111 | szArtist[sizeof(szArtist)-1] = 0; |
119 | szDelimit = strrchr(id3->path, ch); | 112 | szDelimit = strrchr(id3->path, ch); |
120 | lcd_puts(0,LINE_Y, szArtist?szArtist:"<nothing>"); | 113 | lcd_puts(0, 0, szArtist?szArtist:"<nothing>"); |
121 | 114 | ||
122 | // removes the .mp3 from the end of the display buffer | 115 | // removes the .mp3 from the end of the display buffer |
123 | szPeriod = strrchr(szDelimit, '.'); | 116 | szPeriod = strrchr(szDelimit, '.'); |
124 | if (szPeriod != NULL) | 117 | if (szPeriod != NULL) |
125 | *szPeriod = 0; | 118 | *szPeriod = 0; |
126 | 119 | ||
127 | lcd_puts_scroll(0,LINE_Y+1,(++szDelimit)); | 120 | lcd_puts_scroll(0, 1, (++szDelimit)); |
128 | break; | 121 | break; |
129 | } | 122 | } |
130 | case PLAY_DISPLAY_FILENAME_SCROLL: | 123 | case PLAY_DISPLAY_FILENAME_SCROLL: |
@@ -147,12 +140,12 @@ static void draw_screen(struct mp3entry* id3) | |||
147 | playlist.amount, | 140 | playlist.amount, |
148 | id3->path); | 141 | id3->path); |
149 | } | 142 | } |
150 | lcd_puts_scroll(0,LINE_Y, buffer); | 143 | lcd_puts_scroll(0, 0, buffer); |
151 | break; | 144 | break; |
152 | } | 145 | } |
153 | case PLAY_DISPLAY_2LINEID3: | 146 | case PLAY_DISPLAY_2LINEID3: |
154 | { | 147 | { |
155 | int l = LINE_Y; | 148 | int l = 0; |
156 | #ifdef HAVE_LCD_BITMAP | 149 | #ifdef HAVE_LCD_BITMAP |
157 | char buffer[64]; | 150 | char buffer[64]; |
158 | 151 | ||
@@ -161,7 +154,7 @@ static void draw_screen(struct mp3entry* id3) | |||
161 | lcd_puts(0, l++, id3->album?id3->album:""); | 154 | lcd_puts(0, l++, id3->album?id3->album:""); |
162 | lcd_puts(0, l++, id3->artist?id3->artist:""); | 155 | lcd_puts(0, l++, id3->artist?id3->artist:""); |
163 | 156 | ||
164 | if(LINE_Y==0&&font_height<=8) { | 157 | if(!global_settings.statusbar && font_height <= 8) { |
165 | if(id3->vbr) | 158 | if(id3->vbr) |
166 | snprintf(buffer, sizeof(buffer), "%d kbit (avg)", | 159 | snprintf(buffer, sizeof(buffer), "%d kbit (avg)", |
167 | id3->bitrate); | 160 | id3->bitrate); |
@@ -345,6 +338,11 @@ static void display_file_time(unsigned int elapsed, unsigned int length) | |||
345 | char buffer[32]; | 338 | char buffer[32]; |
346 | 339 | ||
347 | #ifdef HAVE_LCD_BITMAP | 340 | #ifdef HAVE_LCD_BITMAP |
341 | int line; | ||
342 | if(global_settings.statusbar) | ||
343 | line = 5; | ||
344 | else | ||
345 | line = 6; | ||
348 | snprintf(buffer,sizeof(buffer), | 346 | snprintf(buffer,sizeof(buffer), |
349 | "Time:%3d:%02d/%d:%02d", | 347 | "Time:%3d:%02d/%d:%02d", |
350 | elapsed / 60000, | 348 | elapsed / 60000, |
@@ -352,7 +350,7 @@ static void display_file_time(unsigned int elapsed, unsigned int length) | |||
352 | length / 60000, | 350 | length / 60000, |
353 | length % 60000 / 1000 ); | 351 | length % 60000 / 1000 ); |
354 | 352 | ||
355 | lcd_puts(0, 6, buffer); | 353 | lcd_puts(0, line, buffer); |
356 | slidebar(0, LCD_HEIGHT-6, LCD_WIDTH, 6, elapsed*100/length, Grow_Right); | 354 | slidebar(0, LCD_HEIGHT-6, LCD_WIDTH, 6, elapsed*100/length, Grow_Right); |
357 | lcd_update(); | 355 | lcd_update(); |
358 | #else | 356 | #else |
@@ -410,6 +408,7 @@ void display_keylock_text(bool locked) | |||
410 | { | 408 | { |
411 | lcd_puts(2, 3, "Key lock is OFF"); | 409 | lcd_puts(2, 3, "Key lock is OFF"); |
412 | } | 410 | } |
411 | status_draw(); | ||
413 | lcd_update(); | 412 | lcd_update(); |
414 | #endif | 413 | #endif |
415 | 414 | ||
@@ -435,6 +434,7 @@ void display_mute_text(bool muted) | |||
435 | { | 434 | { |
436 | lcd_puts(2, 3, "Mute is OFF"); | 435 | lcd_puts(2, 3, "Mute is OFF"); |
437 | } | 436 | } |
437 | status_draw(); | ||
438 | lcd_update(); | 438 | lcd_update(); |
439 | #endif | 439 | #endif |
440 | 440 | ||
@@ -464,7 +464,10 @@ int wps_show(void) | |||
464 | lcd_icon(ICON_AUDIO, true); | 464 | lcd_icon(ICON_AUDIO, true); |
465 | lcd_icon(ICON_PARAM, false); | 465 | lcd_icon(ICON_PARAM, false); |
466 | #else | 466 | #else |
467 | lcd_setmargins(0,0); | 467 | if(global_settings.statusbar) |
468 | lcd_setmargins(0, STATUSBAR_HEIGHT); | ||
469 | else | ||
470 | lcd_setmargins(0, 0); | ||
468 | #endif | 471 | #endif |
469 | 472 | ||
470 | ff_rewind = false; | 473 | ff_rewind = false; |
@@ -876,15 +879,9 @@ int wps_show(void) | |||
876 | #endif | 879 | #endif |
877 | if(!keys_locked && !dont_go_to_menu && menu_button_is_down) | 880 | if(!keys_locked && !dont_go_to_menu && menu_button_is_down) |
878 | { | 881 | { |
879 | #ifdef HAVE_LCD_BITMAP | ||
880 | bool laststate=statusbar(false); | ||
881 | #endif | ||
882 | lcd_stop_scroll(); | 882 | lcd_stop_scroll(); |
883 | button_set_release(old_release_mask); | 883 | button_set_release(old_release_mask); |
884 | main_menu(); | 884 | main_menu(); |
885 | #ifdef HAVE_LCD_BITMAP | ||
886 | statusbar(laststate); | ||
887 | #endif | ||
888 | old_release_mask = button_set_release(RELEASE_MASK); | 885 | old_release_mask = button_set_release(RELEASE_MASK); |
889 | ignore_keyup = true; | 886 | ignore_keyup = true; |
890 | id3 = mpeg_current_track(); | 887 | id3 = mpeg_current_track(); |
@@ -905,6 +902,10 @@ int wps_show(void) | |||
905 | #ifdef HAVE_LCD_BITMAP | 902 | #ifdef HAVE_LCD_BITMAP |
906 | global_settings.statusbar = !global_settings.statusbar; | 903 | global_settings.statusbar = !global_settings.statusbar; |
907 | settings_save(); | 904 | settings_save(); |
905 | if(global_settings.statusbar) | ||
906 | lcd_setmargins(0, STATUSBAR_HEIGHT); | ||
907 | else | ||
908 | lcd_setmargins(0, 0); | ||
908 | draw_screen(id3); | 909 | draw_screen(id3); |
909 | #endif | 910 | #endif |
910 | break; | 911 | break; |