BugFix SessionFile source import

This commit is contained in:
Bruno Herbelin
2022-03-26 15:02:28 +01:00
parent b04ab65258
commit e888bfbc8d
4 changed files with 9 additions and 8 deletions

View File

@@ -296,7 +296,7 @@ float LayerView::setDepth(Source *s, float d)
sourceNode->translation_.z = CLAMP( depth, MIN_DEPTH, MAX_DEPTH); sourceNode->translation_.z = CLAMP( depth, MIN_DEPTH, MAX_DEPTH);
// request reordering of scene at next update // request reordering of scene at next update
View::need_deep_update_++; ++View::need_deep_update_;
// request update of source // request update of source
s->touch(); s->touch();

View File

@@ -268,6 +268,8 @@ Source * Mixer::createSourceFile(const std::string &path)
// propose a new name based on uri // propose a new name based on uri
s->setName(SystemToolkit::base_filename(path)); s->setName(SystemToolkit::base_filename(path));
// remember as recent import
Settings::application.recentImport.push(path);
} }
else { else {
Settings::application.recentImport.remove(path); Settings::application.recentImport.remove(path);
@@ -443,9 +445,6 @@ void Mixer::insertSource(Source *s, View::Mode m)
// notify creation of source // notify creation of source
Log::Notify("Added source '%s' with %s", s->name().c_str(), s->info().c_str()); Log::Notify("Added source '%s' with %s", s->name().c_str(), s->info().c_str());
MediaSource *ms = dynamic_cast<MediaSource *>(s);
if (ms)
Settings::application.recentImport.push(ms->path());
// if requested to show the source in a given view // if requested to show the source in a given view
// (known to work for View::MIXING et TRANSITION: other views untested) // (known to work for View::MIXING et TRANSITION: other views untested)

View File

@@ -255,8 +255,10 @@ void SessionFileSource::init()
Node *loader = overlays_[View::TRANSITION]->back(); Node *loader = overlays_[View::TRANSITION]->back();
overlays_[View::TRANSITION]->detach(loader); overlays_[View::TRANSITION]->detach(loader);
delete loader; delete loader;
// deep update to reorder // request deep update to reorder session_
++View::need_deep_update_; ++View::need_deep_update_;
// run update to redraw framebuffer (after reorder)
session_->update(dt_);
} }
} }

View File

@@ -80,7 +80,7 @@ void View::update(float dt)
// a more complete update is requested // a more complete update is requested
if (View::need_deep_update_ > 0) { if (View::need_deep_update_ > 0) {
// reorder sources // reorder sources
scene.ws()->sort(); scene.root()->sort();
} }
} }