forked from dbusjs/mpris-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migration to dbus-next (a fork of dbus-native) is a rewrite, but fixes some outstanding bugs in the project related to variant types. The project is now transpiled to use the experimental decorator feature that will be available in the language at some later time. gulpfile.js contains build instructions. Build with `npm run build`. The dist/ folder contains what will be published on npm. Interfaces are implemented as classes with decorators specifying the properties of the member that is exported on the bus. Update examples and add a new tracklist example. Other bugfixes may have been a side effect of the rewrite. fixes dbusjs#1 fixes dbusjs#6 fixes dbusjs#13
- Loading branch information
Tony Crisci
committed
Nov 8, 2018
1 parent
1c44ad3
commit 4993dea
Showing
17 changed files
with
854 additions
and
582 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"plugins": [ | ||
[ "@babel/plugin-proposal-decorators", { "decoratorsBeforeExport": true, "legacy": false } ], | ||
"@babel/plugin-proposal-class-properties" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
/dist | ||
/package-lock.json | ||
/yarn.lock | ||
*.swp | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"plugins": { | ||
"node": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
var Player = require('../dist'); | ||
|
||
var player = Player({ | ||
name: 'nodejs', | ||
identity: 'Node.js media player', | ||
supportedUriSchemes: ['file'], | ||
supportedMimeTypes: ['audio/mpeg', 'application/ogg'], | ||
supportedInterfaces: ['trackList'] | ||
}); | ||
|
||
// Events | ||
var events = ['addTrack', 'removeTrack', 'goTo']; | ||
events.forEach(function (eventName) { | ||
player.on(eventName, function () { | ||
console.log('Event:', eventName, arguments); | ||
}); | ||
}); | ||
|
||
player.tracks = [ | ||
{ | ||
'mpris:trackid': player.objectPath('track/0'), | ||
'mpris:length': 60 * 1000 * 1000, | ||
'mpris:artUrl': 'http://www.adele.tv/images/facebook/adele.jpg', | ||
'xesam:title': 'Lolol', | ||
'xesam:album': '21', | ||
'xesam:artist': 'Adele' | ||
}, | ||
{ | ||
'mpris:trackid': player.objectPath('track/1'), | ||
'mpris:length': 60 * 1000 * 1000, | ||
'mpris:artUrl': 'file:///home/emersion/anime/waifu.jpg', | ||
'xesam:title': 'Shake It Off', | ||
'xesam:album': '21', | ||
'xesam:artist': 'Taylor Swift' | ||
} | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const gulp = require('gulp'); | ||
const babel = require('gulp-babel'); | ||
const sourcemaps = require('gulp-sourcemaps'); | ||
var path = require('path'); | ||
|
||
function handleError(error) { | ||
console.log(error.toString()); | ||
this.emit('end'); | ||
process.exit(1); | ||
} | ||
|
||
gulp.task('default', () => | ||
gulp.src('src/**/*.js') | ||
.pipe(sourcemaps.init()) | ||
.pipe(babel()) | ||
.on('error', handleError) | ||
.pipe(sourcemaps.write('.', { sourceRoot: path.join('../src/') })) | ||
.pipe(gulp.dest('dist')) | ||
); |
Oops, something went wrong.