summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2009-08-03 04:57:43 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2009-08-03 04:57:43 +0000
commitb5442f8752f510f0b79d09579ad98ac517848721 (patch)
tree3be73c47ffecbbe97ad4caed2b07dc133c6a6a5e
parent3e7444ff8770678b563af6b3f9f6b05521cac959 (diff)
downloadrockbox-b5442f8752f510f0b79d09579ad98ac517848721.tar.gz
rockbox-b5442f8752f510f0b79d09579ad98ac517848721.zip
these didnt get renamed for some reason
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22136 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/wps.c (renamed from apps/gui/music_screen.c)80
-rw-r--r--apps/gui/wps.h (renamed from apps/gui/music_screen.h)0
2 files changed, 23 insertions, 57 deletions
diff --git a/apps/gui/music_screen.c b/apps/gui/wps.c
index d5eccd5868..4a7de875d2 100644
--- a/apps/gui/music_screen.c
+++ b/apps/gui/wps.c
@@ -34,7 +34,7 @@
34#include "debug.h" 34#include "debug.h"
35#include "sprintf.h" 35#include "sprintf.h"
36#include "settings.h" 36#include "settings.h"
37#include "wps_engine/wps_engine.h" 37#include "skin_engine/skin_engine.h"
38#include "mp3_playback.h" 38#include "mp3_playback.h"
39#include "audio.h" 39#include "audio.h"
40#include "usb.h" 40#include "usb.h"
@@ -66,7 +66,7 @@
66#include "option_select.h" 66#include "option_select.h"
67#include "dsp.h" 67#include "dsp.h"
68#include "playlist_viewer.h" 68#include "playlist_viewer.h"
69#include "music_screen.h" 69#include "wps.h"
70 70
71#define RESTORE_WPS_INSTANTLY 0l 71#define RESTORE_WPS_INSTANTLY 0l
72#define RESTORE_WPS_NEXT_SECOND ((long)(HZ+current_tick)) 72#define RESTORE_WPS_NEXT_SECOND ((long)(HZ+current_tick))
@@ -114,7 +114,7 @@ void fade(bool fade_in, bool updatewps)
114 if (updatewps) 114 if (updatewps)
115 { 115 {
116 FOR_NB_SCREENS(i) 116 FOR_NB_SCREENS(i)
117 gui_wps_redraw(&gui_wps[i], 0, WPS_REFRESH_NON_STATIC); 117 skin_update(&gui_wps[i], WPS_REFRESH_NON_STATIC);
118 } 118 }
119 sleep(1); 119 sleep(1);
120 } 120 }
@@ -130,7 +130,7 @@ void fade(bool fade_in, bool updatewps)
130 if (updatewps) 130 if (updatewps)
131 { 131 {
132 FOR_NB_SCREENS(i) 132 FOR_NB_SCREENS(i)
133 gui_wps_redraw(&gui_wps[i], 0, WPS_REFRESH_NON_STATIC); 133 skin_update(&gui_wps[i], WPS_REFRESH_NON_STATIC);
134 } 134 }
135 sleep(1); 135 sleep(1);
136 } 136 }
@@ -155,7 +155,7 @@ bool is_wps_fading(void)
155 155
156bool update_onvol_change(struct gui_wps * gwps) 156bool update_onvol_change(struct gui_wps * gwps)
157{ 157{
158 gui_wps_redraw(gwps, 0, WPS_REFRESH_NON_STATIC); 158 skin_update(gwps, WPS_REFRESH_NON_STATIC);
159 159
160#ifdef HAVE_LCD_CHARCELLS 160#ifdef HAVE_LCD_CHARCELLS
161 splashf(0, "Vol: %3d dB", 161 splashf(0, "Vol: %3d dB",
@@ -254,19 +254,23 @@ bool ffwd_rew(int button)
254 ff_rewind_count = -wps_state.id3->elapsed; 254 ff_rewind_count = -wps_state.id3->elapsed;
255 } 255 }
256 256
257 /* set the wps state ff_rewind_count so the progess info
258 displays corectly */
259 wps_state.ff_rewind_count = (wps_state.wps_time_countup == false)?
260 ff_rewind_count:-ff_rewind_count;
257 FOR_NB_SCREENS(i) 261 FOR_NB_SCREENS(i)
258 gui_wps_redraw(&gui_wps[i], 262 {
259 (wps_state.wps_time_countup == false)? 263 skin_update(&gui_wps[i],
260 ff_rewind_count:-ff_rewind_count, 264 WPS_REFRESH_PLAYER_PROGRESS |
261 WPS_REFRESH_PLAYER_PROGRESS | 265 WPS_REFRESH_DYNAMIC);
262 WPS_REFRESH_DYNAMIC); 266 }
263 267
264 break; 268 break;
265 269
266 case ACTION_WPS_STOPSEEK: 270 case ACTION_WPS_STOPSEEK:
267 wps_state.id3->elapsed = wps_state.id3->elapsed+ff_rewind_count; 271 wps_state.id3->elapsed = wps_state.id3->elapsed+ff_rewind_count;
268 audio_ff_rewind(wps_state.id3->elapsed); 272 audio_ff_rewind(wps_state.id3->elapsed);
269 ff_rewind_count = 0; 273 wps_state.ff_rewind_count = 0;
270 wps_state.ff_rewind = false; 274 wps_state.ff_rewind = false;
271 status_set_ffmode(0); 275 status_set_ffmode(0);
272#if (CONFIG_CODEC != SWCODEC) 276#if (CONFIG_CODEC != SWCODEC)
@@ -275,7 +279,7 @@ bool ffwd_rew(int button)
275#endif 279#endif
276#ifdef HAVE_LCD_CHARCELLS 280#ifdef HAVE_LCD_CHARCELLS
277 FOR_NB_SCREENS(i) 281 FOR_NB_SCREENS(i)
278 gui_wps_redraw(&gui_wps[i],0, WPS_REFRESH_ALL); 282 skin_update(&gui_wps[i], WPS_REFRESH_ALL);
279#endif 283#endif
280 exit = true; 284 exit = true;
281 break; 285 break;
@@ -553,49 +557,12 @@ int wps_get_touchaction(struct wps_data *data)
553 if (vx >= r->x && vx < r->x+r->width && 557 if (vx >= r->x && vx < r->x+r->width &&
554 vy >= r->y && vy < r->y+r->height) 558 vy >= r->y && vy < r->y+r->height)
555 { 559 {
556 /* reposition the touch within the area */ 560 if ((repeated && r->repeat) ||
557 vx -= r->x; 561 (released && !r->repeat))
558 vy -= r->y;
559
560 switch(r->type)
561 { 562 {
562 case WPS_TOUCHREGION_ACTION: 563 last_action = r->action;
563 if ((repeated && r->repeat) || (released && !r->repeat)) 564 return r->action;
564 { 565 }
565 last_action = r->action;
566 return r->action;
567 }
568 break;
569 case WPS_TOUCHREGION_SCROLLBAR:
570 if(r->width > r->height)
571 /* landscape */
572 wps_state.id3->elapsed = (vx *
573 wps_state.id3->length) / r->width;
574 else
575 /* portrait */
576 wps_state.id3->elapsed = (vy *
577 wps_state.id3->length) / r->height;
578
579 audio_ff_rewind(wps_state.id3->elapsed);
580 break;
581 case WPS_TOUCHREGION_VOLUME:
582 {
583 const int min_vol = sound_min(SOUND_VOLUME);
584 const int max_vol = sound_max(SOUND_VOLUME);
585 if(r->width > r->height)
586 /* landscape */
587 global_settings.volume = (vx *
588 (max_vol - min_vol)) / r->width;
589 else
590 /* portrait */
591 global_settings.volume = (vy *
592 (max_vol-min_vol)) / r->height;
593
594 global_settings.volume += min_vol;
595 setvol();
596 break;
597 }
598 }
599 } 566 }
600 } 567 }
601 } 568 }
@@ -682,8 +649,7 @@ long gui_wps_show(void)
682 FOR_NB_SCREENS(i) 649 FOR_NB_SCREENS(i)
683 { 650 {
684 if(gui_wps[i].data->peak_meter_enabled) 651 if(gui_wps[i].data->peak_meter_enabled)
685 gui_wps_redraw(&gui_wps[i], 0, 652 skin_update(&gui_wps[i], WPS_REFRESH_PEAK_METER);
686 WPS_REFRESH_PEAK_METER);
687 next_refresh += HZ / PEAK_METER_FPS; 653 next_refresh += HZ / PEAK_METER_FPS;
688 } 654 }
689 } 655 }
@@ -1083,7 +1049,7 @@ long gui_wps_show(void)
1083 ) 1049 )
1084#endif 1050#endif
1085 { 1051 {
1086 gui_wps_update(&gui_wps[i]); 1052 skin_update(&gui_wps[i], WPS_REFRESH_NON_STATIC);
1087 } 1053 }
1088 } 1054 }
1089 wps_state.do_full_update = false; 1055 wps_state.do_full_update = false;
diff --git a/apps/gui/music_screen.h b/apps/gui/wps.h
index 90614cb65b..90614cb65b 100644
--- a/apps/gui/music_screen.h
+++ b/apps/gui/wps.h