summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/wps.c40
1 files changed, 29 insertions, 11 deletions
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index c33268e6bd..069df09c36 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -219,10 +219,10 @@ static int skintouch_to_wps(struct wps_data *data)
219#endif 219#endif
220 case ACTION_TOUCH_SCROLLBAR: 220 case ACTION_TOUCH_SCROLLBAR:
221 skin_get_global_state()->id3->elapsed = skin_get_global_state()->id3->length*offset/100; 221 skin_get_global_state()->id3->elapsed = skin_get_global_state()->id3->length*offset/100;
222 if (!skin_get_global_state()->paused)
223#if (CONFIG_CODEC == SWCODEC) 222#if (CONFIG_CODEC == SWCODEC)
224 audio_pre_ff_rewind(); 223 audio_pre_ff_rewind();
225#else 224#else
225 if (!skin_get_global_state()->paused)
226 audio_pause(); 226 audio_pause();
227#endif 227#endif
228 audio_ff_rewind(skin_get_global_state()->id3->elapsed); 228 audio_ff_rewind(skin_get_global_state()->id3->elapsed);
@@ -300,10 +300,10 @@ bool ffwd_rew(int button)
300 if ( (audio_status() & AUDIO_STATUS_PLAY) && 300 if ( (audio_status() & AUDIO_STATUS_PLAY) &&
301 skin_get_global_state()->id3 && skin_get_global_state()->id3->length ) 301 skin_get_global_state()->id3 && skin_get_global_state()->id3->length )
302 { 302 {
303 if (!skin_get_global_state()->paused)
304#if (CONFIG_CODEC == SWCODEC) 303#if (CONFIG_CODEC == SWCODEC)
305 audio_pre_ff_rewind(); 304 audio_pre_ff_rewind();
306#else 305#else
306 if (!skin_get_global_state()->paused)
307 audio_pause(); 307 audio_pause();
308#endif 308#endif
309#if CONFIG_KEYPAD == PLAYER_PAD 309#if CONFIG_KEYPAD == PLAYER_PAD
@@ -472,10 +472,10 @@ static void prev_track(unsigned long skip_thresh)
472 return; 472 return;
473 } 473 }
474 474
475 if (!state->paused)
476#if (CONFIG_CODEC == SWCODEC) 475#if (CONFIG_CODEC == SWCODEC)
477 audio_pre_ff_rewind(); 476 audio_pre_ff_rewind();
478#else 477#else
478 if (!state->paused)
479 audio_pause(); 479 audio_pause();
480#endif 480#endif
481 481
@@ -554,16 +554,20 @@ static void play_hop(int direction)
554 { 554 {
555 elapsed += step * direction; 555 elapsed += step * direction;
556 } 556 }
557 if((audio_status() & AUDIO_STATUS_PLAY) && !state->paused) 557 if(audio_status() & AUDIO_STATUS_PLAY)
558 { 558 {
559#if (CONFIG_CODEC == SWCODEC) 559#if (CONFIG_CODEC == SWCODEC)
560 audio_pre_ff_rewind(); 560 audio_pre_ff_rewind();
561#else 561#else
562 audio_pause(); 562 if (!state->paused)
563 audio_pause();
563#endif 564#endif
564 } 565 }
566
567#if (CONFIG_CODEC == SWCODEC)
568 audio_ff_rewind(elapsed);
569#else
565 audio_ff_rewind(state->id3->elapsed = elapsed); 570 audio_ff_rewind(state->id3->elapsed = elapsed);
566#if (CONFIG_CODEC != SWCODEC)
567 if (!state->paused) 571 if (!state->paused)
568 audio_resume(); 572 audio_resume();
569#endif 573#endif
@@ -849,10 +853,10 @@ long gui_wps_show(void)
849 { 853 {
850 if (state->id3->cuesheet) 854 if (state->id3->cuesheet)
851 { 855 {
852 if (!state->paused)
853#if (CONFIG_CODEC == SWCODEC) 856#if (CONFIG_CODEC == SWCODEC)
854 audio_pre_ff_rewind(); 857 audio_pre_ff_rewind();
855#else 858#else
859 if (!state->paused)
856 audio_pause(); 860 audio_pause();
857#endif 861#endif
858 audio_ff_rewind(0); 862 audio_ff_rewind(0);
@@ -1146,6 +1150,17 @@ static void nextid3available_callback(void* param)
1146 skin_request_full_update(WPS); 1150 skin_request_full_update(WPS);
1147} 1151}
1148 1152
1153#ifdef AUDIO_FAST_SKIP_PREVIEW
1154/* this is called on the audio_skip caller thread */
1155static void track_skip_callback(void *param)
1156{
1157 struct wps_state *state = skin_get_global_state();
1158 state->id3 = audio_current_track();
1159 state->nid3 = audio_next_track();
1160 skin_request_full_update(WPS);
1161 (void)param;
1162}
1163#endif /* AUDIO_FAST_SKIP_PREVIEW */
1149 1164
1150static void wps_state_init(void) 1165static void wps_state_init(void)
1151{ 1166{
@@ -1167,6 +1182,9 @@ static void wps_state_init(void)
1167 /* add the WPS track event callbacks */ 1182 /* add the WPS track event callbacks */
1168 add_event(PLAYBACK_EVENT_TRACK_CHANGE, false, track_changed_callback); 1183 add_event(PLAYBACK_EVENT_TRACK_CHANGE, false, track_changed_callback);
1169 add_event(PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, false, nextid3available_callback); 1184 add_event(PLAYBACK_EVENT_NEXTTRACKID3_AVAILABLE, false, nextid3available_callback);
1185#ifdef AUDIO_FAST_SKIP_PREVIEW
1186 add_event(PLAYBACK_EVENT_TRACK_SKIP, false, track_skip_callback);
1187#endif
1170} 1188}
1171 1189
1172 1190