-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.brs
47 lines (42 loc) · 949 Bytes
/
utils.brs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Sub MillisecondsToString(ms as integer) as string
hours = Int(ms / 1000 / 60 / 60)
ms -= Int(hours * 1000 * 60 * 60)
minutes = Int(ms / 1000 / 60)
ms -= Int(minutes * 1000 * 60)
seconds = Int(ms / 1000)
str = ""
if hours > 0 and hours < 10
str = "0"
end if
str = hours.ToStr() + ":"
if minutes < 10
str += "0"
end if
str += minutes.ToStr() + ":"
if seconds < 10
str += "0"
end if
str += seconds.ToStr()
return str
end Sub
Sub min(a as integer, b as integer) as integer
if (a < b)
return a
else
return b
end if
end Sub
Sub max(a as integer, b as integer) as integer
if (a > b)
return a
else
return b
end if
end Sub
Sub GenerateTitle(seriesTitle as string, title as string) as string
if seriesTitle = title
return title
else
return seriesTitle + " - " + title
end if
end Sub