mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
lua rockevents reduce context switching for action and buttons
check if any buttons are waiting in the queue before triggering the event thread for action & button events makes button events quicker and also spend less time interrupting lua both wins Change-Id: I38346c084afdd99e4608f40b52053ee39730fb40
This commit is contained in:
parent
a511917f18
commit
1c0648c603
2 changed files with 31 additions and 16 deletions
|
@ -227,7 +227,7 @@ do
|
|||
local quit = false
|
||||
local last_action = 0
|
||||
local magnitude = 1
|
||||
local skip_ms = 1000
|
||||
local skip_ms = 100
|
||||
local playback
|
||||
|
||||
function action_event(action)
|
||||
|
@ -237,11 +237,15 @@ do
|
|||
elseif action == act.PLA_RIGHT_REPEAT then
|
||||
event = pb.TRACK_FF
|
||||
audio_ff_rew(skip_ms * magnitude)
|
||||
magnitude = magnitude + 1
|
||||
if magnitude < 300 then
|
||||
magnitude = magnitude + 1
|
||||
end
|
||||
elseif action == act.PLA_LEFT_REPEAT then
|
||||
event = pb.TRACK_REW
|
||||
audio_ff_rew(-skip_ms * magnitude)
|
||||
magnitude = magnitude + 1
|
||||
if magnitude < 300 then
|
||||
magnitude = magnitude + 1
|
||||
end
|
||||
elseif action == act.PLA_SELECT then
|
||||
playback = rb.audio("status")
|
||||
if playback == 1 then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue