From c8a75e4c29a35daaf031c23b65e372e47ff3e0d1 Mon Sep 17 00:00:00 2001 From: Amish Shah Date: Thu, 26 Oct 2017 16:44:21 +0100 Subject: [PATCH] More volume docs --- src/client/voice/dispatcher/StreamDispatcher.js | 8 ++++++++ src/client/voice/util/VolumeInterface.js | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/client/voice/dispatcher/StreamDispatcher.js b/src/client/voice/dispatcher/StreamDispatcher.js index 173e6576e..81b08548a 100644 --- a/src/client/voice/dispatcher/StreamDispatcher.js +++ b/src/client/voice/dispatcher/StreamDispatcher.js @@ -168,6 +168,7 @@ class StreamDispatcher extends Writable { */ get bitrateEditable() { return this.streams.opus && this.streams.opus.setBitrate; } + // Volume get volume() { return this.player.streams.volume ? this.player.streams.volume.volume : 1; } @@ -177,6 +178,13 @@ class StreamDispatcher extends Writable { this.player.streams.volume.setVolume(value); return true; } + + // Volume stubs for docs + /* eslint-disable no-empty-function*/ + get volumeDecibels() {} + get volumeLogarithmic() {} + setVolumeDecibels() {} + setVolumeLogarithmic() {} } VolumeInterface.applyToClass(StreamDispatcher); diff --git a/src/client/voice/util/VolumeInterface.js b/src/client/voice/util/VolumeInterface.js index 7c25aaa56..7a2dfe15d 100644 --- a/src/client/voice/util/VolumeInterface.js +++ b/src/client/voice/util/VolumeInterface.js @@ -18,7 +18,7 @@ class VolumeInterface extends EventEmitter { } /** - * The current volume of the broadcast + * The current volume of the stream * @readonly * @type {number} */ @@ -27,7 +27,7 @@ class VolumeInterface extends EventEmitter { } /** - * The current volume of the broadcast in decibels + * The current volume of the stream in decibels * @readonly * @type {number} */ @@ -36,7 +36,7 @@ class VolumeInterface extends EventEmitter { } /** - * The current volume of the broadcast from a logarithmic scale + * The current volume of the stream from a logarithmic scale * @readonly * @type {number} */