mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-29 13:59:55 +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) {
|
void NodeList::setAvatarGain(const QUuid& nodeID, float gain) {
|
||||||
|
if (nodeID.isNull()) {
|
||||||
|
_avatarGain = gain;
|
||||||
|
}
|
||||||
|
|
||||||
// cannot set gain of yourself
|
// cannot set gain of yourself
|
||||||
if (getSessionUUID() != nodeID) {
|
if (getSessionUUID() != nodeID) {
|
||||||
auto audioMixer = soloNodeOfType(NodeType::AudioMixer);
|
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;
|
qCDebug(networking) << "Sending Set MASTER Avatar Gain packet with Gain:" << gain;
|
||||||
|
|
||||||
sendPacket(std::move(setAvatarGainPacket), *audioMixer);
|
sendPacket(std::move(setAvatarGainPacket), *audioMixer);
|
||||||
_avatarGain = gain;
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
qCDebug(networking) << "Sending Set Avatar Gain packet with UUID:" << uuidStringWithoutCurlyBraces(nodeID) << "Gain:" << gain;
|
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) {
|
void NodeList::setInjectorGain(float gain) {
|
||||||
|
_injectorGain = gain;
|
||||||
|
|
||||||
auto audioMixer = soloNodeOfType(NodeType::AudioMixer);
|
auto audioMixer = soloNodeOfType(NodeType::AudioMixer);
|
||||||
if (audioMixer) {
|
if (audioMixer) {
|
||||||
// setup the packet
|
// setup the packet
|
||||||
|
@ -1203,7 +1208,6 @@ void NodeList::setInjectorGain(float gain) {
|
||||||
qCDebug(networking) << "Sending Set Injector Gain packet with Gain:" << gain;
|
qCDebug(networking) << "Sending Set Injector Gain packet with Gain:" << gain;
|
||||||
|
|
||||||
sendPacket(std::move(setInjectorGainPacket), *audioMixer);
|
sendPacket(std::move(setInjectorGainPacket), *audioMixer);
|
||||||
_injectorGain = gain;
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
qWarning() << "Couldn't find audio mixer to send set gain request";
|
qWarning() << "Couldn't find audio mixer to send set gain request";
|
||||||
|
|
Loading…
Reference in a new issue