iobroker.yamaha 2.3.2 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -21
- package/admin/i18n/de.json +25 -1
- package/admin/i18n/en.json +25 -1
- package/admin/i18n/es.json +25 -1
- package/admin/i18n/fr.json +25 -1
- package/admin/i18n/it.json +25 -1
- package/admin/i18n/nl.json +25 -1
- package/admin/i18n/pl.json +25 -1
- package/admin/i18n/pt.json +25 -1
- package/admin/i18n/ru.json +25 -1
- package/admin/i18n/uk.json +25 -1
- package/admin/i18n/zh-cn.json +25 -1
- package/build/lib/browse/browse-engine.js +35 -0
- package/build/lib/browse/browse-engine.js.map +3 -3
- package/build/lib/browse/objects.js +98 -8
- package/build/lib/browse/objects.js.map +2 -2
- package/build/lib/browse/surface.js +2 -1
- package/build/lib/browse/surface.js.map +2 -2
- package/build/lib/browse/types.js +6 -0
- package/build/lib/browse/types.js.map +2 -2
- package/build/lib/browse/xml-browse-driver.js +37 -18
- package/build/lib/browse/xml-browse-driver.js.map +2 -2
- package/build/lib/browse/ynca-browse-driver.js +64 -1
- package/build/lib/browse/ynca-browse-driver.js.map +2 -2
- package/build/lib/catalog/groups.js +1 -1
- package/build/lib/catalog/groups.js.map +2 -2
- package/build/lib/device-controller.js +24 -6
- package/build/lib/device-controller.js.map +2 -2
- package/build/lib/xml/device-controller.js +14 -3
- package/build/lib/xml/device-controller.js.map +2 -2
- package/build/lib/yxc/device-controller.js +8 -1
- package/build/lib/yxc/device-controller.js.map +2 -2
- package/build/lib/yxc/object-mapper.js +105 -13
- package/build/lib/yxc/object-mapper.js.map +2 -2
- package/build/main.js +1 -1
- package/build/main.js.map +2 -2
- package/io-package.json +27 -27
- package/package.json +1 -1
|
@@ -18,9 +18,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var objects_exports = {};
|
|
20
20
|
__export(objects_exports, {
|
|
21
|
-
browseObjectDefs: () => browseObjectDefs
|
|
21
|
+
browseObjectDefs: () => browseObjectDefs,
|
|
22
|
+
remoteObjectDefs: () => remoteObjectDefs
|
|
22
23
|
});
|
|
23
24
|
module.exports = __toCommonJS(objects_exports);
|
|
25
|
+
var import_types = require("../catalog/types");
|
|
24
26
|
var import_i18n = require("../i18n");
|
|
25
27
|
function browseObjectDefs(sources) {
|
|
26
28
|
const line = (n) => ({
|
|
@@ -44,22 +46,50 @@ function browseObjectDefs(sources) {
|
|
|
44
46
|
{
|
|
45
47
|
id: "player.browse.menuName",
|
|
46
48
|
type: "state",
|
|
47
|
-
common: {
|
|
49
|
+
common: {
|
|
50
|
+
name: (0, import_i18n.tName)("menuName"),
|
|
51
|
+
desc: (0, import_i18n.tName)("descMenuName"),
|
|
52
|
+
type: "string",
|
|
53
|
+
role: "text",
|
|
54
|
+
read: true,
|
|
55
|
+
write: false
|
|
56
|
+
}
|
|
48
57
|
},
|
|
49
58
|
{
|
|
50
59
|
id: "player.browse.layer",
|
|
51
60
|
type: "state",
|
|
52
|
-
common: {
|
|
61
|
+
common: {
|
|
62
|
+
name: (0, import_i18n.tName)("menuLevel"),
|
|
63
|
+
desc: (0, import_i18n.tName)("descMenuLevel"),
|
|
64
|
+
type: "number",
|
|
65
|
+
role: "value",
|
|
66
|
+
read: true,
|
|
67
|
+
write: false
|
|
68
|
+
}
|
|
53
69
|
},
|
|
54
70
|
{
|
|
55
71
|
id: "player.browse.totalItems",
|
|
56
72
|
type: "state",
|
|
57
|
-
common: {
|
|
73
|
+
common: {
|
|
74
|
+
name: (0, import_i18n.tName)("totalEntries"),
|
|
75
|
+
desc: (0, import_i18n.tName)("descTotalEntries"),
|
|
76
|
+
type: "number",
|
|
77
|
+
role: "value",
|
|
78
|
+
read: true,
|
|
79
|
+
write: false
|
|
80
|
+
}
|
|
58
81
|
},
|
|
59
82
|
{
|
|
60
83
|
id: "player.browse.currentLine",
|
|
61
84
|
type: "state",
|
|
62
|
-
common: {
|
|
85
|
+
common: {
|
|
86
|
+
name: (0, import_i18n.tName)("currentLine"),
|
|
87
|
+
desc: (0, import_i18n.tName)("descCurrentLine"),
|
|
88
|
+
type: "number",
|
|
89
|
+
role: "value",
|
|
90
|
+
read: true,
|
|
91
|
+
write: false
|
|
92
|
+
}
|
|
63
93
|
},
|
|
64
94
|
...[1, 2, 3, 4, 5, 6, 7, 8].map(line),
|
|
65
95
|
{
|
|
@@ -67,6 +97,7 @@ function browseObjectDefs(sources) {
|
|
|
67
97
|
type: "state",
|
|
68
98
|
common: {
|
|
69
99
|
name: (0, import_i18n.tName)("selectLineFolderOpensItemPlays"),
|
|
100
|
+
desc: (0, import_i18n.tName)("descSelectLineFolderOpensItemPlays"),
|
|
70
101
|
type: "number",
|
|
71
102
|
role: "level",
|
|
72
103
|
read: true,
|
|
@@ -85,6 +116,7 @@ function browseObjectDefs(sources) {
|
|
|
85
116
|
type: "state",
|
|
86
117
|
common: {
|
|
87
118
|
name: (0, import_i18n.tName)("navigatePathEGBookmarksRadioParadise"),
|
|
119
|
+
desc: (0, import_i18n.tName)("descNavigatePathEGBookmarksRadioParadise"),
|
|
88
120
|
type: "string",
|
|
89
121
|
role: "text",
|
|
90
122
|
read: true,
|
|
@@ -94,17 +126,75 @@ function browseObjectDefs(sources) {
|
|
|
94
126
|
{
|
|
95
127
|
id: "player.browse.rows",
|
|
96
128
|
type: "state",
|
|
97
|
-
common: {
|
|
129
|
+
common: {
|
|
130
|
+
name: (0, import_i18n.tName)("rowsJSON"),
|
|
131
|
+
desc: (0, import_i18n.tName)("descRowsJSON"),
|
|
132
|
+
type: "string",
|
|
133
|
+
role: "json",
|
|
134
|
+
read: true,
|
|
135
|
+
write: false
|
|
136
|
+
}
|
|
98
137
|
},
|
|
99
138
|
{
|
|
100
139
|
id: "player.browse.busy",
|
|
101
140
|
type: "state",
|
|
102
|
-
common: {
|
|
141
|
+
common: {
|
|
142
|
+
name: (0, import_i18n.tName)("busy"),
|
|
143
|
+
desc: (0, import_i18n.tName)("descBusy"),
|
|
144
|
+
type: "boolean",
|
|
145
|
+
role: "indicator",
|
|
146
|
+
read: true,
|
|
147
|
+
write: false
|
|
148
|
+
}
|
|
103
149
|
}
|
|
104
150
|
];
|
|
105
151
|
}
|
|
152
|
+
function remoteObjectDefs(cursorValues, menuValues) {
|
|
153
|
+
const states = (values) => Object.fromEntries(values.map((value) => [value, value]));
|
|
154
|
+
const defs = [];
|
|
155
|
+
if (!(cursorValues == null ? void 0 : cursorValues.length) && !(menuValues == null ? void 0 : menuValues.length)) {
|
|
156
|
+
return defs;
|
|
157
|
+
}
|
|
158
|
+
defs.push({
|
|
159
|
+
id: "remote",
|
|
160
|
+
type: "channel",
|
|
161
|
+
common: { name: (0, import_i18n.tName)(import_types.CHANNEL_NAME_KEYS.remote), desc: (0, import_i18n.tName)(import_types.CHANNEL_DESC_KEYS.remote) }
|
|
162
|
+
});
|
|
163
|
+
if (cursorValues == null ? void 0 : cursorValues.length) {
|
|
164
|
+
defs.push({
|
|
165
|
+
id: "remote.cursor",
|
|
166
|
+
type: "state",
|
|
167
|
+
common: {
|
|
168
|
+
name: (0, import_i18n.tName)("cursorPad"),
|
|
169
|
+
desc: (0, import_i18n.tName)("descCursorPad"),
|
|
170
|
+
type: "string",
|
|
171
|
+
role: "state",
|
|
172
|
+
read: false,
|
|
173
|
+
write: true,
|
|
174
|
+
states: states(cursorValues)
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
if (menuValues == null ? void 0 : menuValues.length) {
|
|
179
|
+
defs.push({
|
|
180
|
+
id: "remote.menu",
|
|
181
|
+
type: "state",
|
|
182
|
+
common: {
|
|
183
|
+
name: (0, import_i18n.tName)("menuKey"),
|
|
184
|
+
desc: (0, import_i18n.tName)("descMenuKey"),
|
|
185
|
+
type: "string",
|
|
186
|
+
role: "state",
|
|
187
|
+
read: false,
|
|
188
|
+
write: true,
|
|
189
|
+
states: states(menuValues)
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
return defs;
|
|
194
|
+
}
|
|
106
195
|
// Annotate the CommonJS export names for ESM import in node:
|
|
107
196
|
0 && (module.exports = {
|
|
108
|
-
browseObjectDefs
|
|
197
|
+
browseObjectDefs,
|
|
198
|
+
remoteObjectDefs
|
|
109
199
|
});
|
|
110
200
|
//# sourceMappingURL=objects.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/lib/browse/objects.ts"],
|
|
4
|
-
"sourcesContent": ["import type { ObjectDef } from \"../catalog/types\";\nimport { tName } from \"../i18n\";\n\n/**\n * The object tree of the browsing surface. Every capable transport contributes the\n * SAME ids, so the object-tree coordinator dedups them and modernity picks the one\n * owner (YXC > YNCA > XML) \u2014 no owner override needed. The ids live under\n * `player.browse.*`, so the existing \"Playback & browsing\" admin group switch and\n * the `player` folder gate them like every other playback datapoint.\n *\n * @param sources the selectable sources (state value \u2192 display label)\n * @returns the channel and state definitions, parents first\n */\nexport function browseObjectDefs(sources: Record<string, string>): ObjectDef[] {\n const line = (n: number): ObjectDef => ({\n id: `player.browse.line${n}`,\n type: \"state\",\n common: { name: tName(\"line\", n), type: \"string\", role: \"text\", read: true, write: false },\n });\n const button = (id: string, name: ioBroker.StringOrTranslated): ObjectDef => ({\n id: `player.browse.${id}`,\n type: \"state\",\n common: { name, type: \"boolean\", role: \"button\", read: false, write: true },\n });\n return [\n { id: \"player\", type: \"channel\", common: { name: tName(\"mediaPlayer\") } },\n { id: \"player.browse\", type: \"channel\", common: { name: tName(\"browse\") } },\n {\n id: \"player.browse.source\",\n type: \"state\",\n common: { name: tName(\"source\"), type: \"string\", role: \"state\", read: true, write: true, states: sources },\n },\n {\n id: \"player.browse.menuName\",\n type: \"state\",\n common: {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["import { CHANNEL_DESC_KEYS, CHANNEL_NAME_KEYS } from \"../catalog/types\";\nimport type { ObjectDef } from \"../catalog/types\";\nimport { tName } from \"../i18n\";\n\n/**\n * The object tree of the browsing surface. Every capable transport contributes the\n * SAME ids, so the object-tree coordinator dedups them and modernity picks the one\n * owner (YXC > YNCA > XML) \u2014 no owner override needed. The ids live under\n * `player.browse.*`, so the existing \"Playback & browsing\" admin group switch and\n * the `player` folder gate them like every other playback datapoint.\n *\n * @param sources the selectable sources (state value \u2192 display label)\n * @returns the channel and state definitions, parents first\n */\nexport function browseObjectDefs(sources: Record<string, string>): ObjectDef[] {\n const line = (n: number): ObjectDef => ({\n id: `player.browse.line${n}`,\n type: \"state\",\n common: { name: tName(\"line\", n), type: \"string\", role: \"text\", read: true, write: false },\n });\n const button = (id: string, name: ioBroker.StringOrTranslated): ObjectDef => ({\n id: `player.browse.${id}`,\n type: \"state\",\n common: { name, type: \"boolean\", role: \"button\", read: false, write: true },\n });\n return [\n { id: \"player\", type: \"channel\", common: { name: tName(\"mediaPlayer\") } },\n { id: \"player.browse\", type: \"channel\", common: { name: tName(\"browse\") } },\n {\n id: \"player.browse.source\",\n type: \"state\",\n common: { name: tName(\"source\"), type: \"string\", role: \"state\", read: true, write: true, states: sources },\n },\n {\n id: \"player.browse.menuName\",\n type: \"state\",\n common: {\n name: tName(\"menuName\"),\n desc: tName(\"descMenuName\"),\n type: \"string\",\n role: \"text\",\n read: true,\n write: false,\n },\n },\n {\n id: \"player.browse.layer\",\n type: \"state\",\n common: {\n name: tName(\"menuLevel\"),\n desc: tName(\"descMenuLevel\"),\n type: \"number\",\n role: \"value\",\n read: true,\n write: false,\n },\n },\n {\n id: \"player.browse.totalItems\",\n type: \"state\",\n common: {\n name: tName(\"totalEntries\"),\n desc: tName(\"descTotalEntries\"),\n type: \"number\",\n role: \"value\",\n read: true,\n write: false,\n },\n },\n {\n id: \"player.browse.currentLine\",\n type: \"state\",\n common: {\n name: tName(\"currentLine\"),\n desc: tName(\"descCurrentLine\"),\n type: \"number\",\n role: \"value\",\n read: true,\n write: false,\n },\n },\n ...[1, 2, 3, 4, 5, 6, 7, 8].map(line),\n {\n id: \"player.browse.selectLine\",\n type: \"state\",\n common: {\n name: tName(\"selectLineFolderOpensItemPlays\"),\n desc: tName(\"descSelectLineFolderOpensItemPlays\"),\n type: \"number\",\n role: \"level\",\n read: true,\n write: true,\n min: 1,\n max: 8,\n step: 1,\n },\n },\n button(\"pageUp\", tName(\"pageUp\")),\n button(\"pageDown\", tName(\"pageDown\")),\n button(\"back\", tName(\"back\")),\n button(\"home\", tName(\"menuRoot\")),\n {\n id: \"player.browse.path\",\n type: \"state\",\n common: {\n name: tName(\"navigatePathEGBookmarksRadioParadise\"),\n desc: tName(\"descNavigatePathEGBookmarksRadioParadise\"),\n type: \"string\",\n role: \"text\",\n read: true,\n write: true,\n },\n },\n {\n id: \"player.browse.rows\",\n type: \"state\",\n common: {\n name: tName(\"rowsJSON\"),\n desc: tName(\"descRowsJSON\"),\n type: \"string\",\n role: \"json\",\n read: true,\n write: false,\n },\n },\n {\n id: \"player.browse.busy\",\n type: \"state\",\n common: {\n name: tName(\"busy\"),\n desc: tName(\"descBusy\"),\n type: \"boolean\",\n role: \"indicator\",\n read: true,\n write: false,\n },\n },\n ];\n}\n\n/**\n * The on-screen remote of one transport: the cursor pad, and the menu keys where the\n * protocol has them.\n *\n * Lives beside the browsing surface because that is where the proof is. A cursor key is a\n * LIST command on both text protocols (`LISTCURSOR`, `<List_Control><Cursor>`), so a device\n * that answered no list probe has no pad either \u2014 the same rule that keeps the menu folder\n * off a receiver that cannot browse (#613). Ids are unprefixed, i.e. the main zone: neither\n * YNCA nor XML declares a cursor for zones 2\u20134.\n *\n * @param cursorValues the cursor words this transport supports (empty/absent = no pad)\n * @param menuValues the menu keys this transport supports (empty/absent = none)\n * @returns the channel and state definitions, parents first\n */\nexport function remoteObjectDefs(cursorValues?: readonly string[], menuValues?: readonly string[]): ObjectDef[] {\n const states = (values: readonly string[]): Record<string, string> =>\n Object.fromEntries(values.map(value => [value, value]));\n const defs: ObjectDef[] = [];\n if (!cursorValues?.length && !menuValues?.length) {\n return defs;\n }\n defs.push({\n id: \"remote\",\n type: \"channel\",\n common: { name: tName(CHANNEL_NAME_KEYS.remote), desc: tName(CHANNEL_DESC_KEYS.remote) },\n });\n if (cursorValues?.length) {\n defs.push({\n id: \"remote.cursor\",\n type: \"state\",\n common: {\n name: tName(\"cursorPad\"),\n desc: tName(\"descCursorPad\"),\n type: \"string\",\n role: \"state\",\n read: false,\n write: true,\n states: states(cursorValues),\n },\n });\n }\n if (menuValues?.length) {\n defs.push({\n id: \"remote.menu\",\n type: \"state\",\n common: {\n name: tName(\"menuKey\"),\n desc: tName(\"descMenuKey\"),\n type: \"string\",\n role: \"state\",\n read: false,\n write: true,\n states: states(menuValues),\n },\n });\n }\n return defs;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAqD;AAErD,kBAAsB;AAYf,SAAS,iBAAiB,SAA8C;AAC7E,QAAM,OAAO,CAAC,OAA0B;AAAA,IACtC,IAAI,qBAAqB,CAAC;AAAA,IAC1B,MAAM;AAAA,IACN,QAAQ,EAAE,UAAM,mBAAM,QAAQ,CAAC,GAAG,MAAM,UAAU,MAAM,QAAQ,MAAM,MAAM,OAAO,MAAM;AAAA,EAC3F;AACA,QAAM,SAAS,CAAC,IAAY,UAAkD;AAAA,IAC5E,IAAI,iBAAiB,EAAE;AAAA,IACvB,MAAM;AAAA,IACN,QAAQ,EAAE,MAAM,MAAM,WAAW,MAAM,UAAU,MAAM,OAAO,OAAO,KAAK;AAAA,EAC5E;AACA,SAAO;AAAA,IACL,EAAE,IAAI,UAAU,MAAM,WAAW,QAAQ,EAAE,UAAM,mBAAM,aAAa,EAAE,EAAE;AAAA,IACxE,EAAE,IAAI,iBAAiB,MAAM,WAAW,QAA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AAC,6CAAc,WAAU,EAAC,yCAAY,SAAQ;AAChD,WAAO;AAAA,EACT;AACA,OAAK,KAAK;AAAA,IACR,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,QAAQ,EAAE,UAAM,mBAAM,+BAAkB,MAAM,GAAG,UAAM,mBAAM,+BAAkB,MAAM,EAAE;AAAA,EACzF,CAAC;AACD,MAAI,6CAAc,QAAQ;AACxB,SAAK,KAAK;AAAA,MACR,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,QAAQ;AAAA,QACN,UAAM,mBAAM,WAAW;AAAA,QACvB,UAAM,mBAAM,eAAe;AAAA,QAC3B,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,OAAO;AAAA,QACP,QAAQ,OAAO,YAAY;AAAA,MAC7B;AAAA,IACF,CAAC;AAAA,EACH;AACA,MAAI,yCAAY,QAAQ;AACtB,SAAK,KAAK;AAAA,MACR,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,QAAQ;AAAA,QACN,UAAM,mBAAM,SAAS;AAAA,QACrB,UAAM,mBAAM,aAAa;AAAA,QACzB,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,OAAO;AAAA,QACP,QAAQ,OAAO,UAAU;AAAA,MAC3B;AAAA,IACF,CAAC;AAAA,EACH;AACA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -28,7 +28,8 @@ async function createBrowseSurface(driver, deviceId, deps) {
|
|
|
28
28
|
if (Object.keys(sources).length === 0) {
|
|
29
29
|
return void 0;
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
const defs = [...(0, import_objects.browseObjectDefs)(sources), ...(0, import_objects.remoteObjectDefs)(driver.cursorValues, driver.menuValues)];
|
|
32
|
+
for (const def of defs) {
|
|
32
33
|
await deps.upsertObject(`${deviceId}.${def.id}`, def);
|
|
33
34
|
}
|
|
34
35
|
const engine = new import_browse_engine.BrowseEngine(driver, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/lib/browse/surface.ts"],
|
|
4
|
-
"sourcesContent": ["import { BrowseEngine } from \"./browse-engine\";\nimport { browseObjectDefs } from \"./objects\";\nimport type { BrowseDriver } from \"./types\";\nimport type { ObjectDef } from \"../catalog/types\";\nimport type { ControllerLog } from \"../controller\";\n\n/** What creating a browsing surface needs from its controller. */\nexport interface BrowseSurfaceDeps {\n /** Create or update an object in the device tree. */\n upsertObject(id: string, def: ObjectDef): Promise<void>;\n /** Write a browse state with ack (already guarded against a closed connection). */\n emit(relativeId: string, value: boolean | number | string): void;\n /** Adapter log. */\n log: ControllerLog;\n /** Adapter-managed delay that ends when the connection closes. */\n delay(ms: number): Promise<void>;\n}\n\n/**\n * Create the `player.browse.*` surface for one transport: its objects, the engine that\n * owns the states, and the wiring between them. All three transports need exactly this\n * sequence, so it lives here once instead of being copied into each controller.\n *\n * Returns undefined when the device offers nothing browsable \u2014 then no objects are created\n * at all, which is what keeps the folder off devices that cannot browse.\n *\n * @param driver the transport's list driver\n * @param deviceId the id-safe device id\n * @param deps the controller callbacks\n * @returns the engine driving the surface, or undefined when there is nothing to browse\n */\nexport async function createBrowseSurface(\n driver: BrowseDriver & { attach(engine: BrowseEngine): void },\n deviceId: string,\n deps: BrowseSurfaceDeps,\n): Promise<BrowseEngine | undefined> {\n const sources = driver.sources();\n if (Object.keys(sources).length === 0) {\n return undefined;\n }\n for (const def of
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA6B;AAC7B,
|
|
4
|
+
"sourcesContent": ["import { BrowseEngine } from \"./browse-engine\";\nimport { browseObjectDefs, remoteObjectDefs } from \"./objects\";\nimport type { BrowseDriver } from \"./types\";\nimport type { ObjectDef } from \"../catalog/types\";\nimport type { ControllerLog } from \"../controller\";\n\n/** What creating a browsing surface needs from its controller. */\nexport interface BrowseSurfaceDeps {\n /** Create or update an object in the device tree. */\n upsertObject(id: string, def: ObjectDef): Promise<void>;\n /** Write a browse state with ack (already guarded against a closed connection). */\n emit(relativeId: string, value: boolean | number | string): void;\n /** Adapter log. */\n log: ControllerLog;\n /** Adapter-managed delay that ends when the connection closes. */\n delay(ms: number): Promise<void>;\n}\n\n/**\n * Create the `player.browse.*` surface for one transport: its objects, the engine that\n * owns the states, and the wiring between them. All three transports need exactly this\n * sequence, so it lives here once instead of being copied into each controller.\n *\n * Returns undefined when the device offers nothing browsable \u2014 then no objects are created\n * at all, which is what keeps the folder off devices that cannot browse.\n *\n * @param driver the transport's list driver\n * @param deviceId the id-safe device id\n * @param deps the controller callbacks\n * @returns the engine driving the surface, or undefined when there is nothing to browse\n */\nexport async function createBrowseSurface(\n driver: BrowseDriver & { attach(engine: BrowseEngine): void },\n deviceId: string,\n deps: BrowseSurfaceDeps,\n): Promise<BrowseEngine | undefined> {\n const sources = driver.sources();\n if (Object.keys(sources).length === 0) {\n return undefined;\n }\n const defs = [...browseObjectDefs(sources), ...remoteObjectDefs(driver.cursorValues, driver.menuValues)];\n for (const def of defs) {\n await deps.upsertObject(`${deviceId}.${def.id}`, def);\n }\n const engine = new BrowseEngine(driver, {\n emit: (id, value) => deps.emit(id, value),\n log: deps.log,\n delay: deps.delay,\n });\n driver.attach(engine);\n engine.seed();\n return engine;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAA6B;AAC7B,qBAAmD;AA8BnD,eAAsB,oBACpB,QACA,UACA,MACmC;AACnC,QAAM,UAAU,OAAO,QAAQ;AAC/B,MAAI,OAAO,KAAK,OAAO,EAAE,WAAW,GAAG;AACrC,WAAO;AAAA,EACT;AACA,QAAM,OAAO,CAAC,OAAG,iCAAiB,OAAO,GAAG,OAAG,iCAAiB,OAAO,cAAc,OAAO,UAAU,CAAC;AACvG,aAAW,OAAO,MAAM;AACtB,UAAM,KAAK,aAAa,GAAG,QAAQ,IAAI,IAAI,EAAE,IAAI,GAAG;AAAA,EACtD;AACA,QAAM,SAAS,IAAI,kCAAa,QAAQ;AAAA,IACtC,MAAM,CAAC,IAAI,UAAU,KAAK,KAAK,IAAI,KAAK;AAAA,IACxC,KAAK,KAAK;AAAA,IACV,OAAO,KAAK;AAAA,EACd,CAAC;AACD,SAAO,OAAO,MAAM;AACpB,SAAO,KAAK;AACZ,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -18,9 +18,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var types_exports = {};
|
|
20
20
|
__export(types_exports, {
|
|
21
|
+
CURSOR_VALUES: () => CURSOR_VALUES,
|
|
22
|
+
MENU_VALUES: () => MENU_VALUES,
|
|
21
23
|
ROW_KIND_BY_ATTRIBUTE: () => ROW_KIND_BY_ATTRIBUTE
|
|
22
24
|
});
|
|
23
25
|
module.exports = __toCommonJS(types_exports);
|
|
26
|
+
const CURSOR_VALUES = ["up", "down", "left", "right", "select", "return", "home"];
|
|
27
|
+
const MENU_VALUES = ["on_screen", "top_menu", "menu", "option", "display", "home"];
|
|
24
28
|
const ROW_KIND_BY_ATTRIBUTE = {
|
|
25
29
|
Container: "folder",
|
|
26
30
|
Item: "item",
|
|
@@ -29,6 +33,8 @@ const ROW_KIND_BY_ATTRIBUTE = {
|
|
|
29
33
|
};
|
|
30
34
|
// Annotate the CommonJS export names for ESM import in node:
|
|
31
35
|
0 && (module.exports = {
|
|
36
|
+
CURSOR_VALUES,
|
|
37
|
+
MENU_VALUES,
|
|
32
38
|
ROW_KIND_BY_ATTRIBUTE
|
|
33
39
|
});
|
|
34
40
|
//# sourceMappingURL=types.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/lib/browse/types.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Shared contracts for the media-menu browsing surface (`player.browse.*`, issue #613).\n * One transport-neutral engine drives the states; each transport contributes a thin\n * {@link BrowseDriver} over its own list protocol (YNCA LISTINFO/LISTSEL, YXC\n * netusb getListInfo/setListControl, XML List_Info/List_Control). The surface mirrors\n * the device's own menu: an 8-line window, select-by-line, page/back/home, plus a\n * path auto-walk for scripts \u2014 the predecessor adapter's proven VIS workflow.\n */\n\n/** The kind of a menu row, as the device reports it. */\nexport type BrowseRowKind = \"folder\" | \"item\" | \"unplayable\" | \"unselectable\";\n\n/** One visible menu row. */\nexport interface BrowseRow {\n /** The row's line number within the window (1\u20138). */\n line: number;\n /** The row's raw text (no symbol prefix). */\n text: string;\n /** Whether the row is a folder, a playable item, or not selectable. */\n kind: BrowseRowKind;\n /** Cover/thumbnail URL, where the protocol carries one (YXC only). */\n thumbnail?: string;\n}\n\n/** A snapshot of the device's current menu window. */\nexport interface BrowseWindow {\n /** The menu title (the current folder's name). */\n menuName: string;\n /** The menu depth (1 = root). */\n layer: number;\n /** Total entries in the current menu. */\n totalItems: number;\n /**\n * The device's cursor position within the whole list (1-based) \u2014 that is what the\n * official YNCA command list defines CURRLINE as (\"absolute position number of current\n * cursor position\"), and the XML `Current_Line` matches it. It is NOT necessarily the\n * window's first line: after stepping back out of a submenu the cursor sits on the row\n * that was entered. The YXC driver has a real window index and reports that.\n */\n currentLine: number;\n /** The visible rows (up to 8). */\n rows: BrowseRow[];\n}\n\n/**\n * The per-transport list operations behind the engine. Every method may be async;\n * the driver reports fresh windows through the engine's `onWindow` (pull transports\n * fetch after each operation, YNCA also receives unsolicited auto-feedback).\n */\nexport interface BrowseDriver {\n /** The selectable sources as state-value \u2192 display-label entries. */\n sources(): Record<string, string>;\n /** Open a source's menu (the device keeps the session position). */\n open(source: string): Promise<void> | void;\n /** Select a visible line (1\u20138) \u2014 a folder opens, a playable item starts. */\n select(line: number): Promise<void> | void;\n /** Show the previous 8 lines. */\n pageUp(): Promise<void> | void;\n /** Show the next 8 lines. */\n pageDown(): Promise<void> | void;\n /** Go one menu level back. */\n back(): Promise<void> | void;\n /** Return to the menu root. */\n home(): Promise<void> | void;\n}\n\n/**\n * How the two text protocols name a row's kind. YNCA (`LINE1ATRIB`) and XML\n * (`Current_List` attribute) use the SAME four words \u2014 one table for both, so a new\n * attribute value is added once instead of in two drivers that then drift apart.\n */\nexport const ROW_KIND_BY_ATTRIBUTE: Readonly<Record<string, BrowseRowKind>> = {\n Container: \"folder\",\n Item: \"item\",\n \"Unplayable Item\": \"unplayable\",\n Unselectable: \"unselectable\",\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["/**\n * Shared contracts for the media-menu browsing surface (`player.browse.*`, issue #613).\n * One transport-neutral engine drives the states; each transport contributes a thin\n * {@link BrowseDriver} over its own list protocol (YNCA LISTINFO/LISTSEL, YXC\n * netusb getListInfo/setListControl, XML List_Info/List_Control). The surface mirrors\n * the device's own menu: an 8-line window, select-by-line, page/back/home, plus a\n * path auto-walk for scripts \u2014 the predecessor adapter's proven VIS workflow.\n */\n\n/** The kind of a menu row, as the device reports it. */\nexport type BrowseRowKind = \"folder\" | \"item\" | \"unplayable\" | \"unselectable\";\n\n/** One visible menu row. */\nexport interface BrowseRow {\n /** The row's line number within the window (1\u20138). */\n line: number;\n /** The row's raw text (no symbol prefix). */\n text: string;\n /** Whether the row is a folder, a playable item, or not selectable. */\n kind: BrowseRowKind;\n /** Cover/thumbnail URL, where the protocol carries one (YXC only). */\n thumbnail?: string;\n}\n\n/** A snapshot of the device's current menu window. */\nexport interface BrowseWindow {\n /** The menu title (the current folder's name). */\n menuName: string;\n /** The menu depth (1 = root). */\n layer: number;\n /** Total entries in the current menu. */\n totalItems: number;\n /**\n * The device's cursor position within the whole list (1-based) \u2014 that is what the\n * official YNCA command list defines CURRLINE as (\"absolute position number of current\n * cursor position\"), and the XML `Current_Line` matches it. It is NOT necessarily the\n * window's first line: after stepping back out of a submenu the cursor sits on the row\n * that was entered. The YXC driver has a real window index and reports that.\n */\n currentLine: number;\n /** The visible rows (up to 8). */\n rows: BrowseRow[];\n}\n\n/**\n * The per-transport list operations behind the engine. Every method may be async;\n * the driver reports fresh windows through the engine's `onWindow` (pull transports\n * fetch after each operation, YNCA also receives unsolicited auto-feedback).\n */\nexport interface BrowseDriver {\n /** The selectable sources as state-value \u2192 display-label entries. */\n sources(): Record<string, string>;\n /** Open a source's menu (the device keeps the session position). */\n open(source: string): Promise<void> | void;\n /** Select a visible line (1\u20138) \u2014 a folder opens, a playable item starts. */\n select(line: number): Promise<void> | void;\n /** Show the previous 8 lines. */\n pageUp(): Promise<void> | void;\n /** Show the next 8 lines. */\n pageDown(): Promise<void> | void;\n /** Go one menu level back. */\n back(): Promise<void> | void;\n /** Return to the menu root. */\n home(): Promise<void> | void;\n /**\n * The cursor-pad values this transport supports, from {@link CURSOR_VALUES} \u2014 absent\n * where the protocol has no cursor pad. The device tree offers exactly this subset, so a\n * word that appears in the dropdown always works on that device.\n */\n cursorValues?: readonly string[];\n /**\n * Press a cursor key.\n *\n * @param value one of {@link cursorValues}\n */\n cursor?(value: string): Promise<void> | void;\n /** The menu keys this transport supports, from {@link MENU_VALUES} \u2014 absent where it has none. */\n menuValues?: readonly string[];\n /**\n * Press a menu key.\n *\n * @param value one of {@link menuValues}\n */\n menu?(value: string): Promise<void> | void;\n}\n\n/**\n * The on-screen remote, in ONE vocabulary for all three protocols.\n *\n * The words are MusicCast's, because that is the set `remote.cursor`/`remote.menu` have carried\n * since v1.x \u2014 a script that presses `select` today must keep working. YNCA and XML spell the\n * same keys differently on the wire (`Sel`, `Back to Home`, `Return to Home`); each driver\n * translates, so the datapoint means the same thing on a 2009 receiver and on a 2024 one.\n *\n * A transport publishes only the words it really has: the YNCA source subunits know no\n * Left/Right, and no XML menu key is documented at all. A missing word is left out of that\n * device's dropdown rather than mapped onto something that merely looks similar.\n */\nexport const CURSOR_VALUES = [\"up\", \"down\", \"left\", \"right\", \"select\", \"return\", \"home\"] as const;\n\n/** The menu keys, same vocabulary rule as {@link CURSOR_VALUES}. */\nexport const MENU_VALUES = [\"on_screen\", \"top_menu\", \"menu\", \"option\", \"display\", \"home\"] as const;\n\n/**\n * How the two text protocols name a row's kind. YNCA (`LINE1ATRIB`) and XML\n * (`Current_List` attribute) use the SAME four words \u2014 one table for both, so a new\n * attribute value is added once instead of in two drivers that then drift apart.\n */\nexport const ROW_KIND_BY_ATTRIBUTE: Readonly<Record<string, BrowseRowKind>> = {\n Container: \"folder\",\n Item: \"item\",\n \"Unplayable Item\": \"unplayable\",\n Unselectable: \"unselectable\",\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkGO,MAAM,gBAAgB,CAAC,MAAM,QAAQ,QAAQ,SAAS,UAAU,UAAU,MAAM;AAGhF,MAAM,cAAc,CAAC,aAAa,YAAY,QAAQ,UAAU,WAAW,MAAM;AAOjF,MAAM,wBAAiE;AAAA,EAC5E,WAAW;AAAA,EACX,MAAM;AAAA,EACN,mBAAmB;AAAA,EACnB,cAAc;AAChB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -54,6 +54,15 @@ function parseXmlListInfo(xml) {
|
|
|
54
54
|
rows
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
+
const XML_CURSOR_WIRE = {
|
|
58
|
+
up: "Up",
|
|
59
|
+
down: "Down",
|
|
60
|
+
left: "Left",
|
|
61
|
+
right: "Right",
|
|
62
|
+
select: "Sel",
|
|
63
|
+
return: "Return",
|
|
64
|
+
home: "Return to Home"
|
|
65
|
+
};
|
|
57
66
|
class XmlBrowseDriver {
|
|
58
67
|
/**
|
|
59
68
|
* @param client the XML client slice (send + getXml)
|
|
@@ -68,13 +77,6 @@ class XmlBrowseDriver {
|
|
|
68
77
|
engine;
|
|
69
78
|
active;
|
|
70
79
|
lastTotal = 0;
|
|
71
|
-
/**
|
|
72
|
-
* The cursor value this device accepts for "one level back". The spec vocabulary is
|
|
73
|
-
* `Return`, but the 2012 generation (RX-V473 class) refuses it and accepts `Left`
|
|
74
|
-
* instead (user-measured on the predecessor adapter, #613). First refusal switches
|
|
75
|
-
* permanently for this device.
|
|
76
|
-
*/
|
|
77
|
-
backCursor = "Return";
|
|
78
80
|
/**
|
|
79
81
|
* Attach the engine that renders the windows (set after both are constructed).
|
|
80
82
|
*
|
|
@@ -118,23 +120,40 @@ class XmlBrowseDriver {
|
|
|
118
120
|
async pageDown() {
|
|
119
121
|
await this.jumpBy(8);
|
|
120
122
|
}
|
|
121
|
-
/**
|
|
123
|
+
/**
|
|
124
|
+
* Go one menu level back.
|
|
125
|
+
*
|
|
126
|
+
* Always `Return`, never a learned substitute (krobi 2026-09-03): a refusal on ONE model is
|
|
127
|
+
* no reason to change the word for every other model, and a transport error is not a refusal
|
|
128
|
+
* at all. Where a receiver of the 2012 generation rejects it (#613), the user reaches the same
|
|
129
|
+
* step through `remote.cursor` = `left`, which that generation accepts.
|
|
130
|
+
*/
|
|
122
131
|
async back() {
|
|
123
|
-
|
|
124
|
-
await this.send(`<Cursor>${this.backCursor}</Cursor>`);
|
|
125
|
-
} catch (e) {
|
|
126
|
-
if (this.backCursor !== "Return") {
|
|
127
|
-
throw e;
|
|
128
|
-
}
|
|
129
|
-
this.backCursor = "Left";
|
|
130
|
-
await this.send("<Cursor>Left</Cursor>");
|
|
131
|
-
}
|
|
132
|
-
await this.fetch();
|
|
132
|
+
await this.control("<Cursor>Return</Cursor>");
|
|
133
133
|
}
|
|
134
134
|
/** Return to the menu root. */
|
|
135
135
|
async home() {
|
|
136
136
|
await this.control("<Cursor>Return to Home</Cursor>");
|
|
137
137
|
}
|
|
138
|
+
/** The cursor keys this protocol declares — the full pad, `<List_Control><Cursor>`. */
|
|
139
|
+
cursorValues = Object.keys(XML_CURSOR_WIRE);
|
|
140
|
+
/**
|
|
141
|
+
* Press a cursor key on the open list.
|
|
142
|
+
*
|
|
143
|
+
* XML/YNC knows the cursor ONLY inside `List_Control`, addressed to the source whose menu
|
|
144
|
+
* is open (`PUT <NET_RADIO><List_Control>…`) — this generation has no zone-wide remote
|
|
145
|
+
* endpoint, and inventing one would put a blind command on the wire. With no menu open the
|
|
146
|
+
* press therefore goes nowhere, which `send()` already handles.
|
|
147
|
+
*
|
|
148
|
+
* @param value one of {@link cursorValues}
|
|
149
|
+
*/
|
|
150
|
+
async cursor(value) {
|
|
151
|
+
const wire = XML_CURSOR_WIRE[value];
|
|
152
|
+
if (wire === void 0) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
await this.control(`<Cursor>${wire}</Cursor>`);
|
|
156
|
+
}
|
|
138
157
|
/**
|
|
139
158
|
* Send a List_Control command to the active source — WITHOUT reading the window back,
|
|
140
159
|
* so a caller can tell a device refusal from a failed follow-up read (see {@link back}).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/lib/browse/xml-browse-driver.ts"],
|
|
4
|
-
"sourcesContent": ["import { ROW_KIND_BY_ATTRIBUTE, type BrowseDriver, type BrowseRow } from \"./types\";\nimport type { BrowseEngine } from \"./browse-engine\";\nimport { decodeXmlText } from \"../xml/entities\";\n\n/** How often to re-read while the device reports Menu_Status Busy. */\nconst BUSY_POLL_MS = 500;\n/** How many busy polls before giving up on one read. */\nconst MAX_BUSY_POLLS = 10;\n\n/**\n * The XML/YNC sources with a List_Info menu (the ones the predecessor adapter's\n * users browsed; rxv drives the same three), with the transport-neutral source key\n * and the input name that activates the source.\n */\nexport const XML_BROWSE_SOURCES: ReadonlyArray<{ element: string; key: string; label: string; input: string }> = [\n { element: \"NET_RADIO\", key: \"netRadio\", label: \"Net Radio\", input: \"NET RADIO\" },\n { element: \"SERVER\", key: \"server\", label: \"Media server\", input: \"SERVER\" },\n { element: \"USB\", key: \"usb\", label: \"USB\", input: \"USB\" },\n];\n\n/** The client surface the driver needs (a slice of the XML client). */\nexport interface XmlBrowseClient {\n /** Send an inner PUT command to an element (a zone or a source). */\n send(element: string, inner: string): Promise<void>;\n /** Read an element's inner GET request and return the raw response body. */\n getXml(element: string, inner: string): Promise<string>;\n}\n\n/** A parsed List_Info response. */\nexport interface XmlListInfo {\n /** Whether the menu is ready (false = the device is still fetching it). */\n ready: boolean;\n /** The menu title. */\n menuName: string;\n /** The menu depth (1 = root). */\n layer: number;\n /** The cursor's absolute line number. */\n currentLine: number;\n /** Total entries in the menu. */\n totalItems: number;\n /** The visible rows. */\n rows: BrowseRow[];\n}\n\n/**\n * Parse a `<List_Info>` response (menu status, layer, name, cursor, and the eight\n * `Current_List` lines with text + attribute \u2014 the shape rxv reads).\n *\n * @param xml the List_Info response body\n * @returns the parsed window\n */\nexport function parseXmlListInfo(xml: string): XmlListInfo {\n const rows: BrowseRow[] = [];\n const linePattern = /<Line_([1-8])>\\s*<Txt>([^<]*)<\\/Txt>\\s*<Attribute>([^<]*)<\\/Attribute>/g;\n for (let match = linePattern.exec(xml); match; match = linePattern.exec(xml)) {\n if (match[2].length > 0) {\n rows.push({\n line: Number(match[1]),\n text: decodeXmlText(match[2]),\n kind: ROW_KIND_BY_ATTRIBUTE[match[3]] ?? \"item\",\n });\n }\n }\n return {\n ready: !/<Menu_Status>Busy<\\/Menu_Status>/.test(xml),\n menuName: decodeXmlText(/<Menu_Name>([^<]*)<\\/Menu_Name>/.exec(xml)?.[1] ?? \"\"),\n layer: Number(/<Menu_Layer>(\\d+)<\\/Menu_Layer>/.exec(xml)?.[1] ?? 0),\n currentLine: Number(/<Current_Line>(\\d+)<\\/Current_Line>/.exec(xml)?.[1] ?? 1),\n totalItems: Number(/<Max_Line>(\\d+)<\\/Max_Line>/.exec(xml)?.[1] ?? 0),\n rows,\n };\n}\n\n/**\n * The XML/YNC list driver over `<List_Info>` + `<List_Control>` (the predecessor\n * adapter's browsing path). Pull-based: every operation re-reads the window, polling\n * while the device reports the menu as busy (levels come from the catalog service).\n * The cursor line stands in for the window start \u2014 the same approximation rxv makes.\n */\nexport class XmlBrowseDriver implements BrowseDriver {\n private engine: BrowseEngine | undefined;\n private active: { element: string; key: string; input: string } | undefined;\n private lastTotal = 0;\n /**\n *
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAyE;AAEzE,sBAA8B;AAG9B,MAAM,eAAe;AAErB,MAAM,iBAAiB;AAOhB,MAAM,qBAAoG;AAAA,EAC/G,EAAE,SAAS,aAAa,KAAK,YAAY,OAAO,aAAa,OAAO,YAAY;AAAA,EAChF,EAAE,SAAS,UAAU,KAAK,UAAU,OAAO,gBAAgB,OAAO,SAAS;AAAA,EAC3E,EAAE,SAAS,OAAO,KAAK,OAAO,OAAO,OAAO,OAAO,MAAM;AAC3D;AAiCO,SAAS,iBAAiB,KAA0B;AAnD3D;AAoDE,QAAM,OAAoB,CAAC;AAC3B,QAAM,cAAc;AACpB,WAAS,QAAQ,YAAY,KAAK,GAAG,GAAG,OAAO,QAAQ,YAAY,KAAK,GAAG,GAAG;AAC5E,QAAI,MAAM,CAAC,EAAE,SAAS,GAAG;AACvB,WAAK,KAAK;AAAA,QACR,MAAM,OAAO,MAAM,CAAC,CAAC;AAAA,QACrB,UAAM,+BAAc,MAAM,CAAC,CAAC;AAAA,QAC5B,OAAM,wCAAsB,MAAM,CAAC,CAAC,MAA9B,YAAmC;AAAA,MAC3C,CAAC;AAAA,IACH;AAAA,EACF;AACA,SAAO;AAAA,IACL,OAAO,CAAC,mCAAmC,KAAK,GAAG;AAAA,IACnD,cAAU,gCAAc,6CAAkC,KAAK,GAAG,MAA1C,mBAA8C,OAA9C,YAAoD,EAAE;AAAA,IAC9E,OAAO,QAAO,6CAAkC,KAAK,GAAG,MAA1C,mBAA8C,OAA9C,YAAoD,CAAC;AAAA,IACnE,aAAa,QAAO,iDAAsC,KAAK,GAAG,MAA9C,mBAAkD,OAAlD,YAAwD,CAAC;AAAA,IAC7E,YAAY,QAAO,yCAA8B,KAAK,GAAG,MAAtC,mBAA0C,OAA1C,YAAgD,CAAC;AAAA,IACpE;AAAA,EACF;AACF;AAQO,MAAM,gBAAwC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
4
|
+
"sourcesContent": ["import { ROW_KIND_BY_ATTRIBUTE, type BrowseDriver, type BrowseRow } from \"./types\";\nimport type { BrowseEngine } from \"./browse-engine\";\nimport { decodeXmlText } from \"../xml/entities\";\n\n/** How often to re-read while the device reports Menu_Status Busy. */\nconst BUSY_POLL_MS = 500;\n/** How many busy polls before giving up on one read. */\nconst MAX_BUSY_POLLS = 10;\n\n/**\n * The XML/YNC sources with a List_Info menu (the ones the predecessor adapter's\n * users browsed; rxv drives the same three), with the transport-neutral source key\n * and the input name that activates the source.\n */\nexport const XML_BROWSE_SOURCES: ReadonlyArray<{ element: string; key: string; label: string; input: string }> = [\n { element: \"NET_RADIO\", key: \"netRadio\", label: \"Net Radio\", input: \"NET RADIO\" },\n { element: \"SERVER\", key: \"server\", label: \"Media server\", input: \"SERVER\" },\n { element: \"USB\", key: \"usb\", label: \"USB\", input: \"USB\" },\n];\n\n/** The client surface the driver needs (a slice of the XML client). */\nexport interface XmlBrowseClient {\n /** Send an inner PUT command to an element (a zone or a source). */\n send(element: string, inner: string): Promise<void>;\n /** Read an element's inner GET request and return the raw response body. */\n getXml(element: string, inner: string): Promise<string>;\n}\n\n/** A parsed List_Info response. */\nexport interface XmlListInfo {\n /** Whether the menu is ready (false = the device is still fetching it). */\n ready: boolean;\n /** The menu title. */\n menuName: string;\n /** The menu depth (1 = root). */\n layer: number;\n /** The cursor's absolute line number. */\n currentLine: number;\n /** Total entries in the menu. */\n totalItems: number;\n /** The visible rows. */\n rows: BrowseRow[];\n}\n\n/**\n * Parse a `<List_Info>` response (menu status, layer, name, cursor, and the eight\n * `Current_List` lines with text + attribute \u2014 the shape rxv reads).\n *\n * @param xml the List_Info response body\n * @returns the parsed window\n */\nexport function parseXmlListInfo(xml: string): XmlListInfo {\n const rows: BrowseRow[] = [];\n const linePattern = /<Line_([1-8])>\\s*<Txt>([^<]*)<\\/Txt>\\s*<Attribute>([^<]*)<\\/Attribute>/g;\n for (let match = linePattern.exec(xml); match; match = linePattern.exec(xml)) {\n if (match[2].length > 0) {\n rows.push({\n line: Number(match[1]),\n text: decodeXmlText(match[2]),\n kind: ROW_KIND_BY_ATTRIBUTE[match[3]] ?? \"item\",\n });\n }\n }\n return {\n ready: !/<Menu_Status>Busy<\\/Menu_Status>/.test(xml),\n menuName: decodeXmlText(/<Menu_Name>([^<]*)<\\/Menu_Name>/.exec(xml)?.[1] ?? \"\"),\n layer: Number(/<Menu_Layer>(\\d+)<\\/Menu_Layer>/.exec(xml)?.[1] ?? 0),\n currentLine: Number(/<Current_Line>(\\d+)<\\/Current_Line>/.exec(xml)?.[1] ?? 1),\n totalItems: Number(/<Max_Line>(\\d+)<\\/Max_Line>/.exec(xml)?.[1] ?? 0),\n rows,\n };\n}\n\n/**\n * The pad in XML wire words. Same seven keys as YNCA's main zone, two of them spelled\n * differently (`Return`, `Return to Home`). There is no documented menu-key command on this\n * generation, so the driver offers no `remote.menu`.\n */\nconst XML_CURSOR_WIRE: Record<string, string> = {\n up: \"Up\",\n down: \"Down\",\n left: \"Left\",\n right: \"Right\",\n select: \"Sel\",\n return: \"Return\",\n home: \"Return to Home\",\n};\n\n/**\n * The XML/YNC list driver over `<List_Info>` + `<List_Control>` (the predecessor\n * adapter's browsing path). Pull-based: every operation re-reads the window, polling\n * while the device reports the menu as busy (levels come from the catalog service).\n * The cursor line stands in for the window start \u2014 the same approximation rxv makes.\n */\nexport class XmlBrowseDriver implements BrowseDriver {\n private engine: BrowseEngine | undefined;\n private active: { element: string; key: string; input: string } | undefined;\n private lastTotal = 0;\n /**\n * @param client the XML client slice (send + getXml)\n * @param available the source keys whose List_Info the start-up probe answered\n * @param delay adapter-managed delay\n */\n public constructor(\n private readonly client: XmlBrowseClient,\n private readonly available: ReadonlySet<string>,\n private readonly delay: (ms: number) => Promise<void>,\n ) {}\n\n /**\n * Attach the engine that renders the windows (set after both are constructed).\n *\n * @param engine the browse engine\n */\n public attach(engine: BrowseEngine): void {\n this.engine = engine;\n }\n\n /** @returns the selectable sources this device offers (state value \u2192 label) */\n public sources(): Record<string, string> {\n const entries = XML_BROWSE_SOURCES.filter(source => this.available.has(source.key));\n return Object.fromEntries(entries.map(source => [source.key, source.label]));\n }\n\n /**\n * Open a source's menu: switch the main-zone input to it and read the window.\n *\n * @param source the source key (from {@link sources})\n */\n public async open(source: string): Promise<void> {\n const entry = XML_BROWSE_SOURCES.find(s => s.key === source && this.available.has(s.key));\n if (!entry) {\n return;\n }\n this.active = entry;\n await this.client.send(\"Main_Zone\", `<Input><Input_Sel>${entry.input}</Input_Sel></Input>`);\n await this.fetch();\n }\n\n /**\n * Select a visible line via Direct_Sel \u2014 a folder opens, a playable item starts.\n *\n * @param line the line number (1\u20138)\n */\n public async select(line: number): Promise<void> {\n await this.control(`<Direct_Sel>Line_${line}</Direct_Sel>`);\n }\n\n /** Show the previous 8 lines (jump the cursor back a page). */\n public async pageUp(): Promise<void> {\n await this.jumpBy(-8);\n }\n\n /** Show the next 8 lines (jump the cursor forward a page). */\n public async pageDown(): Promise<void> {\n await this.jumpBy(8);\n }\n\n /**\n * Go one menu level back.\n *\n * Always `Return`, never a learned substitute (krobi 2026-09-03): a refusal on ONE model is\n * no reason to change the word for every other model, and a transport error is not a refusal\n * at all. Where a receiver of the 2012 generation rejects it (#613), the user reaches the same\n * step through `remote.cursor` = `left`, which that generation accepts.\n */\n public async back(): Promise<void> {\n await this.control(\"<Cursor>Return</Cursor>\");\n }\n\n /** Return to the menu root. */\n public async home(): Promise<void> {\n await this.control(\"<Cursor>Return to Home</Cursor>\");\n }\n\n /** The cursor keys this protocol declares \u2014 the full pad, `<List_Control><Cursor>`. */\n public readonly cursorValues = Object.keys(XML_CURSOR_WIRE);\n\n /**\n * Press a cursor key on the open list.\n *\n * XML/YNC knows the cursor ONLY inside `List_Control`, addressed to the source whose menu\n * is open (`PUT <NET_RADIO><List_Control>\u2026`) \u2014 this generation has no zone-wide remote\n * endpoint, and inventing one would put a blind command on the wire. With no menu open the\n * press therefore goes nowhere, which `send()` already handles.\n *\n * @param value one of {@link cursorValues}\n */\n public async cursor(value: string): Promise<void> {\n const wire = XML_CURSOR_WIRE[value];\n if (wire === undefined) {\n return;\n }\n await this.control(`<Cursor>${wire}</Cursor>`);\n }\n\n /**\n * Send a List_Control command to the active source \u2014 WITHOUT reading the window back,\n * so a caller can tell a device refusal from a failed follow-up read (see {@link back}).\n *\n * @param inner the List_Control payload (Direct_Sel, Cursor, Jump_Line)\n */\n private async send(inner: string): Promise<void> {\n if (!this.active) {\n return;\n }\n await this.client.send(this.active.element, `<List_Control>${inner}</List_Control>`);\n }\n\n /**\n * Send a List_Control command to the active source and read the window back.\n *\n * @param inner the List_Control payload (Direct_Sel, Cursor, Jump_Line)\n */\n private async control(inner: string): Promise<void> {\n if (!this.active) {\n return;\n }\n await this.send(inner);\n await this.fetch();\n }\n\n /**\n * Jump the cursor by a page, clamped to the menu bounds.\n *\n * @param delta the line offset (\u00B18)\n */\n private async jumpBy(delta: number): Promise<void> {\n if (!this.active) {\n return;\n }\n const current = await this.readWindow();\n if (!current) {\n return;\n }\n const target = Math.min(Math.max(1, current.currentLine + delta), Math.max(1, this.lastTotal));\n await this.control(`<Jump_Line>${target}</Jump_Line>`);\n }\n\n /** Read the window (polling while busy) and render it to the engine. */\n private async fetch(): Promise<void> {\n const window = await this.readWindow();\n if (window) {\n this.lastTotal = window.totalItems;\n this.engine?.onWindow({\n menuName: window.menuName,\n layer: window.layer,\n totalItems: window.totalItems,\n currentLine: window.currentLine,\n rows: window.rows,\n });\n }\n }\n\n /**\n * Read the active source's List_Info, polling while the device reports Busy.\n *\n * @returns the parsed window, or undefined without an active source / when busy persists\n */\n private async readWindow(): Promise<XmlListInfo | undefined> {\n if (!this.active) {\n return undefined;\n }\n for (let attempt = 0; attempt < MAX_BUSY_POLLS; attempt++) {\n const info = parseXmlListInfo(await this.client.getXml(this.active.element, \"<List_Info>GetParam</List_Info>\"));\n if (info.ready) {\n return info;\n }\n await this.delay(BUSY_POLL_MS);\n }\n return undefined;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAyE;AAEzE,sBAA8B;AAG9B,MAAM,eAAe;AAErB,MAAM,iBAAiB;AAOhB,MAAM,qBAAoG;AAAA,EAC/G,EAAE,SAAS,aAAa,KAAK,YAAY,OAAO,aAAa,OAAO,YAAY;AAAA,EAChF,EAAE,SAAS,UAAU,KAAK,UAAU,OAAO,gBAAgB,OAAO,SAAS;AAAA,EAC3E,EAAE,SAAS,OAAO,KAAK,OAAO,OAAO,OAAO,OAAO,MAAM;AAC3D;AAiCO,SAAS,iBAAiB,KAA0B;AAnD3D;AAoDE,QAAM,OAAoB,CAAC;AAC3B,QAAM,cAAc;AACpB,WAAS,QAAQ,YAAY,KAAK,GAAG,GAAG,OAAO,QAAQ,YAAY,KAAK,GAAG,GAAG;AAC5E,QAAI,MAAM,CAAC,EAAE,SAAS,GAAG;AACvB,WAAK,KAAK;AAAA,QACR,MAAM,OAAO,MAAM,CAAC,CAAC;AAAA,QACrB,UAAM,+BAAc,MAAM,CAAC,CAAC;AAAA,QAC5B,OAAM,wCAAsB,MAAM,CAAC,CAAC,MAA9B,YAAmC;AAAA,MAC3C,CAAC;AAAA,IACH;AAAA,EACF;AACA,SAAO;AAAA,IACL,OAAO,CAAC,mCAAmC,KAAK,GAAG;AAAA,IACnD,cAAU,gCAAc,6CAAkC,KAAK,GAAG,MAA1C,mBAA8C,OAA9C,YAAoD,EAAE;AAAA,IAC9E,OAAO,QAAO,6CAAkC,KAAK,GAAG,MAA1C,mBA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Ac,KAAK,GAAG,KAAK,IAAI,GAAG,KAAK,SAAS,CAAC;AAC7F,UAAM,KAAK,QAAQ,cAAc,MAAM,cAAc;AAAA,EACvD;AAAA;AAAA,EAGA,MAAc,QAAuB;AAhPvC;AAiPI,UAAM,SAAS,MAAM,KAAK,WAAW;AACrC,QAAI,QAAQ;AACV,WAAK,YAAY,OAAO;AACxB,iBAAK,WAAL,mBAAa,SAAS;AAAA,QACpB,UAAU,OAAO;AAAA,QACjB,OAAO,OAAO;AAAA,QACd,YAAY,OAAO;AAAA,QACnB,aAAa,OAAO;AAAA,QACpB,MAAM,OAAO;AAAA,MACf;AAAA,IACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAc,aAA+C;AAC3D,QAAI,CAAC,KAAK,QAAQ;AAChB,aAAO;AAAA,IACT;AACA,aAAS,UAAU,GAAG,UAAU,gBAAgB,WAAW;AACzD,YAAM,OAAO,iBAAiB,MAAM,KAAK,OAAO,OAAO,KAAK,OAAO,SAAS,iCAAiC,CAAC;AAC9G,UAAI,KAAK,OAAO;AACd,eAAO;AAAA,MACT;AACA,YAAM,KAAK,MAAM,YAAY;AAAA,IAC/B;AACA,WAAO;AAAA,EACT;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -36,6 +36,21 @@ const YNCA_BROWSE_SOURCES = [
|
|
|
36
36
|
{ subunit: "RHAP", key: "rhapsody", label: "Rhapsody", input: "Rhapsody" },
|
|
37
37
|
{ subunit: "SIRIUS", key: "sirius", label: "SiriusXM", input: "SIRIUS" }
|
|
38
38
|
];
|
|
39
|
+
const YNCA_CURSOR_WIRE = {
|
|
40
|
+
up: "Up",
|
|
41
|
+
down: "Down",
|
|
42
|
+
left: "Left",
|
|
43
|
+
right: "Right",
|
|
44
|
+
select: "Sel",
|
|
45
|
+
return: "Back",
|
|
46
|
+
home: "Back to Home"
|
|
47
|
+
};
|
|
48
|
+
const YNCA_MENU_WIRE = {
|
|
49
|
+
on_screen: "On Screen",
|
|
50
|
+
top_menu: "Top Menu",
|
|
51
|
+
menu: "Menu",
|
|
52
|
+
option: "Option"
|
|
53
|
+
};
|
|
39
54
|
class YncaBrowseDriver {
|
|
40
55
|
/**
|
|
41
56
|
* @param client the YNCA client slice (send + get)
|
|
@@ -73,6 +88,10 @@ class YncaBrowseDriver {
|
|
|
73
88
|
close() {
|
|
74
89
|
this.closed = true;
|
|
75
90
|
}
|
|
91
|
+
/** The cursor keys this protocol has on the main zone. */
|
|
92
|
+
cursorValues = Object.keys(YNCA_CURSOR_WIRE);
|
|
93
|
+
/** The menu keys this protocol has on the main zone. */
|
|
94
|
+
menuValues = Object.keys(YNCA_MENU_WIRE);
|
|
76
95
|
/** @returns the selectable sources this device offers (state value → label) */
|
|
77
96
|
sources() {
|
|
78
97
|
const entries = YNCA_BROWSE_SOURCES.filter((source) => this.present.has(source.subunit));
|
|
@@ -110,7 +129,15 @@ class YncaBrowseDriver {
|
|
|
110
129
|
pageDown() {
|
|
111
130
|
this.command("LISTPAGE", "Down");
|
|
112
131
|
}
|
|
113
|
-
/**
|
|
132
|
+
/**
|
|
133
|
+
* Go one menu level back.
|
|
134
|
+
*
|
|
135
|
+
* Always `Back`, never a learned substitute: a refusal is not proof that the model lacks the
|
|
136
|
+
* step — `@RESTRICTED` also comes back while the receiver is in standby, and switching the
|
|
137
|
+
* whole device to `Left` on that would break the receivers where `Back` is the right word.
|
|
138
|
+
* A model that only knows `Left` (RX-V473, issue #613) is served by `remote.cursor`, which
|
|
139
|
+
* offers every value the official command list declares, including `Left`.
|
|
140
|
+
*/
|
|
114
141
|
back() {
|
|
115
142
|
this.command("LISTCURSOR", "Back");
|
|
116
143
|
}
|
|
@@ -118,6 +145,42 @@ class YncaBrowseDriver {
|
|
|
118
145
|
home() {
|
|
119
146
|
this.command("LISTCURSOR", "Back to Home");
|
|
120
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* Press a cursor key — always on `@MAIN`, never on the open source.
|
|
150
|
+
*
|
|
151
|
+
* The official command list gives MAIN the FULL pad (Up/Down/Left/Right/Sel/Back/Back to
|
|
152
|
+
* Home) while the source subunits (`@NETRADIO`, `@USB`, …) declare only
|
|
153
|
+
* Up/Down/Sel/Back/Back to Home — no Left, no Right. Sending to MAIN therefore gives the
|
|
154
|
+
* user every key the device has, and it works with no list open: this is the on-screen
|
|
155
|
+
* menu of the receiver, not a list window. That is also the way out for a model that
|
|
156
|
+
* refuses `Back` on the list (#613) — `left` steps back there.
|
|
157
|
+
*
|
|
158
|
+
* @param value one of {@link cursorValues}
|
|
159
|
+
*/
|
|
160
|
+
cursor(value) {
|
|
161
|
+
this.send("LISTCURSOR", YNCA_CURSOR_WIRE[value]);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Press a menu key (`@MAIN:LISTMENU`).
|
|
165
|
+
*
|
|
166
|
+
* @param value one of {@link menuValues}
|
|
167
|
+
*/
|
|
168
|
+
menu(value) {
|
|
169
|
+
this.send("LISTMENU", YNCA_MENU_WIRE[value]);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Send one main-zone remote command and re-read the window.
|
|
173
|
+
*
|
|
174
|
+
* @param func the YNCA function (LISTCURSOR, LISTMENU)
|
|
175
|
+
* @param wire the wire value, or undefined for a word this device has no key for
|
|
176
|
+
*/
|
|
177
|
+
send(func, wire) {
|
|
178
|
+
if (this.closed || wire === void 0) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
this.client.send("MAIN", func, wire);
|
|
182
|
+
this.refresh();
|
|
183
|
+
}
|
|
121
184
|
/** Re-read the current window (`LISTINFO=?` answers with the full field burst). */
|
|
122
185
|
refresh() {
|
|
123
186
|
if (this.active) {
|