{"name":"AnthemAV","type":"com.fibaro.genericDevice","apiVersion":"1.3","initialProperties":{"viewLayout":{"$jason":{"body":{"header":{"style":{"height":"0"},"title":"quickApp_device_283"},"sections":{"items":[{"components":[{"name":"lblTitle","style":{"weight":"1.2"},"text":"Label","type":"label","visible":true},{"style":{"weight":"0.5"},"type":"space"}],"style":{"weight":"1.2"},"type":"vertical"},{"components":[{"name":"lblName","style":{"weight":"1.2"},"text":"Label","type":"label","visible":true},{"style":{"weight":"0.5"},"type":"space"}],"style":{"weight":"1.2"},"type":"vertical"},{"components":[{"components":[{"name":"button_ID_12_1","style":{"weight":"0.33"},"text":"Button","type":"button","visible":false},{"name":"btnPOW","style":{"weight":"0.33"},"text":"ONOFF","type":"button","visible":true},{"name":"button_ID_12_3","style":{"weight":"0.33"},"text":"Button","type":"button","visible":false}],"style":{"weight":"1.2"},"type":"horizontal"},{"style":{"weight":"0.5"},"type":"space"}],"style":{"weight":"1.2"},"type":"vertical"},{"components":[{"name":"lblVOL","style":{"weight":"1.2"},"text":"Label","type":"label","visible":true},{"style":{"weight":"0.5"},"type":"space"}],"style":{"weight":"1.2"},"type":"vertical"},{"components":[{"components":[{"name":"btnVDN","style":{"weight":"0.33"},"text":"-","type":"button","visible":true},{"name":"btnMUT","style":{"weight":"0.33"},"text":"Mute","type":"button","visible":true},{"name":"btnVUP","style":{"weight":"0.33"},"text":"+","type":"button","visible":true}],"style":{"weight":"1.2"},"type":"horizontal"},{"style":{"weight":"0.5"},"type":"space"}],"style":{"weight":"1.2"},"type":"vertical"},{"components":[{"name":"lblINP","style":{"weight":"1.2"},"text":"Input","type":"label","visible":true},{"style":{"weight":"0.5"},"type":"space"}],"style":{"weight":"1.2"},"type":"vertical"},{"components":[{"components":[{"name":"btnFOX","style":{"weight":"0.33"},"text":"FOXTEL","type":"button","visible":true},{"name":"btnATV","style":{"weight":"0.33"},"text":"APPLE TV","type":"button","visible":true},{"name":"button_ID_11_3","style":{"weight":"0.33"},"text":"Button","type":"button","visible":false}],"style":{"weight":"1.2"},"type":"horizontal"},{"style":{"weight":"0.5"},"type":"space"}],"style":{"weight":"1.2"},"type":"vertical"},{"components":[{"components":[{"name":"btnBLU","style":{"weight":"0.33"},"text":"BLU-RAY","type":"button","visible":true},{"name":"btnPLAY","style":{"weight":"0.33"},"text":"PLAYSTATION","type":"button","visible":true},{"name":"btnFMR","style":{"weight":"0.33"},"text":"FM RADIO","type":"button","visible":true}],"style":{"weight":"1.2"},"type":"horizontal"},{"style":{"weight":"0.5"},"type":"space"}],"style":{"weight":"1.2"},"type":"vertical"},{"components":[{"name":"lblALM","style":{"weight":"1.2"},"text":"lblALM","type":"label","visible":true},{"style":{"weight":"0.5"},"type":"space"}],"style":{"weight":"1.2"},"type":"vertical"},{"components":[{"components":[{"name":"btnALMpa","style":{"weight":"0.33"},"text":"-","type":"button","visible":true},{"name":"button_ID_23_2","style":{"weight":"0.33"},"text":"Button","type":"button","visible":false},{"name":"btnALMna","style":{"weight":"0.33"},"text":"+","type":"button","visible":true}],"style":{"weight":"1.2"},"type":"horizontal"},{"style":{"weight":"0.5"},"type":"space"}],"style":{"weight":"1.2"},"type":"vertical"},{"components":[{"name":"lblAIN","style":{"weight":"1.2"},"text":"Sound Mode: ","type":"label","visible":true},{"style":{"weight":"0.5"},"type":"space"}],"style":{"weight":"1.2"},"type":"vertical"},{"components":[{"name":"lblAIC","style":{"weight":"1.2"},"text":"AIC","type":"label","visible":true},{"style":{"weight":"0.5"},"type":"space"}],"style":{"weight":"1.2"},"type":"vertical"},{"components":[{"name":"lblAIR","style":{"weight":"1.2"},"text":"Sample Frequency: ","type":"label","visible":true},{"style":{"weight":"0.5"},"type":"space"}],"style":{"weight":"1.2"},"type":"vertical"},{"components":[{"name":"lblAIF","style":{"weight":"1.2"},"text":"lblAIF","type":"label","visible":true},{"style":{"weight":"0.5"},"type":"space"}],"style":{"weight":"1.2"},"type":"vertical"},{"components":[{"name":"lblBRT","style":{"weight":"1.2"},"text":"lblBRT","type":"label","visible":true},{"style":{"weight":"0.5"},"type":"space"}],"style":{"weight":"1.2"},"type":"vertical"},{"components":[{"name":"lblSRT","style":{"weight":"1.2"},"text":"lblSRT","type":"label","visible":true},{"style":{"weight":"0.5"},"type":"space"}],"style":{"weight":"1.2"},"type":"vertical"},{"components":[{"name":"lblVIR","style":{"weight":"1.2"},"text":"VIR","type":"label","visible":true},{"style":{"weight":"0.5"},"type":"space"}],"style":{"weight":"1.2"},"type":"vertical"},{"components":[{"components":[{"name":"btnConn","style":{"weight":"0.33"},"text":"Connect","type":"button","visible":true},{"name":"btnStat","style":{"weight":"0.33"},"text":"Status","type":"button","visible":true},{"name":"btnDisc","style":{"weight":"0.33"},"text":"Disconnect","type":"button","visible":true}],"style":{"weight":"1.2"},"type":"horizontal"},{"style":{"weight":"0.5"},"type":"space"}],"style":{"weight":"1.2"},"type":"vertical"},{"components":[{"name":"lblIDM","style":{"weight":"1.2"},"text":"lblIDM","type":"label","visible":true},{"style":{"weight":"0.5"},"type":"space"}],"style":{"weight":"1.2"},"type":"vertical"},{"components":[{"name":"lblIDR","style":{"weight":"1.2"},"text":"lblIDR","type":"label","visible":true},{"style":{"weight":"0.5"},"type":"space"}],"style":{"weight":"1.2"},"type":"vertical"},{"components":[{"name":"lblIDN","style":{"weight":"1.2"},"text":"lblIDN","type":"label","visible":true},{"style":{"weight":"0.5"},"type":"space"}],"style":{"weight":"1.2"},"type":"vertical"},{"components":[{"name":"lblIDH","style":{"weight":"1.2"},"text":"lblIDH","type":"label","visible":true},{"style":{"weight":"0.5"},"type":"space"}],"style":{"weight":"1.2"},"type":"vertical"},{"components":[{"name":"lblIDS","style":{"weight":"1.2"},"text":"lblIDS","type":"label","visible":true},{"style":{"weight":"0.5"},"type":"space"}],"style":{"weight":"1.2"},"type":"vertical"},{"components":[{"name":"lblIDB","style":{"weight":"1.2"},"text":"lblIDB","type":"label","visible":true},{"style":{"weight":"0.5"},"type":"space"}],"style":{"weight":"1.2"},"type":"vertical"}]}},"head":{"title":"quickApp_device_283"}}},"uiView":[{"components":[{"name":"lblTitle","style":{"weight":"1.0"},"text":"Label","type":"label","visible":true}],"style":{"weight":"1.0"},"type":"horizontal"},{"components":[{"name":"lblName","style":{"weight":"1.0"},"text":"Label","type":"label","visible":true}],"style":{"weight":"1.0"},"type":"horizontal"},{"components":[{"eventBinding":{"onLongPressDown":[{"params":{"actionName":"UIAction","args":["onLongPressDown","button_ID_12_1"]},"type":"deviceAction"}],"onLongPressReleased":[{"params":{"actionName":"UIAction","args":["onLongPressReleased","button_ID_12_1"]},"type":"deviceAction"}],"onReleased":[{"params":{"actionName":"UIAction","args":["onReleased","button_ID_12_1"]},"type":"deviceAction"}]},"name":"button_ID_12_1","style":{"weight":"0.33"},"text":"Button","type":"button","visible":false},{"eventBinding":{"onLongPressDown":[{"params":{"actionName":"UIAction","args":["onLongPressDown","btnPOW"]},"type":"deviceAction"}],"onLongPressReleased":[{"params":{"actionName":"UIAction","args":["onLongPressReleased","btnPOW"]},"type":"deviceAction"}],"onReleased":[{"params":{"actionName":"UIAction","args":["onReleased","btnPOW"]},"type":"deviceAction"}]},"name":"btnPOW","style":{"weight":"0.33"},"text":"ONOFF","type":"button","visible":true},{"eventBinding":{"onLongPressDown":[{"params":{"actionName":"UIAction","args":["onLongPressDown","button_ID_12_3"]},"type":"deviceAction"}],"onLongPressReleased":[{"params":{"actionName":"UIAction","args":["onLongPressReleased","button_ID_12_3"]},"type":"deviceAction"}],"onReleased":[{"params":{"actionName":"UIAction","args":["onReleased","button_ID_12_3"]},"type":"deviceAction"}]},"name":"button_ID_12_3","style":{"weight":"0.33"},"text":"Button","type":"button","visible":false}],"style":{"weight":"1.0"},"type":"horizontal"},{"components":[{"name":"lblVOL","style":{"weight":"1.0"},"text":"Label","type":"label","visible":true}],"style":{"weight":"1.0"},"type":"horizontal"},{"components":[{"eventBinding":{"onLongPressDown":[{"params":{"actionName":"UIAction","args":["onLongPressDown","btnVDN"]},"type":"deviceAction"}],"onLongPressReleased":[{"params":{"actionName":"UIAction","args":["onLongPressReleased","btnVDN"]},"type":"deviceAction"}],"onReleased":[{"params":{"actionName":"UIAction","args":["onReleased","btnVDN"]},"type":"deviceAction"}]},"name":"btnVDN","style":{"weight":"0.33"},"text":"-","type":"button","visible":true},{"eventBinding":{"onLongPressDown":[{"params":{"actionName":"UIAction","args":["onLongPressDown","btnMUT"]},"type":"deviceAction"}],"onLongPressReleased":[{"params":{"actionName":"UIAction","args":["onLongPressReleased","btnMUT"]},"type":"deviceAction"}],"onReleased":[{"params":{"actionName":"UIAction","args":["onReleased","btnMUT"]},"type":"deviceAction"}]},"name":"btnMUT","style":{"weight":"0.33"},"text":"Mute","type":"button","visible":true},{"eventBinding":{"onLongPressDown":[{"params":{"actionName":"UIAction","args":["onLongPressDown","btnVUP"]},"type":"deviceAction"}],"onLongPressReleased":[{"params":{"actionName":"UIAction","args":["onLongPressReleased","btnVUP"]},"type":"deviceAction"}],"onReleased":[{"params":{"actionName":"UIAction","args":["onReleased","btnVUP"]},"type":"deviceAction"}]},"name":"btnVUP","style":{"weight":"0.33"},"text":"+","type":"button","visible":true}],"style":{"weight":"1.0"},"type":"horizontal"},{"components":[{"name":"lblINP","style":{"weight":"1.0"},"text":"Input","type":"label","visible":true}],"style":{"weight":"1.0"},"type":"horizontal"},{"components":[{"eventBinding":{"onLongPressDown":[{"params":{"actionName":"UIAction","args":["onLongPressDown","btnFOX"]},"type":"deviceAction"}],"onLongPressReleased":[{"params":{"actionName":"UIAction","args":["onLongPressReleased","btnFOX"]},"type":"deviceAction"}],"onReleased":[{"params":{"actionName":"UIAction","args":["onReleased","btnFOX"]},"type":"deviceAction"}]},"name":"btnFOX","style":{"weight":"0.33"},"text":"FOXTEL","type":"button","visible":true},{"eventBinding":{"onLongPressDown":[{"params":{"actionName":"UIAction","args":["onLongPressDown","btnATV"]},"type":"deviceAction"}],"onLongPressReleased":[{"params":{"actionName":"UIAction","args":["onLongPressReleased","btnATV"]},"type":"deviceAction"}],"onReleased":[{"params":{"actionName":"UIAction","args":["onReleased","btnATV"]},"type":"deviceAction"}]},"name":"btnATV","style":{"weight":"0.33"},"text":"APPLE TV","type":"button","visible":true},{"eventBinding":{"onLongPressDown":[{"params":{"actionName":"UIAction","args":["onLongPressDown","button_ID_11_3"]},"type":"deviceAction"}],"onLongPressReleased":[{"params":{"actionName":"UIAction","args":["onLongPressReleased","button_ID_11_3"]},"type":"deviceAction"}],"onReleased":[{"params":{"actionName":"UIAction","args":["onReleased","button_ID_11_3"]},"type":"deviceAction"}]},"name":"button_ID_11_3","style":{"weight":"0.33"},"text":"Button","type":"button","visible":false}],"style":{"weight":"1.0"},"type":"horizontal"},{"components":[{"eventBinding":{"onLongPressDown":[{"params":{"actionName":"UIAction","args":["onLongPressDown","btnBLU"]},"type":"deviceAction"}],"onLongPressReleased":[{"params":{"actionName":"UIAction","args":["onLongPressReleased","btnBLU"]},"type":"deviceAction"}],"onReleased":[{"params":{"actionName":"UIAction","args":["onReleased","btnBLU"]},"type":"deviceAction"}]},"name":"btnBLU","style":{"weight":"0.33"},"text":"BLU-RAY","type":"button","visible":true},{"eventBinding":{"onLongPressDown":[{"params":{"actionName":"UIAction","args":["onLongPressDown","btnPLAY"]},"type":"deviceAction"}],"onLongPressReleased":[{"params":{"actionName":"UIAction","args":["onLongPressReleased","btnPLAY"]},"type":"deviceAction"}],"onReleased":[{"params":{"actionName":"UIAction","args":["onReleased","btnPLAY"]},"type":"deviceAction"}]},"name":"btnPLAY","style":{"weight":"0.33"},"text":"PLAYSTATION","type":"button","visible":true},{"eventBinding":{"onLongPressDown":[{"params":{"actionName":"UIAction","args":["onLongPressDown","btnFMR"]},"type":"deviceAction"}],"onLongPressReleased":[{"params":{"actionName":"UIAction","args":["onLongPressReleased","btnFMR"]},"type":"deviceAction"}],"onReleased":[{"params":{"actionName":"UIAction","args":["onReleased","btnFMR"]},"type":"deviceAction"}]},"name":"btnFMR","style":{"weight":"0.33"},"text":"FM RADIO","type":"button","visible":true}],"style":{"weight":"1.0"},"type":"horizontal"},{"components":[{"name":"lblALM","style":{"weight":"1.0"},"text":"lblALM","type":"label","visible":true}],"style":{"weight":"1.0"},"type":"horizontal"},{"components":[{"eventBinding":{"onLongPressDown":[{"params":{"actionName":"UIAction","args":["onLongPressDown","btnALMpa"]},"type":"deviceAction"}],"onLongPressReleased":[{"params":{"actionName":"UIAction","args":["onLongPressReleased","btnALMpa"]},"type":"deviceAction"}],"onReleased":[{"params":{"actionName":"UIAction","args":["onReleased","btnALMpa"]},"type":"deviceAction"}]},"name":"btnALMpa","style":{"weight":"0.33"},"text":"-","type":"button","visible":true},{"eventBinding":{"onLongPressDown":[{"params":{"actionName":"UIAction","args":["onLongPressDown","button_ID_23_2"]},"type":"deviceAction"}],"onLongPressReleased":[{"params":{"actionName":"UIAction","args":["onLongPressReleased","button_ID_23_2"]},"type":"deviceAction"}],"onReleased":[{"params":{"actionName":"UIAction","args":["onReleased","button_ID_23_2"]},"type":"deviceAction"}]},"name":"button_ID_23_2","style":{"weight":"0.33"},"text":"Button","type":"button","visible":false},{"eventBinding":{"onLongPressDown":[{"params":{"actionName":"UIAction","args":["onLongPressDown","btnALMna"]},"type":"deviceAction"}],"onLongPressReleased":[{"params":{"actionName":"UIAction","args":["onLongPressReleased","btnALMna"]},"type":"deviceAction"}],"onReleased":[{"params":{"actionName":"UIAction","args":["onReleased","btnALMna"]},"type":"deviceAction"}]},"name":"btnALMna","style":{"weight":"0.33"},"text":"+","type":"button","visible":true}],"style":{"weight":"1.0"},"type":"horizontal"},{"components":[{"name":"lblAIN","style":{"weight":"1.0"},"text":"Sound Mode: ","type":"label","visible":true}],"style":{"weight":"1.0"},"type":"horizontal"},{"components":[{"name":"lblAIC","style":{"weight":"1.0"},"text":"AIC","type":"label","visible":true}],"style":{"weight":"1.0"},"type":"horizontal"},{"components":[{"name":"lblAIR","style":{"weight":"1.0"},"text":"Sample Frequency: ","type":"label","visible":true}],"style":{"weight":"1.0"},"type":"horizontal"},{"components":[{"name":"lblAIF","style":{"weight":"1.0"},"text":"lblAIF","type":"label","visible":true}],"style":{"weight":"1.0"},"type":"horizontal"},{"components":[{"name":"lblBRT","style":{"weight":"1.0"},"text":"lblBRT","type":"label","visible":true}],"style":{"weight":"1.0"},"type":"horizontal"},{"components":[{"name":"lblSRT","style":{"weight":"1.0"},"text":"lblSRT","type":"label","visible":true}],"style":{"weight":"1.0"},"type":"horizontal"},{"components":[{"name":"lblVIR","style":{"weight":"1.0"},"text":"VIR","type":"label","visible":true}],"style":{"weight":"1.0"},"type":"horizontal"},{"components":[{"eventBinding":{"onLongPressDown":[{"params":{"actionName":"UIAction","args":["onLongPressDown","btnConn"]},"type":"deviceAction"}],"onLongPressReleased":[{"params":{"actionName":"UIAction","args":["onLongPressReleased","btnConn"]},"type":"deviceAction"}],"onReleased":[{"params":{"actionName":"UIAction","args":["onReleased","btnConn"]},"type":"deviceAction"}]},"name":"btnConn","style":{"weight":"0.33"},"text":"Connect","type":"button","visible":true},{"eventBinding":{"onLongPressDown":[{"params":{"actionName":"UIAction","args":["onLongPressDown","btnStat"]},"type":"deviceAction"}],"onLongPressReleased":[{"params":{"actionName":"UIAction","args":["onLongPressReleased","btnStat"]},"type":"deviceAction"}],"onReleased":[{"params":{"actionName":"UIAction","args":["onReleased","btnStat"]},"type":"deviceAction"}]},"name":"btnStat","style":{"weight":"0.33"},"text":"Status","type":"button","visible":true},{"eventBinding":{"onLongPressDown":[{"params":{"actionName":"UIAction","args":["onLongPressDown","btnDisc"]},"type":"deviceAction"}],"onLongPressReleased":[{"params":{"actionName":"UIAction","args":["onLongPressReleased","btnDisc"]},"type":"deviceAction"}],"onReleased":[{"params":{"actionName":"UIAction","args":["onReleased","btnDisc"]},"type":"deviceAction"}]},"name":"btnDisc","style":{"weight":"0.33"},"text":"Disconnect","type":"button","visible":true}],"style":{"weight":"1.0"},"type":"horizontal"},{"components":[{"name":"lblIDM","style":{"weight":"1.0"},"text":"lblIDM","type":"label","visible":true}],"style":{"weight":"1.0"},"type":"horizontal"},{"components":[{"name":"lblIDR","style":{"weight":"1.0"},"text":"lblIDR","type":"label","visible":true}],"style":{"weight":"1.0"},"type":"horizontal"},{"components":[{"name":"lblIDN","style":{"weight":"1.0"},"text":"lblIDN","type":"label","visible":true}],"style":{"weight":"1.0"},"type":"horizontal"},{"components":[{"name":"lblIDH","style":{"weight":"1.0"},"text":"lblIDH","type":"label","visible":true}],"style":{"weight":"1.0"},"type":"horizontal"},{"components":[{"name":"lblIDS","style":{"weight":"1.0"},"text":"lblIDS","type":"label","visible":true}],"style":{"weight":"1.0"},"type":"horizontal"},{"components":[{"name":"lblIDB","style":{"weight":"1.0"},"text":"lblIDB","type":"label","visible":true}],"style":{"weight":"1.0"},"type":"horizontal"}],"useUiView":true,"uiCallbacks":[{"callback":"butHidden","eventType":"onReleased","name":"button_ID_12_1"},{"callback":"","eventType":"onLongPressDown","name":"button_ID_12_1"},{"callback":"","eventType":"onLongPressReleased","name":"button_ID_12_1"},{"callback":"btnPOW","eventType":"onReleased","name":"btnPOW"},{"callback":"","eventType":"onLongPressDown","name":"btnPOW"},{"callback":"","eventType":"onLongPressReleased","name":"btnPOW"},{"callback":"butHidden","eventType":"onReleased","name":"button_ID_12_3"},{"callback":"","eventType":"onLongPressDown","name":"button_ID_12_3"},{"callback":"","eventType":"onLongPressReleased","name":"button_ID_12_3"},{"callback":"btnVDN","eventType":"onReleased","name":"btnVDN"},{"callback":"","eventType":"onLongPressDown","name":"btnVDN"},{"callback":"","eventType":"onLongPressReleased","name":"btnVDN"},{"callback":"btnMUT","eventType":"onReleased","name":"btnMUT"},{"callback":"","eventType":"onLongPressDown","name":"btnMUT"},{"callback":"","eventType":"onLongPressReleased","name":"btnMUT"},{"callback":"btnVUP","eventType":"onReleased","name":"btnVUP"},{"callback":"","eventType":"onLongPressDown","name":"btnVUP"},{"callback":"","eventType":"onLongPressReleased","name":"btnVUP"},{"callback":"btnFOX","eventType":"onReleased","name":"btnFOX"},{"callback":"","eventType":"onLongPressDown","name":"btnFOX"},{"callback":"","eventType":"onLongPressReleased","name":"btnFOX"},{"callback":"btnATV","eventType":"onReleased","name":"btnATV"},{"callback":"","eventType":"onLongPressDown","name":"btnATV"},{"callback":"","eventType":"onLongPressReleased","name":"btnATV"},{"callback":"butHidden","eventType":"onReleased","name":"button_ID_11_3"},{"callback":"","eventType":"onLongPressDown","name":"button_ID_11_3"},{"callback":"","eventType":"onLongPressReleased","name":"button_ID_11_3"},{"callback":"btnBLU","eventType":"onReleased","name":"btnBLU"},{"callback":"","eventType":"onLongPressDown","name":"btnBLU"},{"callback":"","eventType":"onLongPressReleased","name":"btnBLU"},{"callback":"btnPLAY","eventType":"onReleased","name":"btnPLAY"},{"callback":"","eventType":"onLongPressDown","name":"btnPLAY"},{"callback":"","eventType":"onLongPressReleased","name":"btnPLAY"},{"callback":"btnFMR","eventType":"onReleased","name":"btnFMR"},{"callback":"","eventType":"onLongPressDown","name":"btnFMR"},{"callback":"","eventType":"onLongPressReleased","name":"btnFMR"},{"callback":"btnALMpa","eventType":"onReleased","name":"btnALMpa"},{"callback":"","eventType":"onLongPressDown","name":"btnALMpa"},{"callback":"","eventType":"onLongPressReleased","name":"btnALMpa"},{"callback":"butHidden","eventType":"onReleased","name":"button_ID_23_2"},{"callback":"","eventType":"onLongPressDown","name":"button_ID_23_2"},{"callback":"","eventType":"onLongPressReleased","name":"button_ID_23_2"},{"callback":"btnALMna","eventType":"onReleased","name":"btnALMna"},{"callback":"","eventType":"onLongPressDown","name":"btnALMna"},{"callback":"","eventType":"onLongPressReleased","name":"btnALMna"},{"callback":"connect","eventType":"onReleased","name":"btnConn"},{"callback":"","eventType":"onLongPressDown","name":"btnConn"},{"callback":"","eventType":"onLongPressReleased","name":"btnConn"},{"callback":"Status","eventType":"onReleased","name":"btnStat"},{"callback":"","eventType":"onLongPressDown","name":"btnStat"},{"callback":"","eventType":"onLongPressReleased","name":"btnStat"},{"callback":"onDisconnect","eventType":"onReleased","name":"btnDisc"},{"callback":"","eventType":"onLongPressDown","name":"btnDisc"},{"callback":"","eventType":"onLongPressReleased","name":"btnDisc"}],"quickAppVariables":[{"name":"IP","type":"string","value":"10.0.0.41"},{"name":"Port","type":"string","value":"14900"}],"typeTemplateInitialized":true},"initialInterfaces":[],"files":[{"name":"main","isMain":true,"isOpen":true,"content":"-- Local variables which take on the value of the QA variables for the script\nlocal host = \"\"\nlocal port = 0\nlocal skt = \"\"\nlocal justconnected = true\n\n\nfunction QuickApp:onInit()\n -- The onInit() function is called when the QA is initialised.\n -- It sets the initial values of labels for the dissplay and calls the connect() function\n\n -- Debug message to indicate the function is being executed:\n self:debug(\"onInit\")\n -- the justconnected variable is used to trigger the Status() function when the first \n -- message is received on the TCP Socket. Currently cannot trigger this automatically\n -- within this script as it interferes with the creation of the socket.\n justconnected = true\n -- Make the local variables equal to the QA variables \n host = self:getVariable(\"IP\")\n port = tonumber(self:getVariable(\"Port\"))\n -- First label is used to display a picture of the receiver.\n -- This could be updated using a global variable for the model and associated picture used \n local PicPath = \"https://www.anthemav.com/uploads/images/medium/mrx-1120.png\"\n local PicName = \"MRX 1120\"\n local PictWidth = 250\n local PicHeight = 150\n self:updateView(\"lblTitle\",\"text\",string.format('
\"%s\"
',PicPath,PicName,PicWidth,PicHeight))\n -- Second label is to display the name of the receiver and the status of the power\n -- by default the Not Connected message is displayed to indicate that the socket is not connected.\n self:updateView(\"lblName\", \"text\", \"MRX 1120: Not Connected\")\n -- Power buttons are displayed below the second label\n -- Third label is used to display the volume\n -- by default the Not Connected message is displayed to indicate that the socket is not connected.\n self:updateView(\"lblVOL\", \"text\", \"Volume: Not Connected\")\n -- Volume and Mute buttons are displayed below the third label\n -- Fourth label is used to display the Input\n -- by default the Not Connected message is displayed to indicate that the socket is not connected.\n self:updateView(\"lblINP\", \"text\", \"Input: Not Connected\")\n -- Input buttons are displayed below the fourth label\n -- Fifth set of labels are used to display the Audio data\n self:updateView(\"lblAIN\", \"text\", \"Audio Input Name: Not Connected\")\n self:updateView(\"lblAIC\", \"text\", \"Number of Input Channels: Not Connected\")\n self:updateView(\"lblAIR\", \"text\", \"Audio Input Rate: Not Connected\")\n -- Sixth label is used to display the Video data\n self:updateView(\"lblVIR\", \"text\", \"Video Input Resolution: Not Connected\")\n -- seventh label is used to display the unit data\n self:updateView(\"lblIDM\", \"text\", \"Model: Not Connected\")\n self:updateView(\"lblIDR\", \"text\", \"Region: Not Connected\")\n self:updateView(\"lblIDN\", \"text\", \"MAC Address: Not Connected\")\n self:updateView(\"lblIDH\", \"text\", \"Hardware Version: Not Connected\")\n self:updateView(\"lblIDS\", \"text\", \"Software Version: Not Connected\")\n self:updateView(\"lblIBD\", \"text\", \"Software Build Date: Not Connected\")\n \n -- TCP socket buttons are displayed below the sixth label\n -- The connect() function is called when the QA is initiated\n self:connect() \n self:debug(\"connected - waiting for socket\")\nend\n\nfunction QuickApp:connect()\n -- The connect() function is called upon initialisation of the QA but a button is also provided\n -- at the bottom of the QA to trigger again\n -- The values for the host and port are issued via debug before the socket is setup\n self:debug(\"connect() - HOST: \" .. host .. \" PORT: \" .. port)\n -- creation of a TCPSocket instance\n self.sock = net.TCPSocket() \n -- connection to the device with the specified IP and port\n self.sock:connect(host, port, { \n -- the function will be triggered if the connection is successful\n success = function() \n skt = self.sock\n self:debug(\"Socket is:- \" , skt)\n -- runs a loop for receiving data\n self:waitForResponseFunction() \n end,\n -- a function that will be triggered in case of an incorrect connection, e.g. timeout\n -- the function is passed a string \"err\" which details the reason for the error\n error = function(err) \n -- closing the socket\n self.sock:close() \n self:debug(\"connection error:\",err)\n self:debug(\"socket closed\")\n -- timeout is commented out but perhaps should be reinstated\n hub.setTimeout(5000, function() self:connect() end) -- re-connection attempt (every 5s)\n end,\n })\n\nend\n\nfunction QuickApp:waitForResponseFunction()\n -- The waitForResponseFunction() function is used to listen for the response from the socket \n -- reading a data package from the socket\n self.sock:read({ \n success = function(data)\n -- handling of received data\n self:onDataReceived(data) \n -- loops for received data\n self:waitForResponseFunction() \n end,\n -- a function that will be called in case of an error when trying to receive data, \n -- e.g. disconnecting a socket\n error = function() \n self:debug(\"response error\")\n self.sock:close()\n -- timeout is commented out but perhaps should be reinstated\n hub.setTimeout(5000, function() self:connect() end) -- re-connection attempt (every 5s)\n end\n }) \n -- if the socket has been assigned and the justconnected variable is still = \"1\"\n -- then the Status() function is called. This makes sure that all fields are updated when \n -- the first command is received on the socket. This can be the response to the socket being opened.\n if skt ~= nil and justconnected == true then\n self:Status()\n end\nend\n\nfunction QuickApp:onDataReceived(data)\n -- The onDateReceived() function is used to read the data from the socket \n -- It extracts each parameter from the text string then calls the function\n -- ParameterStatus(strInstr) for each parameter\n -- As each parameter is extracted from the data string it will reduce to 0\n local strLen = string.len(data)\n local strSub = data\n local strInstr = \"\"\n self:debug(\"onDataReceived\", data, strLen)\n -- The following loop will extract each command from the returned string until the \n -- length of the string is 0.\n while strLen > 0 do\n -- the find instruction gets the position in the string of the delimiter \";\"\n -- as there is only 1 character - b is not used.\n a, b = string.find(strSub, \";\")\n -- the sub instruction extracts the command from the string by copying the characters \n -- upto but not including the delimiter\n strInstr = strSub:sub(1, a - 1)\n self:debug(\"Parameter 1 = \" .. strInstr)\n -- the command is sent to the ParameterStatus() function which extracts the command\n -- and the value returned.\n self:ParameterStatus(strInstr)\n -- the string is then reduced by that most recent command length\n strSub = strSub:sub(a+1, strLen)\n strLen = string.len(strSub)\n self:debug(\"Remaining = \" .. strSub .. \" :- \" .. strLen) \n end\nend\n\nfunction QuickApp:ParameterStatus(data)\n -- The function ParameterStatus(data) will extract the parameter and value\n -- which has been obtained from the string which was returned from the socket\n -- The parameter will start with \"Z1\" and the following three characters \n -- relate to the command (strCmd)\n -- the rest of the string is equal to the value of the parameter (i.e. \"-40\" for volume) \n local strLen = 0\n local strCmd = \"\"\n local strStat = \"\"\n local Z1POW = false\n local Z1MUT = false\n local Z1VOL = \"\"\n local Z1AIR = \"\"\n local Z1AIN = \"\"\n local Z1ILN = \"\"\n local Z1AIC = \"\"\n local Z1VIR = \"\"\n local Z1INP = \"\"\n local IDM = \"\"\n local IDR = \"\"\n local IDN = \"\"\n local IDH = \"\"\n local IDS = \"\"\n local IDB = \"\"\n local Z1AIF = \"\"\n local Z1BRT = \"\"\n local Z1SRT = \"\"\n local Z1ALM = \"\"\n \n\n\n if data:sub(1,2) == \"Z1\" then\n strLen = string.len(data)\n strCmd = data:sub(3, 5)\n strStat = data:sub(6, strLen)\n end\n \n if data:sub(1,1) == \"I\" then\n strLen = string.len(data)\n strCmd = data:sub(1, 3)\n strStat = data:sub(4, strLen)\n end\n\n\n -- These following commands request the status of various elements and an example \n -- of the response from the socket\n --Z1POW? - Z1POW1\n --Z1VOL? - Z1VOL-38\n --Z1MUT? - Z1MUT0\n\n --Z1INP? - Z1INP4\n\n --Z1ALM? - Z1ALM0\n\n --Z1AIN? - Z1AIN2.0 PCM\n --Z1AIC? - Z1AIC3\n --Z1AIR? - Z1AIR48kHz\n --Z1AIF? - Z1AIF2\n --Z1BRT? - Z1BRT1536\n --Z1SRT? - Z1SRT48\n --Z1VIR? - Z1VIR3\n \n --Z1IDM? - Z1IDMMRX 1120\n --Z1IDR? - Z1IDREU\n --Z1IDN? - Z1IDNabcdefgh\n --Z1IDH? - Z1IDH1\n --Z1IDS? - Z1IDS0.9.5\n --Z1IDB? - Z1IDBOct 23 2018\n\n -- if the command is POW then the response will be either 1 or 0\n if strCmd == \"POW\" then\n if strStat == \"1\" then\n Z1POW = true\n self:updateView(\"btnPOW\", \"text\", \"OFF\")\n self:updateView(\"lblName\", \"text\", \"
MRX 1120: Power:ON
\")\n else\n Z1POW = false\n self:updateView(\"btnPOW\", \"text\", \"ON\")\n self:updateView(\"lblName\", \"text\", \"MRX 1120: Power: \" .. \"OFF \")\n end\n self:debug(\"Power Status is Z1POW:- \", Z1POW)\n end\n -- if the command is MUT then the response will be either 1 or 0\n if strCmd == \"MUT\" then\n if strStat == \"1\" then\n Z1MUT = true\n self:updateView(\"btnMUT\", \"text\", \"UNMUTE\")\n else\n Z1MUT = false\n self:updateView(\"btnMUT\", \"text\", \"MUTE\")\n end\n self:debug(\"Mute Status is Z1MUT:- \", Z1MUT)\n end\n -- if the command is VOL then the response will be the current reference volume (i.e. -40)\n if strCmd == \"VOL\" then\n Z1VOL = strStat\n self:updateView(\"lblVOL\", \"text\", \"Volume: \" .. \"\" .. Z1VOL .. \"\")\n self:debug(\"Volume Z1VOL:- \", Z1VOL)\n end\n \n -- if the command is ILN then the response will be the current Input Long Name (i.e. \"APPLE TV\")\n if strCmd == \"ILN\" then\n Z1ILN = strStat\n self:debug(\"Input Long Name Z1ILN:- \", Z1ILN)\n end\n \n -- if the command is INP then the response will be the input number currently selected\n -- this number is then used to display a specific string in the label corresponding to the device\n if strCmd == \"INP\" then\n if strStat == \"1\" then\n Z1INP = \"FOXTEL\"\n end\n if strStat == \"2\" then\n Z1INP = \"BLU-RAY\"\n end\n if strStat == \"3\" then\n Z1INP = \"PLAYSTATION\"\n end\n if strStat == \"4\" then\n Z1INP = \"APPLE TV\"\n end\n if strStat == \"5\" then\n Z1INP = \"FM TUNER\"\n end\n self:updateView(\"lblINP\", \"text\", \"Input: \" .. \"\" .. Z1INP ..\" \")\n self:debug(\"INPUT Z1INP: \", Z1INP)\n end\n \n--Z1ALM?\n --00=None, \n --01=AnthemLogic-Movie, \n --02=AnthemLogic-Music, \n --03=PLIIx Movie, \n --04=PLIIx Music, \n --05=Neo:6 Cinema, \n --06=Neo:6 Music, \n --07=All Channel Stereo*, \n --08=All-Channel Mono*, \n --09=Mono*, \n --10=Mono-Academy*, \n --11=Mono(L)*, \n --12=Mono(R)*, \n --13=High Blend*, \n --na=cycle to next applicable, \n --pa=cycle to previous applicable. \n\n if strCmd == \"ALM\" then\n Z1ALM = strStat\n if Z1ALM == \"00\" then\n self:updateView(\"lblALM\", \"text\", \"Audio Listening Mode: \" .. \"00-None\")\n end\n if Z1ALM == \"01\" then\n self:updateView(\"lblALM\", \"text\", \"Audio Listening Mode: \" .. \"01-AnthemLogic Movie\")\n end\n if Z1ALM == \"02\" then\n self:updateView(\"lblALM\", \"text\", \"Audio Listening Mode: \" .. \"02-AnthemLogic Music\")\n end\n if Z1ALM == \"03\" then\n self:updateView(\"lblALM\", \"text\", \"Audio Listening Mode: \" .. \"03-PLIIx Movie\")\n end\n if Z1ALM == \"04\" then\n self:updateView(\"lblALM\", \"text\", \"Audio Listening Mode: \" .. \"04-PLIIx Music\")\n end\n if Z1ALM == \"05\" then\n self:updateView(\"lblALM\", \"text\", \"Audio Listening Mode: \" .. \"05-Neo:6 Cinema\")\n end\n if Z1ALM == \"06\" then\n self:updateView(\"lblALM\", \"text\", \"Audio Listening Mode: \" .. \"06-Neo:6 Music\")\n end\n if Z1ALM == \"07\" then\n self:updateView(\"lblALM\", \"text\", \"Audio Listening Mode: \" .. \"07-All Channel Stereo\")\n end\n if Z1ALM == \"08\" then\n self:updateView(\"lblALM\", \"text\", \"Audio Listening Mode: \" .. \"08-All Channel Mono\")\n end\n if Z1ALM == \"09\" then\n self:updateView(\"lblALM\", \"text\", \"Audio Listening Mode: \" .. \"09-Mono\")\n end\n if Z1ALM == \"10\" then\n self:updateView(\"lblALM\", \"text\", \"Audio Listening Mode: \" .. \"10-Mono Academy\")\n end\n if Z1ALM == \"11\" then\n self:updateView(\"lblALM\", \"text\", \"Audio Listening Mode: \" .. \"11-Mono(L)\")\n end\n if Z1ALM == \"12\" then\n self:updateView(\"lblALM\", \"text\", \"Audio Listening Mode: \" .. \"12-Mono(R)\")\n end\n if Z1ALM == \"13\" then\n self:updateView(\"lblALM\", \"text\", \"Audio Listening Mode: \" .. \"13-High Blend\")\n end\n if Z1ALM == \"na\" then\n self:updateView(\"lblALM\", \"text\", \"Audio Listening Mode: \" .. \"na-cycle to next applicable\")\n end\n if Z1ALM == \"pa\" then\n self:updateView(\"lblALM\", \"text\", \"Audio Listening Mode: \" .. \"pa-cycle to previous applicable\")\n end \n self:debug(\"Audio Listening Mode Z1ALM:- \", Z1ALM)\n end\n -- if the command is AIN then the response will be the current Audio Input Name (i.e. DTS Master Audio)\n if strCmd == \"AIN\" then\n Z1AIN = strStat\n self:updateView(\"lblAIN\", \"text\", \"Audio Input Name: \" .. \"\" .. Z1AIN ..\" \")\n self:debug(\"Audio Input Name Z1AIN:- \", Z1AIN)\n end\n -- if the command is AIC then the response will be a code for the current number of channels\n -- this code is then used to display a specific string in the label\n if strCmd == \"AIC\" then\n Z1AIC = strStat\n if Z1AIC == \"0\" then\n self:updateView(\"lblAIC\", \"text\", \"Number of Input Channels: \" .. \"0\")\n end\n if Z1AIC == \"1\" then\n self:updateView(\"lblAIC\", \"text\", \"Number of Input Channels: \" .. \"Other\")\n end\n if Z1AIC == \"2\" then\n self:updateView(\"lblAIC\", \"text\", \"Number of Input Channels: \" .. \"Mono (Center) Only\")\n end\n if Z1AIC == \"3\" then\n self:updateView(\"lblAIC\", \"text\", \"Number of Input Channels: \" .. \"2 Channel\")\n end\n if Z1AIC == \"4\" then\n self:updateView(\"lblAIC\", \"text\", \"Number of Input Channels: \" .. \"5.1\")\n end\n if Z1AIC == \"5\" then\n self:updateView(\"lblAIC\", \"text\", \"Number of Input Channels: \" .. \"6.1\")\n end\n if Z1AIC == \"6\" then\n self:updateView(\"lblAIC\", \"text\", \"Number of Input Channels: \" .. \"7.1\")\n end\n self:debug(\"Audio Input Channels Z1AIC:- \", Z1AIC)\n end\n\n -- if the command is AIR then the response will be the current Audio Input Rate (i.e. 48kHz)\n if strCmd == \"AIR\" then\n Z1AIR = strStat\n self:updateView(\"lblAIR\", \"text\", \"Audio Input Rate: \" .. \"\" .. strStat .. \"\")\n self:debug(\"Audio Input Rate Z1AIR:- \", Z1AIR)\n end\n\n --Z1AIM?\n --Query audio input format: \n --0=no input, \n --1=Analog, \n --2=PCM, \n --3=Dolby, \n --4=DSD, \n --5=DTS. \n\n if strCmd == \"AIF\" then\n Z1AIF = strStat\n if Z1AIF == \"0\" then\n self:updateView(\"lblAIF\", \"text\", \"Audio Input Format: \" .. \"0-No input\")\n end\n if Z1AIF == \"1\" then\n self:updateView(\"lblAIF\", \"text\", \"Audio Input Format: \" .. \"1-Analog\")\n end\n if Z1AIF == \"2\" then\n self:updateView(\"lblAIF\", \"text\", \"Audio Input Format: \" .. \"2-PCM\")\n end\n if Z1AIF == \"3\" then\n self:updateView(\"lblAIF\", \"text\", \"Audio Input Format: \" .. \"3-Dolby\")\n end\n if Z1AIF == \"4\" then\n self:updateView(\"lblAIF\", \"text\", \"Audio Input Format: \" .. \"4-DSD\")\n end\n if Z1AIF == \"5\" then\n self:updateView(\"lblAIF\", \"text\", \"Audio Input Format: \" .. \"5-DTS\")\n end\n self:debug(\"Audio Input Format Z1AIF:- \", Z1AIF)\n end\n \n if strCmd == \"BRT\" then\n Z1BRT = strStat\n self:updateView(\"lblBRT\", \"text\", \"Audio Input Bit Rate: \" .. \"\" .. Z1BRT .. \"kbps\")\n self:debug(\"Audio Input Bit Rate Z1BRT:- \", Z1BRT)\n end\n if strCmd == \"SRT\" then\n Z1SRT = strStat\n self:updateView(\"lblSRT\", \"text\", \"Audio Input Sampling Rate: \" .. \"\" .. Z1SRT .. \"kHz\")\n self:debug(\"Audio Input Sampling Rate Z1SRT:- \", Z1SRT)\n end\n -- if the command is VIR then the response will be a code relating to the Video Input Resolution\n -- this code is then used to display a specific string in the label\n -- Z1VIR\n --0=no input, \n --1=other, \n --2=1080p60, \n --3=1080p50, \n --4=1080p24, \n --5=1080i60, \n --6=1080i50, \n --7=720p60, \n --8=720p50, \n --9=576p50, \n --10=576i50, \n --11=480p60, \n --12=480i60, \n --13=3D, \n --14=4k\n\n if strCmd == \"VIR\" then\n Z1VIR = strStat\n if Z1VIR == \"0\" then\n self:updateView(\"lblVIR\", \"text\", \"Video Input Resolution: \" .. \"0\")\n end\n if Z1VIR == \"1\" then\n self:updateView(\"lblVIR\", \"text\", \"Video Input Resolution: \" .. \"Other\")\n end\n if Z1VIR == \"2\" then\n self:updateView(\"lblVIR\", \"text\", \"Video Input Resolution: \" .. \"1080p60\")\n end\n if Z1VIR == \"3\" then\n self:updateView(\"lblVIR\", \"text\", \"Video Input Resolution: \" .. \"1080p50\")\n end\n if Z1VIR == \"4\" then\n self:updateView(\"lblVIR\", \"text\", \"Video Input Resolution: \" .. \"1080p24\")\n end\n if Z1VIR == \"5\" then\n self:updateView(\"lblVIR\", \"text\", \"Video Input Resolution: \" .. \"1080i60\")\n end\n if Z1VIR == \"6\" then\n self:updateView(\"lblVIR\", \"text\", \"Video Input Resolution: \" .. \"1080i50\")\n end\n if Z1VIR == \"7\" then\n self:updateView(\"lblVIR\", \"text\", \"Video Input Resolution: \" .. \"720p60\")\n end\n if Z1VIR == \"8\" then\n self:updateView(\"lblVIR\", \"text\", \"Video Input Resolution: \" .. \"720p50\")\n end\n if Z1VIR == \"9\" then\n self:updateView(\"lblVIR\", \"text\", \"Video Input Resolution: \" .. \"576p50\")\n end\n if Z1VIR == \"10\" then\n self:updateView(\"lblVIR\", \"text\", \"Video Input Resolution: \" .. \"576i50\")\n end\n if Z1VIR == \"11\" then\n self:updateView(\"lblVIR\", \"text\", \"Video Input Resolution: \" .. \"480p60\")\n end\n if Z1VIR == \"12\" then\n self:updateView(\"lblVIR\", \"text\", \"Video Input Resolution: \" .. \"480i60\")\n end\n if Z1VIR == \"13\" then\n self:updateView(\"lblVIR\", \"text\", \"Video Input Resolution: \" .. \"3D\")\n end\n if Z1VIR == \"14\" then\n self:updateView(\"lblVIR\", \"text\", \"Video Input Resolution: \" .. \"4K\")\n end\n self:debug(\"Video Input Resolution Z1VIR:- \", Z1VIR)\n end\n\n -- if the command is IDM then the response will be the model number of the AVR\n -- (i.e. \"MRX 1120\")\n if strCmd == \"IDM\" then\n IDM = strStat\n self:updateView(\"lblIDM\", \"text\", \"Model: \" .. \"\" .. IDM .. \"\")\n self:debug(\"Model IDM:- \", IDM)\n end\n -- if the command is IDM then the response will be the region of the AVR\n -- (i.e. \"EU\")\n if strCmd == \"IDR\" then\n IDR = strStat\n self:updateView(\"lblIDR\", \"text\", \"Region: \" .. \"\" .. IDR .. \"\")\n self:debug(\"Region IDR:- \", IDR)\n end\n -- if the command is IDN then the response will be the MAC Address of the AVR\n -- (i.e. \"abcdefgh\")\n if strCmd == \"IDN\" then\n IDN = strStat\n self:updateView(\"lblIDN\", \"text\", \"MAC Address: \" .. \"\" .. IDN .. \"\")\n self:debug(\"MAC Address IDN:- \", IDN)\n end\n -- if the command is IDM then the response will be the hardware version of the AVR\n -- (i.e. \"1\")\n if strCmd == \"IDH\" then\n IDH = strStat\n self:updateView(\"lblIDH\", \"text\", \"Hardware Version: \" .. \"\" .. IDH .. \"\")\n self:debug(\"Hardware Version IDH:- \", IDH)\n end\n -- if the command is IDS then the response will be the software version of the -- AVR (i.e. \"0.9.5\")\n if strCmd == \"IDS\" then\n IDS = strStat\n self:updateView(\"lblIDS\", \"text\", \"Software Version: \" .. \"\" .. IDS .. \"\")\n self:debug(\"Software Version IDS:- \", IDS)\n end\n -- if the command is IDM then the response will be the software build date of -- the AVR (i.e. \"Oct 23 2018\")\n if strCmd == \"IDB\" then\n IDB = strStat\n self:updateView(\"lblIDB\", \"text\", \"Build Date: \" .. \"\" .. IDB .. \"\")\n self:debug(\"Software Build Date IDB:- \", IDB)\n end\n\n\nend\n\nfunction QuickApp:onDisconnect() \n -- if the socket is disconnected then the socket is closed\n self:debug(\"disconnecting\")\n self.sock:close() \n self:debug(\"Socket Closed\")\nend\n\n-- First row of buttons: Power\nfunction QuickApp:btnPOW()\n local strPOW = self:getView('btnPOW','text')\n -- if the ONOFF label is ON then pressing the button will turn on the receiver by sending Z1POW1\n if strPOW == \"ON\"then\n self.sock:write(\"Z1POW1;\")\n self:waitForResponseFunction()\n end\n -- if the ONOFF label is OFF then pressing the button will turn off the receiver by sending Z1POW0\n if strPOW == \"OFF\"then\n self.sock:write(\"Z1POW0;\")\n self:waitForResponseFunction()\n end\n -- if the ONOFF label is ONOFF then pressing the button will turn on the receiver by sending Z1POW1\n if strPOW == \"ONOFF\"then\n self.sock:write(\"Z1POW1;\")\n self:waitForResponseFunction()\n end\nend\n\n-- Second row of buttons: Volume\nfunction QuickApp:btnVDN()\n -- if the - button is pressed, the volume will be reduced by 1dB by sending Z1VDN01\n self.sock:write(\"Z1VDN01;\")\n self:waitForResponseFunction()\nend\n\nfunction QuickApp:btnMUT()\n -- if the Mute button is pressed, the volume will be muted / unmuted by sending Z1VMUTt\n self.sock:write(\"Z1MUTt;\")\n self:waitForResponseFunction() \nend\n\nfunction QuickApp:btnVUP()\n -- if the + button is pressed, the volume will be increased by 1dB by sending Z1VUP01\n self.sock:write(\"Z1VUP01;\")\n self:waitForResponseFunction()\nend\n\n-- Third set of buttons: Inputs\nfunction QuickApp:btnFOX()\n -- if the FOXTEL button is pressed, the input will be changed to 1 by sending Z1INP01\n self.sock:write(\"Z1INP01;\")\n self:waitForResponseFunction()\nend\n\nfunction QuickApp:btnBLU()\n -- if the BLU-RAY button is pressed, the input will be changed to 2 by sending Z1INP02\n self.sock:write(\"Z1INP02;\")\n self:waitForResponseFunction()\nend\n\nfunction QuickApp:butHidden()\n -- this is assigned to buttons that are hidden\nend\n\nfunction QuickApp:btnPLAY()\n -- if the FOXTEL button is pressed, the input will be changed to 1 by sending Z1INP01\n self.sock:write(\"Z1INP03;\")\n self:waitForResponseFunction()\nend\n\nfunction QuickApp:btnATV()\n -- if the APPLE TV button is pressed, the input will be changed to 4 by sending Z1INP04\n self.sock:write(\"Z1INP04;\")\n self:waitForResponseFunction()\nend\n\nfunction QuickApp:btnFMR()\n -- if the FM RADIO button is pressed, the input will be changed to 5 by sending Z1INP05\n self.sock:write(\"Z1INP05;\")\n self:waitForResponseFunction()\nend\n\n-- fourth row of buttons: Audio Listening Mode\nfunction QuickApp:btnALMna()\n -- if the na button is pressed, the Audio Listening Mode will be cycled to the next available by sending Z1ALMna\n self.sock:write(\"Z1ALMna;\")\n self:waitForResponseFunction()\nend\n\nfunction QuickApp:btnALMpa()\n -- if the pa button is pressed, the Audio Listening Mode will be cycled to the previous available by sending Z1ALMpa\n self.sock:write(\"Z1ALMpa;\")\n self:waitForResponseFunction()\nend\n\n-- Fifth set of buttons: TCP Socket. Status is only function remaining\nfunction QuickApp:Status()\n -- The Status() function can be called when the first data is read from the socket -- or by pressing the STATUS button.\n -- here the justconnected variable is set to 0 to indicate that the Status has been -- run so all labels have an initial value displayed\n justconnected = false\n -- ther above states are queried by writing the following commands to the socket\n self.sock:write(\"Z1POW?;\")\n\n self.sock:write(\"Z1MUT?;\")\n self.sock:write(\"Z1VOL?;\")\n\n self.sock:write(\"Z1INP?;\")\n\n self.sock:write(\"Z1ALM?;\")\n self.sock:write(\"Z1ILN?;\")\n self.sock:write(\"Z1AIN?;\")\n self.sock:write(\"Z1AIC?;\")\n self.sock:write(\"Z1AIR?;\")\n self.sock:write(\"Z1AIF?;\")\n self.sock:write(\"Z1BRT?;\")\n self.sock:write(\"Z1SRT?;\")\n self.sock:write(\"Z1VIR?;\")\n\n self.sock:write(\"IDM?;\")\n self.sock:write(\"IDR?;\")\n self.sock:write(\"IDN?;\")\n self.sock:write(\"IDH?;\")\n self.sock:write(\"IDS?;\")\n self.sock:write(\"IDB?;\")\n \n self:waitForResponseFunction()\nend\n\nfunction QuickApp:Disc()\n -- if the Disconnect button is pressed, the socket will be closed\n self:debug(\"disconnecting\")\n self.sock:close() \n self:debug(\"Socket Closed\")\nend\n\n"}]}