How to use createPacket method in wpt

Best JavaScript code snippet using wpt

OnkyoReceiver.js

Source:OnkyoReceiver.js Github

copy

Full Screen

1var OnkyoDevice = function(DeviceName)2{3 var checkzone = 1;4 this.DriverName = DeviceName;5 this.device = IR.GetDevice(this.DriverName);6 7 var QueueCommands = [];8 var TransportFree = true;9 10 var flagRegex = /.*?!1NLSC\dP/g;11 var listaRegex = /.*?!1NLSU(.*?)\x2D(.*)/g;12 var playnowRegex = /.*?!1(NTM|NAT|NAL|NTI)(.*)/g;13 var volRegex = /!1(MVL|ZVL|VL3)(.*)/g;14 var powRegex = /!1(PWR|ZPW|PW3)(.*)/g;15 var muteRegex = /!1(AMT|ZMT|MT3)(.*)/g; 16 var tunerRegex = /!1(TUN|TUZ)(.*)/g; 17 var selectorRegex = /!1(SLI|SLZ|SL3)(.*)/g;18 var AudioselectorRegex = /!1(SLA)(.*)/g;19 var ListeningModeRegex = /!1(LMD|LMZ)(.*)/g;20 var BassTrebleRegex = /!1(TFR)(.*)/g;21 var valpr;22 23 this.radioModule;24 25 this.setRadioModule = function(radioModule) {26 this.radioModule = radioModule; 27 }28 29 IR.Log("this.device = "+DeviceName)30 var that = this;31 IR.AddListener(IR.EVENT_START,0,function()32 {33 IR.Log("start");34 that.device.SetFeedback("Listening zone 1", "Select Listening");35 that.device.SetFeedback("Listening zone 2", "Select Listening");36 37 that.device.SetFeedback("Audio zone 1", "Select Audio");38 that.device.SetFeedback("Audio zone 2", "Select Audio");39 that.device.SetFeedback("Audio zone 3", "Select Audio");40 41 that.device.SetFeedback("Input zone 1", "Select Source");42 that.device.SetFeedback("Input zone 2", "Select Source");43 that.device.SetFeedback("Input zone 3", "Select Source"); 44 });45 46 //-------------------------------------------------------47 // Обработчик перехода устройства в Online48 //------------------------------------------------------- 49 IR.AddListener(IR.EVENT_ONLINE, that.device, function()50 { 51 IR.Log("DEVICE is Online");52 53 QueueCommands.push("!1PWRQSTN");54 QueueCommands.push("!1ZPWQSTN'");55 QueueCommands.push("!1PW3QSTN");56 57 QueueCommands.push("!1MVLQSTN");58 QueueCommands.push("!1ZVLQSTN");59 QueueCommands.push("!1VL3QSTN");60 61 QueueCommands.push("!1AMTQSTN");62 QueueCommands.push("!1ZMTQSTN");63 QueueCommands.push("!1MT3QSTN"); 64 65 QueueCommands.push("!1SLIQSTN");66 QueueCommands.push("!1SL3QSTN");67 QueueCommands.push("!1SLAQSTN");68 QueueCommands.push("!1SLZQSTN");69 QueueCommands.push("!1LMZQSTN");70 71 QueueCommands.push("!1LMDQSTN");72 73 QueueCommands.push("!1TUNQSTN");74 QueueCommands.push("!1TFRQSTN");75 QueueCommands.push("!1LMDQSTN");76 77 }, that);78 79 //-------------------------------------------------------80 // Обработчик перехода устройства в Offline81 //-------------------------------------------------------82 IR.AddListener(IR.EVENT_OFFLINE, that.device, function()83 { 84 IR.Log("DEVICE is Offline");85 }, that);86 87 88 function hexToString(tmp) 89 {90 var arr = tmp;91 var str = '';92 var c; 93 var arr_len = arr.length;94 95 for (var i = 0; i < arr_len; i += 1) 96 {97 if (arr[i] != 0)98 {99 c = String.fromCharCode(arr[i]);100 101 str += c;102 } 103 }104 105 return str;106 }107 108 109 //---------------------------------------------------------110 // Действия каждый цикл111 //---------------------------------------------------------112 IR.SetInterval(1000, function()113 {114 // Посылаем команду из очереди115 if (TransportFree)116 {117 var command = QueueCommands.shift();118 if(command) 119 {120 SendPacket(command);121 }122 } 123 }, this);124 125 126 127 IR.AddListener(IR.EVENT_RECEIVE_DATA,that.device, function(data)128 {129 //IR.Log("data = "+ data);130 TransportFree = true;131 var FinishStr = ""; 132 FinishStr = hexToString(data);133 IR.Log("FinishStr = "+ FinishStr);134 IR.Log("data in");135//-----------------------------------------------------------------------------------------136 var msg = null;137 BassTrebleRegex = /!1(TFR)(.*)/g;138 msg = BassTrebleRegex.exec(FinishStr);139 if (msg != null)140 {141 var tr = IR.GetPopup("PopupSettings").GetItem("tr");142 var bs = IR.GetPopup("PopupSettings").GetItem("bs");143 var strrrr = FinishStr.slice(12, FinishStr.length-3);144 var bassVal = strrrr.slice(0, 3);145 var trebleVal = strrrr.slice(3, 6);146 switch (bassVal) {147 case "B-A":148 bs.Text = "-10 dB";149 break;150 case "B-8":151 bs.Text = "-8 dB";152 break;153 case "B-6":154 bs.Text = "-6 dB";155 break;156 case "B-4":157 bs.Text = "-4 dB";158 break;159 case "B-2":160 bs.Text = "-2 dB";161 break;162 case "B00":163 bs.Text = "0 dB";164 break; 165 case "B+2":166 bs.Text = "+2 dB";167 break;168 case "B+4":169 bs.Text = "+4 dB";170 break;171 case "B+6":172 bs.Text = "+6 dB";173 break;174 case "B+8":175 bs.Text = "+8 dB";176 break;177 case "B+A":178 bs.Text = "+10 dB";179 break;180 } 181 182 183 switch (trebleVal) {184 case "T-A":185 tr.Text = "-10 dB";186 break;187 case "T-8":188 tr.Text = "-8 dB";189 break;190 case "T-6":191 tr.Text = "-6 dB";192 break;193 case "T-4":194 tr.Text = "-4 dB";195 break;196 case "T-2":197 tr.Text = "-2 dB";198 break;199 case "T00":200 tr.Text = "0 dB";201 break; 202 case "T+2":203 tr.Text = "+2 dB";204 break;205 case "T+4":206 tr.Text = "+4 dB";207 break;208 case "T+6":209 tr.Text = "+6 dB";210 break;211 case "T+8":212 tr.Text = "+8 dB";213 break;214 case "T+A":215 tr.Text = "+10 dB";216 break;217 }218 219 };220 221 ListeningModeRegex = /!1(LMD|LMZ)(.*)/g;222 msg = ListeningModeRegex.exec(FinishStr);223 if(msg != null)224 {225 var id = msg[2].slice(0, msg[2].length - 1);226 IR.Log("id = "+ id);227 var ListeningModeName = 'NaN';228 switch(checkzone)229 {230 case '1':231 switch(id)232 {233 case "00":234 ListeningModeName = 'STEREO';235 break;236 case "01":237 ListeningModeName = 'DIRECT';238 break;239 case "02":240 ListeningModeName = 'SURROUND';241 break;242 case "03":243 ListeningModeName = 'Game-RGB';244 break;245 case "04":246 ListeningModeName = 'THX';247 break; 248 case "05":249 ListeningModeName = 'Game-Action';250 break;251 case "06":252 ListeningModeName = 'Game-Rock';253 break;254 case "07":255 ListeningModeName = 'MONO MOVIE';256 break;257 case "08":258 ListeningModeName = 'ORCHESTRA';259 break;260 case "09":261 ListeningModeName = 'UNPLUGGED';262 break;263 case "0A":264 ListeningModeName = 'STUDIO-MIX';265 break;266 case "0B":267 ListeningModeName = 'TV LOGIC';268 break;269 case "0C":270 ListeningModeName = 'ALL CH STEREO';271 break;272 case "0D":273 ListeningModeName = 'THEATER-DIMENSIONAL';274 break;275 case "0E":276 ListeningModeName = 'Game-Sports';277 break;278 case "0F":279 ListeningModeName = 'MONO';280 break;281 case "11":282 ListeningModeName = 'PURE AUDIO';283 break;284 case "12":285 ListeningModeName = 'MULTIPLEX';286 break;287 case "13":288 ListeningModeName = 'FULL MONO';289 break;290 case "14":291 ListeningModeName = 'DOLBY VIRTUAL';292 break;293 case "40":294 ListeningModeName = 'SURROUND';295 break;296 case "41":297 ListeningModeName = 'DOLBY';298 break;299 case "42":300 ListeningModeName = 'THX CINEMA';301 break;302 case "43":303 ListeningModeName = 'THX SURROUND';304 break;305 case "50":306 ListeningModeName = 'Cinema';307 break;308 case "51":309 ListeningModeName = 'MusicMode';310 break;311 case "52":312 ListeningModeName = 'Games Mode';313 break;314 case "80":315 ListeningModeName = 'PLII Movie';316 break;317 case "81":318 ListeningModeName = 'PLII Music';319 break;320 case "82":321 ListeningModeName = 'Neo:6 Cinema';322 break;323 case "83":324 ListeningModeName = 'Neo:6 Music';325 break;326 case "84":327 ListeningModeName = 'PLII THX Cinema';328 break;329 case "85":330 ListeningModeName = 'Neo:6 THX Cinema';331 break;332 case "86":333 ListeningModeName = 'PLII Game';334 break;335 case "87":336 ListeningModeName = 'Neural Surr';337 break;338 case "88":339 ListeningModeName = 'Neural THX';340 break;341 case "89":342 ListeningModeName = 'PLII THX Games';343 break;344 case "8A":345 ListeningModeName = 'Neo:6 THX Games';346 break;347 case "8B":348 ListeningModeName = 'PLII THX Music';349 break;350 case "8C":351 ListeningModeName = 'Neo:6 THX Music';352 break; 353 };354 that.device.SetFeedback("Listening zone 1", ListeningModeName);355 break;356 case '2':357 switch(id)358 {359 case "00":360 ListeningModeName = 'STEREO';361 break;362 case "01":363 ListeningModeName = 'DIRECT';364 break;365 case "0F":366 ListeningModeName = 'MONO';367 break;368 case "12":369 ListeningModeName = 'MULTIPLEX';370 break;371 case "87":372 ListeningModeName = 'DVS(PI2)';373 break;374 case "88":375 ListeningModeName = 'DVS(NEO6)';376 break;377 }378 that.device.SetFeedback("Listening zone 2", ListeningModeName);379 break; 380 };381 };382 383 msg = AudioselectorRegex.exec(FinishStr);384 if(msg != null)385 {386 var id = msg[2].slice(0, msg[2].length - 1);387 var AudioSelectorName = 'NaN';388 switch(id)389 {390 case "00":391 AudioSelectorName = 'AUTO';392 break;393 case "01":394 AudioSelectorName = 'MULTI-CHANNEL';395 break;396 case "02":397 AudioSelectorName = 'ANALOG';398 break;399 case "03":400 AudioSelectorName = 'iLINK';401 break;402 case "04":403 AudioSelectorName = 'HDMI';404 break; 405 };406 that.device.SetFeedback("Audio zone", AudioSelectorName); 407 };408 409 msg = playnowRegex.exec(FinishStr);410 if(msg != null)411 {412 switch(msg[1])413 {414 415 case "NTM":416 IR.Log("!!!! = "+ msg[2]);417 break;418 case "NAT":419 IR.Log("!!!! = "+ msg[2]);420 break;421 case "NAL":422 IR.Log("!!!! = "+ msg[2]);423 break;424 case "NTI":425 IR.Log("!!!! = "+ msg[2]);426 break;427 428 };429 430 };431 432 msg = powRegex.exec(FinishStr);433 if(msg != null)434 {435 var PowerStatus;436 if (/00/.test(msg[2]))437 {438 PowerStatus = '0';439 } else if (/01/.test(msg[2]))440 {441 PowerStatus = '1';442 }443 switch(msg[1])444 { 445 case "PWR":446 that.device.SetFeedback("Power", PowerStatus);447 //IR.Log("Main Zone Power = "+ msg[2]);448 break;449 case "ZPW":450 that.device.SetFeedback("Power z2", PowerStatus);451 //IR.Log("Second Zone Power = "+ PowerStatus);452 break;453 case "PW3":454 that.device.SetFeedback("Power z3", PowerStatus);455 //IR.Log("Third Zone Power = "+ msg[2]);456 break; 457 };458 powRegex.lastIndex = 0;459 };460 461 msg = muteRegex.exec(FinishStr);462 if(msg != null)463 { 464 var MuteStatus;465 if (/00/.test(msg[2]))466 {467 MuteStatus = '0';468 } else if (/01/.test(msg[2]))469 {470 MuteStatus = '1';471 }472 switch(msg[1])473 { 474 case "AMT":475 that.device.SetFeedback("Mute", MuteStatus);476 //IR.Log("Main Zone Mute = "+ MuteStatus);477 break;478 case "ZMT":479 that.device.SetFeedback("Mute z2", MuteStatus);480 //IR.Log("Second Zone Mute = "+ MuteStatus);481 break;482 case "MT3":483 that.device.SetFeedback("Mute z3", MuteStatus);484 //IR.Log("Third Zone Mute = "+ MuteStatus);485 break; 486 };487 muteRegex.lastIndex = 0;488 };489 490 msg = volRegex.exec(FinishStr);491 if(msg != null)492 { 493 if (/N\/A/.test(msg[2])) 494 msg[2] = 0;495 switch(msg[1])496 { 497 case "MVL":498 //var Volume = parseInt(msg[2],16);499 var Volume = parseInt(msg[2],16);500 if (Volume == 'Nan') {return}501 that.device.SetFeedback("Volume", Volume);502 IR.Log("Main Zone Volume = "+ Volume);503 //var Aux = (parseInt(msg[2],16)/100)*65535;504 //IR.Log("Main Zone Aux = "+ Aux);505 break;506 507 case "ZVL":508 //var Volume = parseInt(msg[2],16);509 var Volume = parseInt(msg[2],16);510 if (Volume == 'Nan') {return} 511 that.device.SetFeedback("Volume z2", Volume);512 IR.Log("Second Zone Volume = "+ Volume);513 //var Aux = (parseInt(msg[2],16)/100)*65535;514 //IR.Log("Second Zone Aux = "+ Aux);515 break;516 517 case "VL3":518 var Volume = parseInt(msg[2],16); 519 if (Volume == 'Nan') {return} 520 that.device.SetFeedback("Volume z3", Volume);521 //IR.Log("Third Zone Volume = "+ Volume);522 break;523 524 }; 525 volRegex.lastIndex = 0;526 }527 528 msg = tunerRegex.exec(FinishStr);529 if(msg != null)530 {531 switch(msg[1])532 { 533 case "TUN":534 var Aux = parseFloat(msg[2]);535 if (Aux >= 1000) 536 Aux = (Aux/100).toFixed(1);537 IR.Log("TUN = " + Aux);538 that.radioModule.fb(msg[2]);539 break;540 541 case "TUZ":542 var Aux = parseFloat(msg[2]);543 if (Aux >= 1000) 544 Aux = (Aux/100).toFixed(1);545 IR.Log("TUZ = " + Aux);546 break;547 548 };549 tunerRegex.lastIndex = 0; 550 } 551 552 msg = selectorRegex.exec(FinishStr);553 if(msg != null)554 {555 if(msg[1] == "SLI")556 {557 var Input;558 switch(parseInt(msg[2]))559 {560 case 00:561 Input = "Video 1";562 break;563 case 01:564 Input = "Video 2";565 break;566 case 02:567 Input = "Video 3";568 break;569 case 03:570 Input = "Video 4";571 break;572 case 04:573 Input = "Video 5";574 break;575 case 05:576 Input = "Video 6";577 break;578 case 06:579 Input = "Video 7";580 break;581 case 10:582 Input = "DVD";583 break;584 case 20:585 Input = "Tape 1";586 break;587 case 21:588 Input = "Tape 2";589 break;590 case 22:591 Input = "Phono";592 break;593 case 23:594 Input = "CD";595 break;596 case 24:597 Input = "FM";598 break;599 case 25:600 Input = "AM";601 break;602 case 26:603 Input = "Tuner";604 break;605 case 27:606 Input = "Music Server";607 break;608 case 28:609 Input = "Net Radio";610 break;611 case 29:612 Input = "USB";613 break;614 case 30:615 Input = "Multi CH";616 break;617 case 31:618 Input = "XM";619 break;620 621 };622 623 that.device.SetFeedback("Input zone 1", Input);624 625 //IR.Log("Main Zone Input = " + Input); 626 }627 if(msg[1] == "SLZ")628 { 629 switch(parseInt(msg[2])){630 631 case 00:632 Input = "Video 1";633 break;634 case 01:635 Input = "Video 2";636 break;637 case 02:638 Input = "Video 3";639 break;640 case 03:641 Input = "Video 4";642 break;643 case 04:644 Input = "Video 5";645 break;646 case 05:647 Input = "Video 6";648 break;649 case 06:650 Input = "Video 7";651 break;652 case 10:653 Input = "DVD";654 break;655 case 20:656 Input = "Tape 1";657 break;658 case 21:659 Input = "Tape 2";660 break;661 case 22:662 Input = "Phono";663 break;664 case 23:665 Input = "CD";666 break;667 case 24:668 Input = "FM";669 break;670 case 25:671 Input = "AM";672 break;673 case 26:674 Input = "Tuner";675 break;676 case 27:677 Input = "Music Server";678 break;679 case 28:680 Input = "Net Radio";681 break;682 case 29:683 Input = "IPod";684 break;685 case 30:686 Input = "Multi CH";687 break;688 case 31:689 Input = "XM";690 break; 691 };692 that.device.SetFeedback("Input zone 2", Input);693 //IR.Log("Second zone input: " + Input); 694 } 695 if(msg[1] == "SL3")696 { 697 switch(parseInt(msg[2]))698 { 699 case 00:700 Input = "Video 1";701 break;702 case 01:703 Input = "Video 2";704 break;705 case 02:706 Input = "Game\TV";707 break;708 case 03:709 Input = "Video 4";710 break;711 case 04:712 Input = "Video 5";713 break;714 case 05:715 Input = "Video 6";716 break;717 case 06:718 Input = "Video 7";719 break;720 case 10:721 Input = "DVD";722 break;723 case 20:724 Input = "Tape 1";725 break;726 case 21:727 Input = "Tape 2";728 break;729 case 22:730 Input = "Phono";731 break;732 case 23:733 Input = "CD";734 break;735 case 24:736 Input = "FM";737 break;738 case 25:739 Input = "AM";740 break;741 case 26:742 Input = "Tuner";743 break;744 case 27:745 Input = "Music Server";746 break;747 case 28:748 Input = "Net Radio";749 break;750 case 29:751 Input = "USB";752 break;753 case 30:754 Input = "Multi CH";755 break;756 case 31:757 Input = "XM";758 break;759 760 };761 that.device.SetFeedback("Input zone 3", Input);762 //IR.Log("Third zone input: " + Input); 763 } 764 selectorRegex.lastIndex = 0;765 766 }; 767//----------------------------------------------------------------------------------------- 768 }); 769 770 function SendPacket(cmd)771 {772 IR.Log("!!! = "+ cmd);773 var len = cmd.length + 3;774 //IR.Log("len = "+ len)775 that.device.Send(['ISCP', 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, len, 0x01, 0x00, 0x00, 0x00, cmd, 0x0D]);776 };777 778 this.publicCreatePacket = function(curzone, cmd, vallvl) {779 CreatePacket(curzone, cmd, vallvl);780 }781 782 function CreatePacket(curzone, cmd, vallvl)783 {784 IR.Log(curzone + ' ' + cmd +' '+ vallvl);785 786 var packet = '!1';787 curzone = curzone + '';788 switch (cmd)789 {790 case 'POWER OFF':791 switch (curzone)792 {793 case '1': 794 packet += 'PWR00';795 break;796 case '2': 797 packet += 'ZPW00';798 break;799 case '3': 800 packet += 'PW300';801 break;802 } 803 break;804 case 'POWER ON': 805 switch (curzone)806 {807 case '1': 808 packet += 'PWR01';809 break;810 case '2': 811 packet += 'ZPW01';812 break;813 case '3': 814 packet += 'PW301';815 break;816 }817 break;818 case 'TREBLE UP':819 packet += 'TFRTUP';820 break;821 case 'TREBLE DOWN':822 packet += 'TFRTDOWN';823 break;824 case 'BASS UP':825 packet += 'TFRBUP';826 break;827 case 'BASS DOWN':828 packet += 'TFRBDOWN';829 break;830 case 'PREV MODE':831 packet += 'LMDUP';832 break;833 case 'NEXT MODE':834 packet += 'LMDDOWN';835 break;836 case 'MUTE OFF': 837 switch (curzone)838 {839 case '1': 840 packet += 'AMT00';841 break;842 case '2': 843 packet += 'ZMT00';844 break;845 case '3': 846 packet += 'MT300';847 break;848 } 849 break;850 case 'MUTE ON': 851 switch (curzone)852 {853 case '1': 854 packet += 'AMT01';855 break;856 case '2': 857 packet += 'ZMT01';858 break;859 case '3': 860 packet += 'MT301';861 break;862 } 863 break;864 865 case 'MUTE SWITCH': 866 switch (curzone) 867 { 868 case '1': 869 if(that.device.GetFeedback("Mute") == 0) 870 packet += 'AMT01'; 871 else 872 packet += 'AMT00'; 873 break; 874 875 case '2': 876 if(that.device.GetFeedback("Mute z2") == 0) 877 packet += 'ZMT01'; 878 else 879 packet += 'ZMT00'; 880 break; 881 882 case '3': 883 if(that.device.GetFeedback("Mute z3") == 0) 884 packet += 'MT301'; 885 else 886 packet += 'MT300'; 887 break; 888 } 889 break;890 891 case 'TUN':892 var data = vallvl;893 packet += 'TUN' + data;894 break;895 896 case 'VOLUME 0-100': 897 898 var data = "";899 if (parseInt(vallvl) < 16) {900 data = "0" + vallvl.toString(16);901 } else {902 data = vallvl.toString(16); 903 } 904 905 switch (curzone)906 {907 case '1': 908 //IR.Log("!!!!!!!!!!!!!!!!" + typeof(vallvl));909 //IR.Log(vallvl);910 //IR.Log(parseInt(vallvl,16));911 packet += 'MVL'+ data;912 break;913 case '2': 914 packet += 'ZVL'+ data;915 break;916 case '3': 917 packet += 'VL3'+ data;918 break;919 } 920 break;921 case 'VOLUME UP': 922 switch (curzone)923 {924 case '1': 925 packet += 'MVLUP';926 break;927 case '2': 928 packet += 'ZVLUP';929 break;930 case '3': 931 packet += 'VL3UP';932 break;933 }934 break; 935 case 'VOLUME DOWN': 936 switch (curzone)937 {938 case '1': 939 packet += 'MVLDOWN';940 break;941 case '2': 942 packet += 'ZVLDOWN';943 break;944 case '3': 945 packet += 'VL3DOWN';946 break;947 }948 break;949 case 'SETUP OPERATION MENU': 950 switch (curzone)951 {952 case '1': 953 packet += 'OSDMENU';954 break;955 } 956 break;957 case 'SETUP OPERATION UP': 958 switch (curzone)959 {960 case '1': 961 packet += 'OSDUP';962 break;963 }964 break;965 case 'SETUP OPERATION DOWN': 966 switch (curzone)967 {968 case '1': 969 packet += 'OSDDOWN';970 break;971 } 972 break;973 case 'SETUP OPERATION RIGHT': 974 switch (curzone)975 {976 case '1': 977 packet += 'OSDRIGHT';978 break;979 }; 980 break;981 case 'SETUP OPERATION LEFT': 982 switch (curzone)983 {984 case '1': 985 packet += 'OSDLEFT';986 break;987 } 988 break;989 case 'SETUP OPERATION ENTER': 990 switch (curzone)991 {992 case '1': 993 packet += 'OSDENTER';994 break;995 } 996 break;997 case 'SETUP OPERATION EXIT': 998 switch (curzone)999 {1000 case '1': 1001 packet += 'OSDEXIT';1002 break;1003 } 1004 break; case 'INPUT SELECTION VCR/DVR': 1005 switch (curzone)1006 {1007 case '1': 1008 packet += 'SLI00';1009 break;1010 case '2': 1011 packet += 'SLZ00';1012 break;1013 case '3': 1014 packet += 'SL300';1015 break;1016 }1017 break;1018 case 'INPUT SELECTION CBL/SAT': 1019 switch (curzone)1020 {1021 case '1': 1022 packet += 'SLI01';1023 break;1024 case '2': 1025 packet += 'SLZ01';1026 break;1027 case '3': 1028 packet += 'SL301';1029 break;1030 }1031 break;1032 case 'INPUT SELECTION GAME/TV': 1033 switch (curzone)1034 {1035 case '1': 1036 packet += 'SLI02';1037 break;1038 case '2': 1039 packet += 'SLZ02';1040 break;1041 case '3': 1042 packet += 'SL302';1043 break;1044 }1045 break;1046 case 'INPUT SELECTION AUX1(AUX)': 1047 switch (curzone)1048 {1049 case '1': 1050 packet += 'SLI03';1051 break;1052 case '2': 1053 packet += 'SLZ03';1054 break;1055 case '3': 1056 packet += 'SL303';1057 break;1058 }1059 break;1060 case 'INPUT SELECTION AUX2': 1061 switch (curzone)1062 {1063 case '1': 1064 packet += 'SLI04';1065 break;1066 case '2': 1067 packet += 'SLZ04';1068 break;1069 case '3': 1070 packet += 'SL304';1071 break;1072 } 1073 break;1074 case 'INPUT SELECTION VIDEO6': 1075 switch (curzone)1076 {1077 case '1': 1078 packet += 'SLI05';1079 break;1080 case '2': 1081 packet += 'SLZ05';1082 break;1083 case '3': 1084 packet += 'SL305';1085 break;1086 } 1087 break;1088 case 'INPUT SELECTION VIDEO7': 1089 switch (curzone)1090 {1091 case '1': 1092 packet += 'SLI06';1093 break;1094 case '2': 1095 packet += 'SLZ06';1096 break;1097 case '3': 1098 packet += 'SL306';1099 break;1100 } 1101 break; 1102 case 'INPUT SELECTION DVD': 1103 switch (curzone)1104 {1105 case '1': 1106 packet += 'SLI10';1107 break;1108 case '2': 1109 packet += 'SLZ10';1110 break;1111 case '3': 1112 packet += 'SL310';1113 break;1114 } 1115 break; 1116 case 'INPUT SELECTION TAPE(1)': 1117 switch (curzone)1118 {1119 case '1': 1120 packet += 'SLI20';1121 break;1122 case '2': 1123 packet += 'SLZ20';1124 break;1125 case '3': 1126 packet += 'SL320';1127 break;1128 } 1129 break; 1130 case 'INPUT SELECTION TAPE2': 1131 switch (curzone)1132 {1133 case '1': 1134 packet += 'SLI21';1135 break;1136 case '2': 1137 packet += 'SLZ21';1138 break;1139 case '3': 1140 packet += 'SL321';1141 break;1142 } 1143 break;1144 case 'INPUT SELECTION PHONO': 1145 switch (curzone)1146 {1147 case '1': 1148 packet += 'SLI22';1149 break;1150 case '2': 1151 packet += 'SLZ22';1152 break;1153 case '3': 1154 packet += 'SL322';1155 break;1156 }1157 break; 1158 case 'INPUT SELECTION CD': 1159 switch (curzone)1160 {1161 case '1': 1162 packet += 'SLI23';1163 break;1164 case '2': 1165 packet += 'SLZ23';1166 break;1167 case '3': 1168 packet += 'SL323';1169 break;1170 } 1171 break;1172 case 'INPUT SELECTION FM': 1173 switch (curzone)1174 {1175 case '1': 1176 packet += 'SLI24';1177 break;1178 case '2': 1179 packet += 'SLZ24';1180 break;1181 case '3': 1182 packet += 'SL324';1183 break;1184 }1185 break;1186 case 'INPUT SELECTION BT':1187 switch (curzone)1188 {1189 case '1':1190 packet += 'SLI2E';1191 break;1192 case '2':1193 packet += 'SLZ2E';1194 break;1195 case '3':1196 packet += 'SL32E';1197 break;1198 } 1199 break;1200 case 'INPUT SELECTION AM': 1201 switch (curzone)1202 {1203 case '1': 1204 packet += 'SLI25';1205 break;1206 case '2': 1207 packet += 'SLZ25';1208 break;1209 case '3': 1210 packet += 'SL325';1211 break;1212 }1213 break;1214 case 'INPUT SELECTION TUNER': 1215 switch (curzone)1216 {1217 case '1': 1218 packet += 'SLI26';1219 break;1220 case '2': 1221 packet += 'SLI26';1222 break;1223 case '3': 1224 packet += 'SL326';1225 break;1226 } 1227 break;1228 case 'INPUT SELECTION MUSIC SERVER': 1229 switch (curzone)1230 {1231 case '1': 1232 packet += 'SLI27';1233 break;1234 case '2': 1235 packet += 'SLZ27';1236 break;1237 case '3': 1238 packet += 'SL327';1239 break;1240 }1241 break;1242 case 'INPUT SELECTION INTERNET RADIO': 1243 switch (curzone)1244 {1245 case '1': 1246 packet += 'SLI28';1247 break;1248 case '2': 1249 packet += 'SLZ28';1250 break;1251 case '3': 1252 packet += 'SL328';1253 break;1254 }1255 break;1256 case 'INPUT SELECTION USB': 1257 switch (curzone)1258 {1259 case '1': 1260 packet += 'SLI29';1261 break;1262 case '2': 1263 packet += 'SLZ29';1264 break;1265 case '3': 1266 packet += 'SL329';1267 break;1268 }1269 break;1270 case 'INPUT SELECTION MULTI CH': 1271 switch (curzone)1272 {1273 case '1': 1274 packet += 'SLI30';1275 break;1276 case '2': 1277 packet += 'SLZ30';1278 break;1279 case '3': 1280 packet += 'SL330';1281 break;1282 } 1283 break;1284 case 'INPUT SELECTION XM*1': 1285 switch (curzone)1286 {1287 case '1': 1288 packet += 'SLI31';1289 break;1290 case '2': 1291 packet += 'SLZ31';1292 break;1293 case '3': 1294 packet += 'SL331';1295 break;1296 } 1297 break;1298 case 'INPUT SELECTION SIRIUS*1': 1299 switch (curzone)1300 {1301 case '1': 1302 packet += 'SLI32';1303 break;1304 case '2': 1305 packet += 'SLZ32';1306 break;1307 case '3': 1308 packet += 'SL332';1309 break;1310 } 1311 break;1312 case 'INPUT SELECTION UP': 1313 switch (curzone)1314 {1315 case '1': 1316 packet += 'SLIUP';1317 break;1318 case '2': 1319 packet += 'SLZUP';1320 break;1321 case '3': 1322 packet += 'SL3UP';1323 break;1324 }1325 break;1326 case 'INPUT SELECTION DOWN': 1327 switch (curzone)1328 {1329 case '1': 1330 packet += 'SLIDOWN';1331 break;1332 case '2': 1333 packet += 'SLZDOWN';1334 break;1335 case '3': 1336 packet += 'SL3DOWN';1337 break;1338 } 1339 break;1340 case 'RECOUT SELECTOR VIDEO1': 1341 switch (curzone)1342 {1343 case '1': 1344 packet += 'SLR00';1345 break;1346 } 1347 break;1348 case 'RECOUT SELECTOR VIDEO2': 1349 switch (curzone)1350 {1351 case '1': 1352 packet += 'SLR01';1353 break;1354 } 1355 break;1356 case 'RECOUT SELECTOR VIDEO3': 1357 switch (curzone)1358 {1359 case '1': 1360 packet += 'SLR02';1361 break;1362 }1363 break;1364 case 'RECOUT SELECTOR VIDEO4': 1365 switch (curzone)1366 {1367 case '1': 1368 packet += 'SLR03';1369 break;1370 } 1371 break;1372 case 'RECOUT SELECTOR VIDEO5': 1373 switch (curzone)1374 {1375 case '1': 1376 packet += 'SLR04';1377 break;1378 } 1379 break;1380 case 'RECOUT SELECTOR VIDEO6': 1381 switch (curzone)1382 {1383 case '1': 1384 packet += 'SLR05';1385 break;1386 } 1387 break;1388 case 'RECOUT SELECTOR VIDEO7': 1389 switch (curzone)1390 {1391 case '1': 1392 packet += 'SLR06';1393 break;1394 }1395 break;1396 case 'RECOUT SELECTOR DVD': 1397 switch (curzone)1398 {1399 case '1': 1400 packet += 'SLR10';1401 break;1402 } 1403 break;1404 case 'RECOUT SELECTOR TAPE(1)': 1405 switch (curzone)1406 {1407 case '1': 1408 packet += 'SLR20';1409 break;1410 }1411 break;1412 case 'RECOUT SELECTOR TAPE2': 1413 switch (curzone)1414 {1415 case '1': 1416 packet += 'SLR21';1417 break;1418 } 1419 break;1420 case 'RECOUT SELECTOR PHONO': 1421 switch (curzone)1422 {1423 case '1': 1424 packet += 'SLR22';1425 break;1426 } 1427 break;1428 case 'RECOUT SELECTOR CD': 1429 switch (curzone)1430 {1431 case '1': 1432 packet += 'SLR23';1433 break;1434 } 1435 break;1436 case 'RECOUT SELECTOR FM': 1437 switch (curzone)1438 {1439 case '1': 1440 packet += 'SLR24';1441 break;1442 } 1443 break;1444 case 'RECOUT SELECTOR AM': 1445 switch (curzone)1446 {1447 case '1': 1448 packet += 'SLR25';1449 break;1450 } 1451 break;1452 case 'RECOUT SELECTOR TUNER': 1453 switch (curzone)1454 {1455 case '1': 1456 packet += 'SLR26';1457 break;1458 } 1459 break;1460 case 'RECOUT SELECTOR MUSIC SERVER': 1461 switch (curzone)1462 {1463 case '1': 1464 packet += 'SLR27';1465 break;1466 }1467 break;1468 case 'RECOUT SELECTOR INTERNET RADIO': 1469 switch (curzone)1470 {1471 case '1': 1472 packet += 'SLR28';1473 break;1474 } 1475 break;1476 case 'RECOUT SELECTOR MULTI CH': 1477 switch (curzone)1478 {1479 case '1': 1480 packet += 'SLR30';1481 break;1482 } 1483 break;1484 case 'RECOUT SELECTOR XM': 1485 switch (curzone)1486 {1487 case '1': 1488 packet += 'SLR31';1489 break;1490 } 1491 break;1492 case 'RECOUT SELECTOR OFF': 1493 switch (curzone)1494 {1495 case '1': 1496 packet += 'SLR7F';1497 break;1498 } 1499 break;1500 case 'RECOUT SELECTOR SOURCE': 1501 switch (curzone)1502 {1503 case '1': 1504 packet += 'SLR80';1505 break;1506 }1507 break;1508 case 'AUDIO SELECTOR AUTO': 1509 switch (curzone)1510 {1511 case '1': 1512 packet += 'SLA00';1513 break;1514 } 1515 break;1516 case 'AUDIO SELECTOR OPT':1517 packet += 'SLA05';1518 break;1519 case 'AUDIO SELECTOR MULTI-CHANNEL': 1520 switch (curzone)1521 {1522 case '1': 1523 packet += 'SLA01';1524 break;1525 } 1526 break;1527 case 'AUDIO SELECTOR ANALOG': 1528 switch (curzone)1529 {1530 case '1': 1531 packet += 'SLA02';1532 break;1533 } 1534 break;1535 case 'AUDIO SELECTOR iLINK': 1536 switch (curzone)1537 {1538 case '1': 1539 packet += 'SLA03';1540 break;1541 } 1542 break;1543 case 'AUDIO SELECTOR HDMI': 1544 switch (curzone)1545 {1546 case '1': 1547 packet += 'SLA04';1548 break;1549 } 1550 break;1551 case 'AUDIO SELECTOR UP': 1552 switch (curzone)1553 {1554 case '1': 1555 packet += 'SLAUP';1556 break;1557 } 1558 break;1559 case 'LISTENING MODE STEREO': 1560 switch (curzone)1561 {1562 case '1': 1563 packet += 'LMD00';1564 break;1565 } 1566 break;1567 case 'LISTENING MODE DIRECT': 1568 switch (curzone)1569 {1570 case '1': 1571 packet += 'LMD01';1572 break;1573 } 1574 break;1575 case 'LISTENING MODE SURROUND': 1576 switch (curzone)1577 {1578 case '1': 1579 packet += 'LMD02';1580 break;1581 } 1582 break;1583 case 'LISTENING MODE FILM': 1584 switch (curzone)1585 {1586 case '1': 1587 packet += 'LMD03';1588 break;1589 } 1590 break;1591 case 'LISTENING MODE THX': 1592 switch (curzone)1593 {1594 case '1': 1595 packet += 'LMD04';1596 break;1597 } 1598 break;1599 case 'LISTENING MODE ACTION': 1600 switch (curzone)1601 {1602 case '1': 1603 packet += 'LMD05';1604 break;1605 } 1606 break;1607 case 'LISTENING MODE MUSICAL': 1608 switch (curzone)1609 {1610 case '1': 1611 packet += 'LMD06';1612 break;1613 } 1614 break;1615 case 'LISTENING MODE MONO MOVIE': 1616 switch (curzone)1617 {1618 case '1': 1619 packet += 'LMD07';1620 break;1621 } 1622 break;1623 case 'LISTENING MODE ORCHESTRA': 1624 switch (curzone)1625 {1626 case '1': 1627 packet += 'LMD08';1628 break;1629 } 1630 break;1631 case 'LISTENING MODE UNPLUGGED': 1632 switch (curzone)1633 {1634 case '1': 1635 packet += 'LMD09';1636 break;1637 } 1638 break;1639 case 'LISTENING MODE STUDIO-MIX': 1640 switch (curzone)1641 {1642 case '1': 1643 packet += 'LMD0A';1644 break;1645 } 1646 break;1647 case 'LISTENING MODE TV LOGIC': 1648 switch (curzone)1649 {1650 case '1': 1651 packet += 'LMD0B';1652 break;1653 } 1654 break;1655 case 'LISTENING MODE ALL CH STEREO': 1656 switch (curzone)1657 {1658 case '1': 1659 packet += 'LMD0C';1660 break;1661 } 1662 break;1663 case 'LISTENING MODE THEATER-DIMENSIONAL': 1664 switch (curzone)1665 {1666 case '1': 1667 packet += 'LMD0D';1668 break;1669 } 1670 break;1671 case 'LISTENING MODE ENHANCED 7/ENHANCE': 1672 switch (curzone)1673 {1674 case '1': 1675 packet += 'LMD0E';1676 break;1677 } 1678 break;1679 case 'LISTENING MODE MONO': 1680 switch (curzone)1681 {1682 case '1': 1683 packet += 'LMD0F';1684 break;1685 } 1686 break;1687 case 'LISTENING MODE PURE AUDIO': 1688 switch (curzone)1689 {1690 case '1': 1691 packet += 'LMD11';1692 break;1693 } 1694 break;1695 case 'LISTENING MODE MULTIPLEX': 1696 switch (curzone)1697 {1698 case '1': 1699 packet += 'LMD12';1700 break;1701 } 1702 break;1703 case 'LISTENING MODE FULL MONO': 1704 switch (curzone)1705 {1706 case '1': 1707 packet += 'LMD13';1708 break;1709 } 1710 break;1711 case 'LISTENING MODE DOLBY VIRTUAL': 1712 switch (curzone)1713 {1714 case '1': 1715 packet += 'LMD14';1716 break;1717 } 1718 break;1719 case 'LISTENING MODE 5,1CH SURROUND': 1720 switch (curzone)1721 {1722 case '1': 1723 packet += 'LMD40';1724 break;1725 } 1726 break;1727 case 'LISTENING MODE STRAIGHT DECODE*1': //FFFFUUUUUUU 1728 switch (curzone)1729 {1730 case '1': 1731 packet += 'LMD40';1732 break;1733 } 1734 break;1735 case 'LISTENING MODE DOLBY EX/DTS ES': 1736 switch (curzone)1737 {1738 case '1': 1739 packet += 'LMD41';1740 break;1741 } 1742 break;1743 case 'LISTENING MODE DOLBY EX*2': //FFFFUUUUUU 1744 switch (curzone)1745 {1746 case '1': 1747 packet += 'LMD41';1748 break;1749 } 1750 break;1751 case 'LISTENING MODE THX CINEMA': 1752 switch (curzone)1753 {1754 case '1': 1755 packet += 'LMD42';1756 break;1757 } 1758 break;1759 case 'LISTENING MODE THX SURROUND EX': 1760 switch (curzone)1761 {1762 case '1': 1763 packet += 'LMD43';1764 break;1765 } 1766 break;1767 case 'LISTENING MODE U2/S2 CINEMA/CINEMA2': 1768 switch (curzone)1769 {1770 case '1': 1771 packet += 'LMD50';1772 break;1773 } 1774 break;1775 case 'LISTENING MODE MUSIC MODE': 1776 switch (curzone)1777 {1778 case '1': 1779 packet += 'LMD51';1780 break;1781 } 1782 break;1783 case 'LISTENING MODE GAMES MODE': 1784 switch (curzone)1785 {1786 case '1': 1787 packet += 'LMD52';1788 break;1789 } 1790 break;1791 case 'LISTENING MODE PLII/PLIIx MOVIE': 1792 switch (curzone)1793 {1794 case '1': 1795 packet += 'LMD80';1796 break;1797 } 1798 break;1799 case 'LISTENING MODE PLII/PLIIx MUSIC': 1800 switch (curzone)1801 {1802 case '1': 1803 packet += 'LMD81';1804 break;1805 } 1806 break;1807 case 'LISTENING MODE NEO6 CINEMA': 1808 switch (curzone)1809 {1810 case '1': 1811 packet += 'LMD82';1812 break;1813 } 1814 break;1815 case 'LISTENING MODE NEO6 MUSIC': 1816 switch (curzone)1817 {1818 case '1': 1819 packet += 'LMD83';1820 break;1821 } 1822 break;1823 case 'LISTENING MODE PLII/PLIIx THX CINEMA': 1824 switch (curzone)1825 {1826 case '1': 1827 packet += 'LMD84';1828 break;1829 } 1830 break;1831 case 'LISTENING MODE NEO6 THX CINEMA': 1832 switch (curzone)1833 {1834 case '1': 1835 packet += 'LMD85';1836 break;1837 } 1838 break;1839 case 'LISTENING MODE PLII/PLIIx GAME': 1840 switch (curzone)1841 {1842 case '1': 1843 packet += 'LMD86';1844 break;1845 } 1846 break;1847 case 'LISTENING MODE NEUTRAL SURR*3': 1848 switch (curzone)1849 {1850 case '1': 1851 packet += 'LMD87';1852 break;1853 } 1854 break;1855 case 'LISTENING MODE NEUTRAL THX': 1856 switch (curzone)1857 {1858 case '1': 1859 packet += 'LMD88';1860 break;1861 } 1862 break;1863 case 'LISTENING MODE PLII THX GAMES': 1864 switch (curzone)1865 {1866 case '1': 1867 packet += 'LMD89';1868 break;1869 } 1870 break;1871 case 'LISTENING MODE NEO6 THX GAMES': 1872 switch (curzone)1873 {1874 case '1': 1875 packet += 'LMD8A';1876 break;1877 } 1878 break;1879 case 'LISTENING MODE UP': 1880 switch (curzone)1881 {1882 case '1': 1883 packet += 'LMDUP';1884 break;1885 } 1886 break;1887 case 'LISTENING MODE DOWN': 1888 switch (curzone)1889 {1890 case '1': 1891 packet += 'LMDDOWN';1892 break;1893 } 1894 break;1895 case 'TUNING COMMAND UP': 1896 switch (curzone)1897 {1898 case '1': 1899 packet += 'TUNUP';1900 break;1901 case '2': 1902 packet += 'TUNUP';1903 break;1904 case '3': 1905 packet += 'TUNUP';1906 break;1907 }1908 break;1909 case 'TUNING COMMAND DOWN': 1910 switch (curzone)1911 {1912 case '1': 1913 packet += 'TUNDOWN';1914 break;1915 case '2': 1916 packet += 'TUNDOWN';1917 break;1918 case '3': 1919 packet += 'TUNDOWN';1920 break;1921 } 1922 break;1923 case 'PRESET COMMAND 1-40': 1924 switch (curzone)1925 {1926 case '1': 1927 packet += 'PRS'+vallvl;1928 break;1929 case '2': 1930 packet += 'PRS'+vallvl;1931 break;1932 case '3': 1933 packet += 'PRS'+vallvl;1934 break;1935 } 1936 break;1937 case 'PRESENT COMMAND UP': 1938 switch (curzone)1939 {1940 case '1': 1941 packet += 'PRSUP';1942 break;1943 case '2': 1944 packet += 'PRSUP';1945 break;1946 case '3': 1947 packet += 'PRSUP';1948 break;1949 } 1950 break;1951 case 'PRESENT COMMAND DOWN': 1952 switch (curzone)1953 {1954 case '1': 1955 packet += 'PRSDOWN';1956 break;1957 case '2': 1958 packet += 'PRSDOWN';1959 break;1960 case '3': 1961 packet += 'PRSDOWN';1962 break;1963 } 1964 break;1965 }1966 SendPacket(packet);1967 };1968 1969 IR.AddListener(IR.EVENT_CHANNEL_SET,that.device,function(namecommand)1970 { 1971 IR.Log("!!!!!! = "+ namecommand);1972 // IR.Log(that.device.GetFeedback("Volume"))1973 var curzone = checkzone;1974 IR.Log("??? = "+ curzone);1975 var cmd = namecommand;1976 switch (namecommand)1977 {1978 case 'POWER OFF': 1979 value = 0;1980 CreatePacket(curzone, cmd, value); 1981 break;1982 case 'POWER ON': 1983 value = 0;1984 CreatePacket(curzone, cmd, value); 1985 break;1986 case 'TREBLE UP':1987 value = 0;1988 CreatePacket(curzone, cmd, value); 1989 break;1990 case 'TREBLE DOWN':1991 value = 0;1992 CreatePacket(curzone, cmd, value); 1993 break;1994 case 'BASS UP':1995 value = 0;1996 CreatePacket(curzone, cmd, value); 1997 break;1998 case 'BASS DOWN':1999 value = 0;2000 CreatePacket(curzone, cmd, value); 2001 break;2002 case 'PREV MODE':2003 value = 0;2004 CreatePacket(curzone, cmd, value); 2005 break;2006 case 'NEXT MODE':2007 value = 0;2008 CreatePacket(curzone, cmd, value); 2009 break;2010 case 'MUTE OFF': 2011 value = 0;2012 CreatePacket(curzone, cmd, value); 2013 break;2014 case 'MUTE ON': 2015 value = 0;2016 CreatePacket(curzone, cmd, value); 2017 break; 2018 case 'MUTE SWITCH': 2019 value = 0;2020 CreatePacket(curzone, cmd, value); 2021 break; 2022 case 'VOLUME 0-100':2023 if (curzone == '1') 2024 { 2025 var vallvl = that.device.GetFeedback('Volume'); 2026 // IR.Log("VALUE = "+vallvl);2027 CreatePacket(curzone, cmd, vallvl); 2028 } else2029 if (curzone == '2')2030 {2031 var vallvl = that.device.GetFeedback('Volume z2');2032 //IR.Log("VALUE = "+vallvl); 2033 CreatePacket(curzone, cmd, vallvl); 2034 }else 2035 if (curzone == '3')2036 {2037 var vallvl = that.device.GetFeedback('Volume z3'); 2038 CreatePacket(curzone, cmd, vallvl); 2039 } 2040 break;2041 case 'VOLUME UP':2042 if (curzone == '1') 2043 { 2044 var vallvl = that.device.GetFeedback('Volume'); 2045 CreatePacket(curzone, cmd, vallvl); 2046 } else if (curzone == '2')2047 {2048 var vallvl = that.device.GetFeedback('Volume z2'); 2049 CreatePacket(curzone, cmd, vallvl); 2050 }else if (curzone == '3')2051 {2052 var vallvl = that.device.GetFeedback('Volume z3'); 2053 CreatePacket(curzone, cmd, vallvl); 2054 }2055 break;2056 case 'VOLUME DOWN': 2057 IR.Log("bygaga");2058 if (curzone == '1') 2059 { 2060 var vallvl = that.device.GetFeedback('Volume'); 2061 CreatePacket(curzone, cmd, vallvl); 2062 } else2063 if (curzone == '2')2064 {2065 var vallvl = that.device.GetFeedback('Volume z2');2066 CreatePacket(curzone, cmd, vallvl); 2067 }else 2068 if (curzone == '3')2069 {2070 var vallvl = that.device.GetFeedback('Volume z3'); 2071 CreatePacket(curzone, cmd, vallvl); 2072 }2073 break; 2074 case 'SETUP OPERATION MENU': 2075 value = 0;2076 CreatePacket(curzone, cmd, value); 2077 break;2078 case 'SETUP OPERATION UP': 2079 value = 0;2080 CreatePacket(curzone, cmd, value); 2081 break;2082 case 'SETUP OPERATION DOWN': 2083 value = 0;2084 CreatePacket(curzone, cmd, value); 2085 break;2086 case 'SETUP OPERATION RIGHT': 2087 value = 0;2088 CreatePacket(curzone, cmd, value); 2089 break;2090 case 'SETUP OPERATION LEFT': 2091 value = 0;2092 CreatePacket(curzone, cmd, value); 2093 break;2094 case 'SETUP OPERATION ENTER': 2095 value = 0;2096 CreatePacket(curzone, cmd, value); 2097 break;2098 case 'SETUP OPERATION EXIT': 2099 value = 0;2100 CreatePacket(curzone, cmd, value); 2101 break; 2102 case 'INPUT SELECTION VCR/DVR': 2103 value = 0;2104 CreatePacket(curzone, cmd, value); 2105 break;2106 case 'INPUT SELECTION CBL/SAT': 2107 value = 0;2108 CreatePacket(curzone, cmd, value); 2109 break; 2110 case 'INPUT SELECTION GAME/TV': 2111 value = 0;2112 CreatePacket(curzone, cmd, value); 2113 break;2114 case 'INPUT SELECTION AUX1(AUX)': 2115 value = 0;2116 CreatePacket(curzone, cmd, value); 2117 break;2118 case 'INPUT SELECTION AUX2': 2119 value = 0;2120 CreatePacket(curzone, cmd, value); 2121 break;2122 case 'INPUT SELECTION VIDEO6': 2123 value = 0;2124 CreatePacket(curzone, cmd, value); 2125 break;2126 case 'INPUT SELECTION VIDEO7': 2127 value = 0;2128 CreatePacket(curzone, cmd, value); 2129 break; 2130 case 'INPUT SELECTION DVD': 2131 value = 0;2132 CreatePacket(curzone, cmd, value); 2133 break; 2134 case 'INPUT SELECTION TAPE(1)': 2135 value = 0;2136 CreatePacket(curzone, cmd, value); 2137 break; 2138 case 'INPUT SELECTION TAPE2': 2139 value = 0;2140 CreatePacket(curzone, cmd, value); 2141 break;2142 case 'INPUT SELECTION PHONO': 2143 value = 0;2144 CreatePacket(curzone, cmd, value); 2145 break; 2146 case 'INPUT SELECTION CD': 2147 value = 0;2148 CreatePacket(curzone, cmd, value); 2149 break;2150 case 'INPUT SELECTION FM': 2151 value = 0;2152 CreatePacket(curzone, cmd, value); 2153 break;2154 case 'INPUT SELECTION BT':2155 value = 0;2156 CreatePacket(curzone, cmd, value);2157 break;2158 case 'INPUT SELECTION AM': 2159 value = 0;2160 CreatePacket(curzone, cmd, value); 2161 break;2162 case 'INPUT SELECTION TUNER': 2163 value = 0;2164 CreatePacket(curzone, cmd, value); 2165 break;2166 case 'INPUT SELECTION MUSIC SERVER': 2167 value = 0;2168 CreatePacket(curzone, cmd, value); 2169 break;2170 case 'INPUT SELECTION INTERNET RADIO': 2171 value = 0;2172 CreatePacket(curzone, cmd, value); 2173 break;2174 case 'INPUT SELECTION USB': 2175 value = 0;2176 CreatePacket(curzone, cmd, value); 2177 break;2178 case 'INPUT SELECTION MULTI CH': 2179 value = 0;2180 CreatePacket(curzone, cmd, value); 2181 break;2182 case 'INPUT SELECTION XM*1': 2183 value = 0;2184 CreatePacket(curzone, cmd, value); 2185 break;2186 case 'INPUT SELECTION SIRIUS*1': 2187 value = 0;2188 CreatePacket(curzone, cmd, value); 2189 break;2190 case 'INPUT SELECTION UP': 2191 value = 0;2192 CreatePacket(curzone, cmd, value); 2193 break;2194 case 'INPUT SELECTION DOWN': 2195 value = 0;2196 CreatePacket(curzone, cmd, value); 2197 break;2198 case 'RECOUT SELECTOR VIDEO1': 2199 value = 0;2200 CreatePacket(curzone, cmd, value); 2201 break;2202 case 'RECOUT SELECTOR VIDEO2': 2203 value = 0;2204 CreatePacket(curzone, cmd, value); 2205 break;2206 case 'RECOUT SELECTOR VIDEO3': 2207 value = 0;2208 CreatePacket(curzone, cmd, value); 2209 break;2210 case 'RECOUT SELECTOR VIDEO4': 2211 value = 0;2212 CreatePacket(curzone, cmd, value); 2213 break;2214 case 'RECOUT SELECTOR VIDEO5': 2215 value = 0;2216 CreatePacket(curzone, cmd, value); 2217 break;2218 case 'RECOUT SELECTOR VIDEO6': 2219 value = 0;2220 CreatePacket(curzone, cmd, value); 2221 break;2222 case 'RECOUT SELECTOR VIDEO7': 2223 value = 0;2224 CreatePacket(curzone, cmd, value); 2225 break;2226 case 'RECOUT SELECTOR DVD': 2227 value = 0;2228 CreatePacket(curzone, cmd, value); 2229 break;2230 case 'RECOUT SELECTOR TAPE(1)': 2231 value = 0;2232 CreatePacket(curzone, cmd, value); 2233 break;2234 case 'RECOUT SELECTOR TAPE2': 2235 value = 0;2236 CreatePacket(curzone, cmd, value); 2237 break;2238 case 'RECOUT SELECTOR PHONO': 2239 value = 0;2240 CreatePacket(curzone, cmd, value); 2241 break;2242 case 'RECOUT SELECTOR CD': 2243 value = 0;2244 CreatePacket(curzone, cmd, value); 2245 break;2246 case 'RECOUT SELECTOR FM': 2247 value = 0;2248 CreatePacket(curzone, cmd, value); 2249 break;2250 case 'RECOUT SELECTOR AM': 2251 value = 0;2252 CreatePacket(curzone, cmd, value); 2253 break;2254 case 'RECOUT SELECTOR TUNER': 2255 value = 0;2256 CreatePacket(curzone, cmd, value); 2257 break;2258 case 'RECOUT SELECTOR MUSIC SERVER': 2259 value = 0;2260 CreatePacket(curzone, cmd, value); 2261 break;2262 case 'RECOUT SELECTOR INTERNET RADIO': 2263 value = 0;2264 CreatePacket(curzone, cmd, value); 2265 break;2266 case 'RECOUT SELECTOR MULTI CH': 2267 value = 0;2268 CreatePacket(curzone, cmd, value); 2269 break;2270 case 'RECOUT SELECTOR XM': 2271 value = 0;2272 CreatePacket(curzone, cmd, value); 2273 break;2274 case 'RECOUT SELECTOR OFF': 2275 value = 0;2276 CreatePacket(curzone, cmd, value); 2277 break;2278 case 'RECOUT SELECTOR SOURCE': 2279 value = 0;2280 CreatePacket(curzone, cmd, value); 2281 break;2282 case 'AUDIO SELECTOR AUTO': 2283 value = 0;2284 CreatePacket(curzone, cmd, value); 2285 break;2286 case 'AUDIO SELECTOR OPT':2287 value = 0;2288 CreatePacket(curzone, cmd, value);2289 break;2290 case 'AUDIO SELECTOR MULTI-CHANNEL': 2291 value = 0;2292 CreatePacket(curzone, cmd, value); 2293 break;2294 case 'AUDIO SELECTOR ANALOG': 2295 value = 0;2296 CreatePacket(curzone, cmd, value); 2297 break;2298 case 'AUDIO SELECTOR iLINK': 2299 value = 0;2300 CreatePacket(curzone, cmd, value); 2301 break;2302 case 'AUDIO SELECTOR HDMI': 2303 value = 0;2304 CreatePacket(curzone, cmd, value); 2305 break;2306 case 'AUDIO SELECTOR UP': 2307 value = 0;2308 CreatePacket(curzone, cmd, value); 2309 break;2310 case 'LISTENING MODE STEREO': 2311 value = 0;2312 CreatePacket(curzone, cmd, value); 2313 break;2314 case 'LISTENING MODE DIRECT': 2315 value = 0;2316 CreatePacket(curzone, cmd, value); 2317 break;2318 case 'LISTENING MODE SURROUND': 2319 value = 0;2320 CreatePacket(curzone, cmd, value); 2321 break;2322 case 'LISTENING MODE FILM': 2323 value = 0;2324 CreatePacket(curzone, cmd, value); 2325 break;2326 case 'LISTENING MODE THX': 2327 value = 0;2328 CreatePacket(curzone, cmd, value); 2329 break;2330 case 'LISTENING MODE ACTION': 2331 value = 0;2332 CreatePacket(curzone, cmd, value); 2333 break;2334 case 'LISTENING MODE MUSICAL': 2335 value = 0;2336 CreatePacket(curzone, cmd, value); 2337 break;2338 case 'LISTENING MODE MONO MOVIE': 2339 value = 0;2340 CreatePacket(curzone, cmd, value); 2341 break;2342 case 'LISTENING MODE ORCHESTRA': 2343 value = 0;2344 CreatePacket(curzone, cmd, value); 2345 break;2346 case 'LISTENING MODE UNPLUGGED': 2347 value = 0;2348 CreatePacket(curzone, cmd, value); 2349 break;2350 case 'LISTENING MODE STUDIO-MIX': 2351 value = 0;2352 CreatePacket(curzone, cmd, value); 2353 break;2354 case 'LISTENING MODE TV LOGIC': 2355 value = 0;2356 CreatePacket(curzone, cmd, value); 2357 break;2358 case 'LISTENING MODE ALL CH STEREO': 2359 value = 0;2360 CreatePacket(curzone, cmd, value); 2361 break;2362 case 'LISTENING MODE THEATER-DIMENSIONAL': 2363 value = 0;2364 CreatePacket(curzone, cmd, value); 2365 break;2366 case 'LISTENING MODE ENHANCED 7/ENHANCE': 2367 value = 0;2368 CreatePacket(curzone, cmd, value); 2369 break;2370 case 'LISTENING MODE MONO': 2371 value = 0;2372 CreatePacket(curzone, cmd, value); 2373 break;2374 case 'LISTENING MODE PURE AUDIO': 2375 value = 0;2376 CreatePacket(curzone, cmd, value); 2377 break;2378 case 'LISTENING MODE MULTIPLEX': 2379 value = 0;2380 CreatePacket(curzone, cmd, value); 2381 break;2382 case 'LISTENING MODE FULL MONO': 2383 value = 0;2384 CreatePacket(curzone, cmd, value); 2385 break;2386 case 'LISTENING MODE DOLBY VIRTUAL': 2387 value = 0;2388 CreatePacket(curzone, cmd, value); 2389 break;2390 case 'LISTENING MODE 5,1CH SURROUND': 2391 value = 0;2392 CreatePacket(curzone, cmd, value); 2393 break;2394 case 'LISTENING MODE STRAIGHT DECODE*1': 2395 value = 0;2396 CreatePacket(curzone, cmd, value); 2397 break;2398 case 'LISTENING MODE DOLBY EX/DTS ES': 2399 value = 0;2400 CreatePacket(curzone, cmd, value); 2401 break;2402 case 'LISTENING MODE DOLBY EX*2': 2403 value = 0;2404 CreatePacket(curzone, cmd, value); 2405 break;2406 case 'LISTENING MODE THX CINEMA': 2407 value = 0;2408 CreatePacket(curzone, cmd, value); 2409 break;2410 case 'LISTENING MODE THX SURROUND EX': 2411 value = 0;2412 CreatePacket(curzone, cmd, value); 2413 break;2414 case 'LISTENING MODE U2/S2 CINEMA/CINEMA2': 2415 value = 0;2416 CreatePacket(curzone, cmd, value); 2417 break;2418 case 'LISTENING MODE MUSIC MODE': 2419 value = 0;2420 CreatePacket(curzone, cmd, value); 2421 break;2422 case 'LISTENING MODE GAMES MODE': 2423 value = 0;2424 CreatePacket(curzone, cmd, value); 2425 break;2426 case 'LISTENING MODE PLII/PLIIx MOVIE': 2427 value = 0;2428 CreatePacket(curzone, cmd, value); 2429 break;2430 case 'LISTENING MODE PLII/PLIIx MUSIC': 2431 value = 0;2432 CreatePacket(curzone, cmd, value); 2433 break;2434 case 'LISTENING MODE NEO6 CINEMA': 2435 value = 0;2436 CreatePacket(curzone, cmd, value); 2437 break;2438 case 'LISTENING MODE NEO6 MUSIC': 2439 value = 0;2440 CreatePacket(curzone, cmd, value); 2441 break;2442 case 'LISTENING MODE PLII/PLIIx THX CINEMA': 2443 value = 0;2444 CreatePacket(curzone, cmd, value); 2445 break;2446 case 'LISTENING MODE NEO6 THX CINEMA': 2447 value = 0;2448 CreatePacket(curzone, cmd, value); 2449 break;2450 case 'LISTENING MODE PLII/PLIIx GAME': 2451 value = 0;2452 CreatePacket(curzone, cmd, value); 2453 break;2454 case 'LISTENING MODE NEUTRAL SURR*3': 2455 value = 0;2456 CreatePacket(curzone, cmd, value); 2457 break;2458 case 'LISTENING MODE NEUTRAL THX': 2459 value = 0;2460 CreatePacket(curzone, cmd, value); 2461 break;2462 case 'LISTENING MODE PLII THX GAMES': 2463 value = 0;2464 CreatePacket(curzone, cmd, value); 2465 break;2466 case 'LISTENING MODE NEO6 THX GAMES': 2467 value = 0;2468 CreatePacket(curzone, cmd, value); 2469 break;2470 case 'LISTENING MODE UP': 2471 value = 0;2472 CreatePacket(curzone, cmd, value); 2473 break;2474 case 'LISTENING MODE DOWN': 2475 value = 0;2476 CreatePacket(curzone, cmd, value); 2477 break;2478 case 'LISTENING MODE GAMES MODE': 2479 value = 0;2480 CreatePacket(curzone, cmd, value); 2481 break;2482 case 'TUNING COMMAND UP': 2483 value = 0;2484 CreatePacket(curzone, cmd, value); 2485 break;2486 case 'TUNING COMMAND DOWN': 2487 value = 0;2488 CreatePacket(curzone, cmd, value); 2489 break;2490 case 'PRESET COMMAND 1-40': 2491 if (curzone = '1') 2492 { 2493 IR.Log("valpr = " + that.device.GetFeedback('Preset')); 2494 var valpr = that.device.GetFeedback('Preset'); 2495 //CreatePacket(curzone, cmd, valpr); 2496 CreatePacket(curzone, cmd, valpr);2497 } else2498 if (curzone = '2')2499 {2500 var valpr = that.device.GetFeedback('Preset z2'); 2501 CreatePacket(curzone, cmd, valpr); 2502 }else 2503 if (curzone = '3')2504 {2505 var valpr = that.device.GetFeedback('Preset z3'); 2506 CreatePacket(curzone, cmd, valpr); 2507 } 2508 break;2509 case 'PRESENT COMMAND UP': 2510 value = 0;2511 CreatePacket(curzone, cmd, value); 2512 break;2513 case 'PRESENT COMMAND DOWN': 2514 value = 0;2515 CreatePacket(curzone, cmd, value); 2516 break;2517 case 'CD-R RECORDER POWER': 2518 value = 0;2519 CreatePacket(curzone, cmd, value); 2520 break;2521 case 'Select Zone 1': 2522 checkzone = '1';2523 break;2524 case 'Select Zone 2': 2525 checkzone = '2'; 2526 break;2527 case 'Select Zone 3': 2528 checkzone = '3'; 2529 break; 2530 } 2531 IR.Log("name = "+ namecommand);2532 });...

Full Screen

Full Screen

Onkay.js

Source:Onkay.js Github

copy

Full Screen

1var OnkyoDevice = function(DeviceName)2{3 var checkzone = 1;4 this.DriverName = DeviceName;5 this.device = IR.GetDevice(this.DriverName);6 7 var QueueCommands = [];8 var TransportFree = true;9 10 var flagRegex = /.*?!1NLSC\dP/g;11 var listaRegex = /.*?!1NLSU(.*?)\x2D(.*)/g;12 var playnowRegex = /.*?!1(NTM|NAT|NAL|NTI)(.*)/g;13 var volRegex = /!1(MVL|ZVL|VL3)(.*)/g;14 var powRegex = /!1(PWR|ZPW|PW3)(.*)/g;15 var muteRegex = /!1(AMT|ZMT|MT3)(.*)/g; 16 var tunerRegex = /!1(TUN|TUZ)(.*)/g; 17 var selectorRegex = /!1(SLI|SLZ|SL3)(.*)/g;18 var AudioselectorRegex = /!1(SLA)(.*)/g;19 var ListeningModeRegex = /!1(LMD|LMZ)(.*)/g;20 var valpr;21 22 23 24 IR.Log("this.device = "+DeviceName)25 var that = this;26 IR.AddListener(IR.EVENT_START,0,function()27 {28 IR.Log("start");29 that.device.SetFeedback("Listening zone 1", "Select Listening");30 that.device.SetFeedback("Listening zone 2", "Select Listening");31 32 that.device.SetFeedback("Audio zone 1", "Select Audio");33 that.device.SetFeedback("Audio zone 2", "Select Audio");34 that.device.SetFeedback("Audio zone 3", "Select Audio");35 36 that.device.SetFeedback("Input zone 1", "Select Source");37 that.device.SetFeedback("Input zone 2", "Select Source");38 that.device.SetFeedback("Input zone 3", "Select Source"); 39 });40 41 //-------------------------------------------------------42 // Обработчик перехода устройства в Online43 //------------------------------------------------------- 44 IR.AddListener(IR.EVENT_ONLINE, that.device, function()45 { 46 IR.Log("DEVICE is Online");47 48 QueueCommands.push("!1PWRQSTN");49 QueueCommands.push("!1ZPWQSTN'");50 QueueCommands.push("!1PW3QSTN");51 52 QueueCommands.push("!1MVLQSTN");53 QueueCommands.push("!1ZVLQSTN");54 QueueCommands.push("!1VL3QSTN");55 56 QueueCommands.push("!1AMTQSTN");57 QueueCommands.push("!1ZMTQSTN");58 QueueCommands.push("!1MT3QSTN"); 59 60 QueueCommands.push("!1SLIQSTN");61 QueueCommands.push("!1SL3QSTN");62 QueueCommands.push("!1SLAQSTN");63 QueueCommands.push("!1SLZQSTN");64 QueueCommands.push("!1LMZQSTN");65 66 QueueCommands.push("!1LMDQSTN");67 68 69 }, that);70 71 //-------------------------------------------------------72 // Обработчик перехода устройства в Offline73 //-------------------------------------------------------74 IR.AddListener(IR.EVENT_OFFLINE, that.device, function()75 { 76 IR.Log("DEVICE is Offline");77 }, that);78 79 80 function hexToString(tmp) 81 {82 var arr = tmp;83 var str = '';84 var c; 85 var arr_len = arr.length;86 87 for (var i = 0; i < arr_len; i += 1) 88 {89 if (arr[i] != 0)90 {91 c = String.fromCharCode(arr[i]);92 93 str += c;94 } 95 }96 97 return str;98 }99 100 101 //---------------------------------------------------------102 // Действия каждый цикл103 //---------------------------------------------------------104 IR.SetInterval(1000, function()105 {106 // Посылаем команду из очереди107 if (TransportFree)108 {109 var command = QueueCommands.shift();110 if(command) 111 {112 SendPacket(command);113 }114 } 115 }, this);116 117 118 119 IR.AddListener(IR.EVENT_RECEIVE_DATA,that.device, function(data)120 {121 //IR.Log("data = "+ data);122 TransportFree = true;123 var FinishStr = ''; 124 FinishStr = hexToString(data);125 IR.Log("FinishStr = "+ FinishStr);126//-----------------------------------------------------------------------------------------127 var msg;128 129 msg = ListeningModeRegex.exec(FinishStr);130 if(msg != null)131 {132 var id = msg[2].slice(0, msg[2].length - 1);133 IR.Log("id = "+ id);134 var ListeningModeName = 'NaN';135 switch(checkzone)136 {137 case '1':138 switch(id)139 {140 case "00":141 ListeningModeName = 'STEREO';142 break;143 case "01":144 ListeningModeName = 'DIRECT';145 break;146 case "02":147 ListeningModeName = 'SURROUND';148 break;149 case "03":150 ListeningModeName = 'FILM';151 break;152 case "04":153 ListeningModeName = 'THX';154 break; 155 case "05":156 ListeningModeName = 'ACTION';157 break;158 case "06":159 ListeningModeName = 'MUSICAL';160 break;161 case "07":162 ListeningModeName = 'MONO MOVIE';163 break;164 case "08":165 ListeningModeName = 'ORCHESTRA';166 break;167 case "09":168 ListeningModeName = 'UNPLUGGED';169 break;170 case "0A":171 ListeningModeName = 'STUDIO-MIX';172 break;173 case "0B":174 ListeningModeName = 'TV LOGIC';175 break;176 case "0C":177 ListeningModeName = 'ALL CH STEREO';178 break;179 case "0D":180 ListeningModeName = 'THEATER-DIMENSIONAL';181 break;182 case "0E":183 ListeningModeName = 'ENHANCE';184 break;185 case "0F":186 ListeningModeName = 'MONO';187 break;188 case "11":189 ListeningModeName = 'PURE AUDIO';190 break;191 case "12":192 ListeningModeName = 'MULTIPLEX';193 break;194 case "13":195 ListeningModeName = 'FULL MONO';196 break;197 case "14":198 ListeningModeName = 'DOLBY VIRTUAL';199 break;200 case "40":201 ListeningModeName = 'SURROUND';202 break;203 case "41":204 ListeningModeName = 'DOLBY';205 break;206 case "42":207 ListeningModeName = 'THX CINEMA';208 break;209 case "43":210 ListeningModeName = 'THX SURROUND';211 break;212 case "50":213 ListeningModeName = 'Cinema';214 break;215 case "51":216 ListeningModeName = 'MusicMode';217 break;218 case "52":219 ListeningModeName = 'Games Mode';220 break;221 case "80":222 ListeningModeName = 'PLII Movie';223 break;224 case "81":225 ListeningModeName = 'PLII Music';226 break;227 case "82":228 ListeningModeName = 'Neo:6 Cinema';229 break;230 case "83":231 ListeningModeName = 'Neo:6 Music';232 break;233 case "84":234 ListeningModeName = 'PLII THX Cinema';235 break;236 case "85":237 ListeningModeName = 'Neo:6 THX Cinema';238 break;239 case "86":240 ListeningModeName = 'PLII Game';241 break;242 case "87":243 ListeningModeName = 'Neural Surr';244 break;245 case "88":246 ListeningModeName = 'Neural THX';247 break;248 case "89":249 ListeningModeName = 'PLII THX Games';250 break;251 case "8A":252 ListeningModeName = 'Neo:6 THX Games';253 break; 254 };255 that.device.SetFeedback("Listening zone 1", ListeningModeName);256 break;257 case '2':258 switch(id)259 {260 case "00":261 ListeningModeName = 'STEREO';262 break;263 case "01":264 ListeningModeName = 'DIRECT';265 break;266 case "0F":267 ListeningModeName = 'MONO';268 break;269 case "12":270 ListeningModeName = 'MULTIPLEX';271 break;272 case "87":273 ListeningModeName = 'DVS(PI2)';274 break;275 case "88":276 ListeningModeName = 'DVS(NEO6)';277 break;278 }279 that.device.SetFeedback("Listening zone 2", ListeningModeName);280 break; 281 };282 };283 284 msg = AudioselectorRegex.exec(FinishStr);285 if(msg != null)286 {287 var id = msg[2].slice(0, msg[2].length - 1);288 var AudioSelectorName = 'NaN';289 switch(id)290 {291 case "00":292 AudioSelectorName = 'AUTO';293 break;294 case "01":295 AudioSelectorName = 'MULTI-CHANNEL';296 break;297 case "02":298 AudioSelectorName = 'ANALOG';299 break;300 case "03":301 AudioSelectorName = 'iLINK';302 break;303 case "04":304 AudioSelectorName = 'HDMI';305 break; 306 };307 that.device.SetFeedback("Audio zone", AudioSelectorName); 308 };309 310 msg = playnowRegex.exec(FinishStr);311 if(msg != null)312 {313 switch(msg[1])314 {315 316 case "NTM":317 IR.Log("!!!! = "+ msg[2]);318 break;319 case "NAT":320 IR.Log("!!!! = "+ msg[2]);321 break;322 case "NAL":323 IR.Log("!!!! = "+ msg[2]);324 break;325 case "NTI":326 IR.Log("!!!! = "+ msg[2]);327 break;328 329 };330 331 };332 333 msg = powRegex.exec(FinishStr);334 if(msg != null)335 {336 var PowerStatus;337 if (/00/.test(msg[2]))338 {339 PowerStatus = '0';340 } else if (/01/.test(msg[2]))341 {342 PowerStatus = '1';343 }344 switch(msg[1])345 { 346 case "PWR":347 that.device.SetFeedback("Power", PowerStatus);348 //IR.Log("Main Zone Power = "+ msg[2]);349 break;350 case "ZPW":351 that.device.SetFeedback("Power z2", PowerStatus);352 //IR.Log("Second Zone Power = "+ PowerStatus);353 break;354 case "PW3":355 that.device.SetFeedback("Power z3", PowerStatus);356 //IR.Log("Third Zone Power = "+ msg[2]);357 break; 358 };359 powRegex.lastIndex = 0;360 };361 362 msg = muteRegex.exec(FinishStr);363 if(msg != null)364 { 365 var MuteStatus;366 if (/00/.test(msg[2]))367 {368 MuteStatus = '0';369 } else if (/01/.test(msg[2]))370 {371 MuteStatus = '1';372 }373 switch(msg[1])374 { 375 case "AMT":376 that.device.SetFeedback("Mute", MuteStatus);377 //IR.Log("Main Zone Mute = "+ MuteStatus);378 break;379 case "ZMT":380 that.device.SetFeedback("Mute z2", MuteStatus);381 //IR.Log("Second Zone Mute = "+ MuteStatus);382 break;383 case "MT3":384 that.device.SetFeedback("Mute z3", MuteStatus);385 //IR.Log("Third Zone Mute = "+ MuteStatus);386 break; 387 };388 muteRegex.lastIndex = 0;389 };390 391 msg = volRegex.exec(FinishStr);392 if(msg != null)393 { 394 if (/N\/A/.test(msg[2])) 395 msg[2] = 0;396 switch(msg[1])397 { 398 case "MVL":399 //var Volume = parseInt(msg[2],16);400 var Volume = parseInt(msg[2],16);401 if (Volume == 'Nan') {return}402 that.device.SetFeedback("Volume", Volume);403 IR.Log("Main Zone Volume = "+ Volume);404 //var Aux = (parseInt(msg[2],16)/100)*65535;405 //IR.Log("Main Zone Aux = "+ Aux);406 break;407 408 case "ZVL":409 //var Volume = parseInt(msg[2],16);410 var Volume = parseInt(msg[2],16);411 if (Volume == 'Nan') {return} 412 that.device.SetFeedback("Volume z2", Volume);413 IR.Log("Second Zone Volume = "+ Volume);414 //var Aux = (parseInt(msg[2],16)/100)*65535;415 //IR.Log("Second Zone Aux = "+ Aux);416 break;417 418 case "VL3":419 var Volume = parseInt(msg[2],16); 420 if (Volume == 'Nan') {return} 421 that.device.SetFeedback("Volume z3", Volume);422 //IR.Log("Third Zone Volume = "+ Volume);423 break;424 425 };426 volRegex.lastIndex = 0;427 }428 429 msg = tunerRegex.exec(FinishStr);430 if(msg != null)431 {432 switch(msg[1])433 { 434 case "TUN":435 var Aux = parseFloat(msg[2]);436 if (Aux >= 1000) 437 Aux = (Aux/100).toFixed(1);438 IR.Log("TUN = " + Aux);439 break;440 441 case "TUZ":442 var Aux = parseFloat(msg[2]);443 if (Aux >= 1000) 444 Aux = (Aux/100).toFixed(1);445 IR.Log("TUZ = " + Aux);446 break;447 448 };449 tunerRegex.lastIndex = 0; 450 } 451 452 msg = selectorRegex.exec(FinishStr);453 if(msg != null)454 {455 if(msg[1] == "SLI")456 {457 var Input;458 switch(parseInt(msg[2]))459 {460 case 00:461 Input = "Video 1";462 break;463 case 01:464 Input = "Video 2";465 break;466 case 02:467 Input = "Video 3";468 break;469 case 03:470 Input = "Video 4";471 break;472 case 04:473 Input = "Video 5";474 break;475 case 05:476 Input = "Video 6";477 break;478 case 06:479 Input = "Video 7";480 break;481 case 10:482 Input = "DVD";483 break;484 case 20:485 Input = "Tape 1";486 break;487 case 21:488 Input = "Tape 2";489 break;490 case 22:491 Input = "Phono";492 break;493 case 23:494 Input = "CD";495 break;496 case 24:497 Input = "FM";498 break;499 case 25:500 Input = "AM";501 break;502 case 26:503 Input = "Tuner";504 break;505 case 27:506 Input = "Music Server";507 break;508 case 28:509 Input = "Net Radio";510 break;511 case 29:512 Input = "USB";513 break;514 case 30:515 Input = "Multi CH";516 break;517 case 31:518 Input = "XM";519 break;520 521 };522 523 that.device.SetFeedback("Input zone 1", Input);524 525 //IR.Log("Main Zone Input = " + Input); 526 }527 if(msg[1] == "SLZ")528 { 529 switch(parseInt(msg[2])){530 531 case 00:532 Input = "Video 1";533 break;534 case 01:535 Input = "Video 2";536 break;537 case 02:538 Input = "Video 3";539 break;540 case 03:541 Input = "Video 4";542 break;543 case 04:544 Input = "Video 5";545 break;546 case 05:547 Input = "Video 6";548 break;549 case 06:550 Input = "Video 7";551 break;552 case 10:553 Input = "DVD";554 break;555 case 20:556 Input = "Tape 1";557 break;558 case 21:559 Input = "Tape 2";560 break;561 case 22:562 Input = "Phono";563 break;564 case 23:565 Input = "CD";566 break;567 case 24:568 Input = "FM";569 break;570 case 25:571 Input = "AM";572 break;573 case 26:574 Input = "Tuner";575 break;576 case 27:577 Input = "Music Server";578 break;579 case 28:580 Input = "Net Radio";581 break;582 case 29:583 Input = "IPod";584 break;585 case 30:586 Input = "Multi CH";587 break;588 case 31:589 Input = "XM";590 break; 591 };592 that.device.SetFeedback("Input zone 2", Input);593 //IR.Log("Second zone input: " + Input); 594 } 595 if(msg[1] == "SL3")596 { 597 switch(parseInt(msg[2]))598 { 599 case 00:600 Input = "Video 1";601 break;602 case 01:603 Input = "Video 2";604 break;605 case 02:606 Input = "Game\TV";607 break;608 case 03:609 Input = "Video 4";610 break;611 case 04:612 Input = "Video 5";613 break;614 case 05:615 Input = "Video 6";616 break;617 case 06:618 Input = "Video 7";619 break;620 case 10:621 Input = "DVD";622 break;623 case 20:624 Input = "Tape 1";625 break;626 case 21:627 Input = "Tape 2";628 break;629 case 22:630 Input = "Phono";631 break;632 case 23:633 Input = "CD";634 break;635 case 24:636 Input = "FM";637 break;638 case 25:639 Input = "AM";640 break;641 case 26:642 Input = "Tuner";643 break;644 case 27:645 Input = "Music Server";646 break;647 case 28:648 Input = "Net Radio";649 break;650 case 29:651 Input = "USB";652 break;653 case 30:654 Input = "Multi CH";655 break;656 case 31:657 Input = "XM";658 break;659 660 };661 that.device.SetFeedback("Input zone 3", Input);662 //IR.Log("Third zone input: " + Input); 663 } 664 selectorRegex.lastIndex = 0;665 666 }; 667//----------------------------------------------------------------------------------------- 668 }); 669 670 function SendPacket(cmd)671 {672 IR.Log("!!! = "+ cmd);673 var len = cmd.length + 3;674 //IR.Log("len = "+ len)675 that.device.Send(['ISCP', 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, len, 0x01, 0x00, 0x00, 0x00, cmd, 0x0D]);676 };677 678 function CreatePacket(curzone, cmd, vallvl)679 {680 IR.Log(curzone + ' ' + cmd +' '+ vallvl);681 682 var packet = '!1';683 curzone = curzone + '';684 switch (cmd)685 {686 case 'POWER OFF':687 switch (curzone)688 {689 case '1': 690 packet += 'PWR00';691 break;692 case '2': 693 packet += 'ZPW00';694 break;695 case '3': 696 packet += 'PW300';697 break;698 } 699 break;700 case 'POWER ON': 701 switch (curzone)702 {703 case '1': 704 packet += 'PWR01';705 break;706 case '2': 707 packet += 'ZPW01';708 break;709 case '3': 710 packet += 'PW301';711 break;712 }713 break;714 case 'MUTE OFF': 715 switch (curzone)716 {717 case '1': 718 packet += 'AMT00';719 break;720 case '2': 721 packet += 'ZMT00';722 break;723 case '3': 724 packet += 'MT300';725 break;726 } 727 break;728 case 'MUTE ON': 729 switch (curzone)730 {731 case '1': 732 packet += 'AMT01';733 break;734 case '2': 735 packet += 'ZMT01';736 break;737 case '3': 738 packet += 'MT301';739 break;740 } 741 break;742 743 case 'MUTE SWITCH': 744 switch (curzone) 745 { 746 case '1': 747 if(that.device.GetFeedback("Mute") == 0) 748 packet += 'AMT01'; 749 else 750 packet += 'AMT00'; 751 break; 752 753 case '2': 754 if(that.device.GetFeedback("Mute z2") == 0) 755 packet += 'ZMT01'; 756 else 757 packet += 'ZMT00'; 758 break; 759 760 case '3': 761 if(that.device.GetFeedback("Mute z3") == 0) 762 packet += 'MT301'; 763 else 764 packet += 'MT300'; 765 break; 766 } 767 break;768 769 case 'VOLUME 0-100': 770 771 var data = "";772 if (parseInt(vallvl) < 16) {773 data = "0" + vallvl.toString(16);774 } else {775 data = vallvl.toString(16); 776 } 777 778 switch (curzone)779 {780 case '1': 781 //IR.Log("!!!!!!!!!!!!!!!!" + typeof(vallvl));782 //IR.Log(vallvl);783 //IR.Log(parseInt(vallvl,16));784 packet += 'MVL'+ data;785 break;786 case '2': 787 packet += 'ZVL'+ data;788 break;789 case '3': 790 packet += 'VL3'+ data;791 break;792 } 793 break;794 case 'VOLUME UP': 795 switch (curzone)796 {797 case '1': 798 packet += 'MVLUP';799 break;800 case '2': 801 packet += 'ZVLUP';802 break;803 case '3': 804 packet += 'VL3UP';805 break;806 }807 break; 808 case 'VOLUME DOWN': 809 switch (curzone)810 {811 case '1': 812 packet += 'MVLDOWN';813 break;814 case '2': 815 packet += 'ZVLDOWN';816 break;817 case '3': 818 packet += 'VL3DOWN';819 break;820 }821 break;822 case 'SETUP OPERATION MENU': 823 switch (curzone)824 {825 case '1': 826 packet += 'OSDMENU';827 break;828 } 829 break;830 case 'SETUP OPERATION UP': 831 switch (curzone)832 {833 case '1': 834 packet += 'OSDUP';835 break;836 }837 break;838 case 'SETUP OPERATION DOWN': 839 switch (curzone)840 {841 case '1': 842 packet += 'OSDDOWN';843 break;844 } 845 break;846 case 'SETUP OPERATION RIGHT': 847 switch (curzone)848 {849 case '1': 850 packet += 'OSDRIGHT';851 break;852 }; 853 break;854 case 'SETUP OPERATION LEFT': 855 switch (curzone)856 {857 case '1': 858 packet += 'OSDLEFT';859 break;860 } 861 break;862 case 'SETUP OPERATION ENTER': 863 switch (curzone)864 {865 case '1': 866 packet += 'OSDENTER';867 break;868 } 869 break;870 case 'SETUP OPERATION EXIT': 871 switch (curzone)872 {873 case '1': 874 packet += 'OSDEXIT';875 break;876 } 877 break; case 'INPUT SELECTION VCR/DVR': 878 switch (curzone)879 {880 case '1': 881 packet += 'SLI00';882 break;883 case '2': 884 packet += 'SLZ00';885 break;886 case '3': 887 packet += 'SL300';888 break;889 }890 break;891 case 'INPUT SELECTION CBL/SAT': 892 switch (curzone)893 {894 case '1': 895 packet += 'SLI01';896 break;897 case '2': 898 packet += 'SLZ01';899 break;900 case '3': 901 packet += 'SL301';902 break;903 }904 break;905 case 'INPUT SELECTION GAME/TV': 906 switch (curzone)907 {908 case '1': 909 packet += 'SLI02';910 break;911 case '2': 912 packet += 'SLZ02';913 break;914 case '3': 915 packet += 'SL302';916 break;917 }918 break;919 case 'INPUT SELECTION AUX1(AUX)': 920 switch (curzone)921 {922 case '1': 923 packet += 'SLI03';924 break;925 case '2': 926 packet += 'SLZ03';927 break;928 case '3': 929 packet += 'SL303';930 break;931 }932 break;933 case 'INPUT SELECTION AUX2': 934 switch (curzone)935 {936 case '1': 937 packet += 'SLI04';938 break;939 case '2': 940 packet += 'SLZ04';941 break;942 case '3': 943 packet += 'SL304';944 break;945 } 946 break;947 case 'INPUT SELECTION VIDEO6': 948 switch (curzone)949 {950 case '1': 951 packet += 'SLI05';952 break;953 case '2': 954 packet += 'SLZ05';955 break;956 case '3': 957 packet += 'SL305';958 break;959 } 960 break;961 case 'INPUT SELECTION VIDEO7': 962 switch (curzone)963 {964 case '1': 965 packet += 'SLI06';966 break;967 case '2': 968 packet += 'SLZ06';969 break;970 case '3': 971 packet += 'SL306';972 break;973 } 974 break; 975 case 'INPUT SELECTION DVD': 976 switch (curzone)977 {978 case '1': 979 packet += 'SLI10';980 break;981 case '2': 982 packet += 'SLZ10';983 break;984 case '3': 985 packet += 'SL310';986 break;987 } 988 break; 989 case 'INPUT SELECTION TAPE(1)': 990 switch (curzone)991 {992 case '1': 993 packet += 'SLI20';994 break;995 case '2': 996 packet += 'SLZ20';997 break;998 case '3': 999 packet += 'SL320';1000 break;1001 } 1002 break; 1003 case 'INPUT SELECTION TAPE2': 1004 switch (curzone)1005 {1006 case '1': 1007 packet += 'SLI21';1008 break;1009 case '2': 1010 packet += 'SLZ21';1011 break;1012 case '3': 1013 packet += 'SL321';1014 break;1015 } 1016 break;1017 case 'INPUT SELECTION PHONO': 1018 switch (curzone)1019 {1020 case '1': 1021 packet += 'SLI22';1022 break;1023 case '2': 1024 packet += 'SLZ22';1025 break;1026 case '3': 1027 packet += 'SL322';1028 break;1029 }1030 break; 1031 case 'INPUT SELECTION CD': 1032 switch (curzone)1033 {1034 case '1': 1035 packet += 'SLI23';1036 break;1037 case '2': 1038 packet += 'SLZ23';1039 break;1040 case '3': 1041 packet += 'SL323';1042 break;1043 } 1044 break;1045 case 'INPUT SELECTION FM': 1046 switch (curzone)1047 {1048 case '1': 1049 packet += 'SLI24';1050 break;1051 case '2': 1052 packet += 'SLZ24';1053 break;1054 case '3': 1055 packet += 'SL324';1056 break;1057 } 1058 break;1059 case 'INPUT SELECTION AM': 1060 switch (curzone)1061 {1062 case '1': 1063 packet += 'SLI25';1064 break;1065 case '2': 1066 packet += 'SLZ25';1067 break;1068 case '3': 1069 packet += 'SL325';1070 break;1071 }1072 break;1073 case 'INPUT SELECTION TUNER': 1074 switch (curzone)1075 {1076 case '1': 1077 packet += 'SLI26';1078 break;1079 case '2': 1080 packet += 'SLI26';1081 break;1082 case '3': 1083 packet += 'SL326';1084 break;1085 } 1086 break;1087 case 'INPUT SELECTION MUSIC SERVER': 1088 switch (curzone)1089 {1090 case '1': 1091 packet += 'SLI27';1092 break;1093 case '2': 1094 packet += 'SLZ27';1095 break;1096 case '3': 1097 packet += 'SL327';1098 break;1099 }1100 break;1101 case 'INPUT SELECTION INTERNET RADIO': 1102 switch (curzone)1103 {1104 case '1': 1105 packet += 'SLI28';1106 break;1107 case '2': 1108 packet += 'SLZ28';1109 break;1110 case '3': 1111 packet += 'SL328';1112 break;1113 }1114 break;1115 case 'INPUT SELECTION USB': 1116 switch (curzone)1117 {1118 case '1': 1119 packet += 'SLI29';1120 break;1121 case '2': 1122 packet += 'SLZ29';1123 break;1124 case '3': 1125 packet += 'SL329';1126 break;1127 }1128 break;1129 case 'INPUT SELECTION MULTI CH': 1130 switch (curzone)1131 {1132 case '1': 1133 packet += 'SLI30';1134 break;1135 case '2': 1136 packet += 'SLZ30';1137 break;1138 case '3': 1139 packet += 'SL330';1140 break;1141 } 1142 break;1143 case 'INPUT SELECTION XM*1': 1144 switch (curzone)1145 {1146 case '1': 1147 packet += 'SLI31';1148 break;1149 case '2': 1150 packet += 'SLZ31';1151 break;1152 case '3': 1153 packet += 'SL331';1154 break;1155 } 1156 break;1157 case 'INPUT SELECTION SIRIUS*1': 1158 switch (curzone)1159 {1160 case '1': 1161 packet += 'SLI32';1162 break;1163 case '2': 1164 packet += 'SLZ32';1165 break;1166 case '3': 1167 packet += 'SL332';1168 break;1169 } 1170 break;1171 case 'INPUT SELECTION UP': 1172 switch (curzone)1173 {1174 case '1': 1175 packet += 'SLIUP';1176 break;1177 case '2': 1178 packet += 'SLZUP';1179 break;1180 case '3': 1181 packet += 'SL3UP';1182 break;1183 }1184 break;1185 case 'INPUT SELECTION DOWN': 1186 switch (curzone)1187 {1188 case '1': 1189 packet += 'SLIDOWN';1190 break;1191 case '2': 1192 packet += 'SLZDOWN';1193 break;1194 case '3': 1195 packet += 'SL3DOWN';1196 break;1197 } 1198 break;1199 case 'RECOUT SELECTOR VIDEO1': 1200 switch (curzone)1201 {1202 case '1': 1203 packet += 'SLR00';1204 break;1205 } 1206 break;1207 case 'RECOUT SELECTOR VIDEO2': 1208 switch (curzone)1209 {1210 case '1': 1211 packet += 'SLR01';1212 break;1213 } 1214 break;1215 case 'RECOUT SELECTOR VIDEO3': 1216 switch (curzone)1217 {1218 case '1': 1219 packet += 'SLR02';1220 break;1221 }1222 break;1223 case 'RECOUT SELECTOR VIDEO4': 1224 switch (curzone)1225 {1226 case '1': 1227 packet += 'SLR03';1228 break;1229 } 1230 break;1231 case 'RECOUT SELECTOR VIDEO5': 1232 switch (curzone)1233 {1234 case '1': 1235 packet += 'SLR04';1236 break;1237 } 1238 break;1239 case 'RECOUT SELECTOR VIDEO6': 1240 switch (curzone)1241 {1242 case '1': 1243 packet += 'SLR05';1244 break;1245 } 1246 break;1247 case 'RECOUT SELECTOR VIDEO7': 1248 switch (curzone)1249 {1250 case '1': 1251 packet += 'SLR06';1252 break;1253 }1254 break;1255 case 'RECOUT SELECTOR DVD': 1256 switch (curzone)1257 {1258 case '1': 1259 packet += 'SLR10';1260 break;1261 } 1262 break;1263 case 'RECOUT SELECTOR TAPE(1)': 1264 switch (curzone)1265 {1266 case '1': 1267 packet += 'SLR20';1268 break;1269 }1270 break;1271 case 'RECOUT SELECTOR TAPE2': 1272 switch (curzone)1273 {1274 case '1': 1275 packet += 'SLR21';1276 break;1277 } 1278 break;1279 case 'RECOUT SELECTOR PHONO': 1280 switch (curzone)1281 {1282 case '1': 1283 packet += 'SLR22';1284 break;1285 } 1286 break;1287 case 'RECOUT SELECTOR CD': 1288 switch (curzone)1289 {1290 case '1': 1291 packet += 'SLR23';1292 break;1293 } 1294 break;1295 case 'RECOUT SELECTOR FM': 1296 switch (curzone)1297 {1298 case '1': 1299 packet += 'SLR24';1300 break;1301 } 1302 break;1303 case 'RECOUT SELECTOR AM': 1304 switch (curzone)1305 {1306 case '1': 1307 packet += 'SLR25';1308 break;1309 } 1310 break;1311 case 'RECOUT SELECTOR TUNER': 1312 switch (curzone)1313 {1314 case '1': 1315 packet += 'SLR26';1316 break;1317 } 1318 break;1319 case 'RECOUT SELECTOR MUSIC SERVER': 1320 switch (curzone)1321 {1322 case '1': 1323 packet += 'SLR27';1324 break;1325 }1326 break;1327 case 'RECOUT SELECTOR INTERNET RADIO': 1328 switch (curzone)1329 {1330 case '1': 1331 packet += 'SLR28';1332 break;1333 } 1334 break;1335 case 'RECOUT SELECTOR MULTI CH': 1336 switch (curzone)1337 {1338 case '1': 1339 packet += 'SLR30';1340 break;1341 } 1342 break;1343 case 'RECOUT SELECTOR XM': 1344 switch (curzone)1345 {1346 case '1': 1347 packet += 'SLR31';1348 break;1349 } 1350 break;1351 case 'RECOUT SELECTOR OFF': 1352 switch (curzone)1353 {1354 case '1': 1355 packet += 'SLR7F';1356 break;1357 } 1358 break;1359 case 'RECOUT SELECTOR SOURCE': 1360 switch (curzone)1361 {1362 case '1': 1363 packet += 'SLR80';1364 break;1365 }1366 break;1367 case 'AUDIO SELECTOR AUTO': 1368 switch (curzone)1369 {1370 case '1': 1371 packet += 'SLA00';1372 break;1373 } 1374 break;1375 case 'AUDIO SELECTOR MULTI-CHANNEL': 1376 switch (curzone)1377 {1378 case '1': 1379 packet += 'SLA01';1380 break;1381 } 1382 break;1383 case 'AUDIO SELECTOR ANALOG': 1384 switch (curzone)1385 {1386 case '1': 1387 packet += 'SLA02';1388 break;1389 } 1390 break;1391 case 'AUDIO SELECTOR iLINK': 1392 switch (curzone)1393 {1394 case '1': 1395 packet += 'SLA03';1396 break;1397 } 1398 break;1399 case 'AUDIO SELECTOR HDMI': 1400 switch (curzone)1401 {1402 case '1': 1403 packet += 'SLA04';1404 break;1405 } 1406 break;1407 case 'AUDIO SELECTOR UP': 1408 switch (curzone)1409 {1410 case '1': 1411 packet += 'SLAUP';1412 break;1413 } 1414 break;1415 case 'LISTENING MODE STEREO': 1416 switch (curzone)1417 {1418 case '1': 1419 packet += 'LMD00';1420 break;1421 } 1422 break;1423 case 'LISTENING MODE DIRECT': 1424 switch (curzone)1425 {1426 case '1': 1427 packet += 'LMD01';1428 break;1429 } 1430 break;1431 case 'LISTENING MODE SURROUND': 1432 switch (curzone)1433 {1434 case '1': 1435 packet += 'LMD02';1436 break;1437 } 1438 break;1439 case 'LISTENING MODE FILM': 1440 switch (curzone)1441 {1442 case '1': 1443 packet += 'LMD03';1444 break;1445 } 1446 break;1447 case 'LISTENING MODE THX': 1448 switch (curzone)1449 {1450 case '1': 1451 packet += 'LMD04';1452 break;1453 } 1454 break;1455 case 'LISTENING MODE ACTION': 1456 switch (curzone)1457 {1458 case '1': 1459 packet += 'LMD05';1460 break;1461 } 1462 break;1463 case 'LISTENING MODE MUSICAL': 1464 switch (curzone)1465 {1466 case '1': 1467 packet += 'LMD06';1468 break;1469 } 1470 break;1471 case 'LISTENING MODE MONO MOVIE': 1472 switch (curzone)1473 {1474 case '1': 1475 packet += 'LMD07';1476 break;1477 } 1478 break;1479 case 'LISTENING MODE ORCHESTRA': 1480 switch (curzone)1481 {1482 case '1': 1483 packet += 'LMD08';1484 break;1485 } 1486 break;1487 case 'LISTENING MODE UNPLUGGED': 1488 switch (curzone)1489 {1490 case '1': 1491 packet += 'LMD09';1492 break;1493 } 1494 break;1495 case 'LISTENING MODE STUDIO-MIX': 1496 switch (curzone)1497 {1498 case '1': 1499 packet += 'LMD0A';1500 break;1501 } 1502 break;1503 case 'LISTENING MODE TV LOGIC': 1504 switch (curzone)1505 {1506 case '1': 1507 packet += 'LMD0B';1508 break;1509 } 1510 break;1511 case 'LISTENING MODE ALL CH STEREO': 1512 switch (curzone)1513 {1514 case '1': 1515 packet += 'LMD0C';1516 break;1517 } 1518 break;1519 case 'LISTENING MODE THEATER-DIMENSIONAL': 1520 switch (curzone)1521 {1522 case '1': 1523 packet += 'LMD0D';1524 break;1525 } 1526 break;1527 case 'LISTENING MODE ENHANCED 7/ENHANCE': 1528 switch (curzone)1529 {1530 case '1': 1531 packet += 'LMD0E';1532 break;1533 } 1534 break;1535 case 'LISTENING MODE MONO': 1536 switch (curzone)1537 {1538 case '1': 1539 packet += 'LMD0F';1540 break;1541 } 1542 break;1543 case 'LISTENING MODE PURE AUDIO': 1544 switch (curzone)1545 {1546 case '1': 1547 packet += 'LMD11';1548 break;1549 } 1550 break;1551 case 'LISTENING MODE MULTIPLEX': 1552 switch (curzone)1553 {1554 case '1': 1555 packet += 'LMD12';1556 break;1557 } 1558 break;1559 case 'LISTENING MODE FULL MONO': 1560 switch (curzone)1561 {1562 case '1': 1563 packet += 'LMD13';1564 break;1565 } 1566 break;1567 case 'LISTENING MODE DOLBY VIRTUAL': 1568 switch (curzone)1569 {1570 case '1': 1571 packet += 'LMD14';1572 break;1573 } 1574 break;1575 case 'LISTENING MODE 5,1CH SURROUND': 1576 switch (curzone)1577 {1578 case '1': 1579 packet += 'LMD40';1580 break;1581 } 1582 break;1583 case 'LISTENING MODE STRAIGHT DECODE*1': //FFFFUUUUUUU 1584 switch (curzone)1585 {1586 case '1': 1587 packet += 'LMD40';1588 break;1589 } 1590 break;1591 case 'LISTENING MODE DOLBY EX/DTS ES': 1592 switch (curzone)1593 {1594 case '1': 1595 packet += 'LMD41';1596 break;1597 } 1598 break;1599 case 'LISTENING MODE DOLBY EX*2': //FFFFUUUUUU 1600 switch (curzone)1601 {1602 case '1': 1603 packet += 'LMD41';1604 break;1605 } 1606 break;1607 case 'LISTENING MODE THX CINEMA': 1608 switch (curzone)1609 {1610 case '1': 1611 packet += 'LMD42';1612 break;1613 } 1614 break;1615 case 'LISTENING MODE THX SURROUND EX': 1616 switch (curzone)1617 {1618 case '1': 1619 packet += 'LMD43';1620 break;1621 } 1622 break;1623 case 'LISTENING MODE U2/S2 CINEMA/CINEMA2': 1624 switch (curzone)1625 {1626 case '1': 1627 packet += 'LMD50';1628 break;1629 } 1630 break;1631 case 'LISTENING MODE MUSIC MODE': 1632 switch (curzone)1633 {1634 case '1': 1635 packet += 'LMD51';1636 break;1637 } 1638 break;1639 case 'LISTENING MODE GAMES MODE': 1640 switch (curzone)1641 {1642 case '1': 1643 packet += 'LMD52';1644 break;1645 } 1646 break;1647 case 'LISTENING MODE PLII/PLIIx MOVIE': 1648 switch (curzone)1649 {1650 case '1': 1651 packet += 'LMD80';1652 break;1653 } 1654 break;1655 case 'LISTENING MODE PLII/PLIIx MUSIC': 1656 switch (curzone)1657 {1658 case '1': 1659 packet += 'LMD81';1660 break;1661 } 1662 break;1663 case 'LISTENING MODE NEO6 CINEMA': 1664 switch (curzone)1665 {1666 case '1': 1667 packet += 'LMD82';1668 break;1669 } 1670 break;1671 case 'LISTENING MODE NEO6 MUSIC': 1672 switch (curzone)1673 {1674 case '1': 1675 packet += 'LMD83';1676 break;1677 } 1678 break;1679 case 'LISTENING MODE PLII/PLIIx THX CINEMA': 1680 switch (curzone)1681 {1682 case '1': 1683 packet += 'LMD84';1684 break;1685 } 1686 break;1687 case 'LISTENING MODE NEO6 THX CINEMA': 1688 switch (curzone)1689 {1690 case '1': 1691 packet += 'LMD85';1692 break;1693 } 1694 break;1695 case 'LISTENING MODE PLII/PLIIx GAME': 1696 switch (curzone)1697 {1698 case '1': 1699 packet += 'LMD86';1700 break;1701 } 1702 break;1703 case 'LISTENING MODE NEUTRAL SURR*3': 1704 switch (curzone)1705 {1706 case '1': 1707 packet += 'LMD87';1708 break;1709 } 1710 break;1711 case 'LISTENING MODE NEUTRAL THX': 1712 switch (curzone)1713 {1714 case '1': 1715 packet += 'LMD88';1716 break;1717 } 1718 break;1719 case 'LISTENING MODE PLII THX GAMES': 1720 switch (curzone)1721 {1722 case '1': 1723 packet += 'LMD89';1724 break;1725 } 1726 break;1727 case 'LISTENING MODE NEO6 THX GAMES': 1728 switch (curzone)1729 {1730 case '1': 1731 packet += 'LMD8A';1732 break;1733 } 1734 break;1735 case 'LISTENING MODE UP': 1736 switch (curzone)1737 {1738 case '1': 1739 packet += 'LMDUP';1740 break;1741 } 1742 break;1743 case 'LISTENING MODE DOWN': 1744 switch (curzone)1745 {1746 case '1': 1747 packet += 'LMDDOWN';1748 break;1749 } 1750 break;1751 case 'TUNING COMMAND UP': 1752 switch (curzone)1753 {1754 case '1': 1755 packet += 'TUNUP';1756 break;1757 case '2': 1758 packet += 'TUNUP';1759 break;1760 case '3': 1761 packet += 'TUNUP';1762 break;1763 }1764 break;1765 case 'TUNING COMMAND DOWN': 1766 switch (curzone)1767 {1768 case '1': 1769 packet += 'TUNDOWN';1770 break;1771 case '2': 1772 packet += 'TUNDOWN';1773 break;1774 case '3': 1775 packet += 'TUNDOWN';1776 break;1777 } 1778 break;1779 case 'PRESET COMMAND 1-40': 1780 switch (curzone)1781 {1782 case '1': 1783 packet += 'PRS'+vallvl;1784 break;1785 case '2': 1786 packet += 'PRS'+vallvl;1787 break;1788 case '3': 1789 packet += 'PRS'+vallvl;1790 break;1791 } 1792 break;1793 case 'PRESENT COMMAND UP': 1794 switch (curzone)1795 {1796 case '1': 1797 packet += 'PRSUP';1798 break;1799 case '2': 1800 packet += 'PRSUP';1801 break;1802 case '3': 1803 packet += 'PRSUP';1804 break;1805 } 1806 break;1807 case 'PRESENT COMMAND DOWN': 1808 switch (curzone)1809 {1810 case '1': 1811 packet += 'PRSDOWN';1812 break;1813 case '2': 1814 packet += 'PRSDOWN';1815 break;1816 case '3': 1817 packet += 'PRSDOWN';1818 break;1819 } 1820 break;1821 }1822 SendPacket(packet);1823 };1824 1825 IR.AddListener(IR.EVENT_CHANNEL_SET,that.device,function(namecommand)1826 { 1827 IR.Log("!!!!!! = "+ namecommand);1828 // IR.Log(that.device.GetFeedback("Volume"))1829 var curzone = checkzone;1830 IR.Log("??? = "+ curzone);1831 var cmd = namecommand;1832 switch (namecommand)1833 {1834 case 'POWER OFF': 1835 value = 0;1836 CreatePacket(curzone, cmd, value); 1837 break;1838 case 'POWER ON': 1839 value = 0;1840 CreatePacket(curzone, cmd, value); 1841 break;1842 case 'MUTE OFF': 1843 value = 0;1844 CreatePacket(curzone, cmd, value); 1845 break;1846 case 'MUTE ON': 1847 value = 0;1848 CreatePacket(curzone, cmd, value); 1849 break; 1850 case 'MUTE SWITCH': 1851 value = 0;1852 CreatePacket(curzone, cmd, value); 1853 break; 1854 case 'VOLUME 0-100':1855 if (curzone == '1') 1856 { 1857 var vallvl = that.device.GetFeedback('Volume'); 1858 // IR.Log("VALUE = "+vallvl);1859 CreatePacket(curzone, cmd, vallvl); 1860 } else1861 if (curzone == '2')1862 {1863 var vallvl = that.device.GetFeedback('Volume z2');1864 //IR.Log("VALUE = "+vallvl); 1865 CreatePacket(curzone, cmd, vallvl); 1866 }else 1867 if (curzone == '3')1868 {1869 var vallvl = that.device.GetFeedback('Volume z3'); 1870 CreatePacket(curzone, cmd, vallvl); 1871 } 1872 break;1873 case 'VOLUME UP':1874 if (curzone == '1') 1875 { 1876 var vallvl = that.device.GetFeedback('Volume'); 1877 CreatePacket(curzone, cmd, vallvl); 1878 } else if (curzone == '2')1879 {1880 var vallvl = that.device.GetFeedback('Volume z2'); 1881 CreatePacket(curzone, cmd, vallvl); 1882 }else if (curzone == '3')1883 {1884 var vallvl = that.device.GetFeedback('Volume z3'); 1885 CreatePacket(curzone, cmd, vallvl); 1886 }1887 break;1888 case 'VOLUME DOWN': 1889 IR.Log("bygaga");1890 if (curzone == '1') 1891 { 1892 var vallvl = that.device.GetFeedback('Volume'); 1893 CreatePacket(curzone, cmd, vallvl); 1894 } else1895 if (curzone == '2')1896 {1897 var vallvl = that.device.GetFeedback('Volume z2');1898 CreatePacket(curzone, cmd, vallvl); 1899 }else 1900 if (curzone == '3')1901 {1902 var vallvl = that.device.GetFeedback('Volume z3'); 1903 CreatePacket(curzone, cmd, vallvl); 1904 }1905 break; 1906 case 'SETUP OPERATION MENU': 1907 value = 0;1908 CreatePacket(curzone, cmd, value); 1909 break;1910 case 'SETUP OPERATION UP': 1911 value = 0;1912 CreatePacket(curzone, cmd, value); 1913 break;1914 case 'SETUP OPERATION DOWN': 1915 value = 0;1916 CreatePacket(curzone, cmd, value); 1917 break;1918 case 'SETUP OPERATION RIGHT': 1919 value = 0;1920 CreatePacket(curzone, cmd, value); 1921 break;1922 case 'SETUP OPERATION LEFT': 1923 value = 0;1924 CreatePacket(curzone, cmd, value); 1925 break;1926 case 'SETUP OPERATION ENTER': 1927 value = 0;1928 CreatePacket(curzone, cmd, value); 1929 break;1930 case 'SETUP OPERATION EXIT': 1931 value = 0;1932 CreatePacket(curzone, cmd, value); 1933 break; 1934 case 'INPUT SELECTION VCR/DVR': 1935 value = 0;1936 CreatePacket(curzone, cmd, value); 1937 break;1938 case 'INPUT SELECTION CBL/SAT': 1939 value = 0;1940 CreatePacket(curzone, cmd, value); 1941 break; 1942 case 'INPUT SELECTION GAME/TV': 1943 value = 0;1944 CreatePacket(curzone, cmd, value); 1945 break;1946 case 'INPUT SELECTION AUX1(AUX)': 1947 value = 0;1948 CreatePacket(curzone, cmd, value); 1949 break;1950 case 'INPUT SELECTION AUX2': 1951 value = 0;1952 CreatePacket(curzone, cmd, value); 1953 break;1954 case 'INPUT SELECTION VIDEO6': 1955 value = 0;1956 CreatePacket(curzone, cmd, value); 1957 break;1958 case 'INPUT SELECTION VIDEO7': 1959 value = 0;1960 CreatePacket(curzone, cmd, value); 1961 break; 1962 case 'INPUT SELECTION DVD': 1963 value = 0;1964 CreatePacket(curzone, cmd, value); 1965 break; 1966 case 'INPUT SELECTION TAPE(1)': 1967 value = 0;1968 CreatePacket(curzone, cmd, value); 1969 break; 1970 case 'INPUT SELECTION TAPE2': 1971 value = 0;1972 CreatePacket(curzone, cmd, value); 1973 break;1974 case 'INPUT SELECTION PHONO': 1975 value = 0;1976 CreatePacket(curzone, cmd, value); 1977 break; 1978 case 'INPUT SELECTION CD': 1979 value = 0;1980 CreatePacket(curzone, cmd, value); 1981 break;1982 case 'INPUT SELECTION FM': 1983 value = 0;1984 CreatePacket(curzone, cmd, value); 1985 break;1986 case 'INPUT SELECTION AM': 1987 value = 0;1988 CreatePacket(curzone, cmd, value); 1989 break;1990 case 'INPUT SELECTION TUNER': 1991 value = 0;1992 CreatePacket(curzone, cmd, value); 1993 break;1994 case 'INPUT SELECTION MUSIC SERVER': 1995 value = 0;1996 CreatePacket(curzone, cmd, value); 1997 break;1998 case 'INPUT SELECTION INTERNET RADIO': 1999 value = 0;2000 CreatePacket(curzone, cmd, value); 2001 break;2002 case 'INPUT SELECTION USB': 2003 value = 0;2004 CreatePacket(curzone, cmd, value); 2005 break;2006 case 'INPUT SELECTION MULTI CH': 2007 value = 0;2008 CreatePacket(curzone, cmd, value); 2009 break;2010 case 'INPUT SELECTION XM*1': 2011 value = 0;2012 CreatePacket(curzone, cmd, value); 2013 break;2014 case 'INPUT SELECTION SIRIUS*1': 2015 value = 0;2016 CreatePacket(curzone, cmd, value); 2017 break;2018 case 'INPUT SELECTION UP': 2019 value = 0;2020 CreatePacket(curzone, cmd, value); 2021 break;2022 case 'INPUT SELECTION DOWN': 2023 value = 0;2024 CreatePacket(curzone, cmd, value); 2025 break;2026 case 'RECOUT SELECTOR VIDEO1': 2027 value = 0;2028 CreatePacket(curzone, cmd, value); 2029 break;2030 case 'RECOUT SELECTOR VIDEO2': 2031 value = 0;2032 CreatePacket(curzone, cmd, value); 2033 break;2034 case 'RECOUT SELECTOR VIDEO3': 2035 value = 0;2036 CreatePacket(curzone, cmd, value); 2037 break;2038 case 'RECOUT SELECTOR VIDEO4': 2039 value = 0;2040 CreatePacket(curzone, cmd, value); 2041 break;2042 case 'RECOUT SELECTOR VIDEO5': 2043 value = 0;2044 CreatePacket(curzone, cmd, value); 2045 break;2046 case 'RECOUT SELECTOR VIDEO6': 2047 value = 0;2048 CreatePacket(curzone, cmd, value); 2049 break;2050 case 'RECOUT SELECTOR VIDEO7': 2051 value = 0;2052 CreatePacket(curzone, cmd, value); 2053 break;2054 case 'RECOUT SELECTOR DVD': 2055 value = 0;2056 CreatePacket(curzone, cmd, value); 2057 break;2058 case 'RECOUT SELECTOR TAPE(1)': 2059 value = 0;2060 CreatePacket(curzone, cmd, value); 2061 break;2062 case 'RECOUT SELECTOR TAPE2': 2063 value = 0;2064 CreatePacket(curzone, cmd, value); 2065 break;2066 case 'RECOUT SELECTOR PHONO': 2067 value = 0;2068 CreatePacket(curzone, cmd, value); 2069 break;2070 case 'RECOUT SELECTOR CD': 2071 value = 0;2072 CreatePacket(curzone, cmd, value); 2073 break;2074 case 'RECOUT SELECTOR FM': 2075 value = 0;2076 CreatePacket(curzone, cmd, value); 2077 break;2078 case 'RECOUT SELECTOR AM': 2079 value = 0;2080 CreatePacket(curzone, cmd, value); 2081 break;2082 case 'RECOUT SELECTOR TUNER': 2083 value = 0;2084 CreatePacket(curzone, cmd, value); 2085 break;2086 case 'RECOUT SELECTOR MUSIC SERVER': 2087 value = 0;2088 CreatePacket(curzone, cmd, value); 2089 break;2090 case 'RECOUT SELECTOR INTERNET RADIO': 2091 value = 0;2092 CreatePacket(curzone, cmd, value); 2093 break;2094 case 'RECOUT SELECTOR MULTI CH': 2095 value = 0;2096 CreatePacket(curzone, cmd, value); 2097 break;2098 case 'RECOUT SELECTOR XM': 2099 value = 0;2100 CreatePacket(curzone, cmd, value); 2101 break;2102 case 'RECOUT SELECTOR OFF': 2103 value = 0;2104 CreatePacket(curzone, cmd, value); 2105 break;2106 case 'RECOUT SELECTOR SOURCE': 2107 value = 0;2108 CreatePacket(curzone, cmd, value); 2109 break;2110 case 'AUDIO SELECTOR AUTO': 2111 value = 0;2112 CreatePacket(curzone, cmd, value); 2113 break;2114 case 'AUDIO SELECTOR MULTI-CHANNEL': 2115 value = 0;2116 CreatePacket(curzone, cmd, value); 2117 break;2118 case 'AUDIO SELECTOR ANALOG': 2119 value = 0;2120 CreatePacket(curzone, cmd, value); 2121 break;2122 case 'AUDIO SELECTOR iLINK': 2123 value = 0;2124 CreatePacket(curzone, cmd, value); 2125 break;2126 case 'AUDIO SELECTOR HDMI': 2127 value = 0;2128 CreatePacket(curzone, cmd, value); 2129 break;2130 case 'AUDIO SELECTOR UP': 2131 value = 0;2132 CreatePacket(curzone, cmd, value); 2133 break;2134 case 'LISTENING MODE STEREO': 2135 value = 0;2136 CreatePacket(curzone, cmd, value); 2137 break;2138 case 'LISTENING MODE DIRECT': 2139 value = 0;2140 CreatePacket(curzone, cmd, value); 2141 break;2142 case 'LISTENING MODE SURROUND': 2143 value = 0;2144 CreatePacket(curzone, cmd, value); 2145 break;2146 case 'LISTENING MODE FILM': 2147 value = 0;2148 CreatePacket(curzone, cmd, value); 2149 break;2150 case 'LISTENING MODE THX': 2151 value = 0;2152 CreatePacket(curzone, cmd, value); 2153 break;2154 case 'LISTENING MODE ACTION': 2155 value = 0;2156 CreatePacket(curzone, cmd, value); 2157 break;2158 case 'LISTENING MODE MUSICAL': 2159 value = 0;2160 CreatePacket(curzone, cmd, value); 2161 break;2162 case 'LISTENING MODE MONO MOVIE': 2163 value = 0;2164 CreatePacket(curzone, cmd, value); 2165 break;2166 case 'LISTENING MODE ORCHESTRA': 2167 value = 0;2168 CreatePacket(curzone, cmd, value); 2169 break;2170 case 'LISTENING MODE UNPLUGGED': 2171 value = 0;2172 CreatePacket(curzone, cmd, value); 2173 break;2174 case 'LISTENING MODE STUDIO-MIX': 2175 value = 0;2176 CreatePacket(curzone, cmd, value); 2177 break;2178 case 'LISTENING MODE TV LOGIC': 2179 value = 0;2180 CreatePacket(curzone, cmd, value); 2181 break;2182 case 'LISTENING MODE ALL CH STEREO': 2183 value = 0;2184 CreatePacket(curzone, cmd, value); 2185 break;2186 case 'LISTENING MODE THEATER-DIMENSIONAL': 2187 value = 0;2188 CreatePacket(curzone, cmd, value); 2189 break;2190 case 'LISTENING MODE ENHANCED 7/ENHANCE': 2191 value = 0;2192 CreatePacket(curzone, cmd, value); 2193 break;2194 case 'LISTENING MODE MONO': 2195 value = 0;2196 CreatePacket(curzone, cmd, value); 2197 break;2198 case 'LISTENING MODE PURE AUDIO': 2199 value = 0;2200 CreatePacket(curzone, cmd, value); 2201 break;2202 case 'LISTENING MODE MULTIPLEX': 2203 value = 0;2204 CreatePacket(curzone, cmd, value); 2205 break;2206 case 'LISTENING MODE FULL MONO': 2207 value = 0;2208 CreatePacket(curzone, cmd, value); 2209 break;2210 case 'LISTENING MODE DOLBY VIRTUAL': 2211 value = 0;2212 CreatePacket(curzone, cmd, value); 2213 break;2214 case 'LISTENING MODE 5,1CH SURROUND': 2215 value = 0;2216 CreatePacket(curzone, cmd, value); 2217 break;2218 case 'LISTENING MODE STRAIGHT DECODE*1': 2219 value = 0;2220 CreatePacket(curzone, cmd, value); 2221 break;2222 case 'LISTENING MODE DOLBY EX/DTS ES': 2223 value = 0;2224 CreatePacket(curzone, cmd, value); 2225 break;2226 case 'LISTENING MODE DOLBY EX*2': 2227 value = 0;2228 CreatePacket(curzone, cmd, value); 2229 break;2230 case 'LISTENING MODE THX CINEMA': 2231 value = 0;2232 CreatePacket(curzone, cmd, value); 2233 break;2234 case 'LISTENING MODE THX SURROUND EX': 2235 value = 0;2236 CreatePacket(curzone, cmd, value); 2237 break;2238 case 'LISTENING MODE U2/S2 CINEMA/CINEMA2': 2239 value = 0;2240 CreatePacket(curzone, cmd, value); 2241 break;2242 case 'LISTENING MODE MUSIC MODE': 2243 value = 0;2244 CreatePacket(curzone, cmd, value); 2245 break;2246 case 'LISTENING MODE GAMES MODE': 2247 value = 0;2248 CreatePacket(curzone, cmd, value); 2249 break;2250 case 'LISTENING MODE PLII/PLIIx MOVIE': 2251 value = 0;2252 CreatePacket(curzone, cmd, value); 2253 break;2254 case 'LISTENING MODE PLII/PLIIx MUSIC': 2255 value = 0;2256 CreatePacket(curzone, cmd, value); 2257 break;2258 case 'LISTENING MODE NEO6 CINEMA': 2259 value = 0;2260 CreatePacket(curzone, cmd, value); 2261 break;2262 case 'LISTENING MODE NEO6 MUSIC': 2263 value = 0;2264 CreatePacket(curzone, cmd, value); 2265 break;2266 case 'LISTENING MODE PLII/PLIIx THX CINEMA': 2267 value = 0;2268 CreatePacket(curzone, cmd, value); 2269 break;2270 case 'LISTENING MODE NEO6 THX CINEMA': 2271 value = 0;2272 CreatePacket(curzone, cmd, value); 2273 break;2274 case 'LISTENING MODE PLII/PLIIx GAME': 2275 value = 0;2276 CreatePacket(curzone, cmd, value); 2277 break;2278 case 'LISTENING MODE NEUTRAL SURR*3': 2279 value = 0;2280 CreatePacket(curzone, cmd, value); 2281 break;2282 case 'LISTENING MODE NEUTRAL THX': 2283 value = 0;2284 CreatePacket(curzone, cmd, value); 2285 break;2286 case 'LISTENING MODE PLII THX GAMES': 2287 value = 0;2288 CreatePacket(curzone, cmd, value); 2289 break;2290 case 'LISTENING MODE NEO6 THX GAMES': 2291 value = 0;2292 CreatePacket(curzone, cmd, value); 2293 break;2294 case 'LISTENING MODE UP': 2295 value = 0;2296 CreatePacket(curzone, cmd, value); 2297 break;2298 case 'LISTENING MODE DOWN': 2299 value = 0;2300 CreatePacket(curzone, cmd, value); 2301 break;2302 case 'LISTENING MODE GAMES MODE': 2303 value = 0;2304 CreatePacket(curzone, cmd, value); 2305 break;2306 case 'TUNING COMMAND UP': 2307 value = 0;2308 CreatePacket(curzone, cmd, value); 2309 break;2310 case 'TUNING COMMAND DOWN': 2311 value = 0;2312 CreatePacket(curzone, cmd, value); 2313 break;2314 case 'PRESET COMMAND 1-40': 2315 if (curzone = '1') 2316 { 2317 IR.Log("valpr = " + that.device.GetFeedback('Preset')); 2318 var valpr = that.device.GetFeedback('Preset'); 2319 //CreatePacket(curzone, cmd, valpr); 2320 CreatePacket(curzone, cmd, valpr);2321 } else2322 if (curzone = '2')2323 {2324 var valpr = that.device.GetFeedback('Preset z2'); 2325 CreatePacket(curzone, cmd, valpr); 2326 }else 2327 if (curzone = '3')2328 {2329 var valpr = that.device.GetFeedback('Preset z3'); 2330 CreatePacket(curzone, cmd, valpr); 2331 } 2332 break;2333 case 'PRESENT COMMAND UP': 2334 value = 0;2335 CreatePacket(curzone, cmd, value); 2336 break;2337 case 'PRESENT COMMAND DOWN': 2338 value = 0;2339 CreatePacket(curzone, cmd, value); 2340 break;2341 case 'CD-R RECORDER POWER': 2342 value = 0;2343 CreatePacket(curzone, cmd, value); 2344 break;2345 case 'Select Zone 1': 2346 checkzone = '1';2347 break;2348 case 'Select Zone 2': 2349 checkzone = '2'; 2350 break;2351 case 'Select Zone 3': 2352 checkzone = '3'; 2353 break; 2354 } 2355 IR.Log("name = "+ namecommand);2356 });2357};2358var mydevice = new OnkyoDevice('Onkyo');2359// Buttons for navigate in the list2360function Onkyo_setto0()2361{2362 IR.GetItem("Onkyo_Main").GetItem("Item 1").SetPosition(0)2363} 2364function Onkyo_setto1()2365{2366 IR.GetItem("Onkyo_Main").GetItem("Item 1").SetPosition(1)2367}2368function Onkyo_setto2()2369{2370 IR.GetItem("Onkyo_Main").GetItem("Item 1").SetPosition(2)...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2var packet = wptools.createPacket();3packet.set('action', 'query');4packet.set('titles', 'Main Page');5packet.set('prop', 'revisions');6packet.set('rvprop', 'content');7packet.set('format', 'json');8packet.set('callback', 'myCallback');9packet.set('origin', '*');10packet.set('formatversion', 2);11packet.set('maxlag', 5);12packet.set('maxage', 0);13packet.set('smaxage', 0);14packet.set('assert', 'user');15packet.set('assert', 'bot');16packet.set('assert', 'anon');17packet.set('assert', 'sysop');18packet.set('assert', 'siteadmin');19packet.set('assert', 'assertuser');20packet.set('assert', 'assertbot');21packet.set('assert', 'assertanon');22packet.set('assert', 'assertsysop');23packet.set('assert', 'assertsiteadmin');24packet.set('assert', 'assertcontentmodel');25packet.set('assert', 'asserttitle');26packet.set('assert', 'assertedit');27packet.set('assert', 'assertedit-anon');28packet.set('assert', 'assertedit-user');29packet.set('assert', 'assertcreate');30packet.set('assert', 'assertmove');31packet.set('assert', 'assertdelete');32packet.set('assert', 'assertundelete');33packet.set('assert', 'assertprotect');34packet.set('assert', 'assertimport');35packet.set('assert', 'assertimport-upload');36packet.set('assert', 'assertupload');37packet.set('assert', 'assertpatrol');38packet.set('assert', 'assertpatrol-anon');39packet.set('assert', 'assertpatrol-user');40packet.set('assert', 'assertmerge');41packet.set('assert', 'assertemail');42packet.set('assert', 'assertemail-user');43packet.set('assert', 'assertemail-anon');44packet.set('assert', 'asserteditprotected');45packet.set('assert', 'asserteditprotected-anon');46packet.set('assert', 'asserteditprotected-user');47packet.set('assert', 'assertread');48packet.set('assert', 'assertread-anon');49packet.set('assert', 'assertread-user');50packet.set('assert', 'assertrollback');51packet.set('assert', 'assertrollback-anon');52packet.set('assert', 'assertrollback-user');53packet.set('assert

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org');3var options = {4};5var packet = wpt.createPacket(options);6console.log(packet);7{8}9var wpt = require('webpagetest');10var wpt = new WebPageTest('www.webpagetest.org');11var options = {12};13wpt.runTest(options, function(err, data) {14 if (err) return console.log(err);15 console.log(data);16});17{18 "data": {19 }20}

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2var wp = new wptools('nodejs');3wp.createPacket(function(err, packet) {4 if (err) {5 console.log(err);6 } else {7 console.log(packet);8 }9});10var wptools = require('wptools');11var wp = new wptools('nodejs');12wp.createPacket({format: 'json'}, function(err, packet) {13 if (err) {14 console.log(err);15 } else {16 console.log(packet);17 }18});19var wptools = require('wptools');20var wp = new wptools('nodejs');21wp.createPacket({format: 'xml'}, function(err, packet) {22 if (err) {23 console.log(err);24 } else {25 console.log(packet);26 }27});28var wptools = require('wptools');29var wp = new wptools('nodejs');30wp.createPacket({format: 'html'}, function(err, packet) {31 if (err) {32 console.log(err);33 } else {34 console.log(packet);35 }36});37var wptools = require('wptools');38var wp = new wptools('nodejs');39wp.createPacket({format: 'txt'}, function(err, packet) {40 if (err) {41 console.log(err);42 } else {43 console.log(packet);44 }45});46var wptools = require('wptools');47var wp = new wptools('nodejs');48wp.createPacket({format: 'wikitext'}, function(err, packet) {49 if (err) {50 console.log(err);51 } else {52 console.log(packet);53 }54});55var wptools = require('wptools');56var wp = new wptools('nodejs');57wp.createPacket({format: 'jsonfm'}, function

Full Screen

Using AI Code Generation

copy

Full Screen

1var packet = wpt.createPacket('test', 'test', 'test');2var xhr = new XMLHttpRequest();3xhr.send(packet);4console.log(xhr.responseText);5var packet = wpt.createPacket('test', 'test', 'test');6var xhr = new XMLHttpRequest();7xhr.send(packet);8console.log(xhr.responseText);

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful