// SPDX-License-Identifier: MIT // // EmulationStation Desktop Edition // SystemView.h // // Main system view. // #ifndef ES_APP_VIEWS_SYSTEM_VIEW_H #define ES_APP_VIEWS_SYSTEM_VIEW_H #include "FileData.h" #include "GuiComponent.h" #include "Sound.h" #include "SystemData.h" #include "components/DateTimeComponent.h" #include "components/GIFAnimComponent.h" #include "components/GameSelectorComponent.h" #include "components/LottieAnimComponent.h" #include "components/RatingComponent.h" #include "components/TextComponent.h" #include "components/VideoFFmpegComponent.h" #include "components/primary/CarouselComponent.h" #include "components/primary/TextListComponent.h" #include "resources/Font.h" #include class SystemData; class SystemView : public GuiComponent { public: using PrimaryType = PrimaryComponent::PrimaryType; SystemView(); ~SystemView(); void onTransition() override; void goToSystem(SystemData* system, bool animate); bool input(InputConfig* config, Input input) override; void update(int deltaTime) override; void render(const glm::mat4& parentTrans) override; bool isScrolling() { return mPrimary->isScrolling(); } void stopScrolling() { mPrimary->stopScrolling(); } bool isSystemAnimationPlaying(unsigned char slot) { return mPrimary->isAnimationPlaying(slot); } void finishSystemAnimation(unsigned char slot) { finishAnimation(slot); mPrimary->finishAnimation(slot); } PrimaryComponent::PrimaryType getPrimaryType() { return mPrimaryType; } CarouselComponent::CarouselType getCarouselType() { return (mCarousel != nullptr) ? mCarousel->getType() : CarouselComponent::CarouselType::NO_CAROUSEL; } SystemData* getFirstSystem() { return mPrimary->getFirst(); } void startViewVideos() override { for (auto& video : mSystemElements[mPrimary->getCursor()].videoComponents) video->startVideoPlayer(); } void stopViewVideos() override { for (auto& video : mSystemElements[mPrimary->getCursor()].videoComponents) video->stopVideoPlayer(); } void pauseViewVideos() override { for (auto& video : mSystemElements[mPrimary->getCursor()].videoComponents) { video->pauseVideoPlayer(); } } void muteViewVideos() override { for (auto& video : mSystemElements[mPrimary->getCursor()].videoComponents) video->muteVideoPlayer(); } void onThemeChanged(const std::shared_ptr& theme); std::vector getHelpPrompts() override; HelpStyle getHelpStyle() override { return mSystemElements[mPrimary->getCursor()].helpStyle; } protected: void onCursorChanged(const CursorState& state); private: void populate(); void updateGameCount(); void updateGameSelectors(); void legacyApplyTheme(const std::shared_ptr& theme); void renderElements(const glm::mat4& parentTrans, bool abovePrimary); struct SystemViewElements { HelpStyle helpStyle; std::string name; std::string fullName; std::vector> gameSelectors; std::vector legacyExtras; std::vector children; std::vector> imageComponents; std::vector> videoComponents; std::vector> lottieAnimComponents; std::vector> GIFAnimComponents; std::vector> gameCountComponents; std::vector> textComponents; std::vector> dateTimeComponents; std::vector> ratingComponents; }; Renderer* mRenderer; std::unique_ptr> mCarousel; std::unique_ptr> mTextList; std::unique_ptr mLegacySystemInfo; std::vector mSystemElements; PrimaryComponent* mPrimary; PrimaryType mPrimaryType; float mCamOffset; float mFadeOpacity; int mPreviousScrollVelocity; bool mUpdatedGameCount; bool mViewNeedsReload; bool mLegacyMode; bool mNavigated; bool mMaxFade; bool mFadeTransitions; }; #endif // ES_APP_VIEWS_SYSTEM_VIEW_H