mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-16 11:52:04 +02:00
simplify loopback trigger for injected audio
This commit is contained in:
parent
ec1f08b140
commit
a61e214c9a
4 changed files with 1 additions and 9 deletions
|
@ -128,7 +128,6 @@ void Hand::simulateToyBall(PalmData& palm, const glm::vec3& fingerTipPosition, f
|
|||
// pass an AudioInjectorOptions struct to set position and disable loopback
|
||||
AudioInjectorOptions injectorOptions;
|
||||
injectorOptions.setPosition(newPosition);
|
||||
injectorOptions.setShouldLoopback(false);
|
||||
injectorOptions.setLoopbackAudioInterface(app->getAudio());
|
||||
|
||||
AudioScriptingInterface::playSound(&_catchSound, &injectorOptions);
|
||||
|
@ -217,7 +216,6 @@ void Hand::simulateToyBall(PalmData& palm, const glm::vec3& fingerTipPosition, f
|
|||
// pass an AudioInjectorOptions struct to set position and disable loopback
|
||||
AudioInjectorOptions injectorOptions;
|
||||
injectorOptions.setPosition(ballPosition);
|
||||
injectorOptions.setShouldLoopback(false);
|
||||
injectorOptions.setLoopbackAudioInterface(app->getAudio());
|
||||
|
||||
AudioScriptingInterface::playSound(&_throwSound, &injectorOptions);
|
||||
|
|
|
@ -63,7 +63,7 @@ void AudioInjector::injectAudio() {
|
|||
currentPacketPosition += rfcStreamUUID.size();
|
||||
|
||||
// pack the flag for loopback
|
||||
bool loopbackFlag = _options.shouldLoopback();
|
||||
bool loopbackFlag = (_options.getLoopbackAudioInterface() == NULL);
|
||||
memcpy(currentPacketPosition, &loopbackFlag, sizeof(loopbackFlag));
|
||||
currentPacketPosition += sizeof(loopbackFlag);
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ AudioInjectorOptions::AudioInjectorOptions(QObject* parent) :
|
|||
_position(0.0f, 0.0f, 0.0f),
|
||||
_volume(1.0f),
|
||||
_orientation(glm::vec3(0.0f, 0.0f, 0.0f)),
|
||||
_shouldLoopback(true),
|
||||
_loopbackAudioInterface(NULL)
|
||||
{
|
||||
|
||||
|
@ -23,6 +22,5 @@ AudioInjectorOptions::AudioInjectorOptions(const AudioInjectorOptions& other) {
|
|||
_position = other._position;
|
||||
_volume = other._volume;
|
||||
_orientation = other._orientation;
|
||||
_shouldLoopback = other._shouldLoopback;
|
||||
_loopbackAudioInterface = other._loopbackAudioInterface;
|
||||
}
|
|
@ -35,9 +35,6 @@ public:
|
|||
const glm::quat& getOrientation() const { return _orientation; }
|
||||
void setOrientation(const glm::quat& orientation) { _orientation = orientation; }
|
||||
|
||||
bool shouldLoopback() const { return _shouldLoopback; }
|
||||
void setShouldLoopback(bool shouldLoopback) { _shouldLoopback = shouldLoopback; }
|
||||
|
||||
AbstractAudioInterface* getLoopbackAudioInterface() const { return _loopbackAudioInterface; }
|
||||
void setLoopbackAudioInterface(AbstractAudioInterface* loopbackAudioInterface)
|
||||
{ _loopbackAudioInterface = loopbackAudioInterface; }
|
||||
|
@ -45,7 +42,6 @@ private:
|
|||
glm::vec3 _position;
|
||||
float _volume;
|
||||
glm::quat _orientation;
|
||||
bool _shouldLoopback;
|
||||
AbstractAudioInterface* _loopbackAudioInterface;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue