@jellybrick/mpris-service 2.1.3 → 2.1.5
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/constants.js.map +1 -1
- package/dist/index.js +30 -40
- package/dist/index.js.map +1 -1
- package/dist/interfaces/mpris-interface.js +6 -14
- package/dist/interfaces/mpris-interface.js.map +1 -1
- package/dist/interfaces/player.js +38 -41
- package/dist/interfaces/player.js.map +1 -1
- package/dist/interfaces/playlists.js +23 -27
- package/dist/interfaces/playlists.js.map +1 -1
- package/dist/interfaces/root.js +29 -34
- package/dist/interfaces/root.js.map +1 -1
- package/dist/interfaces/tracklist.js +22 -26
- package/dist/interfaces/tracklist.js.map +1 -1
- package/dist/interfaces/types.js +2 -2
- package/dist/interfaces/types.js.map +1 -1
- package/dist/logging.js +1 -1
- package/dist/logging.js.map +1 -1
- package/package.json +11 -11
- package/src/index.js +7 -7
- package/src/interfaces/mpris-interface.js +5 -9
- package/src/interfaces/player.js +8 -5
- package/src/interfaces/playlists.js +10 -8
- package/src/interfaces/root.js +7 -6
- package/src/interfaces/tracklist.js +8 -7
- package/src/interfaces/types.js +2 -2
- package/src/logging.js +1 -1
- package/.idea/discord.xml +0 -7
- package/.idea/jsLibraryMappings.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/mpris-service.iml +0 -12
- package/.idea/vcs.xml +0 -6
package/dist/interfaces/root.js
CHANGED
|
@@ -1,32 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _decorate(
|
|
4
|
-
function _getDecoratorsApi() { _getDecoratorsApi = function () { return
|
|
5
|
-
function _createElementDescriptor(
|
|
6
|
-
function _coalesceGetterSetter(
|
|
7
|
-
function _coalesceClassElements(
|
|
8
|
-
function _hasDecorators(
|
|
9
|
-
function _isDataDescriptor(
|
|
10
|
-
function _optionalCallableProperty(
|
|
11
|
-
function _toPropertyKey(
|
|
12
|
-
function _toPrimitive(
|
|
13
|
-
function _toArray(
|
|
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
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(
|
|
16
|
-
function _arrayLikeToArray(
|
|
17
|
-
function _iterableToArray(
|
|
18
|
-
function _arrayWithHoles(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
let {
|
|
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 {
|
|
23
22
|
property,
|
|
24
23
|
method,
|
|
25
|
-
|
|
26
|
-
DBusError,
|
|
27
|
-
ACCESS_READ,
|
|
28
|
-
ACCESS_WRITE,
|
|
29
|
-
ACCESS_READWRITE
|
|
24
|
+
ACCESS_READ
|
|
30
25
|
} = dbus.interface;
|
|
31
26
|
let RootInterface = _decorate(null, function (_initialize, _MprisInterface) {
|
|
32
27
|
class RootInterface extends _MprisInterface {
|
|
@@ -112,7 +107,7 @@ let RootInterface = _decorate(null, function (_initialize, _MprisInterface) {
|
|
|
112
107
|
access: ACCESS_READ
|
|
113
108
|
})],
|
|
114
109
|
key: "CanQuit",
|
|
115
|
-
value: function
|
|
110
|
+
value: function () {
|
|
116
111
|
return this._CanQuit;
|
|
117
112
|
}
|
|
118
113
|
}, {
|
|
@@ -121,13 +116,13 @@ let RootInterface = _decorate(null, function (_initialize, _MprisInterface) {
|
|
|
121
116
|
signature: 'b'
|
|
122
117
|
})],
|
|
123
118
|
key: "Fullscreen",
|
|
124
|
-
value: function
|
|
119
|
+
value: function () {
|
|
125
120
|
return this._Fullscreen;
|
|
126
121
|
}
|
|
127
122
|
}, {
|
|
128
123
|
kind: "set",
|
|
129
124
|
key: "Fullscreen",
|
|
130
|
-
value: function
|
|
125
|
+
value: function (value) {
|
|
131
126
|
this._setPropertyInternal('Fullscreen', value);
|
|
132
127
|
}
|
|
133
128
|
}, {
|
|
@@ -137,7 +132,7 @@ let RootInterface = _decorate(null, function (_initialize, _MprisInterface) {
|
|
|
137
132
|
access: ACCESS_READ
|
|
138
133
|
})],
|
|
139
134
|
key: "CanSetFullscreen",
|
|
140
|
-
value: function
|
|
135
|
+
value: function () {
|
|
141
136
|
return this._CanSetFullscreen;
|
|
142
137
|
}
|
|
143
138
|
}, {
|
|
@@ -147,7 +142,7 @@ let RootInterface = _decorate(null, function (_initialize, _MprisInterface) {
|
|
|
147
142
|
access: ACCESS_READ
|
|
148
143
|
})],
|
|
149
144
|
key: "CanRaise",
|
|
150
|
-
value: function
|
|
145
|
+
value: function () {
|
|
151
146
|
return this._CanRaise;
|
|
152
147
|
}
|
|
153
148
|
}, {
|
|
@@ -157,7 +152,7 @@ let RootInterface = _decorate(null, function (_initialize, _MprisInterface) {
|
|
|
157
152
|
access: ACCESS_READ
|
|
158
153
|
})],
|
|
159
154
|
key: "HasTrackList",
|
|
160
|
-
value: function
|
|
155
|
+
value: function () {
|
|
161
156
|
return this._HasTrackList;
|
|
162
157
|
}
|
|
163
158
|
}, {
|
|
@@ -167,7 +162,7 @@ let RootInterface = _decorate(null, function (_initialize, _MprisInterface) {
|
|
|
167
162
|
access: ACCESS_READ
|
|
168
163
|
})],
|
|
169
164
|
key: "Identity",
|
|
170
|
-
value: function
|
|
165
|
+
value: function () {
|
|
171
166
|
return this._Identity;
|
|
172
167
|
}
|
|
173
168
|
}, {
|
|
@@ -177,7 +172,7 @@ let RootInterface = _decorate(null, function (_initialize, _MprisInterface) {
|
|
|
177
172
|
access: ACCESS_READ
|
|
178
173
|
})],
|
|
179
174
|
key: "DesktopEntry",
|
|
180
|
-
value: function
|
|
175
|
+
value: function () {
|
|
181
176
|
return this._DesktopEntry;
|
|
182
177
|
}
|
|
183
178
|
}, {
|
|
@@ -187,7 +182,7 @@ let RootInterface = _decorate(null, function (_initialize, _MprisInterface) {
|
|
|
187
182
|
access: ACCESS_READ
|
|
188
183
|
})],
|
|
189
184
|
key: "SupportedUriSchemes",
|
|
190
|
-
value: function
|
|
185
|
+
value: function () {
|
|
191
186
|
return this._SupportedUriSchemes;
|
|
192
187
|
}
|
|
193
188
|
}, {
|
|
@@ -197,7 +192,7 @@ let RootInterface = _decorate(null, function (_initialize, _MprisInterface) {
|
|
|
197
192
|
access: ACCESS_READ
|
|
198
193
|
})],
|
|
199
194
|
key: "SupportedMimeTypes",
|
|
200
|
-
value: function
|
|
195
|
+
value: function () {
|
|
201
196
|
return this._SupportedMimeTypes;
|
|
202
197
|
}
|
|
203
198
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root.js","names":["MprisInterface","require","dbus","
|
|
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,iBAAAC,WAAA,EAAAC,eAAA;EAAnB,MAAMH,aAAa,SAAAG,eAAA,CAAwB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,cAAc;AAwF1CwC,MAAM,CAACC,OAAO,GAAGlC,aAAa","ignoreList":[]}
|
|
@@ -1,33 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _decorate(
|
|
4
|
-
function _getDecoratorsApi() { _getDecoratorsApi = function () { return
|
|
5
|
-
function _createElementDescriptor(
|
|
6
|
-
function _coalesceGetterSetter(
|
|
7
|
-
function _coalesceClassElements(
|
|
8
|
-
function _hasDecorators(
|
|
9
|
-
function _isDataDescriptor(
|
|
10
|
-
function _optionalCallableProperty(
|
|
11
|
-
function _toPropertyKey(
|
|
12
|
-
function _toPrimitive(
|
|
13
|
-
function _toArray(
|
|
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
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(
|
|
16
|
-
function _arrayLikeToArray(
|
|
17
|
-
function _iterableToArray(
|
|
18
|
-
function _arrayWithHoles(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
let {
|
|
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 {
|
|
24
23
|
property,
|
|
25
24
|
method,
|
|
26
25
|
signal,
|
|
27
|
-
|
|
28
|
-
ACCESS_READ,
|
|
29
|
-
ACCESS_WRITE,
|
|
30
|
-
ACCESS_READWRITE
|
|
26
|
+
ACCESS_READ
|
|
31
27
|
} = dbus.interface;
|
|
32
28
|
let TracklistInterface = _decorate(null, function (_initialize, _MprisInterface) {
|
|
33
29
|
class TracklistInterface extends _MprisInterface {
|
|
@@ -63,7 +59,7 @@ let TracklistInterface = _decorate(null, function (_initialize, _MprisInterface)
|
|
|
63
59
|
access: ACCESS_READ
|
|
64
60
|
})],
|
|
65
61
|
key: "Tracks",
|
|
66
|
-
value: function
|
|
62
|
+
value: function () {
|
|
67
63
|
return this._Tracks;
|
|
68
64
|
}
|
|
69
65
|
}, {
|
|
@@ -73,7 +69,7 @@ let TracklistInterface = _decorate(null, function (_initialize, _MprisInterface)
|
|
|
73
69
|
access: ACCESS_READ
|
|
74
70
|
})],
|
|
75
71
|
key: "CanEditTracks",
|
|
76
|
-
value: function
|
|
72
|
+
value: function () {
|
|
77
73
|
return this._CanEditTracks;
|
|
78
74
|
}
|
|
79
75
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracklist.js","names":["MprisInterface","require","dbus","
|
|
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,W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AjC,IAAA;MAAAM,UAAA,GAEAjB,MAAM,CAAC;QAACkB,SAAS,EAAE;MAAG,CAAC,CAAC;MAAAN,GAAA;MAAAC,KAAA,EAAzB,SACAgC,YAAYA,CAACC,IAAI,EAAE;QACjB,OAAOA,IAAI;MACb;IAAC;MAAAnC,IAAA;MAAAM,UAAA,GAEAjB,MAAM,CAAC;QAACkB,SAAS,EAAE;MAAQ,CAAC,CAAC;MAAAN,GAAA;MAAAC,KAAA,EAA9B,SACAkC,oBAAoBA,CAACD,IAAI,EAAEF,QAAQ,EAAC;QAClC,OAAO,CACLE,IAAI,EACJjD,KAAK,CAACmC,cAAc,CAACY,QAAQ,CAAC,CAC/B;MACH;IAAC;EAAA;AAAA,GAtE8BlD,cAAc;AAyE/CsD,MAAM,CAACC,OAAO,GAAG9C,kBAAkB","ignoreList":[]}
|
package/dist/interfaces/types.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const Variant = require('@jellybrick/dbus-next').Variant;
|
|
4
|
+
const logging = require('../logging');
|
|
5
5
|
function guessMetadataSignature(key, value) {
|
|
6
6
|
if (key === 'mpris:trackid') {
|
|
7
7
|
return 'o';
|
|
@@ -1 +1 @@
|
|
|
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":["
|
|
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;EAC1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AG,CAAC,CAAC;EACxB,KAAK,IAAIE,CAAC,IAAIC,MAAM,CAACC,IAAI,CAACH,aAAa,CAAC,EAAE;IACxC,IAAIR,KAAK,GAAGQ,aAAa,CAACC,CAAC,CAAC;IAC5B,IAAIM,SAAS,GAAGjB,sBAAsB,CAACW,CAAC,EAAET,KAAK,CAAC;IAChD,IAAIe,SAAS,EAAE;MACbR,eAAe,CAACE,CAAC,CAAC,GAAG,IAAId,OAAO,CAACoB,SAAS,EAAEf,KAAK,CAAC;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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const loggingEnabled = process.env.MPRIS_SERVICE_DEBUG !== undefined && process.env.MPRIS_SERVICE_DEBUG !== '0';
|
|
4
4
|
module.exports.debug = function (message) {
|
|
5
5
|
if (loggingEnabled) {
|
|
6
6
|
console.log(message);
|
package/dist/logging.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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":["
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jellybrick/mpris-service",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.5",
|
|
4
4
|
"description": "Node.js implementation for the MPRIS D-Bus Interface Specification to create a mediaplayer service",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -27,22 +27,22 @@
|
|
|
27
27
|
},
|
|
28
28
|
"homepage": "https://github.com/JellyBrick/mpris-service",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"dbus-next": "^0.10.
|
|
31
|
-
"deep-equal": "^2.2.
|
|
32
|
-
"source-map-support": "^0.5.
|
|
30
|
+
"@jellybrick/dbus-next": "^0.10.3",
|
|
31
|
+
"deep-equal": "^2.2.3",
|
|
32
|
+
"source-map-support": "^0.5.21"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@babel/core": "^7.
|
|
36
|
-
"@babel/plugin-proposal-decorators": "^7.
|
|
37
|
-
"@babel/plugin-transform-private-methods": "^7.
|
|
38
|
-
"@babel/preset-env": "^7.
|
|
39
|
-
"gulp": "^
|
|
35
|
+
"@babel/core": "^7.26.0",
|
|
36
|
+
"@babel/plugin-proposal-decorators": "^7.25.9",
|
|
37
|
+
"@babel/plugin-transform-private-methods": "^7.25.9",
|
|
38
|
+
"@babel/preset-env": "^7.26.0",
|
|
39
|
+
"gulp": "^5.0.0",
|
|
40
40
|
"gulp-babel": "^8.0.0",
|
|
41
|
-
"gulp-cli": "^
|
|
41
|
+
"gulp-cli": "^3.0.0",
|
|
42
42
|
"gulp-sourcemaps": "^3.0.0",
|
|
43
43
|
"jest": "^29.7.0",
|
|
44
44
|
"jsbi": "^4.3.0",
|
|
45
|
-
"jsdoc": "^4.0.
|
|
45
|
+
"jsdoc": "^4.0.4"
|
|
46
46
|
},
|
|
47
47
|
"jest": {
|
|
48
48
|
"testEnvironment": "node"
|
package/src/index.js
CHANGED
|
@@ -2,7 +2,7 @@ require('source-map-support').install();
|
|
|
2
2
|
|
|
3
3
|
const { EventEmitter } = require('events');
|
|
4
4
|
|
|
5
|
-
const dbus = require('dbus-next');
|
|
5
|
+
const dbus = require('@jellybrick/dbus-next');
|
|
6
6
|
const PlayerInterface = require('./interfaces/player');
|
|
7
7
|
const RootInterface = require('./interfaces/root');
|
|
8
8
|
const PlaylistsInterface = require('./interfaces/playlists');
|
|
@@ -154,16 +154,16 @@ class Player extends EventEmitter {
|
|
|
154
154
|
* @property {String} loopStatus - The current loop/repeat status. May be "None", "Track", or "Playlist".
|
|
155
155
|
* @property {Boolean} shuffle - Whether the player is shuffling.
|
|
156
156
|
* @property {Object} metadata - The metadata of the current element. If there is a current track, this must have a "mpris:trackid" entry (of D-Bus type "o") at the very least, which contains a D-Bus path that uniquely identifies this track.
|
|
157
|
-
* @property {
|
|
157
|
+
* @property {Number} volume - The volume level. (Double)
|
|
158
158
|
* @property {Boolean} canControl - Whether the media player may be controlled over this interface.
|
|
159
159
|
* @property {Boolean} canPause - Whether playback can be paused using Pause or PlayPause.
|
|
160
160
|
* @property {Boolean} canPlay - Whether playback can be started using Play or PlayPause.
|
|
161
161
|
* @property {Boolean} canSeek - Whether the client can control the playback position using Seek and SetPosition.
|
|
162
162
|
* @property {Boolean} canGoNext - Whether the client can call the Next method on this interface and expect the current track to change.
|
|
163
163
|
* @property {Boolean} canGoPrevious - Whether the client can call the Previous method on this interface and expect the current track to change.
|
|
164
|
-
* @property {
|
|
165
|
-
* @property {
|
|
166
|
-
* @property {
|
|
164
|
+
* @property {Number} rate - The current playback rate. (Double)
|
|
165
|
+
* @property {Number} minimumRate - The minimum value which the Rate property can take. (Double)
|
|
166
|
+
* @property {Number} maximumRate - The maximum value which the Rate property can take. (Double)
|
|
167
167
|
* @property {Array} playlists - The current playlists set by {@link Player#setPlaylists}. (Not a DBus property).
|
|
168
168
|
* @property {String} activePlaylist - The id of the currently-active playlist.
|
|
169
169
|
*/
|
|
@@ -306,7 +306,7 @@ class Player extends EventEmitter {
|
|
|
306
306
|
*
|
|
307
307
|
* @name Player#getPosition
|
|
308
308
|
* @function
|
|
309
|
-
* @returns {
|
|
309
|
+
* @returns {Number} - The current position of the player in microseconds. (Integer)
|
|
310
310
|
*/
|
|
311
311
|
getPosition() {
|
|
312
312
|
return 0;
|
|
@@ -317,7 +317,7 @@ class Player extends EventEmitter {
|
|
|
317
317
|
*
|
|
318
318
|
* @name Player#seeked
|
|
319
319
|
* @function
|
|
320
|
-
* @param {
|
|
320
|
+
* @param {Number} position - The position in microseconds. (Integer)
|
|
321
321
|
*/
|
|
322
322
|
seeked(position) {
|
|
323
323
|
let seekTo = Math.floor(position || 0);
|