mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-10-10 08:03:04 -04:00
FS#13961 - Add audio status, file_attr constants to lua
use require "audio_status" to use the new AUDIO_STATUS_ defines use require "file_attrs" to use the new FILE_ATTR_ defines Change-Id: If0b3b612e92e9e5b361a9487ccca2d40f79a953e
This commit is contained in:
parent
db87622e7d
commit
1007216fc4
3 changed files with 29 additions and 7 deletions
|
|
@ -29,6 +29,7 @@ local _clr = require("color")
|
|||
require("actions")
|
||||
require("rbsettings")
|
||||
require("settings")
|
||||
require("audio_status")
|
||||
|
||||
local scrpath = rb.current_path()
|
||||
|
||||
|
|
@ -103,9 +104,9 @@ end
|
|||
local function clear_actions()
|
||||
track_length = (rb.audio("length") or 0)
|
||||
local playback = rb.audio("status")
|
||||
if playback == 1 then
|
||||
if playback == rb.AUDIO_STATUS_PLAY then
|
||||
set_active_icon(2)
|
||||
elseif playback == 3 then
|
||||
elseif playback == (rb.AUDIO_STATUS_PAUSE + rb.AUDIO_STATUS_PLAY) then
|
||||
set_active_icon(4)
|
||||
return
|
||||
end
|
||||
|
|
@ -247,10 +248,10 @@ do
|
|||
end
|
||||
elseif action == act.PLA_SELECT then
|
||||
playback = rb.audio("status")
|
||||
if playback == 1 then
|
||||
if playback == rb.AUDIO_STATUS_PLAY then
|
||||
rb.audio("pause")
|
||||
collectgarbage("collect")
|
||||
elseif playback == 3 then
|
||||
elseif playback == (rb.AUDIO_STATUS_PAUSE + rb.AUDIO_STATUS_PLAY) then
|
||||
rb.audio("resume")
|
||||
end
|
||||
event = rb.audio("status") + 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue