mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
New mechanism for source update with callbacks
Similarly to Node update callbacks, sources now have SourceCallbacks called at the start of each update. Several SourceCallback are implemented to ensure thread safe update of more complex properties (mixing alpha, depth, etc.).
This commit is contained in:
@@ -138,10 +138,9 @@ void LayerView::draw()
|
||||
float depth_inc = (dsl.back()->depth() - depth) / static_cast<float>(Mixer::selection().size()-1);
|
||||
for (++it; it != dsl.end(); ++it) {
|
||||
depth += depth_inc;
|
||||
(*it)->setDepth(depth);
|
||||
(*it)->call( new SetDepth(depth, 80.f) );
|
||||
}
|
||||
Action::manager().store(std::string("Selection: Layer Distribute"));
|
||||
++View::need_deep_update_;
|
||||
}
|
||||
if (ImGui::Selectable( ICON_FA_RULER_HORIZONTAL " Compress" )){
|
||||
SourceList dsl = depth_sorted(Mixer::selection().getCopy());
|
||||
@@ -149,20 +148,18 @@ void LayerView::draw()
|
||||
float depth = (*it)->depth();
|
||||
for (++it; it != dsl.end(); ++it) {
|
||||
depth += LAYER_STEP;
|
||||
(*it)->setDepth(depth);
|
||||
(*it)->call( new SetDepth(depth, 80.f) );
|
||||
}
|
||||
Action::manager().store(std::string("Selection: Layer Compress"));
|
||||
++View::need_deep_update_;
|
||||
}
|
||||
if (ImGui::Selectable( ICON_FA_EXCHANGE_ALT " Reverse order" )){
|
||||
SourceList dsl = depth_sorted(Mixer::selection().getCopy());
|
||||
SourceList::iterator it = dsl.begin();
|
||||
SourceList::reverse_iterator rit = dsl.rbegin();
|
||||
for (; it != dsl.end(); ++it, ++rit) {
|
||||
(*it)->setDepth((*rit)->depth());
|
||||
(*it)->call( new SetDepth((*rit)->depth(), 80.f) );
|
||||
}
|
||||
Action::manager().store(std::string("Selection: Layer Reverse order"));
|
||||
++View::need_deep_update_;
|
||||
}
|
||||
|
||||
ImGui::PopStyleColor(2);
|
||||
|
||||
Reference in New Issue
Block a user