mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-05 01:16:00 +02:00
hook AudioScope to new Dependency Audio
This commit is contained in:
parent
a9eaa4b9f7
commit
3c6c37710d
3 changed files with 16 additions and 10 deletions
|
@ -120,9 +120,6 @@ Audio::Audio() :
|
|||
// Create the noise sample array
|
||||
_noiseSampleFrames = new float[NUMBER_OF_NOISE_SAMPLE_FRAMES];
|
||||
|
||||
// connect(&_receivedAudioStream, &MixedProcessedAudioStream::addedSilence, this, &Audio::addStereoSilenceToScope, Qt::DirectConnection);
|
||||
// connect(&_receivedAudioStream, &MixedProcessedAudioStream::addedLastFrameRepeatedWithFade, this, &Audio::addLastFrameRepeatedWithFadeToScope, Qt::DirectConnection);
|
||||
// connect(&_receivedAudioStream, &MixedProcessedAudioStream::addedStereoSamples, this, &Audio::addStereoSamplesToScope, Qt::DirectConnection);
|
||||
connect(&_receivedAudioStream, &MixedProcessedAudioStream::processSamples, this, &Audio::processReceivedSamples, Qt::DirectConnection);
|
||||
|
||||
// Initialize GVerb
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
|
||||
#include <AudioConstants.h>
|
||||
|
||||
#include "Audio.h"
|
||||
|
||||
#include "AudioScope.h"
|
||||
|
||||
static const unsigned int DEFAULT_FRAMES_PER_SCOPE = 5;
|
||||
|
@ -34,7 +36,13 @@ AudioScope::AudioScope() :
|
|||
_scopeOutputRight(NULL),
|
||||
_scopeLastFrame()
|
||||
{
|
||||
|
||||
Audio* audioIO = DependencyManager::get<Audio>();
|
||||
connect(&audioIO->getReceivedAudioStream(), &MixedProcessedAudioStream::addedSilence,
|
||||
this, &AudioScope::addStereoSilenceToScope);
|
||||
connect(&audioIO->getReceivedAudioStream(), &MixedProcessedAudioStream::addedLastFrameRepeatedWithFade,
|
||||
this, &AudioScope::addLastFrameRepeatedWithFadeToScope);
|
||||
connect(&audioIO->getReceivedAudioStream(), &MixedProcessedAudioStream::addedStereoSamples,
|
||||
this, &AudioScope::addStereoSamplesToScope);
|
||||
}
|
||||
|
||||
void AudioScope::toggle() {
|
||||
|
@ -283,10 +291,12 @@ void AudioScope::addLastFrameRepeatedWithFadeToScope(int samplesPerChannel) {
|
|||
int indexOfRepeat = 0;
|
||||
do {
|
||||
int samplesToWriteThisIteration = std::min(samplesRemaining, (int) AudioConstants::NETWORK_FRAME_SAMPLES_PER_CHANNEL);
|
||||
// float fade = calculateRepeatedFrameFadeFactor(indexOfRepeat);
|
||||
// addBufferToScope(_scopeOutputLeft, _scopeOutputOffset, lastFrameData, samplesToWriteThisIteration, 0, STEREO_FACTOR, fade);
|
||||
// _scopeOutputOffset = addBufferToScope(_scopeOutputRight, _scopeOutputOffset, lastFrameData, samplesToWriteThisIteration, 1, STEREO_FACTOR, fade);
|
||||
//
|
||||
float fade = calculateRepeatedFrameFadeFactor(indexOfRepeat);
|
||||
addBufferToScope(_scopeOutputLeft, _scopeOutputOffset, lastFrameData,
|
||||
samplesToWriteThisIteration, 0, STEREO_FACTOR, fade);
|
||||
_scopeOutputOffset = addBufferToScope(_scopeOutputRight, _scopeOutputOffset,
|
||||
lastFrameData, samplesToWriteThisIteration, 1, STEREO_FACTOR, fade);
|
||||
|
||||
samplesRemaining -= samplesToWriteThisIteration;
|
||||
indexOfRepeat++;
|
||||
} while (samplesRemaining > 0);
|
||||
|
|
|
@ -20,8 +20,7 @@ AudioDeviceScriptingInterface* AudioDeviceScriptingInterface::getInstance() {
|
|||
|
||||
AudioDeviceScriptingInterface::AudioDeviceScriptingInterface() {
|
||||
connect(DependencyManager::get<Audio>(), &Audio::muteToggled,
|
||||
AudioDeviceScriptingInterface::getInstance(),
|
||||
&AudioDeviceScriptingInterface::muteToggled, Qt::DirectConnection);
|
||||
this, &AudioDeviceScriptingInterface::muteToggled);
|
||||
}
|
||||
|
||||
bool AudioDeviceScriptingInterface::setInputDevice(const QString& deviceName) {
|
||||
|
|
Loading…
Reference in a new issue