some comment

This commit is contained in:
Furkan Mudanyali 2020-03-14 14:54:22 +03:00
parent 83082009d0
commit 42899c1de1

View File

@ -4,21 +4,21 @@ System.createDirectory("ux0:/data/TrackPlugArchive")
-- Scanning TrackPlug folder -- Scanning TrackPlug folder
local tbl = System.listDirectory("ux0:/data/TrackPlug") local tbl = System.listDirectory("ux0:/data/TrackPlug")
-- Removing apps with no region, may also add livetweet, crunchyroll etc.
for i, file in pairs(tbl) do for i, file in pairs(tbl) do
local regcod = string.sub(file.name,1,4) local regcod = string.sub(file.name,1,4)
if regcod ~= "PCSA" and regcod ~= "PCSE" and regcod ~= "PCSB" and regcod ~= "PCSF" and regcod ~= "PCSG" and regcod ~= "PCSH" then if regcod ~= "PCSA" and regcod ~= "PCSE" and regcod ~= "PCSB" and regcod ~= "PCSF" and regcod ~= "PCSG" and regcod ~= "PCSH" then
System.deleteFile("ux0:/data/TrackPlug/"..file.name) System.deleteFile("ux0:/data/TrackPlug/"..file.name)
end end
end end
-- Reset the table
tbl = System.listDirectory("ux0:/data/TrackPlug") tbl = System.listDirectory("ux0:/data/TrackPlug")
if tbl == nil then if tbl == nil then
tbl = {} tbl = {}
end end
-- Convert a 32 bit binary string to a integer -- Convert a 32 bit binary string to an integer
function bin2int(str) function bin2int(str)
local b1, b2, b3, b4 = string.byte(str, 1, 4) local b1, b2, b3, b4 = string.byte(str, 1, 4)
return (b4 << 24) + (b3 << 16) + (b2 << 8) + b1 return (b4 << 24) + (b3 << 16) + (b2 << 8) + b1
@ -117,8 +117,7 @@ if col_idx == nil then
col_idx = 0 col_idx = 0
end end
local function LoadWave(height,dim,f,style,x_dim) local function LoadWave(height,dim,f,x_dim)
if style == 1 then
f=f or 0.1 f=f or 0.1
local onda={pi=math.pi,Frec=f,Long_onda=dim,Amplitud=height} local onda={pi=math.pi,Frec=f,Long_onda=dim,Amplitud=height}
function onda:color(a,b,c) self.a=a self.b=b self.c=c end function onda:color(a,b,c) self.a=a self.b=b self.c=c end
@ -129,7 +128,7 @@ local function LoadWave(height,dim,f,style,x_dim)
end end
if not self.a or not self.b or not self.c then if not self.a or not self.b or not self.c then
self.a = 255 self.a = 255
self.b = 170 self.b = 200
self.c = 220 self.c = 220
end end
local t,x,y,i local t,x,y,i
@ -138,9 +137,8 @@ local function LoadWave(height,dim,f,style,x_dim)
y = 404+self.Amplitud*math.sin(2*self.pi*(t*self.Frec-x/self.Long_onda)) y = 404+self.Amplitud*math.sin(2*self.pi*(t*self.Frec-x/self.Long_onda))
i = self.Amplitud*(self.pi/self.Long_onda)*math.cos(2*self.pi*(t*self.Frec-x/self.Long_onda)) i = self.Amplitud*(self.pi/self.Long_onda)*math.cos(2*self.pi*(t*self.Frec-x/self.Long_onda))
k = self.Amplitud*(1*self.pi/self.Long_onda)*math.sin(-1*self.pi*(t*self.Frec-x/self.Long_onda)) k = self.Amplitud*(1*self.pi/self.Long_onda)*math.sin(-1*self.pi*(t*self.Frec-x/self.Long_onda))
Graphics.drawLine(x-30,x+30,y-i*30,y+i*30,Color.new(255,200,220,math.floor(x/65))) Graphics.drawLine(x-30,x+30,y-i*30,y+i*30,Color.new(self.a,self.b,self.c,math.floor(x/65)))
--Graphics.drawLine(x-100,x+100,y+i*100,y-i*100,Color.new(200,120,180,math.floor(x/30))) Graphics.drawLine(x-150,x+150,y-k*150,y+k*150,Color.new(self.a-60,self.b-80,self.a-70,math.floor(x/20)))
Graphics.drawLine(x-150,x+150,y-k*150,y+k*150,Color.new(140,110,170,math.floor(x/20)))
end end
end end
function onda:destroy() function onda:destroy()
@ -150,7 +148,7 @@ local function LoadWave(height,dim,f,style,x_dim)
end end
end end
wav = LoadWave(100,1160, 0.1, 1, 1160) wav = LoadWave(100,1160, 0.1, 1160)
-- Internal stuffs -- Internal stuffs
local list_idx = 1 local list_idx = 1
@ -161,11 +159,7 @@ local orders = {"Name", "Playtime"}
table.sort(tbl, function (a, b) return (a.title:lower() < b.title:lower() ) end) table.sort(tbl, function (a, b) return (a.title:lower() < b.title:lower() ) end)
function resortList(o_type, m_idx) function resortList(o_type, m_idx)
local old_id = tbl[m_idx].id local old_id = tbl[m_idx].id
if o_type == 1 then -- Playtime
table.sort(tbl, function (a, b) return (a.rtime > b.rtime ) end) table.sort(tbl, function (a, b) return (a.rtime > b.rtime ) end)
elseif o_type == 2 then -- Playtime
table.sort(tbl, function (a, b) return (a.rtime > b.rtime ) end)
end
for i, title in pairs(tbl) do for i, title in pairs(tbl) do
if title.id == old_id then if title.id == old_id then
return i return i
@ -179,6 +173,7 @@ local yellow = Color.new(255, 255, 0)
local grey = Color.new(40, 40, 40) local grey = Color.new(40, 40, 40)
-- Shows an alarm with selection on screen -- Shows an alarm with selection on screen
--[[
local alarm_val = 128 local alarm_val = 128
local alarm_decrease = true local alarm_decrease = true
function showAlarm(title, select_idx) function showAlarm(title, select_idx)
@ -200,7 +195,7 @@ function showAlarm(title, select_idx)
Graphics.debugPrint(205, 235, "Yes", white) Graphics.debugPrint(205, 235, "Yes", white)
Graphics.debugPrint(205, 255, "No", white) Graphics.debugPrint(205, 255, "No", white)
end end
]]--
-- Scroll-list Renderer -- Scroll-list Renderer
local sel_val = 128 local sel_val = 128
local decrease = true local decrease = true