rockbox/apps/plugins/lua/include_lua/audio.lua
Petr Mikhalicin 6f7d70797e plugin api: Add audio_pre_ff_rewind to plugin's API
According to wps code audio_pre_ff_rewind function should be called
before any rewinding. It stops playback and automatically resumes it
after audio_ff_rewind call

So, let's add audio_pre_ff_rewind to plugin's API

Lua scipts were tested:
```lua
-- has issue with rewinding
rb.audio("ff_rewind", 0)
```

```lua
-- no issue with rewinding
rb.audio("pre_ff_rewind")
rb.audio("ff_rewind", 0)
```

Change-Id: I2ad6b9c396760b2086bc0a28633a1c80c3512739
2025-12-29 19:58:26 +05:00

37 lines
1.8 KiB
Lua

--[[ Lua RB Audio Operations
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2017 William Wilgus
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
]]
-- [[ conversion to old style audio_ functions ]]
if not rb.audio then rb.splash(rb.HZ, "No Support!") return nil end
rb.audio_status = function() return rb.audio("status") end
rb.audio_play = function (elapsed, offset) rb.audio("play", elapsed, offset) end
rb.audio_stop = function() rb.audio("stop") end
rb.audio_pause = function() rb.audio("pause") end
rb.audio_resume = function() rb.audio("resume") end
rb.audio_next = function() rb.audio("next") end
rb.audio_prev = function() rb.audio("prev") end
rb.audio_pre_ff_rewind = function () rb.audio("pre_ff_rewind") end
rb.audio_ff_rewind = function (newtime) rb.audio("ff_rewind", newtime) end
rb.audio_flush_and_reload_tracks = function() rb.audio("flush_and_reload_tracks") end
rb.audio_get_file_pos = function() return rb.audio("get_file_pos") end