mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-07 03:32:42 +02:00
Merge pull request #841 from overte-org/fix/avatar_volume_adjustment
Fixed avatar volume adjustment
This commit is contained in:
commit
d58940369c
1 changed files with 14 additions and 4 deletions
|
@ -222,13 +222,23 @@ void AudioMixerClientData::parseInjectorGainSet(ReceivedMessage& message, const
|
|||
qCDebug(audio) << "Setting MASTER injector gain for" << uuid << "to" << gain;
|
||||
}
|
||||
|
||||
void AudioMixerClientData::setGainForAvatar(QUuid nodeID, float gain) {
|
||||
auto it = std::find_if(_streams.active.cbegin(), _streams.active.cend(), [nodeID](const MixableStream& mixableStream){
|
||||
bool setGainInStreams(const QUuid &nodeID, float gain, std::vector<AudioMixerClientData::MixableStream> &streamVector) {
|
||||
auto itActive = std::find_if(streamVector.cbegin(), streamVector.cend(),
|
||||
[nodeID](const AudioMixerClientData::MixableStream& mixableStream){
|
||||
return mixableStream.nodeStreamID.nodeID == nodeID && mixableStream.nodeStreamID.streamID.isNull();
|
||||
});
|
||||
|
||||
if (it != _streams.active.cend()) {
|
||||
it->hrtf->setGainAdjustment(gain);
|
||||
if (itActive != streamVector.cend()) {
|
||||
itActive->hrtf->setGainAdjustment(gain);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void AudioMixerClientData::setGainForAvatar(QUuid nodeID, float gain) {
|
||||
if (!setGainInStreams(nodeID, gain, _streams.active)) {
|
||||
setGainInStreams(nodeID, gain, _streams.inactive);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue