History

Merge pull request #6420 from jherico/dargo

Make recording and playback work in interface, playback in agent

samcake committed 10 years ago

Commit 74beeef2 parents b47aadf 98cc74019 files · +274 −241Browse files

Showing the changes to interface/src/Application.cpp (1 of 19 files). Show all

Unified · Split

interface/src/Application.cpp+11−6
@@ -454,6 +454,17 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 453 unmodified lines
454454 audioIO->setOrientationGetter([this]{ return getMyAvatar()->getOrientationForAudio(); });
455455
456456 audioIO->moveToThread(audioThread);
457+ recording::Frame::registerFrameHandler(AudioConstants::AUDIO_FRAME_NAME, [=](recording::Frame::ConstPointer frame) {
458+ audioIO->handleRecordedAudioInput(frame->data);
459+ });
460+
461+ connect(audioIO.data(), &AudioClient::inputReceived, [](const QByteArray& audio){
462+ static auto recorder = DependencyManager::get<recording::Recorder>();
463+ if (recorder->isRecording()) {
464+ static const recording::FrameType AUDIO_FRAME_TYPE = recording::Frame::registerFrameType(AudioConstants::AUDIO_FRAME_NAME);
465+ recorder->recordFrame(AUDIO_FRAME_TYPE, audio);
466+ }
467+ });
457468
458469 auto& audioScriptingInterface = AudioScriptingInterface::getInstance();
459470
@@ -743,10 +754,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 283 unmodified lines
743754 connect(applicationUpdater.data(), &AutoUpdater::newVersionIsAvailable, dialogsManager.data(), &DialogsManager::showUpdateDialog);
744755 applicationUpdater->checkForUpdate();
745756
746− // Assign MyAvatar to th eRecording Singleton
747− DependencyManager::get<RecordingScriptingInterface>()->setControlledAvatar(getMyAvatar());
748−
749−
750757 // Now that menu is initalized we can sync myAvatar with it's state.
751758 getMyAvatar()->updateMotionBehaviorFromMenu();
752759
@@ -841,8 +848,6 @@ void Application::cleanupBeforeQuit() { · 88 unmodified lines
841848 #ifdef HAVE_IVIEWHMD
842849 DependencyManager::get<EyeTracker>()->setEnabled(false, true);
843850 #endif
844− DependencyManager::get<RecordingScriptingInterface>()->setControlledAvatar(nullptr);
845−
846851 AnimDebugDraw::getInstance().shutdown();
847852
848853 // FIXME: once we move to shared pointer for the INputDevice we shoud remove this naked delete: