Added missing code for previous video FPS settings

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
This commit is contained in:
Alexis Maiquez 2022-10-28 07:38:57 +02:00
parent 94777fc34b
commit 1b1bec879d
5 changed files with 15 additions and 0 deletions

View File

@ -37,6 +37,8 @@ CProject* CProject::fromFile (const std::string& filename, CContainer* container
{ {
wallpaper = new CVideo (file.c_str ()); wallpaper = new CVideo (file.c_str ());
} }
else if (type == "web")
throw std::runtime_error ("Web wallpapers not supported yet");
else else
throw std::runtime_error ("Unsupported wallpaper type"); throw std::runtime_error ("Unsupported wallpaper type");

View File

@ -243,3 +243,8 @@ void CContext::setMouse (CMouseInput* mouse)
{ {
this->m_mouse = mouse; this->m_mouse = mouse;
} }
CWallpaper* CContext::getWallpaper () const
{
return this->m_wallpaper;
}

View File

@ -25,6 +25,7 @@ namespace WallpaperEngine::Render
void setDefaultViewport (glm::vec4 defaultViewport); void setDefaultViewport (glm::vec4 defaultViewport);
CMouseInput* getMouse () const; CMouseInput* getMouse () const;
void setMouse (CMouseInput* mouse); void setMouse (CMouseInput* mouse);
CWallpaper* getWallpaper () const;
private: private:
Display* m_display; Display* m_display;

View File

@ -371,4 +371,9 @@ int CVideo::getHeight ()
return this->m_codecCtx->height; return this->m_codecCtx->height;
} }
int CVideo::getFPS ()
{
return this->m_codecCtx->framerate.num;
}
const std::string CVideo::Type = "video"; const std::string CVideo::Type = "video";

View File

@ -25,6 +25,8 @@ namespace WallpaperEngine::Render
int getWidth (); int getWidth ();
int getHeight (); int getHeight ();
int getFPS ();
protected: protected:
void renderFrame (glm::ivec4 viewport) override; void renderFrame (glm::ivec4 viewport) override;