Make recording and playback work in interface, playback in agent
Showing the changes to interface/src/Application.cpp (1 of 19 files). Show all
Unified · Split
| @@ -454,6 +454,17 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 453 unmodified lines | |||
| 454 | audioIO->setOrientationGetter([this]{ return getMyAvatar()->getOrientationForAudio(); }); | 454 | audioIO->setOrientationGetter([this]{ return getMyAvatar()->getOrientationForAudio(); }); |
| 455 | 455 | ||
| 456 | audioIO->moveToThread(audioThread); | 456 | 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 | }); | ||
| 457 | 468 | ||
| 458 | auto& audioScriptingInterface = AudioScriptingInterface::getInstance(); | 469 | auto& audioScriptingInterface = AudioScriptingInterface::getInstance(); |
| 459 | 470 | ||
| @@ -743,10 +754,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 283 unmodified lines | |||
| 743 | connect(applicationUpdater.data(), &AutoUpdater::newVersionIsAvailable, dialogsManager.data(), &DialogsManager::showUpdateDialog); | 754 | connect(applicationUpdater.data(), &AutoUpdater::newVersionIsAvailable, dialogsManager.data(), &DialogsManager::showUpdateDialog); |
| 744 | applicationUpdater->checkForUpdate(); | 755 | applicationUpdater->checkForUpdate(); |
| 745 | 756 | ||
| 746 | // Assign MyAvatar to th eRecording Singleton | ||
| 747 | DependencyManager::get<RecordingScriptingInterface>()->setControlledAvatar(getMyAvatar()); | ||
| 748 | |||
| 749 | |||
| 750 | // Now that menu is initalized we can sync myAvatar with it's state. | 757 | // Now that menu is initalized we can sync myAvatar with it's state. |
| 751 | getMyAvatar()->updateMotionBehaviorFromMenu(); | 758 | getMyAvatar()->updateMotionBehaviorFromMenu(); |
| 752 | 759 | ||
| @@ -841,8 +848,6 @@ void Application::cleanupBeforeQuit() { · 88 unmodified lines | |||
| 841 | #ifdef HAVE_IVIEWHMD | 848 | #ifdef HAVE_IVIEWHMD |
| 842 | DependencyManager::get<EyeTracker>()->setEnabled(false, true); | 849 | DependencyManager::get<EyeTracker>()->setEnabled(false, true); |
| 843 | #endif | 850 | #endif |
| 844 | DependencyManager::get<RecordingScriptingInterface>()->setControlledAvatar(nullptr); | ||
| 845 | |||
| 846 | AnimDebugDraw::getInstance().shutdown(); | 851 | AnimDebugDraw::getInstance().shutdown(); |
| 847 | 852 | ||
| 848 | // FIXME: once we move to shared pointer for the INputDevice we shoud remove this naked delete: | 853 | // FIXME: once we move to shared pointer for the INputDevice we shoud remove this naked delete: |