1
0
Fork 0
forked from len0rd/rockbox

Move play_hop() to gwps.c and make it static. It's the only file that calls it.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20306 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2009-03-12 18:50:24 +00:00
parent 23722d5ff4
commit 74aba34b58
3 changed files with 32 additions and 32 deletions

View file

@ -63,6 +63,7 @@
#include "pitchscreen.h"
#include "appevents.h"
#include "viewport.h"
#include "pcmbuf.h"
/* currently only one wps_state is needed */
struct wps_state wps_state;
@ -115,6 +116,37 @@ static void next_track(void)
audio_next();
}
static void play_hop(int direction)
{
unsigned step = ((unsigned)global_settings.skip_length*1000);
unsigned long *elapsed = &(wps_state.id3->elapsed);
if (direction == 1 && wps_state.id3->length - *elapsed < step+1000) {
#if CONFIG_CODEC == SWCODEC
if(global_settings.beep)
pcmbuf_beep(1000, 150, 1500*global_settings.beep);
#endif
return;
} else if ((direction == -1 && *elapsed < step)) {
*elapsed = 0;
} else {
*elapsed += step * direction;
}
if((audio_status() & AUDIO_STATUS_PLAY) && !wps_state.paused) {
#if (CONFIG_CODEC == SWCODEC)
audio_pre_ff_rewind();
#else
audio_pause();
#endif
}
audio_ff_rewind(*elapsed);
#if (CONFIG_CODEC != SWCODEC)
if (!wps_state.paused)
audio_resume();
#endif
}
static int fix_wps_bars(void)
{
#ifdef HAVE_LCD_BITMAP