116
B.6. Sample program
The following code is an example of an intelligent module script for Symetrix
Composer 8.0 that uses the API to control the microphone gain and mute settings of
an MAS-A100 unit from a Symetrix device.
Example
-- For Symetrix Composer 8.0
-- MAS-A100 remote control lua script
-- This software is provided "as is".
--
MASComm = {}
function MASComm.new()
local obj = {
sock = TcpSocket.New(),
MASCommTimer = Timer.New(),
ipaddr = "",
cur1 = -999,
cur2 = -999,
cur3 = -999,
data = ""
}
return setmetatable(obj, {__index = MASComm})
end
function MASComm:ControlCheck(cur,new)
return new >= 0.0 and new <= 1.0 and cur ~= new
end
function MASComm:send(data)
self.data = data
self.sock:Connect(self.ipaddr, 42382)
end