mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-14 11:49:59 +01:00
Clone with copy attributes
Two modes of cloning: from the source panel with 'Clone & filter' clones with copy of attributes (geometry, alpha, etc.), from the Insert source panel with 'Internal' source creates a fresh new copy.
This commit is contained in:
16
Mixer.cpp
16
Mixer.cpp
@@ -396,7 +396,7 @@ Source * Mixer::createSourceGroup()
|
||||
return s;
|
||||
}
|
||||
|
||||
Source * Mixer::createSourceClone(const std::string &namesource)
|
||||
Source * Mixer::createSourceClone(const std::string &namesource, bool copy_attributes)
|
||||
{
|
||||
// ready to create a source
|
||||
Source *s = nullptr;
|
||||
@@ -412,9 +412,17 @@ Source * Mixer::createSourceClone(const std::string &namesource)
|
||||
if (origin != session_->end()) {
|
||||
// create a source
|
||||
s = (*origin)->clone();
|
||||
// place clone next to origin
|
||||
s->group(View::MIXING)->translation_ = (*origin)->group(View::MIXING)->translation_;
|
||||
s->group(View::LAYER)->translation_ = (*origin)->group(View::LAYER)->translation_ + LAYER_STEP;
|
||||
|
||||
// if clone operation asks to copy attributes
|
||||
if (copy_attributes) {
|
||||
// place clone next to origin
|
||||
s->group(View::MIXING)->translation_ = (*origin)->group(View::MIXING)->translation_;
|
||||
s->group(View::LAYER)->translation_ = (*origin)->group(View::LAYER)->translation_ + LAYER_STEP;
|
||||
// copy geometry (overlap)
|
||||
s->group(View::GEOMETRY)->translation_ = (*origin)->group(View::GEOMETRY)->translation_;
|
||||
s->group(View::GEOMETRY)->scale_ = (*origin)->group(View::GEOMETRY)->scale_;
|
||||
s->group(View::GEOMETRY)->rotation_ = (*origin)->group(View::GEOMETRY)->rotation_;
|
||||
}
|
||||
}
|
||||
|
||||
return s;
|
||||
|
||||
2
Mixer.h
2
Mixer.h
@@ -49,7 +49,7 @@ public:
|
||||
// creation of sources
|
||||
Source * createSourceFile (const std::string &path);
|
||||
Source * createSourceMultifile(const std::list<std::string> &list_files, uint fps);
|
||||
Source * createSourceClone (const std::string &namesource = "");
|
||||
Source * createSourceClone (const std::string &namesource = "", bool copy_attributes = true);
|
||||
Source * createSourceRender ();
|
||||
Source * createSourceStream (const std::string &gstreamerpipeline);
|
||||
Source * createSourcePattern(uint pattern, glm::ivec2 res);
|
||||
|
||||
@@ -6652,7 +6652,7 @@ void Navigator::RenderNewPannel()
|
||||
label = std::string("Source ") + (*iter)->initials() + " - " + (*iter)->name();
|
||||
if (ImGui::Selectable( label.c_str() )) {
|
||||
label = std::string("Clone of ") + label;
|
||||
new_source_preview_.setSource( Mixer::manager().createSourceClone((*iter)->name()),label);
|
||||
new_source_preview_.setSource( Mixer::manager().createSourceClone((*iter)->name(), false),label);
|
||||
}
|
||||
}
|
||||
ImGui::EndCombo();
|
||||
|
||||
Reference in New Issue
Block a user