mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-09 07:22:19 +02:00
have Application pass audio pos/orientation to AudioClient
This commit is contained in:
parent
e28ca27ccd
commit
d2af9a2911
5 changed files with 17 additions and 11 deletions
|
@ -279,6 +279,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
|||
QThread* audioThread = new QThread(this);
|
||||
|
||||
auto audioIO = DependencyManager::get<AudioClient>();
|
||||
|
||||
audioIO->setPositionGetter(getPositionForAudio);
|
||||
audioIO->setOrientationGetter(getOrientationForAudio);
|
||||
|
||||
audioIO->moveToThread(audioThread);
|
||||
connect(audioThread, &QThread::started, audioIO.data(), &AudioClient::start);
|
||||
|
||||
|
|
|
@ -132,6 +132,8 @@ public:
|
|||
static Application* getInstance() { return static_cast<Application*>(QCoreApplication::instance()); }
|
||||
static const glm::vec3& getPositionForPath() { return getInstance()->_myAvatar->getPosition(); }
|
||||
static glm::quat getOrientationForPath() { return getInstance()->_myAvatar->getOrientation(); }
|
||||
static glm::vec3 getPositionForAudio() { return getInstance()->_myAvatar->getHead()->getPosition(); }
|
||||
static glm::quat getOrientationForAudio() { return getInstance()->_myAvatar->getHead()->getFinalOrientationInWorldFrame(); }
|
||||
|
||||
Application(int& argc, char** argv, QElapsedTimer &startup_time);
|
||||
~Application();
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <AccountManager.h>
|
||||
#include <AddressManager.h>
|
||||
#include <AudioClient.h>
|
||||
#include <DependencyManager.h>
|
||||
#include <MainWindow.h>
|
||||
#include <GlowEffect.h>
|
||||
|
@ -41,7 +42,6 @@
|
|||
|
||||
#include "Application.h"
|
||||
#include "AccountManager.h"
|
||||
#include "Audio.h"
|
||||
#include "audio/AudioIOStatsRenderer.h"
|
||||
#include "audio/AudioScope.h"
|
||||
#include "devices/RealSense.h"
|
||||
|
|
|
@ -5,17 +5,17 @@ setup_hifi_library(Network)
|
|||
|
||||
link_hifi_libraries(audio)
|
||||
|
||||
# call macro to include our dependency includes and bubble them up via a property on our target
|
||||
include_dependency_includes()
|
||||
|
||||
set(GVERB_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external/gverb")
|
||||
|
||||
# As Gverb is currently the only reverb library, it's required.
|
||||
find_package(Gverb REQUIRED)
|
||||
|
||||
if (GVERB_FOUND)
|
||||
file(GLOB GVERB_SRCS ${GVERB_SRC_DIRS}/*.c)
|
||||
include_directories(${GVERB_INCLUDE_DIRS})
|
||||
add_library(gverb STATIC ${GVERB_SRCS})
|
||||
target_link_libraries(${TARGET_NAME} gverb)
|
||||
endif (GVERB_FOUND)
|
||||
file(GLOB GVERB_SRCS ${GVERB_SRC_DIRS}/*.c)
|
||||
add_library(gverb STATIC ${GVERB_SRCS})
|
||||
target_link_libraries(${TARGET_NAME} gverb)
|
||||
|
||||
# append gverb includes to our list of includes to bubble
|
||||
list(APPEND ${TARGET_NAME}_DEPENDENCY_INCLUDES "${GVERB_INCLUDE_DIRS}")
|
||||
|
||||
# call macro to include our dependency includes and bubble them up via a property on our target
|
||||
include_dependency_includes()
|
|
@ -68,7 +68,7 @@ class QAudioInput;
|
|||
class QAudioOutput;
|
||||
class QIODevice;
|
||||
|
||||
typedef const glm::vec3& (*PositionGetter)();
|
||||
typedef glm::vec3 (*PositionGetter)();
|
||||
typedef glm::quat (*OrientationGetter)();
|
||||
|
||||
class AudioClient : public AbstractAudioInterface, public Dependency {
|
||||
|
|
Loading…
Reference in a new issue