From 4c5bb66bd7e6f68b3d92729f17ea981d2435e2aa Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Fri, 2 Jan 2015 16:01:04 -0800 Subject: [PATCH] Add audio output buffer size to preferences --- interface/src/ui/PreferencesDialog.cpp | 7 + interface/ui/preferencesDialog.ui | 281 ++++++++++++++++++------- 2 files changed, 211 insertions(+), 77 deletions(-) diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index 7baacd3d5a..947f6dea70 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -135,6 +135,8 @@ void PreferencesDialog::loadPreferences() { ui.windowSecondsForDesiredReductionSpin->setValue(streamSettings._windowSecondsForDesiredReduction); ui.repetitionWithFadeCheckBox->setChecked(streamSettings._repetitionWithFade); + ui.outputBufferSizeSpinner->setValue(Application::getInstance()->getAudio()->getOutputBufferSize()); + ui.realWorldFieldOfViewSpin->setValue(menuInstance->getRealWorldFieldOfView()); ui.fieldOfViewSpin->setValue(menuInstance->getFieldOfView()); @@ -245,9 +247,14 @@ void PreferencesDialog::savePreferences() { streamSettings._windowSecondsForDesiredReduction = ui.windowSecondsForDesiredReductionSpin->value(); streamSettings._repetitionWithFade = ui.repetitionWithFadeCheckBox->isChecked(); + Audio* audio = Application::getInstance()->getAudio(); + Menu::getInstance()->setReceivedAudioStreamSettings(streamSettings); + audio->setReceivedAudioStreamSettings(streamSettings); Application::getInstance()->getAudio()->setReceivedAudioStreamSettings(streamSettings); + QMetaObject::invokeMethod(audio, "setOutputBufferSize", Q_ARG(int, ui.outputBufferSizeSpinner->value())); + Application::getInstance()->resizeGL(glCanvas->width(), glCanvas->height()); Application::getInstance()->bumpSettings(); diff --git a/interface/ui/preferencesDialog.ui b/interface/ui/preferencesDialog.ui index 0108437c1f..864f8aa282 100644 --- a/interface/ui/preferencesDialog.ui +++ b/interface/ui/preferencesDialog.ui @@ -59,9 +59,9 @@ 0 - 0 - 500 - 1386 + -690 + 485 + 1499 @@ -1126,6 +1126,185 @@ + + + + 0 + + + 7 + + + 0 + + + 7 + + + + + + Arial + + + + Faceshift eye detection + + + 0 + + + faceshiftEyeDeflectionSider + + + + + + + + Arial + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 130 + 0 + + + + + Arial + + + + Qt::Horizontal + + + + + + + + + 0 + + + 7 + + + 0 + + + 7 + + + + + + Arial + + + + Faceshift hostname + + + 0 + + + faceshiftHostnameEdit + + + + + + + + Arial + + + + Qt::Horizontal + + + + 0 + 0 + + + + + + + + + Arial + + + + Qt::LeftToRight + + + + + + localhost + + + + + + + + + + 0 + 0 + + + + + 0 + 40 + + + + + Arial + 18 + 75 + true + + + + color:#29967e + + + Audio + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + @@ -1651,7 +1830,7 @@ - + 0 @@ -1664,26 +1843,26 @@ 7 - - + + Arial - Faceshift eye detection + Output Buffer Size (Frames) 0 - faceshiftEyeDeflectionSider + windowSecondsForDesiredReductionSpin - + Arial @@ -1701,7 +1880,7 @@ - + 0 @@ -1710,86 +1889,34 @@ - 130 + 100 0 + + + 70 + 16777215 + + Arial - - Qt::Horizontal + + 1 + + + 20 + + + 1 - - - - 0 - - - 7 - - - 0 - - - 7 - - - - - - Arial - - - - Faceshift hostname - - - 0 - - - faceshiftHostnameEdit - - - - - - - - Arial - - - - Qt::Horizontal - - - - - - - - Arial - - - - Qt::LeftToRight - - - - - - localhost - - - - -