diff --git a/Mixer.cpp b/Mixer.cpp index ab1993f..ac00b52 100644 --- a/Mixer.cpp +++ b/Mixer.cpp @@ -668,8 +668,9 @@ void Mixer::groupSelection() // set depth at given location group->group(View::LAYER)->translation_.z = d; - // scale alpha - group->setAlpha( 1.f ); + // set alpha to full opacity + group->group(View::MIXING)->translation_.x = 0.f; + group->group(View::MIXING)->translation_.y = 0.f; // Add source to Session session_->addSource(group); diff --git a/Session.cpp b/Session.cpp index afe36fd..556d474 100644 --- a/Session.cpp +++ b/Session.cpp @@ -74,10 +74,8 @@ void Session::update(float dt) // ensure the RenderSource is rendering this session RenderSource *s = dynamic_cast( *it ); - if ( s!= nullptr ){ - if ( s->session() != this /*|| s->session()->frame()->resolution() != frame()->resolution()*/) - s->setSession(nullptr); // RenderSource will fail and be replaced - } + if ( s!= nullptr && s->session() != this ) + s->setSession(this); if ( (*it)->failed() ) { failedSource_ = (*it); @@ -198,8 +196,10 @@ Source *Session::popSource() void Session::setResolution(glm::vec3 resolution, bool useAlpha) { + // setup the render view: if not specified the default config resulution will be used render_.setResolution( resolution, useAlpha ); - config_[View::RENDERING]->scale_ = resolution; + // store the actual resolution set in the render view + config_[View::RENDERING]->scale_ = render_.resolution(); } void Session::setFading(float f, bool forcenow) diff --git a/SessionSource.cpp b/SessionSource.cpp index 3a1dd74..4a7da94 100644 --- a/SessionSource.cpp +++ b/SessionSource.cpp @@ -329,7 +329,10 @@ RenderSource::RenderSource() : Source(), session_(nullptr) bool RenderSource::failed() const { - return (initialized_ && session_ == nullptr); + if (initialized_ && session_!=nullptr) + return renderbuffer_->resolution() != session_->frame()->resolution(); + + return false; } uint RenderSource::texture() const @@ -365,6 +368,16 @@ void RenderSource::init() } +glm::vec3 RenderSource::resolution() const +{ + if (initialized_) + return renderbuffer_->resolution(); + else if (session_ && session_->frame()) + return session_->frame()->resolution(); + else + return glm::vec3(0.f); +} + void RenderSource::accept(Visitor& v) { Source::accept(v); diff --git a/SessionSource.h b/SessionSource.h index c51b2b1..9cce888 100644 --- a/SessionSource.h +++ b/SessionSource.h @@ -89,6 +89,8 @@ public: inline Session *session () const { return session_; } inline void setSession (Session *se) { session_ = se; } + glm::vec3 resolution() const; + glm::ivec2 icon() const override { return glm::ivec2(0, 2); } protected: