Removed volume from AudioInjectorLocalBuffer

Since it doesn't use it.  Now clamping at 0-1 in the
AudioInjector::getVolume() call.  This is better -- one spot so it now
always gets clamped.
This commit is contained in:
David Kelly 2016-12-13 17:34:56 -08:00 committed by Seth Alves
parent 6680395e97
commit 0dd7366198
4 changed files with 1 additions and 5 deletions

View file

@ -166,7 +166,6 @@ bool AudioInjector::injectLocally() {
_localBuffer->open(QIODevice::ReadOnly); _localBuffer->open(QIODevice::ReadOnly);
_localBuffer->setShouldLoop(_options.loop); _localBuffer->setShouldLoop(_options.loop);
_localBuffer->setVolume(_options.volume);
// give our current send position to the local buffer // give our current send position to the local buffer
_localBuffer->setCurrentOffset(_currentSendOffset); _localBuffer->setCurrentOffset(_currentSendOffset);

View file

@ -63,7 +63,7 @@ public:
AudioFOA& getLocalFOA() { return _localFOA; } AudioFOA& getLocalFOA() { return _localFOA; }
bool isLocalOnly() const { return _options.localOnly; } bool isLocalOnly() const { return _options.localOnly; }
float getVolume() const { return _options.volume; } float getVolume() const { return glm::clamp(_options.volume, 0.0f, 1.0f); }
glm::vec3 getPosition() const { return _options.position; } glm::vec3 getPosition() const { return _options.position; }
glm::quat getOrientation() const { return _options.orientation; } glm::quat getOrientation() const { return _options.orientation; }
bool isStereo() const { return _options.stereo; } bool isStereo() const { return _options.stereo; }

View file

@ -17,7 +17,6 @@ AudioInjectorLocalBuffer::AudioInjectorLocalBuffer(const QByteArray& rawAudioArr
_shouldLoop(false), _shouldLoop(false),
_isStopped(false), _isStopped(false),
_currentOffset(0), _currentOffset(0),
_volume(1.0f)
{ {
} }

View file

@ -30,7 +30,6 @@ public:
void setShouldLoop(bool shouldLoop) { _shouldLoop = shouldLoop; } void setShouldLoop(bool shouldLoop) { _shouldLoop = shouldLoop; }
void setCurrentOffset(int currentOffset) { _currentOffset = currentOffset; } void setCurrentOffset(int currentOffset) { _currentOffset = currentOffset; }
void setVolume(float volume) { _volume = glm::clamp(volume, 0.0f, 1.0f); }
private: private:
qint64 recursiveReadFromFront(char* data, qint64 maxSize); qint64 recursiveReadFromFront(char* data, qint64 maxSize);
@ -40,7 +39,6 @@ private:
bool _isStopped; bool _isStopped;
int _currentOffset; int _currentOffset;
float _volume;
}; };
#endif // hifi_AudioInjectorLocalBuffer_h #endif // hifi_AudioInjectorLocalBuffer_h