blob: fbff4378a2d5347ddd5a8b285ee429f77b2e2876 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
// Copyright 2005-2019 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.
#include "mumble_pch.hpp"
#include "AudioOutputUser.h"
AudioOutputUser::AudioOutputUser(const QString& name) : qsName(name) {
iBufferSize = 0;
pfBuffer = NULL;
pfVolume = NULL;
fPos[0]=fPos[1]=fPos[2]=0.0;
}
AudioOutputUser::~AudioOutputUser() {
delete [] pfBuffer;
delete [] pfVolume;
}
void AudioOutputUser::resizeBuffer(unsigned int newsize) {
if (newsize > iBufferSize) {
float *n = new float[newsize];
if (pfBuffer) {
memcpy(n, pfBuffer, sizeof(float) * iBufferSize);
delete [] pfBuffer;
}
pfBuffer = n;
iBufferSize = newsize;
}
}
|