Skip to content

Commit

Permalink
Vol+ Vol- with touch in VideoPlayer
Browse files Browse the repository at this point in the history
  • Loading branch information
ONElua authored Sep 8, 2020
1 parent e081021 commit a300321
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 2 additions & 0 deletions ONEMenuVita/system/explorer/callbacks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ fileant = ""
total_size,files_move, cont = 0,0,0

function onCopyFiles(size,written,file)
power.tick(__POWER_TICK_ALL)
if _print then

if theme.data["list"] then theme.data["list"]:blit(0,0) end
Expand Down Expand Up @@ -200,6 +201,7 @@ end

-- CallBack DeleteFiles
function onDeleteFiles(file)
power.tick(__POWER_TICK_ALL)
if not game_move then
if theme.data["list"] then theme.data["list"]:blit(0,0) end
draw.fillrect(0,0,__DISPLAYW,30, theme.style.CBACKSBARCOLOR)
Expand Down
14 changes: 11 additions & 3 deletions ONEMenuVita/system/explorer/commons.lua
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,12 @@ function VideoPlayer(obj)
local flag = false
local crono_mp4 = timer.new()

swipe.disableContV=false
swipe.set(30, 640,20,300,504)
while video.actived() do
buttons.read()
touch.read()
touch.read()
swipe.read()

if video.playing() then power.tick(__POWER_TICK_ALL) end

Expand Down Expand Up @@ -496,14 +499,17 @@ function VideoPlayer(obj)
if loop then video.looping(0) else video.looping(1) end
end

--Vol+ Vol-
if swipe.up then hw.volume(hw.volume()+1) elseif swipe.down then hw.volume(hw.volume()-1) end

video.render(x,y,w,h)

if flag or (video.percent() > 0 and not video.playing()) then
os.infobar(1,0,1)
screen.print(955,32, files.nopath(obj.path), 1, color.new(255, 255, 255), color.new(64, 64, 64), __ARIGHT)
screen.print(20,520,tostring(video.time()).." / "..tostring(video.totaltime()).." "..tostring(video.percent()) .. " %", 1, color.new(255, 255, 255), color.new(64, 64, 64))
screen.print(20,520,tostring(video.time()).." / "..tostring(video.totaltime()).." "..tostring(video.percent()) .. " %".." Vol "..tostring(hw.volume()), 1, color.new(255, 255, 255), color.new(64, 64, 64))
if video.looping() then
screen.print(190,520, "", 1, color.green, color.new(64, 64, 64))
screen.print(255,520, "", 1, color.green, color.new(64, 64, 64))
end
draw.fillrect(0,540,math.map(video.percent(), 0, 100, 0, 960),5, color.new(0,0,255))
else
Expand All @@ -518,6 +524,8 @@ function VideoPlayer(obj)
os.infobar()
video.term()
end
swipe.set(30,255,70,695,430)
swipe.disableContV=true
end

-- ## Music Player ##
Expand Down
2 changes: 1 addition & 1 deletion ONEMenuVita/system/explorer/explorer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ local makezip_callback = function ()
if name then
name = name .. ".zip"
end
if not name or name == "" then name = "MakeZip.zip" end
if not name or name == "" then return end

local pass = nil
if os.message("\n"..STRINGS_PASS,1)==1 then
Expand Down
2 changes: 1 addition & 1 deletion ONEMenuVita/system/swipeLib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,6 @@ swipe={

}

swipe.set(30,255,70,695,430)
swipe.set(30,100,70,850,430)
swipe.enableDiagonal=false
swipe.disableContV=true

0 comments on commit a300321

Please sign in to comment.