void pause_action(bool may_fade, bool updatewps) { #if CONFIG_CODEC == SWCODEC /* Do audio first, then update, unless skin were to use its local status in which case, reverse it */ audio_pause(); if (updatewps) update_non_static(); #else if (may_fade && global_settings.fade_on_stop) fade(false, updatewps); else audio_pause(); #endif if (global_settings.pause_rewind) { long newpos; #if (CONFIG_CODEC == SWCODEC) audio_pre_ff_rewind(); #endif newpos = audio_current_track()->elapsed - global_settings.pause_rewind * 1000; audio_ff_rewind(newpos > 0 ? newpos : 0); } (void)may_fade; }
/* takes care of seeking to a track in a playlist * returns false if audio isn't playing */ static bool seek(unsigned long pos) { if (!(audio_status() & AUDIO_STATUS_PLAY)) { return false; } else { #if (CONFIG_CODEC == SWCODEC) audio_pre_ff_rewind(); audio_ff_rewind(pos); #else audio_pause(); audio_ff_rewind(pos); audio_resume(); #endif return true; } }