From e888bfbc8df60f4b26320fe59dd00389e187fd7c Mon Sep 17 00:00:00 2001 From: Bruno Herbelin Date: Sat, 26 Mar 2022 15:02:28 +0100 Subject: [PATCH] BugFix SessionFile source import --- LayerView.cpp | 2 +- Mixer.cpp | 5 ++--- SessionSource.cpp | 8 +++++--- View.cpp | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/LayerView.cpp b/LayerView.cpp index 3c0fd68..dfd708c 100644 --- a/LayerView.cpp +++ b/LayerView.cpp @@ -296,7 +296,7 @@ float LayerView::setDepth(Source *s, float d) sourceNode->translation_.z = CLAMP( depth, MIN_DEPTH, MAX_DEPTH); // request reordering of scene at next update - View::need_deep_update_++; + ++View::need_deep_update_; // request update of source s->touch(); diff --git a/Mixer.cpp b/Mixer.cpp index 42c51a7..f51da5a 100644 --- a/Mixer.cpp +++ b/Mixer.cpp @@ -268,6 +268,8 @@ Source * Mixer::createSourceFile(const std::string &path) // propose a new name based on uri s->setName(SystemToolkit::base_filename(path)); + // remember as recent import + Settings::application.recentImport.push(path); } else { Settings::application.recentImport.remove(path); @@ -443,9 +445,6 @@ void Mixer::insertSource(Source *s, View::Mode m) // notify creation of source Log::Notify("Added source '%s' with %s", s->name().c_str(), s->info().c_str()); - MediaSource *ms = dynamic_cast(s); - if (ms) - Settings::application.recentImport.push(ms->path()); // if requested to show the source in a given view // (known to work for View::MIXING et TRANSITION: other views untested) diff --git a/SessionSource.cpp b/SessionSource.cpp index c773c25..028c96f 100644 --- a/SessionSource.cpp +++ b/SessionSource.cpp @@ -210,7 +210,7 @@ void SessionFileSource::init() active_ = true; touch(); - // update to draw framebuffer + // update to draw framebuffer session_->update(dt_); // if all sources are ready, done with initialization! @@ -227,7 +227,7 @@ void SessionFileSource::init() // set resolution session_->setResolution( session_->config(View::RENDERING)->scale_ ); - // update to draw framebuffer + // update to draw framebuffer session_->update(dt_); // get the texture index from framebuffer of session, apply it to the surface @@ -255,8 +255,10 @@ void SessionFileSource::init() Node *loader = overlays_[View::TRANSITION]->back(); overlays_[View::TRANSITION]->detach(loader); delete loader; - // deep update to reorder + // request deep update to reorder session_ ++View::need_deep_update_; + // run update to redraw framebuffer (after reorder) + session_->update(dt_); } } diff --git a/View.cpp b/View.cpp index 15a7066..5cd2cb8 100644 --- a/View.cpp +++ b/View.cpp @@ -80,7 +80,7 @@ void View::update(float dt) // a more complete update is requested if (View::need_deep_update_ > 0) { // reorder sources - scene.ws()->sort(); + scene.root()->sort(); } }