diff --git a/Doxyfile b/Doxyfile index 43c790ff3d6381d66ee53b60af111a6ff8935724..5832155ee65df43814a075dfb2757535cae26562 100644 --- a/Doxyfile +++ b/Doxyfile @@ -876,7 +876,8 @@ RECURSIVE = YES EXCLUDE = "components/common/cpp/include/nlohmann/json.hpp" \ "components/common/cpp/include/loguru.hpp" \ "components/common/cpp/include/ctpl_stl.h" \ - "build/" + "build/" \ + "ext/" # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded diff --git a/applications/gui/src/camera.cpp b/applications/gui/src/camera.cpp index 8f2162dc860013aea1ed3fcf2355a59aa5bd0359..610be4ad8a7deacebedc16b4c55d914421642d9f 100644 --- a/applications/gui/src/camera.cpp +++ b/applications/gui/src/camera.cpp @@ -406,7 +406,7 @@ bool ftl::gui::Camera::setVR(bool on) { else { vr_mode_ = false; setChannel(Channel::Left); // reset to left channel - // todo restore camera params + // todo restore camera params< } return vr_mode_; @@ -415,7 +415,7 @@ bool ftl::gui::Camera::setVR(bool on) { void ftl::gui::Camera::setChannel(Channel c) { #ifdef HAVE_OPENVR - if (isVR()) { + if (isVR() && (c != Channel::Right)) { LOG(ERROR) << "Changing channel in VR mode is not possible."; return; } diff --git a/components/audio/src/speaker.cpp b/components/audio/src/speaker.cpp index a0b40f932baa9d6222ac0d7378d164e862a618d3..4670ca3852fa3aa237ba16ff102f6e93e2953ba3 100644 --- a/components/audio/src/speaker.cpp +++ b/components/audio/src/speaker.cpp @@ -13,49 +13,49 @@ using ftl::codecs::Channel; /* Portaudio callback to receive audio data. */ static int pa_speaker_callback(const void *input, void *output, - unsigned long frameCount, const PaStreamCallbackTimeInfo *timeInfo, - PaStreamCallbackFlags statusFlags, void *userData) { + unsigned long frameCount, const PaStreamCallbackTimeInfo *timeInfo, + PaStreamCallbackFlags statusFlags, void *userData) { - auto *buffer = (ftl::audio::StereoBuffer16<2000>*)userData; - short *out = (short*)output; + auto *buffer = (ftl::audio::StereoBuffer16<2000>*)userData; + short *out = (short*)output; buffer->readFrame(out); - return 0; + return 0; } #endif Speaker::Speaker(nlohmann::json &config) : ftl::Configurable(config), buffer_(48000) { #ifdef HAVE_PORTAUDIO - ftl::audio::pa_init(); - - auto err = Pa_OpenDefaultStream( - &stream_, - 0, - 2, - paInt16, - 48000, // Sample rate - 256, // Size of single frame - pa_speaker_callback, - &this->buffer_ - ); - - if (err != paNoError) { - LOG(ERROR) << "Portaudio open stream error: " << Pa_GetErrorText(err); - active_ = false; + ftl::audio::pa_init(); + + auto err = Pa_OpenDefaultStream( + &stream_, + 0, + 2, + paInt16, + 48000, // Sample rate + 256, // Size of single frame + pa_speaker_callback, + &this->buffer_ + ); + + if (err != paNoError) { + LOG(ERROR) << "Portaudio open stream error: " << Pa_GetErrorText(err); + active_ = false; return; - } else { - active_ = true; - } + } else { + active_ = true; + } - err = Pa_StartStream(stream_); + err = Pa_StartStream(stream_); - if (err != paNoError) { - LOG(ERROR) << "Portaudio start stream error: " << Pa_GetErrorText(err); - //active_ = false; + if (err != paNoError) { + LOG(ERROR) << "Portaudio start stream error: " << Pa_GetErrorText(err); + //active_ = false; return; - } + } #else // No portaudio @@ -71,40 +71,40 @@ Speaker::Speaker(nlohmann::json &config) : ftl::Configurable(config), buffer_(48 } Speaker::~Speaker() { - if (active_) { - active_ = false; + if (active_) { + active_ = false; #ifdef HAVE_PORTAUDIO - auto err = Pa_StopStream(stream_); + auto err = Pa_StopStream(stream_); - if (err != paNoError) { - LOG(ERROR) << "Portaudio stop stream error: " << Pa_GetErrorText(err); - //active_ = false; - } + if (err != paNoError) { + LOG(ERROR) << "Portaudio stop stream error: " << Pa_GetErrorText(err); + //active_ = false; + } - err = Pa_CloseStream(stream_); + err = Pa_CloseStream(stream_); - if (err != paNoError) { - LOG(ERROR) << "Portaudio close stream error: " << Pa_GetErrorText(err); - } + if (err != paNoError) { + LOG(ERROR) << "Portaudio close stream error: " << Pa_GetErrorText(err); + } #endif - } + } #ifdef HAVE_PORTAUDIO - ftl::audio::pa_final(); + ftl::audio::pa_final(); #endif } void Speaker::queue(int64_t ts, ftl::audio::Frame &frame) { - auto &audio = frame.get<ftl::audio::Audio>(Channel::Audio); + auto &audio = frame.get<ftl::audio::Audio>(Channel::Audio); - LOG(INFO) << "Buffer Fullness (" << ts << "): " << buffer_.size(); + //LOG(INFO) << "Buffer Fullness (" << ts << "): " << buffer_.size(); buffer_.write(audio.data()); - LOG(INFO) << "Audio delay: " << buffer_.delay() << "s"; + //LOG(INFO) << "Audio delay: " << buffer_.delay() << "s"; } void Speaker::setDelay(int64_t ms) { - float d = static_cast<float>(ms) / 1000.0f + extra_delay_; - if (d < 0.0f) d = 0.0f; // Clamp to 0 delay (not ideal to be exactly 0) - buffer_.setDelay(d); + float d = static_cast<float>(ms) / 1000.0f + extra_delay_; + if (d < 0.0f) d = 0.0f; // Clamp to 0 delay (not ideal to be exactly 0) + buffer_.setDelay(d); }