mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 12:24:07 +02:00
hook menu calls up to AudioIOStreamStatsRenderer
This commit is contained in:
parent
0f18a9651b
commit
d9ab673442
3 changed files with 16 additions and 7 deletions
|
@ -1382,6 +1382,12 @@ int Audio::calculateNumberOfFrameSamples(int numBytes) const {
|
|||
return frameSamples;
|
||||
}
|
||||
|
||||
float Audio::getInputRingBufferMsecsAvailable() const {
|
||||
int bytesInInputRingBuffer = _inputRingBuffer.samplesAvailable() * sizeof(int16_t);
|
||||
float msecsInInputRingBuffer = bytesInInputRingBuffer / (float)(_inputFormat.bytesForDuration(USECS_PER_MSEC));
|
||||
return msecsInInputRingBuffer;
|
||||
}
|
||||
|
||||
float Audio::getAudioOutputMsecsUnplayed() const {
|
||||
if (!_audioOutput) {
|
||||
return 0.0f;
|
||||
|
|
|
@ -120,6 +120,7 @@ public slots:
|
|||
void stop();
|
||||
void addReceivedAudioToStream(const QByteArray& audioByteArray);
|
||||
void parseAudioEnvironmentData(const QByteArray& packet);
|
||||
void parseAudioStreamStatsPacket(const QByteArray& packet) { _stats.parseAudioStreamStatsPacket(packet); }
|
||||
void handleAudioInput();
|
||||
void reset();
|
||||
void audioMixerKilled();
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
|
||||
#include "Application.h"
|
||||
#include "AccountManager.h"
|
||||
#include "audio/AudioIOStatsRenderer.h"
|
||||
#include "audio/AudioScope.h"
|
||||
#include "devices/Faceshift.h"
|
||||
#include "devices/OculusManager.h"
|
||||
|
@ -610,18 +611,19 @@ Menu::Menu() :
|
|||
audioScopeFramesGroup->addAction(twentyFrames);
|
||||
audioScopeFramesGroup->addAction(fiftyFrames);
|
||||
}
|
||||
|
||||
|
||||
AudioIOStatsRenderer* statsRenderer = DependencyManager::get<AudioIOStatsRenderer>();
|
||||
addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::AudioStats,
|
||||
Qt::CTRL | Qt::Key_A,
|
||||
false,
|
||||
audioIO,
|
||||
SLOT(toggleStats()));
|
||||
Qt::CTRL | Qt::Key_A,
|
||||
false,
|
||||
statsRenderer,
|
||||
SLOT(toggle()));
|
||||
|
||||
addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::AudioStatsShowInjectedStreams,
|
||||
0,
|
||||
false,
|
||||
audioIO,
|
||||
SLOT(toggleStatsShowInjectedStreams()));
|
||||
statsRenderer,
|
||||
SLOT(toggleShowInjectedStreams()));
|
||||
|
||||
connect(audioIO, SIGNAL(muteToggled()), this, SLOT(audioMuteToggled()));
|
||||
|
||||
|
|
Loading…
Reference in a new issue