From 53858b0815233b75cc63cf5cbf1d4337d297f0bf Mon Sep 17 00:00:00 2001 From: Lockzi Date: Tue, 30 May 2017 19:58:41 +0200 Subject: [PATCH] Added support for Balance Added support for Balance while keeping backward compatibillity --- .gitignore | 1 + lib/actions/equalizer.js | 9 +++++++++ lib/actions/volume.js | 3 ++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d2c2d964..1fc43a97 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ obj/ # Ignore Mac DS_Store files .DS_Store +npm-debug.log diff --git a/lib/actions/equalizer.js b/lib/actions/equalizer.js index ca1157d7..1897a738 100644 --- a/lib/actions/equalizer.js +++ b/lib/actions/equalizer.js @@ -10,7 +10,16 @@ function speechEnhancement(player, values) { return player.speechEnhancement(enable); } +function balance(player, values) { + + const balance = parseInt(values[0]); + + return player.setBalance(balance); + +} + module.exports = function (api) { api.registerAction('nightmode', nightMode); api.registerAction('speechenhancement', speechEnhancement); + api.registerAction('balance', balance); } diff --git a/lib/actions/volume.js b/lib/actions/volume.js index 31fe8eb2..0bddbf2b 100644 --- a/lib/actions/volume.js +++ b/lib/actions/volume.js @@ -1,7 +1,8 @@ 'use strict'; function volume(player, values) { var volume = values[0]; - return player.setVolume(volume); + var channel = values[1] || 'Master'; + return player.setVolume(volume, channel); } function groupVolume(player, values) {