mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-12 02:40:00 +01:00
Mixing Group improved UI feedback
This commit is contained in:
@@ -89,6 +89,11 @@ void MixingGroup::setAction (Action a)
|
|||||||
if (update_action_ == ACTION_NONE)
|
if (update_action_ == ACTION_NONE)
|
||||||
update_action_ = ACTION_UPDATE;
|
update_action_ = ACTION_UPDATE;
|
||||||
}
|
}
|
||||||
|
else if (a == ACTION_FINISH) {
|
||||||
|
// only needs to finish if an action was done
|
||||||
|
if (update_action_ != ACTION_NONE)
|
||||||
|
update_action_ = ACTION_FINISH;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
update_action_ = a;
|
update_action_ = a;
|
||||||
}
|
}
|
||||||
@@ -106,7 +111,15 @@ void MixingGroup::update (float)
|
|||||||
setActive(currentsource != sources_.end());
|
setActive(currentsource != sources_.end());
|
||||||
|
|
||||||
// perform action
|
// perform action
|
||||||
if (update_action_ == ACTION_UPDATE ) {
|
if (update_action_ == ACTION_FINISH ) {
|
||||||
|
// update barycenter
|
||||||
|
recenter();
|
||||||
|
// clear index, delete lines_, and recreate path and index with remaining sources
|
||||||
|
createLineStrip();
|
||||||
|
// update only once
|
||||||
|
update_action_ = ACTION_NONE;
|
||||||
|
}
|
||||||
|
else if (update_action_ == ACTION_UPDATE ) {
|
||||||
|
|
||||||
std::vector<glm::vec2> p = lines_->path();
|
std::vector<glm::vec2> p = lines_->path();
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,8 @@ public:
|
|||||||
ACTION_UPDATE = 1,
|
ACTION_UPDATE = 1,
|
||||||
ACTION_GRAB_ONE = 2,
|
ACTION_GRAB_ONE = 2,
|
||||||
ACTION_GRAB_ALL = 3,
|
ACTION_GRAB_ALL = 3,
|
||||||
ACTION_ROTATE_ALL = 4
|
ACTION_ROTATE_ALL = 4,
|
||||||
|
ACTION_FINISH = 5
|
||||||
} Action;
|
} Action;
|
||||||
void setAction (Action a) ;
|
void setAction (Action a) ;
|
||||||
inline Action action () { return update_action_; }
|
inline Action action () { return update_action_; }
|
||||||
|
|||||||
@@ -476,7 +476,7 @@ void MixingView::terminate()
|
|||||||
// terminate all mixing group actions
|
// terminate all mixing group actions
|
||||||
for (auto g = Mixer::manager().session()->beginMixingGroup();
|
for (auto g = Mixer::manager().session()->beginMixingGroup();
|
||||||
g != Mixer::manager().session()->endMixingGroup(); g++)
|
g != Mixer::manager().session()->endMixingGroup(); g++)
|
||||||
(*g)->setAction( MixingGroup::ACTION_NONE );
|
(*g)->setAction( MixingGroup::ACTION_FINISH );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
10
Source.cpp
10
Source.cpp
@@ -60,6 +60,7 @@ Source::Source() : initialized_(false), symbol_(nullptr), active_(true), locked_
|
|||||||
overlay_mixinggroup_ = new Switch;
|
overlay_mixinggroup_ = new Switch;
|
||||||
overlay_mixinggroup_->translation_.z = 0.1;
|
overlay_mixinggroup_->translation_.z = 0.1;
|
||||||
center = new Symbol(Symbol::CIRCLE_POINT, glm::vec3(0.f, 0.f, 0.1f));
|
center = new Symbol(Symbol::CIRCLE_POINT, glm::vec3(0.f, 0.f, 0.1f));
|
||||||
|
center->scale_= glm::vec3(1.6f, 1.6f, 1.f);
|
||||||
center->color = glm::vec4( COLOR_MIXING_GROUP, 0.96f);
|
center->color = glm::vec4( COLOR_MIXING_GROUP, 0.96f);
|
||||||
overlay_mixinggroup_->attach(center);
|
overlay_mixinggroup_->attach(center);
|
||||||
rotation_mixingroup_ = new Symbol(Symbol::ROTATION, glm::vec3(0.f, 0.f, 0.1f));
|
rotation_mixingroup_ = new Symbol(Symbol::ROTATION, glm::vec3(0.f, 0.f, 0.1f));
|
||||||
@@ -304,7 +305,11 @@ void Source::setMode(Source::Mode m)
|
|||||||
for (auto o = overlays_.begin(); o != overlays_.end(); o++)
|
for (auto o = overlays_.begin(); o != overlays_.end(); o++)
|
||||||
(*o).second->visible_ = current & !locked_;
|
(*o).second->visible_ = current & !locked_;
|
||||||
|
|
||||||
overlay_mixinggroup_->visible_ = mixinggroup_!= nullptr;
|
// the lock icon
|
||||||
|
locker_->setActive( locked_ ? 0 : 1);
|
||||||
|
|
||||||
|
// the mixing group overlay
|
||||||
|
overlay_mixinggroup_->visible_ = mixinggroup_!= nullptr && !locked_;
|
||||||
overlay_mixinggroup_->setActive(current);
|
overlay_mixinggroup_->setActive(current);
|
||||||
|
|
||||||
// show in appearance view if current
|
// show in appearance view if current
|
||||||
@@ -453,8 +458,7 @@ void Source::setLocked (bool on)
|
|||||||
{
|
{
|
||||||
locked_ = on;
|
locked_ = on;
|
||||||
|
|
||||||
// the lock icon
|
setMode(mode_);
|
||||||
locker_->setActive( on ? 0 : 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Transfer functions from coordinates to alpha (1 - transparency)
|
// Transfer functions from coordinates to alpha (1 - transparency)
|
||||||
|
|||||||
Reference in New Issue
Block a user