-
Notifications
You must be signed in to change notification settings - Fork 14
/
onkyo.commands.js
401 lines (385 loc) · 8.72 KB
/
onkyo.commands.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
// Power
const POWER = {
ON: 'PWR01',
OFF: 'PWR00',
STATUS: 'PWRQSTN',
'Power ON': 'PWR01', // compatibility with <0.4.0
'Power OFF': 'PWR00', // compatibility with <0.4.0
'Power STATUS': 'PWRQSTN' // compatibility with <0.4.0
};
// Audio
const AUDIO =
{
Mute: 'AMT01',
MUTE: 'AMT01',
UnMute: 'AMT00',
UNMUTE: 'AMT00',
MuteQstn: 'AMTQSTN',
MUTE_QSTN: 'AMTQSTN',
'Volume Up': 'MVLUP',
VOL_UP: 'MVLUP',
'Volume Down': 'MVLDOWN',
VOL_DOWN: 'MVLDOWN',
'Volume Up1': 'MVLUP1',
VOL_UP1: 'MVLUP1',
'Volume Down1': 'MVLDOWN1',
VOL_DOWN1: 'MVLDOWN1',
Volume: 'MVLQSTN',
VOL_QSTN: 'MVLQSTN',
STATUS_VOL: 'MVLQSTN',
STATUS_MUTE: 'AMTQSTN',
CTL_UP: 'CTLUP',
'Center Up': 'CTLUP',
CTL_DOWN: 'CTLDOWN',
'Center Down': 'CTLDOWN',
CTL_QSTN: 'CTLQSTN',
STATUS_CTL: 'CTLQSTN'
};
// Cinema Filter
const CINEMA_FILTER =
{
OFF: 'RAS00',
ON: 'RAS01',
UP: 'RASUP',
STATUS: 'RASQSTN'
};
// Dimmer Level
const DIMMER =
{
BRIGHT: 'DIM00',
DIM: 'DIM01',
DARK: 'DIM02',
SHUT_OFF: 'DIM03',
BRIGHT_LED_OFF: 'DIM08',
STATUS: 'DIMQSTN'
};
// Source Select
const SOURCE_SELECT =
{
VIDEO1: 'SLI00',
VIDEO2: 'SLI01',
'CBL/SAT': 'SLI01',
GAME: 'SLI02',
AUX: 'SLI03',
VIDEO5: 'SLI04',
PC: 'SLI05',
VIDEO6: 'SLI05',
VIDEO7: 'SLI06',
'BD/DVD': 'SLI10',
STREAM: 'SLI11',
TV: 'SLI12',
TAPE1: 'SLI20',
TAPE2: 'SLI21',
PHONO: 'SLI22',
CD: 'SLI23',
FM: 'SLI24',
AM: 'SLI25',
TUNER: 'SLI26',
MUSICSERVER: 'SLI27',
INTERNETRADIO: 'SLI28',
USB: 'SLI29',
USB_REAR: 'SLI2A',
USB_C: 'SLI2C',
AIRPLAY: 'SLI2D',
BT: 'SLI2E',
MULTICH: 'SLI30',
XM: 'SLI31',
SIRIUS: 'SLI32',
NET: 'SLI2B',
'Selector Position Wrap-Around Up': 'SLIUP',
'Selector Position Wrap-Around Down': 'SLIDOWN',
STATUS: 'SLIQSTN'
};
// Speaker AB Control
const SPEAKER_AB_CONTROL =
{
A_OFF: 'SPA00',
A_ON: 'SPA01',
B_OFF: 'SPB00',
B_ON: 'SPB01',
'Speaker A Off': 'SPA00', // compatibility with < 0.4.0
'Speaker A On': 'SPA01', // compatibility with < 0.4.0
'Speaker B Off': 'SPB00', // compatibility with < 0.4.0
'Speaker B On': 'SPB01', // compatibility with < 0.4.0
STATUS_A: 'SPAQSTN',
STATUS_B: 'SPBQSTN'
};
// Sound modes
const SOUND_MODE =
{
STEREO: 'LMD00',
DIRECT: 'LMD01',
SURROUND: 'LMD02',
FILM: 'LMD03',
THX: 'LMD04',
ACTION: 'LMD05',
MUSICAL: 'LMD06',
'MONO MOVIE': 'LMD07',
ORCHESTRA: 'LMD08',
UNPLUGGED: 'LMD09',
'STUDIO-MIX': 'LMD0A',
'TV LOGIC': 'LMD0B',
'ALL CH STEREO': 'LMD0C',
'THEATER-DIMENSIONAL': 'LMD0D',
'ENHANCED 7/ENHANCE': 'LMD0E',
MONO: 'LMD0F',
'PURE AUDIO': 'LMD11',
MULTIPLEX: 'LMD12',
'FULL MONO': 'LMD13',
'DOLBY VIRTUAL': 'LMD14',
'5.1ch Surround': 'LMD40',
'Straight Decode*1': 'LMD40',
'Dolby EX/DTS ES': 'LMD41',
'Dolby EX*2': 'LMD41',
'THX Cinema': 'LMD42',
'THX Surround EX': 'LMD43',
'U2/S2 Cinema/Cinema2': 'LMD50',
MusicMode: 'LMD51',
'Games Mode': 'LMD52',
'PLII/PLIIx Movie': 'LMD80',
'PLII/PLIIx Music': 'LMD81',
'Neo6 Cinema': 'LMD82',
'Neo6 Music': 'LMD83',
'PLII/PLIIx THX Cinema': 'LMD84',
'Neo6 THX Cinema': 'LMD85',
'PLII/PLIIx Game': 'LMD86',
'Neural Surr*3': 'LMD87',
'Neural THX': 'LMD88',
'PLII THX Games': 'LMD89',
'Neo6 THX Games': 'LMD8A',
'Auto Surround': 'LMDFF',
JPSTAGE: 'LMD23',
JPACTION: 'LMD25',
JPSPORTS: 'LMD2E',
JPMUSIC: 'LMD26',
'DTS Surround Sensation': 'LMD15',
'Audyssey DSX': 'LMD16',
'THX Music': 'LMD44',
'THX Games': 'LMD45',
'PLIIz Height': 'LMD90',
'Neo:6 Cinema DTS Surround Sensation': 'LMD91',
'Neo:6 Music DTS Surround Sensation': 'LMD92',
'Neural Digital Music': 'LMD93',
'PLIIz Height + THX Cinema': 'LMD94',
'PLIIz Height + THX Music': 'LMD95',
'PLIIz Height + THX Games': 'LMD96',
'PLIIz Height + THX U2/S2 Cinema': 'LMD97',
'PLIIz Height + THX U2/S2 Music': 'LMD98',
'PLIIz Height + THX U2/S2 Games': 'LMD99',
'Whole House Mode': 'LMD1F',
'PLII/PLIIx THX Music/Dolby Surround THX Music': 'LMD8B',
'Neo:6/Neo:X THX Music/DTS Neural:X THX Music': 'LMD8C',
'Neural THX Cinema': 'LMD8D',
'Neural THX Music': 'LMD8E',
'Neural THX Games': 'LMD8F',
'Neo:X Game': 'LMD9A',
'PLIIx/PLII Movie + Audyssey DSX': 'LMDA0',
'PLIIx/PLII Music + Audyssey DSX': 'LMDA1',
'PLIIx/PLII Game + Audyssey DSX': 'LMDA2',
'Neo:6 Cinema + Audyssey DSX': 'LMDA3',
'Neo:6 Music + Audyssey DSX': 'LMDA4',
'Neural Surround + Audyssey DSX': 'LMDA5',
'Neural Digital Music + Audyssey DSX': 'LMDA6',
'Dolby EX + Audyssey DSX': 'LMDA7',
MOVIE: 'LMDMOVIE',
MUSIC: 'LMDMUSIC',
GAME: 'LMDGAME',
THX2: 'LMDTHX',
AUTO: 'LMDAUTO',
SURR: 'LMDSURR',
STEREO2: 'LMDSTEREO',
UP: 'LMDUP',
DOWN: 'LMDDOWN',
'Listening Mode Wrap-Around Down': 'LMDDOWN', // compatibility with <0.4.0
'Listening Mode Wrap-Around Up': 'LMDUP', // compatibility with <0.4.0
STATUS: 'LMDQSTN',
'N/A': 'LMDN/A'
};
const ZONE2_POWER = {
ON: 'ZPW01',
STANDBY: 'ZPW00',
OFF: 'ZPW00',
STATUS: 'ZPWQSTN'
};
// Audio
const ZONE2_AUDIO = {
MUTE: 'ZMT01',
UNMUTE: 'ZMT00',
MUTE_QSTN: 'ZMTQSTN',
VOL_UP: 'ZVLUP',
VOL_DOWN: 'ZVLDOWN',
VOL_UP1: 'ZVLUP1',
VOL_DOWN1: 'ZVLDOWN1',
VOL_QSTN: 'ZVLQSTN',
STATUS_VOL: 'ZVLQSTN',
STATUS_MUTE: 'ZMTQSTN'
};
// Source Select
const ZONE2_SOURCE_SELECT = {
'CBL/SAT': 'SLZ01',
GAME: 'SLZ02',
AUX: 'SLZ03',
'BD/DVD': 'SLZ10',
STRM_BOX: 'SLZ11',
TV: 'SLZ12',
PHONO: 'SLZ22',
CD: 'SLZ23',
FM: 'SLZ24',
AM: 'SLZ25',
TUNER: 'SLZ26',
USB_FRONT: 'SLZ29',
NET: 'SLZ2B',
USB_REAR: 'SLZ2C',
BT: 'SLZ2E',
HDMI_5: 'SLZ55',
QSTN: 'SLZQSTN',
UP: 'SLZUP',
DOWN: 'SLZDOWN',
STATUS: 'SLZQSTN'
};
// Net commands
const ZONE2_NET = {
PLAY: 'NTZPLAY',
STOP: 'NTZSTOP',
PAUSE: 'NTZPAUSE',
PLAY_PAUSE: 'NTZP/P',
TRACK_UP: 'NTZTRUP',
TRACK_DOWN: 'NTZTRDN',
CHANNEL_UP: 'NTZCHUP',
CHANNEL_DOWN: 'NTZCHDN',
FF: 'NTZFF',
REW: 'NTZREW',
REPEAT: 'NTZREPEAT',
RANDOM: 'NTZRANDOM',
REPEAT_SHUFFLE: 'NTZREP/SHF',
DISPLAY: 'NTZDISPLAY',
MEMORY: 'NTZMEMORY',
RIGHT: 'NTZRIGHT',
LEFT: 'NTZLEFT',
UP: 'NTZUP',
DOWN: 'NTZDOWN',
SELECT: 'NTZSELECT',
RETURN: 'NTZRETURN'
};
const ZONE3_POWER = {
ON: 'PW301',
STANDBY: 'PW300',
OFF: 'PW300',
STATUS: 'PW3QSTN'
};
// Audio
const ZONE3_AUDIO = {
MUTE: 'MT301',
UNMUTE: 'MT300',
MUTE_QSTN: 'MT3QSTN',
VOL_UP: 'VL3UP',
VOL_DOWN: 'VL3DOWN',
VOL_UP1: 'VL3UP1',
VOL_DOWN1: 'VL3DOWN1',
VOL_QSTN: 'VL3QSTN',
STATUS_VOL: 'VL3QSTN',
STATUS_MUTE: 'MT3QSTN'
};
// Source Select
const ZONE3_SOURCE_SELECT = {
'CBL/SAT': 'SL301',
GAME: 'SL302',
AUX: 'SL303',
'BD/DVD': 'SL310',
STRM_BOX: 'SL311',
TV: 'SL312',
PHONO: 'SL322',
CD: 'SL323',
FM: 'SL324',
AM: 'SL325',
TUNER: 'SL326',
USB_FRONT: 'SL329',
NET: 'SL32B',
USB_REAR: 'SL32C',
BT: 'SL32E',
HDMI_5: 'SL355',
QSTN: 'SL3QSTN',
UP: 'SL3UP',
DOWN: 'SL3DOWN',
STATUS: 'SL3QSTN'
};
// Net commands
const ZONE3_NET = {
PLAY: 'NT3PLAY',
STOP: 'NT3STOP',
PAUSE: 'NT3PAUSE',
PLAY_PAUSE: 'NT3P/P',
TRACK_UP: 'NT3TRUP',
TRACK_DOWN: 'NT3TRDN',
CHANNEL_UP: 'NT3CHUP',
CHANNEL_DOWN: 'NT3CHDN',
FF: 'NT3FF',
REW: 'NT3REW',
REPEAT: 'NT3REPEAT',
RANDOM: 'NT3RANDOM',
REPEAT_SHUFFLE: 'NT3REP/SHF',
DISPLAY: 'NT3DISPLAY',
MEMORY: 'NT3MEMORY',
RIGHT: 'NT3RIGHT',
LEFT: 'NT3LEFT',
UP: 'NT3UP',
DOWN: 'NT3DOWN',
SELECT: 'NT3SELECT',
RETURN: 'NT3RETURN'
};
const getGroups = function () {
const groups = [
'POWER',
'AUDIO',
'CINEMA_FILTER',
'DIMMER',
'SOURCE_SELECT',
'SOUND_MODE',
'SPEAKER_AB_CONTROL',
'ZONE2_POWER',
'ZONE2_AUDIO',
'ZONE2_SOURCE_SELECT',
'ZONE2_NET',
'ZONE3_POWER',
'ZONE3_AUDIO',
'ZONE3_SOURCE_SELECT',
'ZONE3_NET'
];
return groups;
};
const getGroupCommands = function (group) {
return Object.keys(module.exports[group]);
};
const getZoneCommand = function (command, z) {
const zone = z && typeof z === 'string' ? z.toLowerCase() : '';
if (['zone2', 'zone3'].includes(zone)) {
if (command === 'MVL') {
return zone === 'zone2' ? 'ZVL' : 'VL3';
}
return `${zone.toUpperCase()}_${command}`;
}
return command;
};
module.exports = {
DISCOVER: '!xECNQSTN',
DISCOVER_PIONEER: '!pECNQSTN',
POWER,
AUDIO,
CINEMA_FILTER,
DIMMER,
SOURCE_SELECT,
SOUND_MODE,
SOUND_MODES: SOUND_MODE,
SPEAKER_AB_CONTROL,
ZONE2_POWER,
ZONE2_AUDIO,
ZONE2_SOURCE_SELECT,
ZONE2_NET,
ZONE3_POWER,
ZONE3_AUDIO,
ZONE3_SOURCE_SELECT,
ZONE3_NET,
getGroups,
getGroupCommands,
getZoneCommand
};