@jellybrick/mpris-service 2.1.5 → 2.2.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/dist/index.cjs +2244 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +314 -0
- package/dist/index.d.mts +314 -0
- package/dist/index.mjs +2244 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +46 -28
- package/.dockerignore +0 -1
- package/.travis.yml +0 -9
- package/Dockerfile +0 -31
- package/Makefile +0 -14
- package/dist/constants.js +0 -20
- package/dist/constants.js.map +0 -1
- package/dist/index.js +0 -442
- package/dist/index.js.map +0 -1
- package/dist/interfaces/mpris-interface.js +0 -49
- package/dist/interfaces/mpris-interface.js.map +0 -1
- package/dist/interfaces/player.js +0 -406
- package/dist/interfaces/player.js.map +0 -1
- package/dist/interfaces/playlists.js +0 -139
- package/dist/interfaces/playlists.js.map +0 -1
- package/dist/interfaces/root.js +0 -216
- package/dist/interfaces/root.js.map +0 -1
- package/dist/interfaces/tracklist.js +0 -160
- package/dist/interfaces/tracklist.js.map +0 -1
- package/dist/interfaces/types.js +0 -78
- package/dist/interfaces/types.js.map +0 -1
- package/dist/logging.js +0 -14
- package/dist/logging.js.map +0 -1
- package/src/constants.js +0 -31
- package/src/index.js +0 -477
- package/src/interfaces/mpris-interface.js +0 -53
- package/src/interfaces/player.js +0 -204
- package/src/interfaces/playlists.js +0 -84
- package/src/interfaces/root.js +0 -99
- package/src/interfaces/tracklist.js +0 -85
- package/src/interfaces/types.js +0 -75
- package/src/logging.js +0 -13
package/dist/interfaces/root.js
DELETED
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _decorate(e, r, t, i) { var o = _getDecoratorsApi(); if (i) for (var n = 0; n < i.length; n++) o = i[n](o); var s = r(function (e) { o.initializeInstanceElements(e, a.elements); }, t), a = o.decorateClass(_coalesceClassElements(s.d.map(_createElementDescriptor)), e); return o.initializeClassElements(s.F, a.elements), o.runClassFinishers(s.F, a.finishers); }
|
|
4
|
-
function _getDecoratorsApi() { _getDecoratorsApi = function () { return e; }; var e = { elementsDefinitionOrder: [["method"], ["field"]], initializeInstanceElements: function (e, r) { ["method", "field"].forEach(function (t) { r.forEach(function (r) { r.kind === t && "own" === r.placement && this.defineClassElement(e, r); }, this); }, this); }, initializeClassElements: function (e, r) { var t = e.prototype; ["method", "field"].forEach(function (i) { r.forEach(function (r) { var o = r.placement; if (r.kind === i && ("static" === o || "prototype" === o)) { var n = "static" === o ? e : t; this.defineClassElement(n, r); } }, this); }, this); }, defineClassElement: function (e, r) { var t = r.descriptor; if ("field" === r.kind) { var i = r.initializer; t = { enumerable: t.enumerable, writable: t.writable, configurable: t.configurable, value: void 0 === i ? void 0 : i.call(e) }; } Object.defineProperty(e, r.key, t); }, decorateClass: function (e, r) { var t = [], i = [], o = { static: [], prototype: [], own: [] }; if (e.forEach(function (e) { this.addElementPlacement(e, o); }, this), e.forEach(function (e) { if (!_hasDecorators(e)) return t.push(e); var r = this.decorateElement(e, o); t.push(r.element), t.push.apply(t, r.extras), i.push.apply(i, r.finishers); }, this), !r) return { elements: t, finishers: i }; var n = this.decorateConstructor(t, r); return i.push.apply(i, n.finishers), n.finishers = i, n; }, addElementPlacement: function (e, r, t) { var i = r[e.placement]; if (!t && -1 !== i.indexOf(e.key)) throw new TypeError("Duplicated element (" + e.key + ")"); i.push(e.key); }, decorateElement: function (e, r) { for (var t = [], i = [], o = e.decorators, n = o.length - 1; n >= 0; n--) { var s = r[e.placement]; s.splice(s.indexOf(e.key), 1); var a = this.fromElementDescriptor(e), l = this.toElementFinisherExtras((0, o[n])(a) || a); e = l.element, this.addElementPlacement(e, r), l.finisher && i.push(l.finisher); var c = l.extras; if (c) { for (var p = 0; p < c.length; p++) this.addElementPlacement(c[p], r); t.push.apply(t, c); } } return { element: e, finishers: i, extras: t }; }, decorateConstructor: function (e, r) { for (var t = [], i = r.length - 1; i >= 0; i--) { var o = this.fromClassDescriptor(e), n = this.toClassDescriptor((0, r[i])(o) || o); if (void 0 !== n.finisher && t.push(n.finisher), void 0 !== n.elements) { e = n.elements; for (var s = 0; s < e.length - 1; s++) for (var a = s + 1; a < e.length; a++) if (e[s].key === e[a].key && e[s].placement === e[a].placement) throw new TypeError("Duplicated element (" + e[s].key + ")"); } } return { elements: e, finishers: t }; }, fromElementDescriptor: function (e) { var r = { kind: e.kind, key: e.key, placement: e.placement, descriptor: e.descriptor }; return Object.defineProperty(r, Symbol.toStringTag, { value: "Descriptor", configurable: !0 }), "field" === e.kind && (r.initializer = e.initializer), r; }, toElementDescriptors: function (e) { if (void 0 !== e) return _toArray(e).map(function (e) { var r = this.toElementDescriptor(e); return this.disallowProperty(e, "finisher", "An element descriptor"), this.disallowProperty(e, "extras", "An element descriptor"), r; }, this); }, toElementDescriptor: function (e) { var r = e.kind + ""; if ("method" !== r && "field" !== r) throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "' + r + '"'); var t = _toPropertyKey(e.key), i = e.placement + ""; if ("static" !== i && "prototype" !== i && "own" !== i) throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "' + i + '"'); var o = e.descriptor; this.disallowProperty(e, "elements", "An element descriptor"); var n = { kind: r, key: t, placement: i, descriptor: Object.assign({}, o) }; return "field" !== r ? this.disallowProperty(e, "initializer", "A method descriptor") : (this.disallowProperty(o, "get", "The property descriptor of a field descriptor"), this.disallowProperty(o, "set", "The property descriptor of a field descriptor"), this.disallowProperty(o, "value", "The property descriptor of a field descriptor"), n.initializer = e.initializer), n; }, toElementFinisherExtras: function (e) { return { element: this.toElementDescriptor(e), finisher: _optionalCallableProperty(e, "finisher"), extras: this.toElementDescriptors(e.extras) }; }, fromClassDescriptor: function (e) { var r = { kind: "class", elements: e.map(this.fromElementDescriptor, this) }; return Object.defineProperty(r, Symbol.toStringTag, { value: "Descriptor", configurable: !0 }), r; }, toClassDescriptor: function (e) { var r = e.kind + ""; if ("class" !== r) throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "' + r + '"'); this.disallowProperty(e, "key", "A class descriptor"), this.disallowProperty(e, "placement", "A class descriptor"), this.disallowProperty(e, "descriptor", "A class descriptor"), this.disallowProperty(e, "initializer", "A class descriptor"), this.disallowProperty(e, "extras", "A class descriptor"); var t = _optionalCallableProperty(e, "finisher"); return { elements: this.toElementDescriptors(e.elements), finisher: t }; }, runClassFinishers: function (e, r) { for (var t = 0; t < r.length; t++) { var i = (0, r[t])(e); if (void 0 !== i) { if ("function" != typeof i) throw new TypeError("Finishers must return a constructor."); e = i; } } return e; }, disallowProperty: function (e, r, t) { if (void 0 !== e[r]) throw new TypeError(t + " can't have a ." + r + " property."); } }; return e; }
|
|
5
|
-
function _createElementDescriptor(e) { var r, t = _toPropertyKey(e.key); "method" === e.kind ? r = { value: e.value, writable: !0, configurable: !0, enumerable: !1 } : "get" === e.kind ? r = { get: e.value, configurable: !0, enumerable: !1 } : "set" === e.kind ? r = { set: e.value, configurable: !0, enumerable: !1 } : "field" === e.kind && (r = { configurable: !0, writable: !0, enumerable: !0 }); var i = { kind: "field" === e.kind ? "field" : "method", key: t, placement: e.static ? "static" : "field" === e.kind ? "own" : "prototype", descriptor: r }; return e.decorators && (i.decorators = e.decorators), "field" === e.kind && (i.initializer = e.value), i; }
|
|
6
|
-
function _coalesceGetterSetter(e, r) { void 0 !== e.descriptor.get ? r.descriptor.get = e.descriptor.get : r.descriptor.set = e.descriptor.set; }
|
|
7
|
-
function _coalesceClassElements(e) { for (var r = [], isSameElement = function (e) { return "method" === e.kind && e.key === o.key && e.placement === o.placement; }, t = 0; t < e.length; t++) { var i, o = e[t]; if ("method" === o.kind && (i = r.find(isSameElement))) { if (_isDataDescriptor(o.descriptor) || _isDataDescriptor(i.descriptor)) { if (_hasDecorators(o) || _hasDecorators(i)) throw new ReferenceError("Duplicated methods (" + o.key + ") can't be decorated."); i.descriptor = o.descriptor; } else { if (_hasDecorators(o)) { if (_hasDecorators(i)) throw new ReferenceError("Decorators can't be placed on different accessors with for the same property (" + o.key + ")."); i.decorators = o.decorators; } _coalesceGetterSetter(o, i); } } else r.push(o); } return r; }
|
|
8
|
-
function _hasDecorators(e) { return e.decorators && e.decorators.length; }
|
|
9
|
-
function _isDataDescriptor(e) { return void 0 !== e && !(void 0 === e.value && void 0 === e.writable); }
|
|
10
|
-
function _optionalCallableProperty(e, r) { var t = e[r]; if (void 0 !== t && "function" != typeof t) throw new TypeError("Expected '" + r + "' to be a function"); return t; }
|
|
11
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
12
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
13
|
-
function _toArray(r) { return _arrayWithHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableRest(); }
|
|
14
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
15
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
16
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
17
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
18
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
19
|
-
const MprisInterface = require('./mpris-interface');
|
|
20
|
-
const dbus = require('@jellybrick/dbus-next');
|
|
21
|
-
const {
|
|
22
|
-
property,
|
|
23
|
-
method,
|
|
24
|
-
ACCESS_READ
|
|
25
|
-
} = dbus.interface;
|
|
26
|
-
let RootInterface = _decorate(null, function (_initialize, _MprisInterface) {
|
|
27
|
-
class RootInterface extends _MprisInterface {
|
|
28
|
-
constructor(player, opts = {}) {
|
|
29
|
-
super('org.mpris.MediaPlayer2', player);
|
|
30
|
-
_initialize(this);
|
|
31
|
-
if (opts.hasOwnProperty('identity')) {
|
|
32
|
-
this._Identity = opts.identity;
|
|
33
|
-
}
|
|
34
|
-
if (opts.hasOwnProperty('supportedUriSchemes')) {
|
|
35
|
-
this._SupportedUriSchemes = opts.supportedUriSchemes;
|
|
36
|
-
}
|
|
37
|
-
if (opts.hasOwnProperty('supportedMimeTypes')) {
|
|
38
|
-
this._SupportedMimeTypes = opts.supportedMimeTypes;
|
|
39
|
-
}
|
|
40
|
-
if (opts.hasOwnProperty('desktopEntry')) {
|
|
41
|
-
this._DesktopEntry = opts.desktopEntry;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// TODO optional properties
|
|
46
|
-
}
|
|
47
|
-
return {
|
|
48
|
-
F: RootInterface,
|
|
49
|
-
d: [{
|
|
50
|
-
kind: "field",
|
|
51
|
-
key: "_CanQuit",
|
|
52
|
-
value() {
|
|
53
|
-
return true;
|
|
54
|
-
}
|
|
55
|
-
}, {
|
|
56
|
-
kind: "field",
|
|
57
|
-
key: "_Fullscreen",
|
|
58
|
-
value() {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
}, {
|
|
62
|
-
kind: "field",
|
|
63
|
-
key: "_CanSetFullscreen",
|
|
64
|
-
value() {
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
}, {
|
|
68
|
-
kind: "field",
|
|
69
|
-
key: "_CanRaise",
|
|
70
|
-
value() {
|
|
71
|
-
return true;
|
|
72
|
-
}
|
|
73
|
-
}, {
|
|
74
|
-
kind: "field",
|
|
75
|
-
key: "_HasTrackList",
|
|
76
|
-
value() {
|
|
77
|
-
return false;
|
|
78
|
-
}
|
|
79
|
-
}, {
|
|
80
|
-
kind: "field",
|
|
81
|
-
key: "_Identity",
|
|
82
|
-
value() {
|
|
83
|
-
return '';
|
|
84
|
-
}
|
|
85
|
-
}, {
|
|
86
|
-
kind: "field",
|
|
87
|
-
key: "_DesktopEntry",
|
|
88
|
-
value() {
|
|
89
|
-
return '';
|
|
90
|
-
}
|
|
91
|
-
}, {
|
|
92
|
-
kind: "field",
|
|
93
|
-
key: "_SupportedUriSchemes",
|
|
94
|
-
value() {
|
|
95
|
-
return [];
|
|
96
|
-
}
|
|
97
|
-
}, {
|
|
98
|
-
kind: "field",
|
|
99
|
-
key: "_SupportedMimeTypes",
|
|
100
|
-
value() {
|
|
101
|
-
return [];
|
|
102
|
-
}
|
|
103
|
-
}, {
|
|
104
|
-
kind: "get",
|
|
105
|
-
decorators: [property({
|
|
106
|
-
signature: 'b',
|
|
107
|
-
access: ACCESS_READ
|
|
108
|
-
})],
|
|
109
|
-
key: "CanQuit",
|
|
110
|
-
value: function () {
|
|
111
|
-
return this._CanQuit;
|
|
112
|
-
}
|
|
113
|
-
}, {
|
|
114
|
-
kind: "get",
|
|
115
|
-
decorators: [property({
|
|
116
|
-
signature: 'b'
|
|
117
|
-
})],
|
|
118
|
-
key: "Fullscreen",
|
|
119
|
-
value: function () {
|
|
120
|
-
return this._Fullscreen;
|
|
121
|
-
}
|
|
122
|
-
}, {
|
|
123
|
-
kind: "set",
|
|
124
|
-
key: "Fullscreen",
|
|
125
|
-
value: function (value) {
|
|
126
|
-
this._setPropertyInternal('Fullscreen', value);
|
|
127
|
-
}
|
|
128
|
-
}, {
|
|
129
|
-
kind: "get",
|
|
130
|
-
decorators: [property({
|
|
131
|
-
signature: 'b',
|
|
132
|
-
access: ACCESS_READ
|
|
133
|
-
})],
|
|
134
|
-
key: "CanSetFullscreen",
|
|
135
|
-
value: function () {
|
|
136
|
-
return this._CanSetFullscreen;
|
|
137
|
-
}
|
|
138
|
-
}, {
|
|
139
|
-
kind: "get",
|
|
140
|
-
decorators: [property({
|
|
141
|
-
signature: 'b',
|
|
142
|
-
access: ACCESS_READ
|
|
143
|
-
})],
|
|
144
|
-
key: "CanRaise",
|
|
145
|
-
value: function () {
|
|
146
|
-
return this._CanRaise;
|
|
147
|
-
}
|
|
148
|
-
}, {
|
|
149
|
-
kind: "get",
|
|
150
|
-
decorators: [property({
|
|
151
|
-
signature: 'b',
|
|
152
|
-
access: ACCESS_READ
|
|
153
|
-
})],
|
|
154
|
-
key: "HasTrackList",
|
|
155
|
-
value: function () {
|
|
156
|
-
return this._HasTrackList;
|
|
157
|
-
}
|
|
158
|
-
}, {
|
|
159
|
-
kind: "get",
|
|
160
|
-
decorators: [property({
|
|
161
|
-
signature: 's',
|
|
162
|
-
access: ACCESS_READ
|
|
163
|
-
})],
|
|
164
|
-
key: "Identity",
|
|
165
|
-
value: function () {
|
|
166
|
-
return this._Identity;
|
|
167
|
-
}
|
|
168
|
-
}, {
|
|
169
|
-
kind: "get",
|
|
170
|
-
decorators: [property({
|
|
171
|
-
signature: 's',
|
|
172
|
-
access: ACCESS_READ
|
|
173
|
-
})],
|
|
174
|
-
key: "DesktopEntry",
|
|
175
|
-
value: function () {
|
|
176
|
-
return this._DesktopEntry;
|
|
177
|
-
}
|
|
178
|
-
}, {
|
|
179
|
-
kind: "get",
|
|
180
|
-
decorators: [property({
|
|
181
|
-
signature: 'as',
|
|
182
|
-
access: ACCESS_READ
|
|
183
|
-
})],
|
|
184
|
-
key: "SupportedUriSchemes",
|
|
185
|
-
value: function () {
|
|
186
|
-
return this._SupportedUriSchemes;
|
|
187
|
-
}
|
|
188
|
-
}, {
|
|
189
|
-
kind: "get",
|
|
190
|
-
decorators: [property({
|
|
191
|
-
signature: 'as',
|
|
192
|
-
access: ACCESS_READ
|
|
193
|
-
})],
|
|
194
|
-
key: "SupportedMimeTypes",
|
|
195
|
-
value: function () {
|
|
196
|
-
return this._SupportedMimeTypes;
|
|
197
|
-
}
|
|
198
|
-
}, {
|
|
199
|
-
kind: "method",
|
|
200
|
-
decorators: [method({})],
|
|
201
|
-
key: "Raise",
|
|
202
|
-
value: function Raise() {
|
|
203
|
-
this.player.emit('raise');
|
|
204
|
-
}
|
|
205
|
-
}, {
|
|
206
|
-
kind: "method",
|
|
207
|
-
decorators: [method({})],
|
|
208
|
-
key: "Quit",
|
|
209
|
-
value: function Quit() {
|
|
210
|
-
this.player.emit('quit');
|
|
211
|
-
}
|
|
212
|
-
}]
|
|
213
|
-
};
|
|
214
|
-
}, MprisInterface);
|
|
215
|
-
module.exports = RootInterface;
|
|
216
|
-
//# sourceMappingURL=root.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"root.js","names":["MprisInterface","require","dbus","property","method","ACCESS_READ","interface","RootInterface","_decorate","_initialize","_MprisInterface","constructor","player","opts","hasOwnProperty","_Identity","identity","_SupportedUriSchemes","supportedUriSchemes","_SupportedMimeTypes","supportedMimeTypes","_DesktopEntry","desktopEntry","F","d","kind","key","value","decorators","signature","access","_CanQuit","_Fullscreen","_setPropertyInternal","_CanSetFullscreen","_CanRaise","_HasTrackList","Raise","emit","Quit","module","exports"],"sourceRoot":"../../src/","sources":["interfaces/root.js"],"sourcesContent":["const MprisInterface = require('./mpris-interface');\nconst dbus = require('@jellybrick/dbus-next');\n\n\nconst {\n property,\n method,\n ACCESS_READ\n} = dbus.interface;\n\nclass RootInterface extends MprisInterface {\n constructor(player, opts={}) {\n super('org.mpris.MediaPlayer2', player);\n\n if (opts.hasOwnProperty('identity')) {\n this._Identity = opts.identity;\n }\n if (opts.hasOwnProperty('supportedUriSchemes')) {\n this._SupportedUriSchemes = opts.supportedUriSchemes;\n }\n if (opts.hasOwnProperty('supportedMimeTypes')) {\n this._SupportedMimeTypes = opts.supportedMimeTypes;\n }\n if (opts.hasOwnProperty('desktopEntry')) {\n this._DesktopEntry = opts.desktopEntry;\n }\n }\n\n _CanQuit = true;\n _Fullscreen = false;\n _CanSetFullscreen = false;\n _CanRaise = true;\n _HasTrackList = false;\n _Identity = '';\n // TODO optional properties\n _DesktopEntry = '';\n _SupportedUriSchemes = [];\n _SupportedMimeTypes = [];\n\n @property({signature: 'b', access: ACCESS_READ})\n get CanQuit() {\n return this._CanQuit;\n }\n\n @property({signature: 'b'})\n get Fullscreen() {\n return this._Fullscreen;\n }\n set Fullscreen(value) {\n this._setPropertyInternal('Fullscreen', value);\n }\n\n @property({signature: 'b', access: ACCESS_READ})\n get CanSetFullscreen() {\n return this._CanSetFullscreen;\n }\n\n @property({signature: 'b', access: ACCESS_READ})\n get CanRaise() {\n return this._CanRaise;\n }\n\n @property({signature: 'b', access: ACCESS_READ})\n get HasTrackList() {\n return this._HasTrackList;\n }\n\n @property({signature: 's', access: ACCESS_READ})\n get Identity() {\n return this._Identity;\n }\n\n @property({signature: 's', access: ACCESS_READ})\n get DesktopEntry() {\n return this._DesktopEntry;\n }\n\n @property({signature: 'as', access: ACCESS_READ})\n get SupportedUriSchemes() {\n return this._SupportedUriSchemes;\n }\n\n @property({signature: 'as', access: ACCESS_READ})\n get SupportedMimeTypes() {\n return this._SupportedMimeTypes;\n }\n\n @method({})\n Raise() {\n this.player.emit('raise');\n }\n\n @method({})\n Quit() {\n this.player.emit('quit');\n }\n}\n\nmodule.exports = RootInterface;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,MAAMA,cAAc,GAAGC,OAAO,CAAC,mBAAmB,CAAC;AACnD,MAAMC,IAAI,GAAGD,OAAO,CAAC,uBAAuB,CAAC;AAG7C,MAAM;EACJE,QAAQ;EACRC,MAAM;EACNC;AACF,CAAC,GAAGH,IAAI,CAACI,SAAS;AAAC,IAEbC,aAAa,GAAAC,SAAA,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,CAAC0B,IAAI,CAAC,MAAM,CAAC;MAC1B;IAAC;EAAA;AAAA,GArFyBtC,cAAc;AAwF1CwC,MAAM,CAACC,OAAO,GAAGlC,aAAa","ignoreList":[]}
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _decorate(e, r, t, i) { var o = _getDecoratorsApi(); if (i) for (var n = 0; n < i.length; n++) o = i[n](o); var s = r(function (e) { o.initializeInstanceElements(e, a.elements); }, t), a = o.decorateClass(_coalesceClassElements(s.d.map(_createElementDescriptor)), e); return o.initializeClassElements(s.F, a.elements), o.runClassFinishers(s.F, a.finishers); }
|
|
4
|
-
function _getDecoratorsApi() { _getDecoratorsApi = function () { return e; }; var e = { elementsDefinitionOrder: [["method"], ["field"]], initializeInstanceElements: function (e, r) { ["method", "field"].forEach(function (t) { r.forEach(function (r) { r.kind === t && "own" === r.placement && this.defineClassElement(e, r); }, this); }, this); }, initializeClassElements: function (e, r) { var t = e.prototype; ["method", "field"].forEach(function (i) { r.forEach(function (r) { var o = r.placement; if (r.kind === i && ("static" === o || "prototype" === o)) { var n = "static" === o ? e : t; this.defineClassElement(n, r); } }, this); }, this); }, defineClassElement: function (e, r) { var t = r.descriptor; if ("field" === r.kind) { var i = r.initializer; t = { enumerable: t.enumerable, writable: t.writable, configurable: t.configurable, value: void 0 === i ? void 0 : i.call(e) }; } Object.defineProperty(e, r.key, t); }, decorateClass: function (e, r) { var t = [], i = [], o = { static: [], prototype: [], own: [] }; if (e.forEach(function (e) { this.addElementPlacement(e, o); }, this), e.forEach(function (e) { if (!_hasDecorators(e)) return t.push(e); var r = this.decorateElement(e, o); t.push(r.element), t.push.apply(t, r.extras), i.push.apply(i, r.finishers); }, this), !r) return { elements: t, finishers: i }; var n = this.decorateConstructor(t, r); return i.push.apply(i, n.finishers), n.finishers = i, n; }, addElementPlacement: function (e, r, t) { var i = r[e.placement]; if (!t && -1 !== i.indexOf(e.key)) throw new TypeError("Duplicated element (" + e.key + ")"); i.push(e.key); }, decorateElement: function (e, r) { for (var t = [], i = [], o = e.decorators, n = o.length - 1; n >= 0; n--) { var s = r[e.placement]; s.splice(s.indexOf(e.key), 1); var a = this.fromElementDescriptor(e), l = this.toElementFinisherExtras((0, o[n])(a) || a); e = l.element, this.addElementPlacement(e, r), l.finisher && i.push(l.finisher); var c = l.extras; if (c) { for (var p = 0; p < c.length; p++) this.addElementPlacement(c[p], r); t.push.apply(t, c); } } return { element: e, finishers: i, extras: t }; }, decorateConstructor: function (e, r) { for (var t = [], i = r.length - 1; i >= 0; i--) { var o = this.fromClassDescriptor(e), n = this.toClassDescriptor((0, r[i])(o) || o); if (void 0 !== n.finisher && t.push(n.finisher), void 0 !== n.elements) { e = n.elements; for (var s = 0; s < e.length - 1; s++) for (var a = s + 1; a < e.length; a++) if (e[s].key === e[a].key && e[s].placement === e[a].placement) throw new TypeError("Duplicated element (" + e[s].key + ")"); } } return { elements: e, finishers: t }; }, fromElementDescriptor: function (e) { var r = { kind: e.kind, key: e.key, placement: e.placement, descriptor: e.descriptor }; return Object.defineProperty(r, Symbol.toStringTag, { value: "Descriptor", configurable: !0 }), "field" === e.kind && (r.initializer = e.initializer), r; }, toElementDescriptors: function (e) { if (void 0 !== e) return _toArray(e).map(function (e) { var r = this.toElementDescriptor(e); return this.disallowProperty(e, "finisher", "An element descriptor"), this.disallowProperty(e, "extras", "An element descriptor"), r; }, this); }, toElementDescriptor: function (e) { var r = e.kind + ""; if ("method" !== r && "field" !== r) throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "' + r + '"'); var t = _toPropertyKey(e.key), i = e.placement + ""; if ("static" !== i && "prototype" !== i && "own" !== i) throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "' + i + '"'); var o = e.descriptor; this.disallowProperty(e, "elements", "An element descriptor"); var n = { kind: r, key: t, placement: i, descriptor: Object.assign({}, o) }; return "field" !== r ? this.disallowProperty(e, "initializer", "A method descriptor") : (this.disallowProperty(o, "get", "The property descriptor of a field descriptor"), this.disallowProperty(o, "set", "The property descriptor of a field descriptor"), this.disallowProperty(o, "value", "The property descriptor of a field descriptor"), n.initializer = e.initializer), n; }, toElementFinisherExtras: function (e) { return { element: this.toElementDescriptor(e), finisher: _optionalCallableProperty(e, "finisher"), extras: this.toElementDescriptors(e.extras) }; }, fromClassDescriptor: function (e) { var r = { kind: "class", elements: e.map(this.fromElementDescriptor, this) }; return Object.defineProperty(r, Symbol.toStringTag, { value: "Descriptor", configurable: !0 }), r; }, toClassDescriptor: function (e) { var r = e.kind + ""; if ("class" !== r) throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "' + r + '"'); this.disallowProperty(e, "key", "A class descriptor"), this.disallowProperty(e, "placement", "A class descriptor"), this.disallowProperty(e, "descriptor", "A class descriptor"), this.disallowProperty(e, "initializer", "A class descriptor"), this.disallowProperty(e, "extras", "A class descriptor"); var t = _optionalCallableProperty(e, "finisher"); return { elements: this.toElementDescriptors(e.elements), finisher: t }; }, runClassFinishers: function (e, r) { for (var t = 0; t < r.length; t++) { var i = (0, r[t])(e); if (void 0 !== i) { if ("function" != typeof i) throw new TypeError("Finishers must return a constructor."); e = i; } } return e; }, disallowProperty: function (e, r, t) { if (void 0 !== e[r]) throw new TypeError(t + " can't have a ." + r + " property."); } }; return e; }
|
|
5
|
-
function _createElementDescriptor(e) { var r, t = _toPropertyKey(e.key); "method" === e.kind ? r = { value: e.value, writable: !0, configurable: !0, enumerable: !1 } : "get" === e.kind ? r = { get: e.value, configurable: !0, enumerable: !1 } : "set" === e.kind ? r = { set: e.value, configurable: !0, enumerable: !1 } : "field" === e.kind && (r = { configurable: !0, writable: !0, enumerable: !0 }); var i = { kind: "field" === e.kind ? "field" : "method", key: t, placement: e.static ? "static" : "field" === e.kind ? "own" : "prototype", descriptor: r }; return e.decorators && (i.decorators = e.decorators), "field" === e.kind && (i.initializer = e.value), i; }
|
|
6
|
-
function _coalesceGetterSetter(e, r) { void 0 !== e.descriptor.get ? r.descriptor.get = e.descriptor.get : r.descriptor.set = e.descriptor.set; }
|
|
7
|
-
function _coalesceClassElements(e) { for (var r = [], isSameElement = function (e) { return "method" === e.kind && e.key === o.key && e.placement === o.placement; }, t = 0; t < e.length; t++) { var i, o = e[t]; if ("method" === o.kind && (i = r.find(isSameElement))) { if (_isDataDescriptor(o.descriptor) || _isDataDescriptor(i.descriptor)) { if (_hasDecorators(o) || _hasDecorators(i)) throw new ReferenceError("Duplicated methods (" + o.key + ") can't be decorated."); i.descriptor = o.descriptor; } else { if (_hasDecorators(o)) { if (_hasDecorators(i)) throw new ReferenceError("Decorators can't be placed on different accessors with for the same property (" + o.key + ")."); i.decorators = o.decorators; } _coalesceGetterSetter(o, i); } } else r.push(o); } return r; }
|
|
8
|
-
function _hasDecorators(e) { return e.decorators && e.decorators.length; }
|
|
9
|
-
function _isDataDescriptor(e) { return void 0 !== e && !(void 0 === e.value && void 0 === e.writable); }
|
|
10
|
-
function _optionalCallableProperty(e, r) { var t = e[r]; if (void 0 !== t && "function" != typeof t) throw new TypeError("Expected '" + r + "' to be a function"); return t; }
|
|
11
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
12
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
13
|
-
function _toArray(r) { return _arrayWithHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableRest(); }
|
|
14
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
15
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
16
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
17
|
-
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
18
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
19
|
-
const MprisInterface = require('./mpris-interface');
|
|
20
|
-
const dbus = require('@jellybrick/dbus-next');
|
|
21
|
-
const types = require('./types');
|
|
22
|
-
const {
|
|
23
|
-
property,
|
|
24
|
-
method,
|
|
25
|
-
signal,
|
|
26
|
-
ACCESS_READ
|
|
27
|
-
} = dbus.interface;
|
|
28
|
-
let TracklistInterface = _decorate(null, function (_initialize, _MprisInterface) {
|
|
29
|
-
class TracklistInterface extends _MprisInterface {
|
|
30
|
-
constructor(player) {
|
|
31
|
-
super('org.mpris.MediaPlayer2.TrackList', player);
|
|
32
|
-
_initialize(this);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return {
|
|
36
|
-
F: TracklistInterface,
|
|
37
|
-
d: [{
|
|
38
|
-
kind: "field",
|
|
39
|
-
key: "_Tracks",
|
|
40
|
-
value() {
|
|
41
|
-
return [];
|
|
42
|
-
}
|
|
43
|
-
}, {
|
|
44
|
-
kind: "field",
|
|
45
|
-
key: "_CanEditTracks",
|
|
46
|
-
value() {
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
}, {
|
|
50
|
-
kind: "method",
|
|
51
|
-
key: "setTracks",
|
|
52
|
-
value: function setTracks(tracksPlain) {
|
|
53
|
-
this.setProperty('Tracks', tracksPlain);
|
|
54
|
-
}
|
|
55
|
-
}, {
|
|
56
|
-
kind: "get",
|
|
57
|
-
decorators: [property({
|
|
58
|
-
signature: 'ao',
|
|
59
|
-
access: ACCESS_READ
|
|
60
|
-
})],
|
|
61
|
-
key: "Tracks",
|
|
62
|
-
value: function () {
|
|
63
|
-
return this._Tracks;
|
|
64
|
-
}
|
|
65
|
-
}, {
|
|
66
|
-
kind: "get",
|
|
67
|
-
decorators: [property({
|
|
68
|
-
signature: 'b',
|
|
69
|
-
access: ACCESS_READ
|
|
70
|
-
})],
|
|
71
|
-
key: "CanEditTracks",
|
|
72
|
-
value: function () {
|
|
73
|
-
return this._CanEditTracks;
|
|
74
|
-
}
|
|
75
|
-
}, {
|
|
76
|
-
kind: "method",
|
|
77
|
-
decorators: [method({
|
|
78
|
-
inSignature: 'ao',
|
|
79
|
-
outSignature: 'aa{sv}'
|
|
80
|
-
})],
|
|
81
|
-
key: "GetTracksMetadata",
|
|
82
|
-
value: function GetTracksMetadata(trackIds) {
|
|
83
|
-
return this.player.tracks.filter(t => {
|
|
84
|
-
return trackIds.some(id => id === t['mpris:trackid']);
|
|
85
|
-
}).map(types.metadataToDbus);
|
|
86
|
-
}
|
|
87
|
-
}, {
|
|
88
|
-
kind: "method",
|
|
89
|
-
decorators: [method({
|
|
90
|
-
inSignature: 'sob'
|
|
91
|
-
})],
|
|
92
|
-
key: "AddTrack",
|
|
93
|
-
value: function AddTrack(uri, afterTrack, setAsCurrent) {
|
|
94
|
-
this.player.emit('addTrack', {
|
|
95
|
-
uri,
|
|
96
|
-
afterTrack,
|
|
97
|
-
setAsCurrent
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
}, {
|
|
101
|
-
kind: "method",
|
|
102
|
-
decorators: [method({
|
|
103
|
-
inSignature: 'o'
|
|
104
|
-
})],
|
|
105
|
-
key: "RemoveTrack",
|
|
106
|
-
value: function RemoveTrack(trackId) {
|
|
107
|
-
this.player.emit('removeTrack', trackId);
|
|
108
|
-
}
|
|
109
|
-
}, {
|
|
110
|
-
kind: "method",
|
|
111
|
-
decorators: [method({
|
|
112
|
-
inSignature: 'o'
|
|
113
|
-
})],
|
|
114
|
-
key: "GoTo",
|
|
115
|
-
value: function GoTo(trackId) {
|
|
116
|
-
this.player.emit('goTo', trackId);
|
|
117
|
-
}
|
|
118
|
-
}, {
|
|
119
|
-
kind: "method",
|
|
120
|
-
decorators: [signal({
|
|
121
|
-
signature: 'aoo'
|
|
122
|
-
})],
|
|
123
|
-
key: "TrackListReplaced",
|
|
124
|
-
value: function TrackListReplaced(replacedPlain) {
|
|
125
|
-
this.setTracks(replacedPlain);
|
|
126
|
-
// TODO what's the active track?
|
|
127
|
-
return [this._Tracks, '/org/mpris/MediaPlayer2/TrackList/NoTrack'];
|
|
128
|
-
}
|
|
129
|
-
}, {
|
|
130
|
-
kind: "method",
|
|
131
|
-
decorators: [signal({
|
|
132
|
-
signature: 'a{sv}'
|
|
133
|
-
})],
|
|
134
|
-
key: "TrackAdded",
|
|
135
|
-
value: function TrackAdded(metadata) {
|
|
136
|
-
return types.metadataToDbus(metadata);
|
|
137
|
-
}
|
|
138
|
-
}, {
|
|
139
|
-
kind: "method",
|
|
140
|
-
decorators: [signal({
|
|
141
|
-
signature: 'o'
|
|
142
|
-
})],
|
|
143
|
-
key: "TrackRemoved",
|
|
144
|
-
value: function TrackRemoved(path) {
|
|
145
|
-
return path;
|
|
146
|
-
}
|
|
147
|
-
}, {
|
|
148
|
-
kind: "method",
|
|
149
|
-
decorators: [signal({
|
|
150
|
-
signature: 'oa{sv}'
|
|
151
|
-
})],
|
|
152
|
-
key: "TrackMetadataChanged",
|
|
153
|
-
value: function TrackMetadataChanged(path, metadata) {
|
|
154
|
-
return [path, types.metadataToDbus(metadata)];
|
|
155
|
-
}
|
|
156
|
-
}]
|
|
157
|
-
};
|
|
158
|
-
}, MprisInterface);
|
|
159
|
-
module.exports = TracklistInterface;
|
|
160
|
-
//# sourceMappingURL=tracklist.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tracklist.js","names":["MprisInterface","require","dbus","types","property","method","signal","ACCESS_READ","interface","TracklistInterface","_decorate","_initialize","_MprisInterface","constructor","player","F","d","kind","key","value","setTracks","tracksPlain","setProperty","decorators","signature","access","_Tracks","_CanEditTracks","inSignature","outSignature","GetTracksMetadata","trackIds","tracks","filter","t","some","id","map","metadataToDbus","AddTrack","uri","afterTrack","setAsCurrent","emit","RemoveTrack","trackId","GoTo","TrackListReplaced","replacedPlain","TrackAdded","metadata","TrackRemoved","path","TrackMetadataChanged","module","exports"],"sourceRoot":"../../src/","sources":["interfaces/tracklist.js"],"sourcesContent":["const MprisInterface = require('./mpris-interface');\nconst dbus = require('@jellybrick/dbus-next');\nconst types = require('./types');\n\nconst {\n property,\n method,\n signal,\n ACCESS_READ\n} = dbus.interface;\n\nclass TracklistInterface extends MprisInterface {\n constructor(player) {\n super('org.mpris.MediaPlayer2.TrackList', player);\n }\n\n _Tracks = [];\n _CanEditTracks = false;\n\n setTracks(tracksPlain) {\n this.setProperty('Tracks', tracksPlain);\n }\n\n @property({signature: 'ao', access: ACCESS_READ})\n get Tracks() {\n return this._Tracks;\n }\n\n @property({signature: 'b', access: ACCESS_READ})\n get CanEditTracks() {\n return this._CanEditTracks;\n }\n\n @method({inSignature: 'ao', outSignature: 'aa{sv}'})\n GetTracksMetadata(trackIds) {\n return this.player.tracks.filter((t) => {\n return trackIds.some((id) => id === t['mpris:trackid']);\n }).map(types.metadataToDbus);\n }\n\n @method({inSignature: 'sob'})\n AddTrack(uri, afterTrack, setAsCurrent) {\n this.player.emit('addTrack', { uri, afterTrack, setAsCurrent });\n }\n\n @method({inSignature: 'o'})\n RemoveTrack(trackId) {\n this.player.emit('removeTrack', trackId);\n }\n\n @method({inSignature: 'o'})\n GoTo(trackId) {\n this.player.emit('goTo', trackId);\n }\n\n @signal({signature: 'aoo'})\n TrackListReplaced(replacedPlain) {\n this.setTracks(replacedPlain);\n // TODO what's the active track?\n return [\n this._Tracks,\n '/org/mpris/MediaPlayer2/TrackList/NoTrack'\n ];\n }\n\n @signal({signature: 'a{sv}'})\n TrackAdded(metadata) {\n return types.metadataToDbus(metadata);\n }\n\n @signal({signature: 'o'})\n TrackRemoved(path) {\n return path;\n }\n\n @signal({signature: 'oa{sv}'})\n TrackMetadataChanged(path, metadata){ \n return [\n path,\n types.metadataToDbus(metadata)\n ];\n }\n}\n\nmodule.exports = TracklistInterface;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA,MAAMA,cAAc,GAAGC,OAAO,CAAC,mBAAmB,CAAC;AACnD,MAAMC,IAAI,GAAGD,OAAO,CAAC,uBAAuB,CAAC;AAC7C,MAAME,KAAK,GAAGF,OAAO,CAAC,SAAS,CAAC;AAEhC,MAAM;EACJG,QAAQ;EACRC,MAAM;EACNC,MAAM;EACNC;AACF,CAAC,GAAGL,IAAI,CAACM,SAAS;AAAC,IAEbC,kBAAkB,GAAAC,SAAA,iBAAAC,WAAA,EAAAC,eAAA;EAAxB,MAAMH,kBAAkB,SAAAG,eAAA,CAAwB;IAC9CC,WAAWA,CAACC,MAAM,EAAE;MAClB,KAAK,CAAC,kCAAkC,EAAEA,MAAM,CAAC;MAACH,WAAA;IACpD;EAoEF;EAAC;IAAAI,CAAA,EAvEKN,kBAAkB;IAAAO,CAAA;MAAAC,IAAA;MAAAC,GAAA;MAAAC,MAAA;QAAA,OAKZ,EAAE;MAAA;IAAA;MAAAF,IAAA;MAAAC,GAAA;MAAAC,MAAA;QAAA,OACK,KAAK;MAAA;IAAA;MAAAF,IAAA;MAAAC,GAAA;MAAAC,KAAA,EAEtB,SAAAC,SAASA,CAACC,WAAW,EAAE;QACrB,IAAI,CAACC,WAAW,CAAC,QAAQ,EAAED,WAAW,CAAC;MACzC;IAAC;MAAAJ,IAAA;MAAAM,UAAA,GAEAnB,QAAQ,CAAC;QAACoB,SAAS,EAAE,IAAI;QAAEC,MAAM,EAAElB;MAAW,CAAC,CAAC;MAAAW,GAAA;MAAAC,KAAA,E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GAAG9C,kBAAkB","ignoreList":[]}
|
package/dist/interfaces/types.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const Variant = require('@jellybrick/dbus-next').Variant;
|
|
4
|
-
const logging = require('../logging');
|
|
5
|
-
function guessMetadataSignature(key, value) {
|
|
6
|
-
if (key === 'mpris:trackid') {
|
|
7
|
-
return 'o';
|
|
8
|
-
} else if (key === 'mpris:length') {
|
|
9
|
-
return 'x';
|
|
10
|
-
} else if (typeof value === 'string') {
|
|
11
|
-
return 's';
|
|
12
|
-
} else if (typeof value === 'boolean') {
|
|
13
|
-
return 'b';
|
|
14
|
-
} else if (typeof value === 'number') {
|
|
15
|
-
return 'd';
|
|
16
|
-
} else if (Array.isArray(value) && value.every(v => typeof v === 'string')) {
|
|
17
|
-
return 'as';
|
|
18
|
-
} else {
|
|
19
|
-
// type not supported yet
|
|
20
|
-
logging.warn(`could not determine metadata type for ${key}: ${value}`);
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
function metadataToPlain(metadataVariant) {
|
|
25
|
-
let metadataPlain = {};
|
|
26
|
-
for (let k of Object.keys(metadataVariant)) {
|
|
27
|
-
let value = metadataVariant[k];
|
|
28
|
-
if (value === undefined || value === null) {
|
|
29
|
-
logging.warn(`ignoring a null metadata value for key ${k}`);
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
if (value.constructor === Variant) {
|
|
33
|
-
metadataPlain[k] = value.value;
|
|
34
|
-
} else {
|
|
35
|
-
metadataPlain[k] = value;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return metadataPlain;
|
|
39
|
-
}
|
|
40
|
-
function metadataToDbus(metadataPlain) {
|
|
41
|
-
let metadataVariant = {};
|
|
42
|
-
for (let k of Object.keys(metadataPlain)) {
|
|
43
|
-
let value = metadataPlain[k];
|
|
44
|
-
let signature = guessMetadataSignature(k, value);
|
|
45
|
-
if (signature) {
|
|
46
|
-
metadataVariant[k] = new Variant(signature, value);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return metadataVariant;
|
|
50
|
-
}
|
|
51
|
-
let emptyPlaylist = ['/', '', ''];
|
|
52
|
-
function playlistToDbus(playlist) {
|
|
53
|
-
if (!playlist) {
|
|
54
|
-
return emptyPlaylist;
|
|
55
|
-
}
|
|
56
|
-
let {
|
|
57
|
-
Id,
|
|
58
|
-
Name,
|
|
59
|
-
Icon
|
|
60
|
-
} = playlist;
|
|
61
|
-
return [Id, Name, Icon];
|
|
62
|
-
}
|
|
63
|
-
function playlistToPlain(wire) {
|
|
64
|
-
let [Id, Name, Icon] = wire;
|
|
65
|
-
return {
|
|
66
|
-
Id,
|
|
67
|
-
Name,
|
|
68
|
-
Icon
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
module.exports = {
|
|
72
|
-
metadataToPlain,
|
|
73
|
-
metadataToDbus,
|
|
74
|
-
playlistToPlain,
|
|
75
|
-
playlistToDbus,
|
|
76
|
-
emptyPlaylist
|
|
77
|
-
};
|
|
78
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":["Variant","require","logging","guessMetadataSignature","key","value","Array","isArray","every","v","warn","metadataToPlain","metadataVariant","metadataPlain","k","Object","keys","undefined","constructor","metadataToDbus","signature","emptyPlaylist","playlistToDbus","playlist","Id","Name","Icon","playlistToPlain","wire","module","exports"],"sourceRoot":"../../src/","sources":["interfaces/types.js"],"sourcesContent":["const Variant = require('@jellybrick/dbus-next').Variant;\nconst logging = require('../logging');\n\nfunction guessMetadataSignature(key, value) {\n if (key === 'mpris:trackid') {\n return 'o';\n } else if (key === 'mpris:length') {\n return 'x';\n } else if (typeof value === 'string') {\n return 's';\n } else if (typeof value === 'boolean') {\n return 'b';\n } else if (typeof value === 'number') {\n return 'd';\n } else if (Array.isArray(value) && value.every((v) => typeof v === 'string')) {\n return 'as';\n } else {\n // type not supported yet\n logging.warn(`could not determine metadata type for ${key}: ${value}`);\n return null;\n }\n}\n\nfunction metadataToPlain(metadataVariant) {\n let metadataPlain = {};\n for (let k of Object.keys(metadataVariant)) {\n let value = metadataVariant[k];\n if (value === undefined || value === null) {\n logging.warn(`ignoring a null metadata value for key ${k}`);\n continue;\n }\n if (value.constructor === Variant) {\n metadataPlain[k] = value.value;\n } else {\n metadataPlain[k] = value;\n }\n }\n return metadataPlain;\n}\n\nfunction metadataToDbus(metadataPlain) {\n let metadataVariant = {};\n for (let k of Object.keys(metadataPlain)) {\n let value = metadataPlain[k];\n let signature = guessMetadataSignature(k, value);\n if (signature) {\n metadataVariant[k] = new Variant(signature, value);\n }\n }\n return metadataVariant;\n}\n\nlet emptyPlaylist = ['/', '', ''];\n\nfunction playlistToDbus(playlist) {\n if (!playlist) {\n return emptyPlaylist;\n }\n\n let { Id, Name, Icon } = playlist;\n return [ Id, Name, Icon ];\n}\n\nfunction playlistToPlain(wire) {\n let [ Id, Name, Icon ] = wire;\n return { Id, Name, Icon };\n}\n\nmodule.exports = {\n metadataToPlain,\n metadataToDbus,\n playlistToPlain,\n playlistToDbus,\n emptyPlaylist\n};\n"],"mappings":";;AAAA,MAAMA,OAAO,GAAGC,OAAO,CAAC,uBAAuB,CAAC,CAACD,OAAO;AACxD,MAAME,OAAO,GAAGD,OAAO,CAAC,YAAY,CAAC;AAErC,SAASE,sBAAsBA,CAACC,GAAG,EAAEC,KAAK,EAAE;EAC1C,IAAID,GAAG,KAAK,eAAe,EAAE;IAC3B,OAAO,GAAG;EACZ,CAAC,MAAM,IAAIA,GAAG,KAAK,cAAc,EAAE;IACjC,OAAO,GAAG;EACZ,CAAC,MAAM,IAAI,OAAOC,KAAK,KAAK,QAAQ,EAAE;IACpC,OAAO,GAAG;EACZ,CAAC,MAAM,IAAI,OAAOA,KAAK,KAAK,SAAS,EAAE;IACrC,OAAO,GAAG;EACZ,CAAC,MAAM,IAAI,OAAOA,KAAK,KAAK,QA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C;IACpD;EACF;EACA,OAAOO,eAAe;AACxB;AAEA,IAAIS,aAAa,GAAG,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC;AAEjC,SAASC,cAAcA,CAACC,QAAQ,EAAE;EAChC,IAAI,CAACA,QAAQ,EAAE;IACb,OAAOF,aAAa;EACtB;EAEA,IAAI;IAAEG,EAAE;IAAEC,IAAI;IAAEC;EAAK,CAAC,GAAGH,QAAQ;EACjC,OAAO,CAAEC,EAAE,EAAEC,IAAI,EAAEC,IAAI,CAAE;AAC3B;AAEA,SAASC,eAAeA,CAACC,IAAI,EAAE;EAC7B,IAAI,CAAEJ,EAAE,EAAEC,IAAI,EAAEC,IAAI,CAAE,GAAGE,IAAI;EAC7B,OAAO;IAAEJ,EAAE;IAAEC,IAAI;IAAEC;EAAK,CAAC;AAC3B;AAEAG,MAAM,CAACC,OAAO,GAAG;EACfnB,eAAe;EACfQ,cAAc;EACdQ,eAAe;EACfL,cAAc;EACdD;AACF,CAAC","ignoreList":[]}
|
package/dist/logging.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const loggingEnabled = process.env.MPRIS_SERVICE_DEBUG !== undefined && process.env.MPRIS_SERVICE_DEBUG !== '0';
|
|
4
|
-
module.exports.debug = function (message) {
|
|
5
|
-
if (loggingEnabled) {
|
|
6
|
-
console.log(message);
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
module.exports.warn = function (message) {
|
|
10
|
-
if (loggingEnabled) {
|
|
11
|
-
console.warn(message);
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=logging.js.map
|
package/dist/logging.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logging.js","names":["loggingEnabled","process","env","MPRIS_SERVICE_DEBUG","undefined","module","exports","debug","message","console","log","warn"],"sourceRoot":"../src/","sources":["logging.js"],"sourcesContent":["const loggingEnabled = (process.env.MPRIS_SERVICE_DEBUG !== undefined && process.env.MPRIS_SERVICE_DEBUG !== '0');\n\nmodule.exports.debug = function(message) {\n if (loggingEnabled) {\n console.log(message);\n }\n};\n\nmodule.exports.warn = function(message) {\n if (loggingEnabled) {\n console.warn(message);\n }\n};\n"],"mappings":";;AAAA,MAAMA,cAAc,GAAIC,OAAO,CAACC,GAAG,CAACC,mBAAmB,KAAKC,SAAS,IAAIH,OAAO,CAACC,GAAG,CAACC,mBAAmB,KAAK,GAAI;AAEjHE,MAAM,CAACC,OAAO,CAACC,KAAK,GAAG,UAASC,OAAO,EAAE;EACvC,IAAIR,cAAc,EAAE;IAClBS,OAAO,CAACC,GAAG,CAACF,OAAO,CAAC;EACtB;AACF,CAAC;AAEDH,MAAM,CAACC,OAAO,CAACK,IAAI,GAAG,UAASH,OAAO,EAAE;EACtC,IAAIR,cAAc,EAAE;IAClBS,OAAO,CAACE,IAAI,CAACH,OAAO,CAAC;EACvB;AACF,CAAC","ignoreList":[]}
|
package/src/constants.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
const constants = {
|
|
2
|
-
PLAYBACK_STATUS_PLAYING: 'Playing',
|
|
3
|
-
PLAYBACK_STATUS_PAUSED: 'Paused',
|
|
4
|
-
PLAYBACK_STATUS_STOPPED: 'Stopped',
|
|
5
|
-
|
|
6
|
-
LOOP_STATUS_NONE: 'None',
|
|
7
|
-
LOOP_STATUS_TRACK: 'Track',
|
|
8
|
-
LOOP_STATUS_PLAYLIST: 'Playlist'
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const playbackStatuses = [
|
|
12
|
-
constants.PLAYBACK_STATUS_PLAYING,
|
|
13
|
-
constants.PLAYBACK_STATUS_PAUSED,
|
|
14
|
-
constants.PLAYBACK_STATUS_STOPPED
|
|
15
|
-
];
|
|
16
|
-
|
|
17
|
-
const loopStatuses = [
|
|
18
|
-
constants.LOOP_STATUS_NONE,
|
|
19
|
-
constants.LOOP_STATUS_PLAYLIST,
|
|
20
|
-
constants.LOOP_STATUS_TRACK
|
|
21
|
-
];
|
|
22
|
-
|
|
23
|
-
constants.isLoopStatusValid = function(value) {
|
|
24
|
-
return loopStatuses.includes(value);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
constants.isPlaybackStatusValid = function(value) {
|
|
28
|
-
return playbackStatuses.includes(value);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
module.exports = constants;
|