mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 11:53:28 +02:00
Track the desired audio-mixer gains when not connected
This commit is contained in:
parent
437d0ea928
commit
0b97f2bbc0
1 changed files with 6 additions and 2 deletions
|
@ -1143,6 +1143,10 @@ void NodeList::maybeSendIgnoreSetToNode(SharedNodePointer newNode) {
|
|||
}
|
||||
|
||||
void NodeList::setAvatarGain(const QUuid& nodeID, float gain) {
|
||||
if (nodeID.isNull()) {
|
||||
_avatarGain = gain;
|
||||
}
|
||||
|
||||
// cannot set gain of yourself
|
||||
if (getSessionUUID() != nodeID) {
|
||||
auto audioMixer = soloNodeOfType(NodeType::AudioMixer);
|
||||
|
@ -1160,7 +1164,6 @@ void NodeList::setAvatarGain(const QUuid& nodeID, float gain) {
|
|||
qCDebug(networking) << "Sending Set MASTER Avatar Gain packet with Gain:" << gain;
|
||||
|
||||
sendPacket(std::move(setAvatarGainPacket), *audioMixer);
|
||||
_avatarGain = gain;
|
||||
|
||||
} else {
|
||||
qCDebug(networking) << "Sending Set Avatar Gain packet with UUID:" << uuidStringWithoutCurlyBraces(nodeID) << "Gain:" << gain;
|
||||
|
@ -1192,6 +1195,8 @@ float NodeList::getAvatarGain(const QUuid& nodeID) {
|
|||
}
|
||||
|
||||
void NodeList::setInjectorGain(float gain) {
|
||||
_injectorGain = gain;
|
||||
|
||||
auto audioMixer = soloNodeOfType(NodeType::AudioMixer);
|
||||
if (audioMixer) {
|
||||
// setup the packet
|
||||
|
@ -1203,7 +1208,6 @@ void NodeList::setInjectorGain(float gain) {
|
|||
qCDebug(networking) << "Sending Set Injector Gain packet with Gain:" << gain;
|
||||
|
||||
sendPacket(std::move(setInjectorGainPacket), *audioMixer);
|
||||
_injectorGain = gain;
|
||||
|
||||
} else {
|
||||
qWarning() << "Couldn't find audio mixer to send set gain request";
|
||||
|
|
Loading…
Reference in a new issue