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:
10
Mixer.cpp
10
Mixer.cpp
@@ -396,7 +396,7 @@ Source * Mixer::createSourceGroup()
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
Source * Mixer::createSourceClone(const std::string &namesource)
|
Source * Mixer::createSourceClone(const std::string &namesource, bool copy_attributes)
|
||||||
{
|
{
|
||||||
// ready to create a source
|
// ready to create a source
|
||||||
Source *s = nullptr;
|
Source *s = nullptr;
|
||||||
@@ -412,9 +412,17 @@ Source * Mixer::createSourceClone(const std::string &namesource)
|
|||||||
if (origin != session_->end()) {
|
if (origin != session_->end()) {
|
||||||
// create a source
|
// create a source
|
||||||
s = (*origin)->clone();
|
s = (*origin)->clone();
|
||||||
|
|
||||||
|
// if clone operation asks to copy attributes
|
||||||
|
if (copy_attributes) {
|
||||||
// place clone next to origin
|
// place clone next to origin
|
||||||
s->group(View::MIXING)->translation_ = (*origin)->group(View::MIXING)->translation_;
|
s->group(View::MIXING)->translation_ = (*origin)->group(View::MIXING)->translation_;
|
||||||
s->group(View::LAYER)->translation_ = (*origin)->group(View::LAYER)->translation_ + LAYER_STEP;
|
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;
|
return s;
|
||||||
|
|||||||
2
Mixer.h
2
Mixer.h
@@ -49,7 +49,7 @@ public:
|
|||||||
// creation of sources
|
// creation of sources
|
||||||
Source * createSourceFile (const std::string &path);
|
Source * createSourceFile (const std::string &path);
|
||||||
Source * createSourceMultifile(const std::list<std::string> &list_files, uint fps);
|
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 * createSourceRender ();
|
||||||
Source * createSourceStream (const std::string &gstreamerpipeline);
|
Source * createSourceStream (const std::string &gstreamerpipeline);
|
||||||
Source * createSourcePattern(uint pattern, glm::ivec2 res);
|
Source * createSourcePattern(uint pattern, glm::ivec2 res);
|
||||||
|
|||||||
@@ -6652,7 +6652,7 @@ void Navigator::RenderNewPannel()
|
|||||||
label = std::string("Source ") + (*iter)->initials() + " - " + (*iter)->name();
|
label = std::string("Source ") + (*iter)->initials() + " - " + (*iter)->name();
|
||||||
if (ImGui::Selectable( label.c_str() )) {
|
if (ImGui::Selectable( label.c_str() )) {
|
||||||
label = std::string("Clone of ") + label;
|
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();
|
ImGui::EndCombo();
|
||||||
|
|||||||
Reference in New Issue
Block a user