summaryrefslogtreecommitdiff
path: root/apps/gui/wps.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/wps.c')
-rw-r--r--apps/gui/wps.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index 1acd00d120..a3d7a1bcf1 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -68,7 +68,7 @@
68#define RESTORE_WPS_INSTANTLY 0l 68#define RESTORE_WPS_INSTANTLY 0l
69#define RESTORE_WPS_NEXT_SECOND ((long)(HZ+current_tick)) 69#define RESTORE_WPS_NEXT_SECOND ((long)(HZ+current_tick))
70 70
71#define FF_REWIND_MAX_PERCENT 3 /* cap ff/rewind step size at max % of file */ 71#define FF_REWIND_MAX_PERCENT 3 /* cap ff/rewind step size at max % of file */
72 /* 3% of 30min file == 54s step size */ 72 /* 3% of 30min file == 54s step size */
73#define MIN_FF_REWIND_STEP 500 73#define MIN_FF_REWIND_STEP 500
74 74
@@ -170,7 +170,7 @@ void unpause_action(bool may_fade, bool updatewps)
170#endif 170#endif
171 171
172 (void)may_fade; 172 (void)may_fade;
173} 173}
174 174
175#if CONFIG_CODEC != SWCODEC 175#if CONFIG_CODEC != SWCODEC
176void fade(bool fade_in, bool updatewps) 176void fade(bool fade_in, bool updatewps)
@@ -189,7 +189,7 @@ void fade(bool fade_in, bool updatewps)
189 189
190 sleep(HZ/10); /* let audio thread run */ 190 sleep(HZ/10); /* let audio thread run */
191 audio_resume(); 191 audio_resume();
192 192
193 if (updatewps) 193 if (updatewps)
194 update_non_static(); 194 update_non_static();
195 195
@@ -227,7 +227,7 @@ void fade(bool fade_in, bool updatewps)
227 sound_set_volume(global_settings.volume); 227 sound_set_volume(global_settings.volume);
228 } 228 }
229} 229}
230#endif /* SWCODEC */ 230#endif /* SWCODEC */
231 231
232static bool update_onvol_change(enum screen_type screen) 232static bool update_onvol_change(enum screen_type screen)
233{ 233{
@@ -298,8 +298,8 @@ static int skintouch_to_wps(struct wps_data *data)
298 298
299bool ffwd_rew(int button) 299bool ffwd_rew(int button)
300{ 300{
301 unsigned int step = 0; /* current ff/rewind step */ 301 unsigned int step = 0; /* current ff/rewind step */
302 unsigned int max_step = 0; /* maximum ff/rewind step */ 302 unsigned int max_step = 0; /* maximum ff/rewind step */
303 int ff_rewind_count = 0; /* current ff/rewind count (in ticks) */ 303 int ff_rewind_count = 0; /* current ff/rewind count (in ticks) */
304 int direction = -1; /* forward=1 or backward=-1 */ 304 int direction = -1; /* forward=1 or backward=-1 */
305 bool exit = false; 305 bool exit = false;
@@ -323,7 +323,7 @@ bool ffwd_rew(int button)
323 if (direction == 1) 323 if (direction == 1)
324 { 324 {
325 /* fast forwarding, calc max step relative to end */ 325 /* fast forwarding, calc max step relative to end */
326 max_step = (skin_get_global_state()->id3->length - 326 max_step = (skin_get_global_state()->id3->length -
327 (skin_get_global_state()->id3->elapsed + 327 (skin_get_global_state()->id3->elapsed +
328 ff_rewind_count)) * 328 ff_rewind_count)) *
329 FF_REWIND_MAX_PERCENT / 100; 329 FF_REWIND_MAX_PERCENT / 100;
@@ -360,7 +360,7 @@ bool ffwd_rew(int button)
360 FOR_NB_SCREENS(i) 360 FOR_NB_SCREENS(i)
361 skin_get_gwps(WPS, i)->display->stop_scroll(); 361 skin_get_gwps(WPS, i)->display->stop_scroll();
362#endif 362#endif
363 if (direction > 0) 363 if (direction > 0)
364 status_set_ffmode(STATUS_FASTFORWARD); 364 status_set_ffmode(STATUS_FASTFORWARD);
365 else 365 else
366 status_set_ffmode(STATUS_FASTBACKWARD); 366 status_set_ffmode(STATUS_FASTBACKWARD);
@@ -489,8 +489,8 @@ static void change_dir(int direction)
489 audio_prev_dir(); 489 audio_prev_dir();
490 else if (direction > 0) 490 else if (direction > 0)
491 audio_next_dir(); 491 audio_next_dir();
492 /* prevent the next dir to immediatly start being ffw'd */ 492 /* prevent the next dir to immediatly start being ffw'd */
493 action_wait_for_release(); 493 action_wait_for_release();
494} 494}
495 495
496static void prev_track(unsigned long skip_thresh) 496static void prev_track(unsigned long skip_thresh)
@@ -644,7 +644,7 @@ static void gwps_leave_wps(void)
644 skin_backdrop_show(sb_get_backdrop(i)); 644 skin_backdrop_show(sb_get_backdrop(i));
645#endif 645#endif
646 viewportmanager_theme_undo(i, skin_has_sbs(i, skin_get_gwps(WPS, i)->data)); 646 viewportmanager_theme_undo(i, skin_has_sbs(i, skin_get_gwps(WPS, i)->data));
647 647
648 } 648 }
649 649
650#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) 650#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
@@ -676,7 +676,7 @@ static void gwps_enter_wps(void)
676#if LCD_DEPTH > 1 676#if LCD_DEPTH > 1
677 if (display->depth > 1) 677 if (display->depth > 1)
678 { 678 {
679 struct skin_viewport *svp = skin_find_item(VP_DEFAULT_LABEL_STRING, 679 struct skin_viewport *svp = skin_find_item(VP_DEFAULT_LABEL_STRING,
680 SKIN_FIND_VP, gwps->data); 680 SKIN_FIND_VP, gwps->data);
681 if (svp) 681 if (svp)
682 { 682 {
@@ -722,7 +722,7 @@ void wps_do_playpause(bool updatewps)
722#endif 722#endif
723 } 723 }
724} 724}
725 725
726 726
727/* The WPS can be left in two ways: 727/* The WPS can be left in two ways:
728 * a) call a function, which draws over the wps. In this case, the wps 728 * a) call a function, which draws over the wps. In this case, the wps
@@ -755,7 +755,7 @@ long gui_wps_show(void)
755 ab_reset_markers(); 755 ab_reset_markers();
756#endif 756#endif
757 wps_state_init(); 757 wps_state_init();
758 758
759 while ( 1 ) 759 while ( 1 )
760 { 760 {
761 bool audio_paused = (audio_status() & AUDIO_STATUS_PAUSE)?true:false; 761 bool audio_paused = (audio_status() & AUDIO_STATUS_PAUSE)?true:false;
@@ -773,7 +773,7 @@ long gui_wps_show(void)
773#endif 773#endif
774 } 774 }
775 } 775 }
776 button = skin_wait_for_action(WPS, CONTEXT_WPS|ALLOW_SOFTLOCK, 776 button = skin_wait_for_action(WPS, CONTEXT_WPS|ALLOW_SOFTLOCK,
777 restore ? 1 : HZ/5); 777 restore ? 1 : HZ/5);
778 778
779 /* Exit if audio has stopped playing. This happens e.g. at end of 779 /* Exit if audio has stopped playing. This happens e.g. at end of
@@ -820,17 +820,17 @@ long gui_wps_show(void)
820 { 820 {
821 bool hotkey = button == ACTION_WPS_HOTKEY; 821 bool hotkey = button == ACTION_WPS_HOTKEY;
822 gwps_leave_wps(); 822 gwps_leave_wps();
823 int retval = onplay(state->id3->path, 823 int retval = onplay(state->id3->path,
824 FILE_ATTR_AUDIO, CONTEXT_WPS, hotkey); 824 FILE_ATTR_AUDIO, CONTEXT_WPS, hotkey);
825 /* if music is stopped in the context menu we want to exit the wps */ 825 /* if music is stopped in the context menu we want to exit the wps */
826 if (retval == ONPLAY_MAINMENU 826 if (retval == ONPLAY_MAINMENU
827 || !audio_status()) 827 || !audio_status())
828 return GO_TO_ROOT; 828 return GO_TO_ROOT;
829 else if (retval == ONPLAY_PLAYLIST) 829 else if (retval == ONPLAY_PLAYLIST)
830 return GO_TO_PLAYLIST_VIEWER; 830 return GO_TO_PLAYLIST_VIEWER;
831#ifdef HAVE_PICTUREFLOW_INTEGRATION 831#ifdef HAVE_PICTUREFLOW_INTEGRATION
832 else if (retval == ONPLAY_PICTUREFLOW) 832 else if (retval == ONPLAY_PICTUREFLOW)
833 return GO_TO_PICTUREFLOW; 833 return GO_TO_PICTUREFLOW;
834#endif 834#endif
835 restore = true; 835 restore = true;
836 } 836 }
@@ -860,7 +860,7 @@ long gui_wps_show(void)
860 global_settings.volume--; 860 global_settings.volume--;
861 vol_changed = true; 861 vol_changed = true;
862 break; 862 break;
863 /* fast forward 863 /* fast forward
864 OR next dir if this is straight after ACTION_WPS_SKIPNEXT */ 864 OR next dir if this is straight after ACTION_WPS_SKIPNEXT */
865 case ACTION_WPS_SEEKFWD: 865 case ACTION_WPS_SEEKFWD:
866 if (global_settings.party_mode) 866 if (global_settings.party_mode)
@@ -880,7 +880,7 @@ long gui_wps_show(void)
880 ffwd_rew(ACTION_WPS_SEEKFWD); 880 ffwd_rew(ACTION_WPS_SEEKFWD);
881 last_right = last_left = 0; 881 last_right = last_left = 0;
882 break; 882 break;
883 /* fast rewind 883 /* fast rewind
884 OR prev dir if this is straight after ACTION_WPS_SKIPPREV,*/ 884 OR prev dir if this is straight after ACTION_WPS_SKIPPREV,*/
885 case ACTION_WPS_SEEKBACK: 885 case ACTION_WPS_SEEKBACK:
886 if (global_settings.party_mode) 886 if (global_settings.party_mode)