-
Notifications
You must be signed in to change notification settings - Fork 0
/
ltImages.ATEMLuaScript
97 lines (81 loc) · 2.63 KB
/
ltImages.ATEMLuaScript
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
-- load the gd libary
package.cpath=package.cpath..";C:\\Program Files (x86)\\Lua\\5.1\\clibs\\?.dll"
function loadDSKLinesFromQueue (frame,indexnumber)
local path= ApplicationPath() .. "Cache\\Stills\\"
picf=path.."\\music\\pic"..frame..".png";
keyf=path.."\\music\\key"..frame..".png";
ATEMMixerMediaStoreUploadStill( 1, indexnumber, picf , "FILE", keyf );
VSLog("Loaded Frame.."..frame.." into media index "..indexnumber);
end
function loadDSKLines (line1,line2,frame,ismusic,fs1,fs2)
local i=0
local path= ApplicationPath() .. "Cache\\Stills\\"
if line1 == nil then line1="" end
if line2 == nil then line2="" end
mediasize=19
EnviroWrite("mediasize",mediasize)
-- 1080 Input
fsize1=fs1 or 48
fsize2=fs2 or 48
font="bookos.ttf"
w=1920
h=1080
lth=240
-- 720 Input Below
--fsize1=fs1 or 36
--fsize2=fs2 or 36
--font="bookos.ttf"
--w=1280
--h=720
--lth=160
lts=h-lth
require "gd"
require "math"
pic=gd.createTrueColor(w,h);
key=gd.createTrueColor(w,h);
Pwhite=pic:colorAllocate(255,255,255);
Pred=pic:colorAllocate(255,0,0);
Kwhite=key:colorAllocate(255,255,255);
for i = 0,w-1 do
lvl=math.cos(0.6*3.14159*(i/w-0.5))-0.3
c=key:colorAllocate(lvl*255,lvl*255,lvl*255)
key:line(i,h-lth-1,i,h-1,c);
end
llx1, lly1, lrx1, lry1, urx1, ury1, ulx1, uly1 = gd.stringFT(nil,Pwhite,font,fsize1,0,0,0,line1)
llx2, lly2, lrx2, lry2, urx2, ury2, ulx2, uly2 = gd.stringFT(nil,Pwhite,font,fsize2,0,0,0,line2)
--VSLog(llx1, lly1, lrx1, lry1, urx1, ury1, ulx1, uly1)
x1=(w-lrx1-llx1)/2;
x2=(w-lrx2-llx2)/2;
ysize=(lly1-uly1)+(lly2-uly2)+0
yoff=lly1-uly1
yoff=10
y1=lts+(lth-ysize)/2+yoff
y2=y1+ysize/2+10
VSLog(ysize)
VSLog(y1,y2)
pic:stringFT(Pwhite,font,fsize1,0,x1,y1,line1);
pic:stringFT(Pwhite,font,fsize2,0,x2,y2,line2)
key:stringFT(Kwhite,font,fsize1,0,x1,y1,line1);
key:stringFT(Kwhite,font,fsize2,0,x2,y2,line2)
key:stringFT(Kwhite,font,fsize1,0,x1+4,y1+3,line1);
key:stringFT(Kwhite,font,fsize2,0,x2+4,y2+3,line2)
if ismusic == 1 then
picf=path.."\\music\\pic"..frame..".png";
keyf=path.."\\music\\key"..frame..".png";
pic:png(picf);
key:png(keyf);
if frame <= mediasize then
ATEMMixerMediaStoreUploadStill( 1, frame, picf , "FILE", keyf )
VSLog("Loaded Frame.."..frame)
else
VSLog("Media Pool Full Queued Frame.."..frame)
end
else
picf=path.."\\twolines\\pic"..frame..".png";
keyf=path.."\\twolines\\key"..frame..".png";
pic:png(picf);
key:png(keyf);
ATEMMixerMediaStoreUploadStill( 1, frame, picf , "FILE", keyf );
VSLog("Loaded Frame.."..frame);
end
end