-
Notifications
You must be signed in to change notification settings - Fork 0
/
NextFrame.ATEMLuaScript
77 lines (66 loc) · 2.71 KB
/
NextFrame.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
mpnumber = 1
mpdsk = 1
mediasize = EnviroRead("mediasize")
button = 24
musiccount = EnviroRead("musiccount")
nextstill = EnviroRead("nextstill")
stillcount = EnviroRead("stillcount")
framequeue = EnviroRead("framequeue")
VSLog("MediaPlayer: "..mpnumber..", downstreamkey: "..mpdsk..", Media Size: "..mediasize..", Music Frames: "..musiccount)
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
-- initialize firsttime script run and to autotransition DSK on.
-- Keep in mind the DSK needs to be off first!!
if stillcount == 1 then
ATEMMixerMPSetMediaIndex(1,mpnumber,nextstill)
ATEMMixerDSKExecuteAutoTransition(1,mpdsk)
XKeysSetButtonRedLEDState(1,button,"TRUE")
VSLog("Displaying Frame: "..stillcount.." of "..musiccount.." with music index "..nextstill)
nextstill = nextstill + 1
stillcount = stillcount + 1
EnviroWrite("stillcount",stillcount);
EnviroWrite("nextstill",nextstill);
else
-- Messures the cumlativestills displayed verse total musiccount when
-- musicload was run to create the frames
VSLog(stillcount);
VSLog(musiccount);
if stillcount <= musiccount then
-- restarts the nextstill to the first index
if nextstill > mediasize then nextstill = 1 end
ATEMMixerMPSetMediaIndex(1,mpnumber,nextstill)
VSLog("Displaying Frame: "..stillcount.." of "..musiccount.." with music index "..nextstill)
nextstill = nextstill + 1
stillcount = stillcount + 1
EnviroWrite("stillcount",stillcount);
EnviroWrite("nextstill",nextstill);
-- Starts loading the next still in the queue after
-- the second frame has been loaded into the index
framequeue = tonumber(framequeue)
if framequeue > 0 then
mediaindexnumber = framequeue - (framequeue - (stillcount -2))
framenumber = mediasize + mediaindexnumber
VSLog(mediaindexnumber);
VSLog(framenumber);
VSLog(musiccount);
if framenumber <= musiccount then
loadDSKLinesFromQueue(framenumber,mediaindexnumber)
end
end
else
ATEMMixerDSKExecuteAutoTransition(1,mpdsk)
nextstill = nil
stillcount = 0
musiccount = 0
EnviroWrite("stillcount",stillcount);
EnviroWrite("nextstill",nextstill);
EnviroWrite("musiccount",musiccount);
XKeysSetButtonRedLEDState(1,button,"FALSE")
VSLog("Exiting")
end
end