mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-12 02:40:00 +01:00
Bugfix and cleanup Group source insert
NB: default setAlpha now re-uses the source previous mixing coordinates (does not force default location)
This commit is contained in:
19
Mixer.cpp
19
Mixer.cpp
@@ -727,7 +727,7 @@ void Mixer::groupSelection()
|
|||||||
info << sessiongroup->name() << " inserted: " << sessiongroup->session()->numSource() << " sources flatten.";
|
info << sessiongroup->name() << " inserted: " << sessiongroup->session()->numSource() << " sources flatten.";
|
||||||
Action::manager().store(info.str());
|
Action::manager().store(info.str());
|
||||||
|
|
||||||
Log::Notify("Added group source '%s' with %s", sessiongroup->name().c_str(), sessiongroup->info().c_str());
|
Log::Notify("Added source '%s' with %s", sessiongroup->name().c_str(), sessiongroup->info().c_str());
|
||||||
|
|
||||||
// give the hand to the user
|
// give the hand to the user
|
||||||
Mixer::manager().setCurrentSource(sessiongroup);
|
Mixer::manager().setCurrentSource(sessiongroup);
|
||||||
@@ -772,24 +772,19 @@ void Mixer::groupAll()
|
|||||||
sessiongroup->group(View::MIXING)->translation_.x = 0.f;
|
sessiongroup->group(View::MIXING)->translation_.x = 0.f;
|
||||||
sessiongroup->group(View::MIXING)->translation_.y = 0.f;
|
sessiongroup->group(View::MIXING)->translation_.y = 0.f;
|
||||||
|
|
||||||
// Add the session-group source to Session
|
|
||||||
session_->addSource(sessiongroup);
|
|
||||||
|
|
||||||
// Attach the session-group source to Mixer
|
|
||||||
attach(sessiongroup);
|
|
||||||
|
|
||||||
// name the session-group source (avoid name duplicates)
|
// name the session-group source (avoid name duplicates)
|
||||||
renameSource(sessiongroup, SystemToolkit::base_filename(session_->filename()));
|
renameSource(sessiongroup, SystemToolkit::base_filename(session_->filename()));
|
||||||
|
|
||||||
|
// Add the session-group source in the mixer
|
||||||
|
// NB: sessiongroup will be updated and inserted to Mixing view on next frame
|
||||||
|
addSource(sessiongroup);
|
||||||
|
|
||||||
// store in action manager
|
// store in action manager
|
||||||
std::ostringstream info;
|
std::ostringstream info;
|
||||||
info << sessiongroup->name() << " inserted: " << sessiongroup->session()->numSource() << " sources flatten.";
|
info << sessiongroup->name() << " inserted: " << sessiongroup->session()->numSource() << " sources flatten.";
|
||||||
Action::manager().store(info.str());
|
Action::manager().store(info.str());
|
||||||
|
|
||||||
Log::Notify("Added group source '%s' with %s", sessiongroup->name().c_str(), sessiongroup->info().c_str());
|
Log::Notify("Added source '%s' with %s", sessiongroup->name().c_str(), sessiongroup->info().c_str());
|
||||||
|
|
||||||
// give the hand to the user
|
|
||||||
Mixer::manager().setCurrentSource(sessiongroup);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
delete sessiongroup;
|
delete sessiongroup;
|
||||||
@@ -834,7 +829,7 @@ void Mixer::flattenSession()
|
|||||||
// prevent deletion of session_ (now embedded into session group)
|
// prevent deletion of session_ (now embedded into session group)
|
||||||
session_ = new Session;
|
session_ = new Session;
|
||||||
|
|
||||||
Log::Notify("Created group source '%s' with %s", sessiongroup->name().c_str(), sessiongroup->info().c_str());
|
Log::Notify("Switched to '%s' with %s", sessiongroup->name().c_str(), sessiongroup->info().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mixer::renameSource(Source *s, const std::string &newname)
|
void Mixer::renameSource(Source *s, const std::string &newname)
|
||||||
|
|||||||
@@ -688,9 +688,9 @@ void MixingView::setAlpha(Source *s)
|
|||||||
if (!s)
|
if (!s)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// move the layer node of the source
|
// move the mixing node of the source
|
||||||
Group *sourceNode = s->group(mode_);
|
Group *sourceNode = s->group(mode_);
|
||||||
glm::vec2 mix_pos = glm::vec2(DEFAULT_MIXING_TRANSLATION);
|
glm::vec2 mix_pos(sourceNode->translation_);
|
||||||
|
|
||||||
for(NodeSet::iterator it = scene.ws()->begin(); it != scene.ws()->end(); ++it) {
|
for(NodeSet::iterator it = scene.ws()->begin(); it != scene.ws()->end(); ++it) {
|
||||||
// avoid superposing icons: distribute equally
|
// avoid superposing icons: distribute equally
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ Source::Source(uint64_t id) : SourceCore(), id_(id), ready_(false), symbol_(null
|
|||||||
// create groups and overlays for each view
|
// create groups and overlays for each view
|
||||||
|
|
||||||
// default mixing nodes
|
// default mixing nodes
|
||||||
groups_[View::MIXING]->scale_ = glm::vec3(0.15f, 0.15f, 1.f);
|
groups_[View::MIXING]->scale_ = glm::vec3(MIXING_ICON_SCALE);
|
||||||
groups_[View::MIXING]->translation_ = glm::vec3(DEFAULT_MIXING_TRANSLATION, 0.f);
|
groups_[View::MIXING]->translation_ = glm::vec3(DEFAULT_MIXING_TRANSLATION, 0.f);
|
||||||
|
|
||||||
frames_[View::MIXING] = new Switch;
|
frames_[View::MIXING] = new Switch;
|
||||||
|
|||||||
Reference in New Issue
Block a user