fixed some more vs clang reformatting

This commit is contained in:
amer cerkic 2019-09-18 14:39:55 -07:00
parent d4dc06d2e7
commit ecca898db8
2 changed files with 61 additions and 60 deletions

View file

@ -90,6 +90,7 @@ using Mutex = std::mutex;
using Lock = std::unique_lock<Mutex>;
Mutex _deviceMutex;
Mutex _recordMutex;
HifiAudioDeviceInfo defaultAudioDeviceForMode(QAudio::Mode mode);
// thread-safe
@ -199,7 +200,7 @@ static void channelUpmix(int16_t* source, int16_t* dest, int numSamples, int num
}
static void channelDownmix(int16_t* source, int16_t* dest, int numSamples) {
for (int i = 0; i < numSamples / 2; i++) {
for (int i = 0; i < numSamples/2; i++) {
// read 2 samples
int16_t left = *source++;
@ -581,7 +582,7 @@ HifiAudioDeviceInfo defaultAudioDeviceForMode(QAudio::Mode mode) {
if (!getPropertyError && propertySize) {
// find a device in the list that matches the name we have and return it
foreach (HifiAudioDeviceInfo audioDevice, getAvailableDevices(mode)) {
foreach(HifiAudioDeviceInfo audioDevice, getAvailableDevices(mode)) {
if (audioDevice.deviceName() == CFStringGetCStringPtr(deviceName, kCFStringEncodingMacRoman)) {
return audioDevice;
}
@ -637,7 +638,7 @@ HifiAudioDeviceInfo defaultAudioDeviceForMode(QAudio::Mode mode) {
return getNamedAudioDeviceForMode(mode, deviceName);
#endif
#if defined(Q_OS_ANDROID)
#if defined (Q_OS_ANDROID)
if (mode == QAudio::AudioInput) {
Setting::Handle<bool> enableAEC(SETTING_AEC_KEY, DEFAULT_AEC_ENABLED);
bool aecEnabled = enableAEC.get();
@ -1045,12 +1046,12 @@ bool AudioClient::switchAudioDevice(QAudio::Mode mode, const HifiAudioDeviceInfo
auto device = deviceInfo;
if (device.getDevice().isNull()) {
device=defaultAudioDeviceForMode(mode);
device = defaultAudioDeviceForMode(mode);
}
if (mode == QAudio::AudioInput) {
return switchInputToAudioDevice(device);
} else { // if (mode == QAudio::AudioOutput)
} else {
return switchOutputToAudioDevice(device);
}
}
@ -1173,7 +1174,7 @@ static void deinterleaveToFloat(const int16_t* src, float* const* dst, int numFr
for (int i = 0; i < numFrames; i++) {
for (int ch = 0; ch < numChannels; ch++) {
float f = *src++;
f *= (1 / 32768.0f); // scale
f *= (1/32768.0f); // scale
dst[ch][i] = f; // deinterleave
}
}
@ -1343,7 +1344,7 @@ void AudioClient::handleLocalEchoAndReverb(QByteArray& inputByteArray) {
// apply stereo reverb at the source, to the loopback audio
if (!_shouldEchoLocally && hasReverb) {
updateReverbOptions();
_sourceReverb.render(loopbackSamples, loopbackSamples, numLoopbackSamples / 2);
_sourceReverb.render(loopbackSamples, loopbackSamples, numLoopbackSamples/2);
}
// if required, upmix or downmix to deviceChannelCount
@ -2323,7 +2324,7 @@ float AudioClient::gainForSource(float distance, float volume) {
return gain;
}
qint64 AudioClient::AudioOutputIODevice::readData(char* data, qint64 maxSize) {
qint64 AudioClient::AudioOutputIODevice::readData(char * data, qint64 maxSize) {
// lock-free wait for initialization to avoid races
if (!_audio->_audioOutputInitialized.load(std::memory_order_acquire)) {

View file

@ -65,7 +65,7 @@
#pragma warning( pop )
#endif
#if defined(Q_OS_ANDROID)
#if defined (Q_OS_ANDROID)
#define VOICE_RECOGNITION "voicerecognition"
#define VOICE_COMMUNICATION "voicecommunication"