mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-15 21:18:06 +02:00
hand off audio bandwidth to BandwidthManager
This commit is contained in:
parent
1a87fa93f4
commit
693c52da55
2 changed files with 9 additions and 2 deletions
|
@ -283,6 +283,9 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
|||
audioIO->setPositionGetter(getPositionForAudio);
|
||||
audioIO->setOrientationGetter(getOrientationForAudio);
|
||||
|
||||
connect(audioIO.data(), &AudioClient::inputBytesFromNetwork, &_bandwidthMeter, &BandwidthMeter::updateAudioInputBytes);
|
||||
connect(audioIO.data(), &AudioClient::outputBytesToNetwork, &_bandwidthMeter, &BandwidthMeter::updateAudioOutputBytes);
|
||||
|
||||
audioIO->moveToThread(audioThread);
|
||||
connect(audioThread, &QThread::started, audioIO.data(), &AudioClient::start);
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
#include <TextRenderer.h>
|
||||
|
||||
|
||||
class BandwidthMeter {
|
||||
|
||||
class BandwidthMeter : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
BandwidthMeter();
|
||||
|
@ -67,6 +67,10 @@ public:
|
|||
Stream const& outputStream(ChannelIndex i) const { return _streams[i * 2 + 1]; }
|
||||
ChannelInfo& channelInfo(ChannelIndex i) { return _channels[i]; }
|
||||
ChannelInfo const& channelInfo(ChannelIndex i) const { return _channels[i]; }
|
||||
|
||||
public slots:
|
||||
void updateAudioInputBytes(int numBytes) { inputStream(AUDIO).updateValue(numBytes); }
|
||||
void updateAudioOutputBytes(int numBytes) { outputStream(AUDIO).updateValue(numBytes); }
|
||||
|
||||
private:
|
||||
static void setColorRGBA(unsigned c);
|
||||
|
|
Loading…
Reference in a new issue