Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protocol changes -> master #1096

Merged
merged 109 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
89e6cbb
mirrors wip
HifiExperiments Mar 4, 2022
10de128
fix view + projection, texture flipping, billboarding
HifiExperiments Nov 13, 2023
97c4184
wip portals
HifiExperiments Nov 13, 2023
4806f90
wip
HifiExperiments Nov 17, 2023
56860be
fix cpu frustum culling (hacky?)
HifiExperiments Nov 18, 2023
093cf29
fix mirrors in deferred
HifiExperiments Nov 19, 2023
a630a6f
mirrors on models + text
HifiExperiments Nov 19, 2023
3336efb
portals use exit as ignoreItem
HifiExperiments Nov 19, 2023
6af7b9f
cleanup
HifiExperiments Nov 19, 2023
85f24f0
entity tags
HifiExperiments Dec 2, 2023
3e0c50e
wild guess to handle view correction, hide portalExitID in create whe…
HifiExperiments Dec 4, 2023
1634131
let's try this??
HifiExperiments Dec 6, 2023
4e5ded0
plz
HifiExperiments Dec 12, 2023
e0f3657
promising
HifiExperiments Dec 14, 2023
5159367
fix paramsOffset and view flipping
HifiExperiments Dec 18, 2023
c608e82
portals shouldn't flip
HifiExperiments Dec 21, 2023
f99a2fa
break when tag found
HifiExperiments Dec 30, 2023
446207a
fix portal view calculation
HifiExperiments Jan 4, 2024
c73566d
Merge pull request #721 from HifiExperiments/mirror
ksuprynowicz Jan 13, 2024
c6e4e5d
Revert "Mirrors + Portals"
ksuprynowicz Jan 13, 2024
b33d35c
Merge pull request #785 from overte-org/revert-721-mirror
ksuprynowicz Jan 13, 2024
e7591d6
Revert "Revert "Mirrors + Portals""
daleglass Jan 13, 2024
ca094dc
Merge pull request #786 from overte-org/revert-785-revert-721-mirror
daleglass Jan 13, 2024
e96a4f5
Merge branch 'protocol_changes' into tags
HifiExperiments Jan 13, 2024
eebeca5
Merge pull request #748 from HifiExperiments/tags
ksuprynowicz Jan 21, 2024
dc32e5c
web entity wantsKeyboardFocus property
HifiExperiments Feb 15, 2024
7941c9e
fix typo
HifiExperiments Mar 1, 2024
d928cb4
Merge pull request #814 from HifiExperiments/focus
JulianGro Mar 2, 2024
b8d2d71
move audio zones to zone entity properties
HifiExperiments Mar 2, 2024
af09c0a
fix audio zones in create
HifiExperiments Mar 12, 2024
8ea3f19
set dynamic factory
HifiExperiments Mar 14, 2024
325a694
Merge pull request #847 from HifiExperiments/audioZones
HifiExperiments Mar 21, 2024
f7c17d6
new procecural particle entity type
HifiExperiments Nov 28, 2023
9f3cf5a
fix particle intersection
HifiExperiments Mar 23, 2024
b97378d
shorten create labels
HifiExperiments Mar 23, 2024
0538284
fix 0 update props case
HifiExperiments Mar 24, 2024
b619907
Ability to smooth model animations
HifiExperiments Feb 20, 2024
878774b
sound entities
HifiExperiments Mar 24, 2024
968fa4a
fix layered simulate items
HifiExperiments Mar 26, 2024
9914d4d
fix stereo sound speed
HifiExperiments Mar 30, 2024
1dece29
Merge pull request #889 from HifiExperiments/animations
HifiExperiments Apr 6, 2024
51a80af
Merge branch 'protocol_changes' into particles
HifiExperiments Apr 6, 2024
aa5e8e6
Merge branch 'protocol_changes' into sound
HifiExperiments Apr 6, 2024
b7a3fb1
support non-localOnly sound avatar entities
HifiExperiments Apr 7, 2024
eb7d970
add sound url prompt
HifiExperiments Apr 7, 2024
376be7b
support registration point, improve locking
HifiExperiments Apr 12, 2024
6a180b1
remove keyboardRasied
HifiExperiments Apr 12, 2024
98c11ce
locking attempt #2
HifiExperiments Apr 15, 2024
ac29616
fix keyboardRasied typo
HifiExperiments Apr 17, 2024
a6491d6
add default particle props
HifiExperiments Apr 17, 2024
f9e729b
Merge pull request #884 from HifiExperiments/particles
HifiExperiments Apr 19, 2024
fa24022
Merge branch 'protocol_changes' into sound
HifiExperiments Jun 18, 2024
179f81a
add unlit property for shapes
HifiExperiments Apr 13, 2024
ee705d2
Merge branch master into protocol_changes
HifiExperiments Jun 19, 2024
2a3d3b3
Merge pull request #1042 from HifiExperiments/master_to_protocol_changes
HifiExperiments Jun 19, 2024
041c584
add ambient light color
HifiExperiments Jun 19, 2024
c08de91
Merge branch 'protocol_changes' into shapeUnlit
HifiExperiments Jun 20, 2024
0d0a0a7
fix create issue
HifiExperiments Jun 21, 2024
261cb94
fix create issue
HifiExperiments Jun 21, 2024
e4d17f4
Merge pull request #1041 from HifiExperiments/shapeUnlit
HifiExperiments Jun 22, 2024
ac7b41f
Merge branch 'protocol_changes' into ambientColor
HifiExperiments Jun 22, 2024
54d70a5
Merge pull request #1043 from HifiExperiments/ambientColor
HifiExperiments Jun 28, 2024
0e4e8d2
Merge branch 'protocol_changes' into sound
HifiExperiments Jun 28, 2024
6317bd4
add tonemapping props to zones, wip ambient occlusion
HifiExperiments Jun 25, 2024
b5da8e7
wip ambient occlusion
HifiExperiments Jun 27, 2024
b00086d
it's working!
HifiExperiments Jun 27, 2024
55907ac
remove attachments
HifiExperiments Jul 6, 2024
af66255
Merge pull request #1069 from HifiExperiments/wearables
HifiExperiments Jul 17, 2024
9d2e03a
fix non-localOnly positional sounds not updating
HifiExperiments Jul 20, 2024
0cfefaf
Merge pull request #894 from HifiExperiments/sound
HifiExperiments Jul 23, 2024
c72f22e
Merge branch 'protocol_changes' into zoneProps
HifiExperiments Jul 23, 2024
2c148ca
change AO default to HBAO, remove from create
HifiExperiments Jul 27, 2024
3dad0f1
Merge pull request #1050 from HifiExperiments/zoneProps
ksuprynowicz Jul 27, 2024
d4ca3d5
more graphics options
HifiExperiments Jun 28, 2024
2594583
fix AO setting + effects in mirrors
HifiExperiments Jun 29, 2024
2d6e502
Merge remote-tracking branch 'overte/master' into master_to_protocol_…
HifiExperiments Jul 30, 2024
f0ecffd
Merge pull request #1095 from HifiExperiments/master_to_protocol_chan…
HifiExperiments Jul 30, 2024
3e617d0
fix AA in mirrors
HifiExperiments Jul 30, 2024
24ed76a
alezia's fixes
HifiExperiments Aug 14, 2024
05661c6
fix haze in mirrors
HifiExperiments Aug 15, 2024
b1d991d
add comment for SKYBOX_DISTANCE
HifiExperiments Aug 16, 2024
91c7229
new line
HifiExperiments Aug 16, 2024
0ab9d5f
Merge pull request #1053 from HifiExperiments/graphicsSettings
HifiExperiments Aug 17, 2024
8fc734b
Merge remote-tracking branch 'overte/master' into master_to_protocol_…
HifiExperiments Aug 17, 2024
fa2211f
Merge pull request #1107 from HifiExperiments/master_to_protocol_chan…
HifiExperiments Aug 17, 2024
093f8b7
Merge remote-tracking branch 'overte/master' into master_to_protocol_…
HifiExperiments Aug 17, 2024
93c1ed6
Merge pull request #1108 from HifiExperiments/master_to_protocol_chan…
HifiExperiments Aug 17, 2024
fe61d92
model loading priority updates over time, takes into account out of b…
HifiExperiments Jul 13, 2024
7c3498b
add loadPriority to model entities, working on other avatars waitForW…
HifiExperiments Jul 15, 2024
86f3ca8
fix build error
HifiExperiments Jul 21, 2024
e9831d9
try to fix isServer assert
HifiExperiments Aug 19, 2024
3d97f78
fix stats + waitForWearables
HifiExperiments Aug 19, 2024
3c4c860
Merge pull request #1085 from HifiExperiments/loadPriority
HifiExperiments Sep 7, 2024
ff50d6c
automated entity property serialization
HifiExperiments Aug 5, 2024
926cbef
cleanup + automate EntityPropertyFlags
HifiExperiments Aug 7, 2024
74fa1d1
text vertical alignment, use uint8_t for entity property enums, fix t…
HifiExperiments Aug 19, 2024
356ccc8
fix text size
HifiExperiments Sep 7, 2024
729b850
fix component mode serialization
HifiExperiments Sep 9, 2024
0dd0d07
fix text debug assert on invalid or unloaded font
HifiExperiments Sep 9, 2024
1533f6a
missed some enums
HifiExperiments Sep 13, 2024
6a3a47b
fix ADD_GROUP_PROPERTY_TO_MAP
HifiExperiments Sep 29, 2024
ed4c5f2
fix PROP_GRAB_EQUIPPABLE_INDICATOR_URL missing urlPermission
HifiExperiments Sep 29, 2024
b88b187
fix KeyLightPropertyGroup legacy properties
HifiExperiments Sep 29, 2024
474026b
fix PolyLineEntityItem::getEntityProperties
HifiExperiments Sep 29, 2024
4e97090
comment cmake script
HifiExperiments Sep 29, 2024
470cd77
fix copyright
HifiExperiments Sep 29, 2024
0f5b0b5
Merge pull request #1098 from HifiExperiments/entityProps
HifiExperiments Sep 30, 2024
0ab050f
Merge pull request #1111 from HifiExperiments/textSize
HifiExperiments Oct 2, 2024
e7f7314
Merge branch 'master' into protocol_changes
HifiExperiments Oct 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions assignment-client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ link_hifi_libraries(
material-networking model-networking ktx shaders
)
include_hifi_library_headers(procedural)
include_hifi_library_headers(entities)

add_crashpad()
target_breakpad()
Expand Down
174 changes: 138 additions & 36 deletions assignment-client/src/audio/AudioMixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <StDev.h>
#include <UUID.h>
#include <CPUDetect.h>
#include <ZoneEntityItem.h>

#include "AudioLogging.h"
#include "AudioHelpers.h"
Expand All @@ -39,6 +40,8 @@
#include "AvatarAudioStream.h"
#include "InjectedAudioStream.h"
#include "crash-handler/CrashHandler.h"
#include "../AssignmentDynamicFactory.h"
#include "../entities/AssignmentParentFinder.h"

using namespace std;

Expand All @@ -56,14 +59,15 @@ float AudioMixer::_noiseMutingThreshold{ DEFAULT_NOISE_MUTING_THRESHOLD };
float AudioMixer::_attenuationPerDoublingInDistance{ DEFAULT_ATTENUATION_PER_DOUBLING_IN_DISTANCE };
map<QString, shared_ptr<CodecPlugin>> AudioMixer::_availableCodecs{ };
QStringList AudioMixer::_codecPreferenceOrder{};
vector<AudioMixer::ZoneDescription> AudioMixer::_audioZones;
vector<AudioMixer::ZoneSettings> AudioMixer::_zoneSettings;
vector<AudioMixer::ReverbSettings> AudioMixer::_zoneReverbSettings;
unordered_map<QString, AudioMixer::ZoneSettings> AudioMixer::_audioZones;

AudioMixer::AudioMixer(ReceivedMessage& message) :
ThreadedAssignment(message)
{

DependencyManager::registerInheritance<EntityDynamicFactoryInterface, AssignmentDynamicFactory>();
DependencyManager::set<AssignmentDynamicFactory>();

// Always clear settings first
// This prevents previous assignment settings from sticking around
clearDomainSettings();
Expand Down Expand Up @@ -112,6 +116,8 @@ AudioMixer::AudioMixer(ReceivedMessage& message) :
PacketReceiver::makeSourcedListenerReference<AudioMixer>(this, &AudioMixer::handleNodeMuteRequestPacket));
packetReceiver.registerListener(PacketType::KillAvatar,
PacketReceiver::makeSourcedListenerReference<AudioMixer>(this, &AudioMixer::handleKillAvatarPacket));
packetReceiver.registerListenerForTypes({ PacketType::OctreeStats, PacketType::EntityData, PacketType::EntityErase },
PacketReceiver::makeSourcedListenerReference<AudioMixer>(this, &AudioMixer::handleOctreePacket));

packetReceiver.registerListenerForTypes({
PacketType::ReplicatedMicrophoneAudioNoEcho,
Expand Down Expand Up @@ -405,7 +411,7 @@ void AudioMixer::start() {

// prepare the NodeList
nodeList->addSetOfNodeTypesToNodeInterestSet({
NodeType::Agent, NodeType::EntityScriptServer,
NodeType::Agent, NodeType::EntityScriptServer, NodeType::EntityServer,
NodeType::UpstreamAudioMixer, NodeType::DownstreamAudioMixer
});
nodeList->linkedDataCreateCallback = [&](Node* node) { getOrCreateClientData(node); };
Expand All @@ -417,12 +423,19 @@ void AudioMixer::start() {
parseSettingsObject(settingsObject);
}

setupEntityQuery();

// mix state
unsigned int frame = 1;

while (!_isFinished) {
auto ticTimer = _ticTiming.timer();

// Set our query each frame
{
_entityViewer.queryOctree();
}

if (_startFrameTimestamp.time_since_epoch().count() == 0) {
_startFrameTimestamp = _idealFrameTimestamp = p_high_resolution_clock::now();
} else {
Expand Down Expand Up @@ -555,8 +568,6 @@ void AudioMixer::clearDomainSettings() {
_noiseMutingThreshold = DEFAULT_NOISE_MUTING_THRESHOLD;
_codecPreferenceOrder.clear();
_audioZones.clear();
_zoneSettings.clear();
_zoneReverbSettings.clear();
}

void AudioMixer::parseSettingsObject(const QJsonObject& settingsObject) {
Expand Down Expand Up @@ -727,8 +738,13 @@ void AudioMixer::parseSettingsObject(const QJsonObject& settingsObject) {
if (allOk) {
glm::vec3 corner(xMin, yMin, zMin);
glm::vec3 dimensions(xMax - xMin, yMax - yMin, zMax - zMin);
AABox zoneAABox(corner, dimensions);
_audioZones.push_back({ zoneName, zoneAABox });

Transform t;
t.setTranslation(corner + 0.5f * dimensions);
t.setScale(dimensions);
_audioZones[zoneName].inverseTransform = t.getInverseMatrix();
_audioZones[zoneName].volume = dimensions.x * dimensions.y * dimensions.z;

qCDebug(audio) << "Added zone:" << zoneName << "(corner:" << corner << ", dimensions:" << dimensions << ")";
}
}
Expand All @@ -749,28 +765,17 @@ void AudioMixer::parseSettingsObject(const QJsonObject& settingsObject) {
coefficientObject.contains(LISTENER) &&
coefficientObject.contains(COEFFICIENT)) {

auto itSource = find_if(begin(_audioZones), end(_audioZones), [&](const ZoneDescription& description) {
return description.name == coefficientObject.value(SOURCE).toString();
});
auto itListener = find_if(begin(_audioZones), end(_audioZones), [&](const ZoneDescription& description) {
return description.name == coefficientObject.value(LISTENER).toString();
});
auto itSource = _audioZones.find(coefficientObject.value(SOURCE).toString());

bool ok;
float coefficient = coefficientObject.value(COEFFICIENT).toString().toFloat(&ok);

if (ok && coefficient <= 1.0f && itSource != _audioZones.end()) {
auto listener = coefficientObject.value(LISTENER).toString();
itSource->second.listeners.emplace_back(listener);
itSource->second.coefficients.emplace_back(coefficient);

if (ok && coefficient <= 1.0f &&
itSource != end(_audioZones) &&
itListener != end(_audioZones)) {

ZoneSettings settings;
settings.source = itSource - begin(_audioZones);
settings.listener = itListener - begin(_audioZones);
settings.coefficient = coefficient;

_zoneSettings.push_back(settings);
qCDebug(audio) << "Added Coefficient:" << itSource->name << itListener->name << settings.coefficient;
qCDebug(audio) << "Added Coefficient:" << itSource->first << listener << coefficient;
}
}
}
Expand All @@ -791,28 +796,125 @@ void AudioMixer::parseSettingsObject(const QJsonObject& settingsObject) {
reverbObject.contains(WET_LEVEL)) {

bool okReverbTime, okWetLevel;
auto itZone = find_if(begin(_audioZones), end(_audioZones), [&](const ZoneDescription& description) {
return description.name == reverbObject.value(ZONE).toString();
});
auto itZone = _audioZones.find(reverbObject.value(ZONE).toString());
float reverbTime = reverbObject.value(REVERB_TIME).toString().toFloat(&okReverbTime);
float wetLevel = reverbObject.value(WET_LEVEL).toString().toFloat(&okWetLevel);

if (okReverbTime && okWetLevel && itZone != end(_audioZones)) {
ReverbSettings settings;
settings.zone = itZone - begin(_audioZones);
settings.reverbTime = reverbTime;
settings.wetLevel = wetLevel;
if (okReverbTime && okWetLevel && itZone != _audioZones.end()) {
itZone->second.reverbEnabled = true;
itZone->second.reverbTime = reverbTime;
itZone->second.wetLevel = wetLevel;

_zoneReverbSettings.push_back(settings);

qCDebug(audio) << "Added Reverb:" << itZone->name << reverbTime << wetLevel;
qCDebug(audio) << "Added Reverb:" << itZone->first << reverbTime << wetLevel;
}
}
}
}
}
}

void AudioMixer::setupEntityQuery() {
_entityViewer.init();
EntityTreePointer entityTree = _entityViewer.getTree();
entityTree->setIsServer(true);
DependencyManager::registerInheritance<SpatialParentFinder, AssignmentParentFinder>();
DependencyManager::set<AssignmentParentFinder>(entityTree);

connect(entityTree.get(), &EntityTree::addingEntityPointer, this, &AudioMixer::entityAdded);
connect(entityTree.get(), &EntityTree::deletingEntityPointer, this, &AudioMixer::entityRemoved);

// ES query: {"type": "Zone"}
QJsonObject zoneQuery;
zoneQuery["type"] = "Zone";

QJsonObject queryFlags;
queryFlags["includeAncestors"] = true;
queryFlags["includeDescendants"] = true;
zoneQuery["flags"] = queryFlags;
zoneQuery["name"] = true; // Handy for debugging.

_entityViewer.getOctreeQuery().setJSONParameters(zoneQuery);
}

void AudioMixer::handleOctreePacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer senderNode) {
PacketType packetType = message->getType();

switch (packetType) {
case PacketType::OctreeStats:
{ // Ignore stats, but may have a different Entity packet appended.
OctreeHeadlessViewer::parseOctreeStats(message, senderNode);
const auto piggyBackedSizeWithHeader = message->getBytesLeftToRead();
if (piggyBackedSizeWithHeader > 0) {
// pull out the piggybacked packet and create a new QSharedPointer<NLPacket> for it
auto buffer = std::unique_ptr<char[]>(new char[piggyBackedSizeWithHeader]);
memcpy(buffer.get(), message->getRawMessage() + message->getPosition(), piggyBackedSizeWithHeader);

auto newPacket = NLPacket::fromReceivedPacket(std::move(buffer), piggyBackedSizeWithHeader, message->getSenderSockAddr());
auto newMessage = QSharedPointer<ReceivedMessage>::create(*newPacket);
handleOctreePacket(newMessage, senderNode);
}
break;
}

case PacketType::EntityData:
_entityViewer.processDatagram(*message, senderNode);
break;

case PacketType::EntityErase:
_entityViewer.processEraseMessage(*message, senderNode);
break;

default:
qCDebug(audio) << "Unexpected packet type:" << packetType;
break;
}
}

void updateAudioZone(EntityItem* entity, std::unordered_map<QString, AudioMixer::ZoneSettings>& audioZones) {
auto zoneEntity = (ZoneEntityItem*)entity;
auto& audioZone = audioZones[entity->getID().toString()];
auto& audioSettings = zoneEntity->getAudioProperties();

vec3 dimensions = entity->getScaledDimensions();
Transform t;
t.setTranslation(entity->getWorldPosition());
t.setScale(dimensions);
t.setRotation(entity->getWorldOrientation());
audioZone.inverseTransform = t.getInverseMatrix();
audioZone.volume = dimensions.x * dimensions.y * dimensions.z;

audioZone.reverbEnabled = audioSettings.getReverbEnabled();
audioZone.reverbTime = audioSettings.getReverbTime();
audioZone.wetLevel = audioSettings.getReverbWetLevel();

audioZone.listeners.clear();
auto listenerZones = audioSettings.getListenerZones();
audioZone.listeners.reserve(listenerZones.length());
for (auto& listener : listenerZones) {
audioZone.listeners.push_back(listener.toString());
}

audioZone.coefficients = audioSettings.getListenerAttenuationCoefficients().toStdVector();

/*qCDebug(audio) << "Updated audio zone:" << entity->getID().toString() << "(position:" << t.getTranslation()
<< ", dimensions:" << t.getScale() << ")";*/
}

void AudioMixer::entityAdded(EntityItem* entity) {
if (entity->getType() == EntityTypes::Zone) {
updateAudioZone(entity, _audioZones);
entity->registerChangeHandler([entity](const EntityItemID& entityItemID) {
updateAudioZone(entity, _audioZones);
});
}
}

void AudioMixer::entityRemoved(EntityItem* entity) {
if (entity->getType() == EntityTypes::Zone) {
_audioZones.erase(entity->getID().toString());
}
}

AudioMixer::Timer::Timing::Timing(uint64_t& sum) : _sum(sum) {
_timing = p_high_resolution_clock::now();
}
Expand Down
44 changes: 24 additions & 20 deletions assignment-client/src/audio/AudioMixer.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include <QtCore/QSharedPointer>

#include <AABox.h>
#include <Transform.h>
#include <AudioHRTF.h>
#include <AudioRingBuffer.h>
#include <ThreadedAssignment.h>
Expand All @@ -25,6 +25,8 @@
#include "AudioMixerStats.h"
#include "AudioMixerWorkerPool.h"

#include "../entities/EntityTreeHeadlessViewer.h"

class PositionalAudioStream;
class AvatarAudioStream;
class AudioHRTF;
Expand All @@ -36,28 +38,22 @@ class AudioMixer : public ThreadedAssignment {
public:
AudioMixer(ReceivedMessage& message);


struct ZoneDescription {
QString name;
AABox area;
};
struct ZoneSettings {
int source;
int listener;
float coefficient;
};
struct ReverbSettings {
int zone;
float reverbTime;
float wetLevel;
glm::mat4 inverseTransform;
float volume { FLT_MAX };

bool reverbEnabled { false };
float reverbTime { 0.0f };
float wetLevel { 0.0f };

std::vector<QString> listeners;
std::vector<float> coefficients;
};

static int getStaticJitterFrames() { return _numStaticJitterFrames; }
static bool shouldMute(float quietestFrame) { return quietestFrame > _noiseMutingThreshold; }
static float getAttenuationPerDoublingInDistance() { return _attenuationPerDoublingInDistance; }
static const std::vector<ZoneDescription>& getAudioZones() { return _audioZones; }
static const std::vector<ZoneSettings>& getZoneSettings() { return _zoneSettings; }
static const std::vector<ReverbSettings>& getReverbSettings() { return _zoneReverbSettings; }
static const std::unordered_map<QString, ZoneSettings>& getAudioZones() { return _audioZones; }
static const std::pair<QString, CodecPluginPointer> negotiateCodec(std::vector<QString> codecs);

static bool shouldReplicateTo(const Node& from, const Node& to) {
Expand All @@ -72,12 +68,17 @@ public slots:
void run() override;
void sendStatsPacket() override;

// Audio zone possibly changed
void entityAdded(EntityItem* entity);
void entityRemoved(EntityItem* entity);

private slots:
// packet handlers
void handleMuteEnvironmentPacket(QSharedPointer<ReceivedMessage> packet, SharedNodePointer sendingNode);
void handleNodeMuteRequestPacket(QSharedPointer<ReceivedMessage> packet, SharedNodePointer sendingNode);
void handleNodeKilled(SharedNodePointer killedNode);
void handleKillAvatarPacket(QSharedPointer<ReceivedMessage> packet, SharedNodePointer sendingNode);
void handleOctreePacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer senderNode);

void queueAudioPacket(QSharedPointer<ReceivedMessage> packet, SharedNodePointer sendingNode);
void queueReplicatedAudioPacket(QSharedPointer<ReceivedMessage> packet);
Expand Down Expand Up @@ -146,14 +147,17 @@ private slots:
static std::map<QString, CodecPluginPointer> _availableCodecs;
static QStringList _codecPreferenceOrder;

static std::vector<ZoneDescription> _audioZones;
static std::vector<ZoneSettings> _zoneSettings;
static std::vector<ReverbSettings> _zoneReverbSettings;
static std::unordered_map<QString, ZoneSettings> _audioZones;

float _throttleStartTarget = 0.9f;
float _throttleBackoffTarget = 0.44f;

AudioMixerWorker::SharedData _workerSharedData;

void setupEntityQuery();

// Attach to entity tree for audio zone info.
EntityTreeHeadlessViewer _entityViewer;
};

#endif // hifi_AudioMixer_h
Loading
Loading