mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 11:41:17 +02:00
CR fixes
This commit is contained in:
parent
72eb797910
commit
5033e7be11
3 changed files with 29 additions and 29 deletions
|
@ -160,7 +160,7 @@ MyAvatar::MyAvatar(RigPointer rig) :
|
||||||
}
|
}
|
||||||
|
|
||||||
auto audioIO = DependencyManager::get<AudioClient>();
|
auto audioIO = DependencyManager::get<AudioClient>();
|
||||||
audioIO->setPlayingBackRecording(isPlaying);
|
audioIO->setIsPlayingBackRecording(isPlaying);
|
||||||
|
|
||||||
if (_rig) {
|
if (_rig) {
|
||||||
_rig->setEnableAnimations(!isPlaying);
|
_rig->setEnableAnimations(!isPlaying);
|
||||||
|
|
|
@ -148,17 +148,17 @@ static inline float convertToFloat(int16_t sample) {
|
||||||
AudioClient::AudioClient() :
|
AudioClient::AudioClient() :
|
||||||
AbstractAudioInterface(),
|
AbstractAudioInterface(),
|
||||||
_gate(this),
|
_gate(this),
|
||||||
_audioInput(nullptr),
|
_audioInput(NULL),
|
||||||
_desiredInputFormat(),
|
_desiredInputFormat(),
|
||||||
_inputFormat(),
|
_inputFormat(),
|
||||||
_numInputCallbackBytes(0),
|
_numInputCallbackBytes(0),
|
||||||
_audioOutput(nullptr),
|
_audioOutput(NULL),
|
||||||
_desiredOutputFormat(),
|
_desiredOutputFormat(),
|
||||||
_outputFormat(),
|
_outputFormat(),
|
||||||
_outputFrameSize(0),
|
_outputFrameSize(0),
|
||||||
_numOutputCallbackBytes(0),
|
_numOutputCallbackBytes(0),
|
||||||
_loopbackAudioOutput(nullptr),
|
_loopbackAudioOutput(NULL),
|
||||||
_loopbackOutputDevice(nullptr),
|
_loopbackOutputDevice(NULL),
|
||||||
_inputRingBuffer(0),
|
_inputRingBuffer(0),
|
||||||
_localInjectorsStream(0),
|
_localInjectorsStream(0),
|
||||||
_receivedAudioStream(RECEIVED_AUDIO_STREAM_CAPACITY_FRAMES),
|
_receivedAudioStream(RECEIVED_AUDIO_STREAM_CAPACITY_FRAMES),
|
||||||
|
@ -176,9 +176,9 @@ AudioClient::AudioClient() :
|
||||||
_isNoiseGateEnabled(true),
|
_isNoiseGateEnabled(true),
|
||||||
_reverb(false),
|
_reverb(false),
|
||||||
_reverbOptions(&_scriptReverbOptions),
|
_reverbOptions(&_scriptReverbOptions),
|
||||||
_inputToNetworkResampler(nullptr),
|
_inputToNetworkResampler(NULL),
|
||||||
_networkToOutputResampler(nullptr),
|
_networkToOutputResampler(NULL),
|
||||||
_localToOutputResampler(nullptr),
|
_localToOutputResampler(NULL),
|
||||||
_localAudioThread(this),
|
_localAudioThread(this),
|
||||||
_audioLimiter(AudioConstants::SAMPLE_RATE, OUTPUT_CHANNEL_COUNT),
|
_audioLimiter(AudioConstants::SAMPLE_RATE, OUTPUT_CHANNEL_COUNT),
|
||||||
_outgoingAvatarAudioSequenceNumber(0),
|
_outgoingAvatarAudioSequenceNumber(0),
|
||||||
|
@ -393,9 +393,9 @@ QAudioDeviceInfo defaultAudioDeviceForMode(QAudio::Mode mode) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
HRESULT hr = S_OK;
|
HRESULT hr = S_OK;
|
||||||
CoInitialize(nullptr);
|
CoInitialize(NULL);
|
||||||
IMMDeviceEnumerator* pMMDeviceEnumerator = nullptr;
|
IMMDeviceEnumerator* pMMDeviceEnumerator = NULL;
|
||||||
CoCreateInstance(__uuidof(MMDeviceEnumerator), nullptr, CLSCTX_ALL, __uuidof(IMMDeviceEnumerator), (void**)&pMMDeviceEnumerator);
|
CoCreateInstance(__uuidof(MMDeviceEnumerator), NULL, CLSCTX_ALL, __uuidof(IMMDeviceEnumerator), (void**)&pMMDeviceEnumerator);
|
||||||
IMMDevice* pEndpoint;
|
IMMDevice* pEndpoint;
|
||||||
hr = pMMDeviceEnumerator->GetDefaultAudioEndpoint(mode == QAudio::AudioOutput ? eRender : eCapture, eMultimedia, &pEndpoint);
|
hr = pMMDeviceEnumerator->GetDefaultAudioEndpoint(mode == QAudio::AudioOutput ? eRender : eCapture, eMultimedia, &pEndpoint);
|
||||||
if (hr == E_NOTFOUND) {
|
if (hr == E_NOTFOUND) {
|
||||||
|
@ -405,7 +405,7 @@ QAudioDeviceInfo defaultAudioDeviceForMode(QAudio::Mode mode) {
|
||||||
deviceName = friendlyNameForAudioDevice(pEndpoint);
|
deviceName = friendlyNameForAudioDevice(pEndpoint);
|
||||||
}
|
}
|
||||||
pMMDeviceEnumerator->Release();
|
pMMDeviceEnumerator->Release();
|
||||||
pMMDeviceEnumerator = nullptr;
|
pMMDeviceEnumerator = NULL;
|
||||||
CoUninitialize();
|
CoUninitialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -965,7 +965,7 @@ void AudioClient::handleLocalEchoAndReverb(QByteArray& inputByteArray) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioClient::handleAudioInput() {
|
void AudioClient::handleAudioInput() {
|
||||||
if (!_inputDevice || _playingBackRecording) {
|
if (!_inputDevice || _isPlayingBackRecording) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1354,10 +1354,10 @@ bool AudioClient::switchInputToAudioDevice(const QAudioDeviceInfo& inputDeviceIn
|
||||||
// That in turn causes it to be disconnected (see for example
|
// That in turn causes it to be disconnected (see for example
|
||||||
// http://stackoverflow.com/questions/9264750/qt-signals-and-slots-object-disconnect).
|
// http://stackoverflow.com/questions/9264750/qt-signals-and-slots-object-disconnect).
|
||||||
_audioInput->stop();
|
_audioInput->stop();
|
||||||
_inputDevice = nullptr;
|
_inputDevice = NULL;
|
||||||
|
|
||||||
delete _audioInput;
|
delete _audioInput;
|
||||||
_audioInput = nullptr;
|
_audioInput = NULL;
|
||||||
_numInputCallbackBytes = 0;
|
_numInputCallbackBytes = 0;
|
||||||
|
|
||||||
_inputAudioDeviceName = "";
|
_inputAudioDeviceName = "";
|
||||||
|
@ -1366,7 +1366,7 @@ bool AudioClient::switchInputToAudioDevice(const QAudioDeviceInfo& inputDeviceIn
|
||||||
if (_inputToNetworkResampler) {
|
if (_inputToNetworkResampler) {
|
||||||
// if we were using an input to network resampler, delete it here
|
// if we were using an input to network resampler, delete it here
|
||||||
delete _inputToNetworkResampler;
|
delete _inputToNetworkResampler;
|
||||||
_inputToNetworkResampler = nullptr;
|
_inputToNetworkResampler = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!inputDeviceInfo.isNull()) {
|
if (!inputDeviceInfo.isNull()) {
|
||||||
|
@ -1461,29 +1461,29 @@ bool AudioClient::switchOutputToAudioDevice(const QAudioDeviceInfo& outputDevice
|
||||||
_audioOutput->stop();
|
_audioOutput->stop();
|
||||||
|
|
||||||
delete _audioOutput;
|
delete _audioOutput;
|
||||||
_audioOutput = nullptr;
|
_audioOutput = NULL;
|
||||||
|
|
||||||
_loopbackOutputDevice = nullptr;
|
_loopbackOutputDevice = NULL;
|
||||||
delete _loopbackAudioOutput;
|
delete _loopbackAudioOutput;
|
||||||
_loopbackAudioOutput = nullptr;
|
_loopbackAudioOutput = NULL;
|
||||||
|
|
||||||
delete[] _outputMixBuffer;
|
delete[] _outputMixBuffer;
|
||||||
_outputMixBuffer = nullptr;
|
_outputMixBuffer = NULL;
|
||||||
|
|
||||||
delete[] _outputScratchBuffer;
|
delete[] _outputScratchBuffer;
|
||||||
_outputScratchBuffer = nullptr;
|
_outputScratchBuffer = NULL;
|
||||||
|
|
||||||
delete[] _localOutputMixBuffer;
|
delete[] _localOutputMixBuffer;
|
||||||
_localOutputMixBuffer = nullptr;
|
_localOutputMixBuffer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_networkToOutputResampler) {
|
if (_networkToOutputResampler) {
|
||||||
// if we were using an input to network resampler, delete it here
|
// if we were using an input to network resampler, delete it here
|
||||||
delete _networkToOutputResampler;
|
delete _networkToOutputResampler;
|
||||||
_networkToOutputResampler = nullptr;
|
_networkToOutputResampler = NULL;
|
||||||
|
|
||||||
delete _localToOutputResampler;
|
delete _localToOutputResampler;
|
||||||
_localToOutputResampler = nullptr;
|
_localToOutputResampler = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!outputDeviceInfo.isNull()) {
|
if (!outputDeviceInfo.isNull()) {
|
||||||
|
|
|
@ -145,7 +145,7 @@ public:
|
||||||
void setPositionGetter(AudioPositionGetter positionGetter) { _positionGetter = positionGetter; }
|
void setPositionGetter(AudioPositionGetter positionGetter) { _positionGetter = positionGetter; }
|
||||||
void setOrientationGetter(AudioOrientationGetter orientationGetter) { _orientationGetter = orientationGetter; }
|
void setOrientationGetter(AudioOrientationGetter orientationGetter) { _orientationGetter = orientationGetter; }
|
||||||
|
|
||||||
void setPlayingBackRecording(bool playingBackRecording) { _playingBackRecording = playingBackRecording; }
|
void setIsPlayingBackRecording(bool isPlayingBackRecording) { _isPlayingBackRecording = isPlayingBackRecording; }
|
||||||
|
|
||||||
Q_INVOKABLE void setAvatarBoundingBoxParameters(glm::vec3 corner, glm::vec3 scale);
|
Q_INVOKABLE void setAvatarBoundingBoxParameters(glm::vec3 corner, glm::vec3 scale);
|
||||||
|
|
||||||
|
@ -328,14 +328,14 @@ private:
|
||||||
// for local audio (used by audio injectors thread)
|
// for local audio (used by audio injectors thread)
|
||||||
float _localMixBuffer[AudioConstants::NETWORK_FRAME_SAMPLES_STEREO];
|
float _localMixBuffer[AudioConstants::NETWORK_FRAME_SAMPLES_STEREO];
|
||||||
int16_t _localScratchBuffer[AudioConstants::NETWORK_FRAME_SAMPLES_AMBISONIC];
|
int16_t _localScratchBuffer[AudioConstants::NETWORK_FRAME_SAMPLES_AMBISONIC];
|
||||||
float* _localOutputMixBuffer { nullptr };
|
float* _localOutputMixBuffer { NULL };
|
||||||
AudioInjectorsThread _localAudioThread;
|
AudioInjectorsThread _localAudioThread;
|
||||||
Mutex _localAudioMutex;
|
Mutex _localAudioMutex;
|
||||||
|
|
||||||
// for output audio (used by this thread)
|
// for output audio (used by this thread)
|
||||||
int _outputPeriod { 0 };
|
int _outputPeriod { 0 };
|
||||||
float* _outputMixBuffer { nullptr };
|
float* _outputMixBuffer { NULL };
|
||||||
int16_t* _outputScratchBuffer { nullptr };
|
int16_t* _outputScratchBuffer { NULL };
|
||||||
|
|
||||||
AudioLimiter _audioLimiter;
|
AudioLimiter _audioLimiter;
|
||||||
|
|
||||||
|
@ -373,7 +373,7 @@ private:
|
||||||
|
|
||||||
QVector<AudioInjector*> _activeLocalAudioInjectors;
|
QVector<AudioInjector*> _activeLocalAudioInjectors;
|
||||||
|
|
||||||
bool _playingBackRecording { false };
|
bool _isPlayingBackRecording { false };
|
||||||
|
|
||||||
CodecPluginPointer _codec;
|
CodecPluginPointer _codec;
|
||||||
QString _selectedCodecName;
|
QString _selectedCodecName;
|
||||||
|
|
Loading…
Reference in a new issue