mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-17 21:29:59 +01:00
Add possibility of Render Loopback source to replay
This commit is contained in:
@@ -117,7 +117,7 @@ void RenderSource::update(float dt)
|
|||||||
|
|
||||||
if (!paused_ && session_ && rendered_output_) {
|
if (!paused_ && session_ && rendered_output_) {
|
||||||
|
|
||||||
if (provenance_ == RENDER_EXCLUSIVE) {
|
if (provenance_ == RENDER_EXCLUSIVE || reset_) {
|
||||||
// temporarily exclude this RenderSource from the rendering
|
// temporarily exclude this RenderSource from the rendering
|
||||||
groups_[View::RENDERING]->visible_ = false;
|
groups_[View::RENDERING]->visible_ = false;
|
||||||
// simulate a rendering of the session in a framebuffer
|
// simulate a rendering of the session in a framebuffer
|
||||||
@@ -128,6 +128,8 @@ void RenderSource::update(float dt)
|
|||||||
rendered_output_->end();
|
rendered_output_->end();
|
||||||
// restore this RenderSource visibility
|
// restore this RenderSource visibility
|
||||||
groups_[View::RENDERING]->visible_ = true;
|
groups_[View::RENDERING]->visible_ = true;
|
||||||
|
// done reset
|
||||||
|
reset_ = false;
|
||||||
}
|
}
|
||||||
// blit session frame to output
|
// blit session frame to output
|
||||||
else if (!session_->frame()->blit(rendered_output_))
|
else if (!session_->frame()->blit(rendered_output_))
|
||||||
@@ -152,6 +154,12 @@ void RenderSource::play (bool on)
|
|||||||
paused_ = !on;
|
paused_ = !on;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RenderSource::replay ()
|
||||||
|
{
|
||||||
|
// request next frame to reset
|
||||||
|
reset_ = true;
|
||||||
|
}
|
||||||
|
|
||||||
glm::vec3 RenderSource::resolution() const
|
glm::vec3 RenderSource::resolution() const
|
||||||
{
|
{
|
||||||
if (rendered_output_ != nullptr)
|
if (rendered_output_ != nullptr)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public:
|
|||||||
void update (float dt) override;
|
void update (float dt) override;
|
||||||
bool playing () const override { return !paused_; }
|
bool playing () const override { return !paused_; }
|
||||||
void play (bool) override;
|
void play (bool) override;
|
||||||
void replay () override {}
|
void replay () override;
|
||||||
bool playable () const override { return true; }
|
bool playable () const override { return true; }
|
||||||
guint64 playtime () const override { return runtime_; }
|
guint64 playtime () const override { return runtime_; }
|
||||||
Failure failed () const override;
|
Failure failed () const override;
|
||||||
@@ -50,6 +50,7 @@ protected:
|
|||||||
|
|
||||||
// control
|
// control
|
||||||
bool paused_;
|
bool paused_;
|
||||||
|
bool reset_;
|
||||||
RenderSourceProvenance provenance_;
|
RenderSourceProvenance provenance_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user