mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 10:19:59 +01:00
Work in progress Implementation of mixing group
link and unlink methods, integration in MixingView, update groups on source change, undo-redo improved.
This commit is contained in:
@@ -237,11 +237,12 @@ void Action::restore(uint target, uint64_t id)
|
|||||||
// apply all changes creating or modifying groups in the session
|
// apply all changes creating or modifying groups in the session
|
||||||
// (after this, new groups are created and existing groups are adjusted)
|
// (after this, new groups are created and existing groups are adjusted)
|
||||||
for (auto group_loader_it = loadergroups.begin(); group_loader_it != loadergroups.end(); group_loader_it++) {
|
for (auto group_loader_it = loadergroups.begin(); group_loader_it != loadergroups.end(); group_loader_it++) {
|
||||||
se->updateMixingGroup( *group_loader_it );
|
se->link( *group_loader_it );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the updated list of mixing groups in the session
|
// Get the updated list of mixing groups in the session
|
||||||
std::list< SourceList > sessiongroups = se->getMixingGroups();
|
std::list< SourceList > sessiongroups = se->getMixingGroups();
|
||||||
|
|
||||||
// the remaining case is if session has groups that are not in the loaded xml
|
// the remaining case is if session has groups that are not in the loaded xml
|
||||||
// (that should therefore be deleted)
|
// (that should therefore be deleted)
|
||||||
if ( sessiongroups.size() > loadergroups.size() )
|
if ( sessiongroups.size() > loadergroups.size() )
|
||||||
@@ -270,7 +271,7 @@ void Action::restore(uint target, uint64_t id)
|
|||||||
// the remaining groups in sessiongroups do not have an EQUAL match in the loader groups
|
// the remaining groups in sessiongroups do not have an EQUAL match in the loader groups
|
||||||
for (auto group_se_it = sessiongroups.begin(); group_se_it != sessiongroups.end(); ) {
|
for (auto group_se_it = sessiongroups.begin(); group_se_it != sessiongroups.end(); ) {
|
||||||
// remove that group from the session
|
// remove that group from the session
|
||||||
se->removeMixingGroup( *group_se_it );
|
se->unlink( *group_se_it );
|
||||||
group_se_it = sessiongroups.erase(group_se_it);
|
group_se_it = sessiongroups.erase(group_se_it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1042,7 +1042,7 @@ void Mixer::merge(Session *session)
|
|||||||
// import and attach session's mixing groups
|
// import and attach session's mixing groups
|
||||||
auto group_iter = session->beginMixingGroup();
|
auto group_iter = session->beginMixingGroup();
|
||||||
while ( group_iter != session->endMixingGroup() ){
|
while ( group_iter != session->endMixingGroup() ){
|
||||||
session_->updateMixingGroup((*group_iter)->getCopy(), mixing_.scene.fg());
|
session_->link((*group_iter)->getCopy(), mixing_.scene.fg());
|
||||||
group_iter = session->deleteMixingGroup(group_iter);
|
group_iter = session->deleteMixingGroup(group_iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1124,7 +1124,7 @@ void Mixer::merge(SessionSource *source)
|
|||||||
// import and attach session's mixing groups
|
// import and attach session's mixing groups
|
||||||
auto group_iter = session->beginMixingGroup();
|
auto group_iter = session->beginMixingGroup();
|
||||||
while ( group_iter != session->endMixingGroup() ){
|
while ( group_iter != session->endMixingGroup() ){
|
||||||
session_->updateMixingGroup((*group_iter)->getCopy(), mixing_.scene.fg());
|
session_->link((*group_iter)->getCopy(), mixing_.scene.fg());
|
||||||
group_iter = session->deleteMixingGroup(group_iter);
|
group_iter = session->deleteMixingGroup(group_iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,6 +82,16 @@ void MixingGroup::recenter()
|
|||||||
center_->translation_ = glm::vec3(center_pos_, 0.f);
|
center_->translation_ = glm::vec3(center_pos_, 0.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MixingGroup::setAction (Action a)
|
||||||
|
{
|
||||||
|
if (a == ACTION_UPDATE) {
|
||||||
|
if (update_action_ == ACTION_NONE)
|
||||||
|
update_action_ = ACTION_UPDATE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
update_action_ = a;
|
||||||
|
}
|
||||||
|
|
||||||
void MixingGroup::update (float dt)
|
void MixingGroup::update (float dt)
|
||||||
{
|
{
|
||||||
// active if current source in the group
|
// active if current source in the group
|
||||||
@@ -89,7 +99,31 @@ void MixingGroup::update (float dt)
|
|||||||
setActive(currentsource != sources_.end());
|
setActive(currentsource != sources_.end());
|
||||||
|
|
||||||
// perform action
|
// perform action
|
||||||
if (update_action_ != ACTION_NONE && updated_source_ != nullptr) {
|
if (update_action_ == ACTION_UPDATE ) {
|
||||||
|
|
||||||
|
std::vector<glm::vec2> p = lines_->path();
|
||||||
|
|
||||||
|
// compute barycenter (0)
|
||||||
|
center_pos_ = glm::vec2(0.f, 0.f);
|
||||||
|
auto it = sources_.begin();
|
||||||
|
for (; it != sources_.end(); it++){
|
||||||
|
// update point
|
||||||
|
p[ index_points_[*it] ] = glm::vec2((*it)->group(View::MIXING)->translation_);
|
||||||
|
|
||||||
|
// compute barycenter (1)
|
||||||
|
center_pos_ += glm::vec2((*it)->group(View::MIXING)->translation_);
|
||||||
|
}
|
||||||
|
// compute barycenter (2)
|
||||||
|
center_pos_ /= sources_.size();
|
||||||
|
center_->translation_ = glm::vec3(center_pos_, 0.f);
|
||||||
|
|
||||||
|
// update path
|
||||||
|
lines_->changePath(p);
|
||||||
|
|
||||||
|
update_action_ = ACTION_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (update_action_ != ACTION_NONE && updated_source_ != nullptr) {
|
||||||
|
|
||||||
if (update_action_ == ACTION_GRAB_ONE ) {
|
if (update_action_ == ACTION_GRAB_ONE ) {
|
||||||
|
|
||||||
@@ -175,7 +209,7 @@ void MixingGroup::setActive (bool on)
|
|||||||
|
|
||||||
// overlays
|
// overlays
|
||||||
lines_->shader()->color.a = active_ ? 0.96f : 0.5f;
|
lines_->shader()->color.a = active_ ? 0.96f : 0.5f;
|
||||||
center_->visible_ = update_action_ != ACTION_NONE;
|
center_->visible_ = update_action_ > ACTION_UPDATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MixingGroup::detach (Source *s)
|
void MixingGroup::detach (Source *s)
|
||||||
|
|||||||
@@ -22,11 +22,12 @@ public:
|
|||||||
// actions for update
|
// actions for update
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ACTION_NONE = 0,
|
ACTION_NONE = 0,
|
||||||
ACTION_GRAB_ONE = 1,
|
ACTION_UPDATE = 1,
|
||||||
ACTION_GRAB_ALL = 2,
|
ACTION_GRAB_ONE = 2,
|
||||||
ACTION_ROTATE_ALL = 3
|
ACTION_GRAB_ALL = 3,
|
||||||
|
ACTION_ROTATE_ALL = 4
|
||||||
} Action;
|
} Action;
|
||||||
inline void setAction (Action a) { update_action_ = a; }
|
void setAction (Action a) ;
|
||||||
inline Action action () { return update_action_; }
|
inline Action action () { return update_action_; }
|
||||||
inline void follow (Source *s) { updated_source_ = s; }
|
inline void follow (Source *s) { updated_source_ = s; }
|
||||||
|
|
||||||
|
|||||||
@@ -127,18 +127,32 @@ void MixingView::draw()
|
|||||||
ImGui::PushStyleColor(ImGuiCol_Text, ImGuiToolkit::HighlightColor());
|
ImGui::PushStyleColor(ImGuiCol_Text, ImGuiToolkit::HighlightColor());
|
||||||
ImGui::PushStyleColor(ImGuiCol_HeaderHovered, ImVec4(0.36f, 0.36f, 0.36f, 0.44f));
|
ImGui::PushStyleColor(ImGuiCol_HeaderHovered, ImVec4(0.36f, 0.36f, 0.36f, 0.44f));
|
||||||
|
|
||||||
// special action of Mixing view
|
// special action of Mixing view: link or unlink
|
||||||
if (ImGui::Selectable( ICON_FA_DRAW_POLYGON " Link" )){
|
SourceList selected = Mixer::selection().getCopy();
|
||||||
// create MixingGroup
|
if ( Mixer::manager().session()->canlink( selected )) {
|
||||||
if (Mixer::manager().session()->updateMixingGroup(Mixer::selection().getCopy(), scene.fg() ) ) {
|
// the selected sources can be linked
|
||||||
Action::manager().store(std::string("Sources linked."), Mixer::manager().session()->lastMixingGroup()->id());
|
if (ImGui::Selectable( ICON_FA_LINK " Link" )){
|
||||||
// clear selection and select one of the sources of the group
|
// assemble a MixingGroup
|
||||||
Source *cur = Mixer::selection().front();
|
if (Mixer::manager().session()->link(selected, scene.fg() ) ) {
|
||||||
Mixer::manager().unsetCurrentSource();
|
Action::manager().store(std::string("Sources linked."), selected.front()->id());
|
||||||
Mixer::selection().clear();
|
// clear selection and select one of the sources of the group
|
||||||
Mixer::manager().setCurrentSource( cur );
|
Source *cur = Mixer::selection().front();
|
||||||
|
Mixer::manager().unsetCurrentSource();
|
||||||
|
Mixer::selection().clear();
|
||||||
|
Mixer::manager().setCurrentSource( cur );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
// the selected sources cannot be linked: offer to unlink!
|
||||||
|
if (ImGui::Selectable( ICON_FA_UNLINK " Unlink" )){
|
||||||
|
// dismantle MixingGroup(s)
|
||||||
|
if (Mixer::manager().session()->unlink(selected) ) {
|
||||||
|
Action::manager().store(std::string("Sources unlinked."), selected.front()->id());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
|
||||||
// manipulation of sources in Mixing view
|
// manipulation of sources in Mixing view
|
||||||
|
|||||||
147
Session.cpp
147
Session.cpp
@@ -332,55 +332,83 @@ void Session::move(int current_index, int target_index)
|
|||||||
sources_.insert(to, s);
|
sources_.insert(to, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Session::updateMixingGroup(SourceList sources, Group *parent)
|
bool Session::canlink (SourceList sources)
|
||||||
|
{
|
||||||
|
bool canlink = false;
|
||||||
|
|
||||||
|
// verify that all sources given are valid in the sesion
|
||||||
|
validate(sources);
|
||||||
|
|
||||||
|
// we need at least 2 sources to make a group
|
||||||
|
if (sources.size() > 1) {
|
||||||
|
// does this interfere with existing groups?
|
||||||
|
SourceListCompare c = SOURCELIST_DISTINCT;
|
||||||
|
for (auto group_it = mixing_groups_.begin(); group_it!= mixing_groups_.end(); group_it++) {
|
||||||
|
// get the list of sources in the group
|
||||||
|
SourceList group_sources = (*group_it)->getCopy();
|
||||||
|
c = compare( group_sources, sources );
|
||||||
|
if ( c != SOURCELIST_DISTINCT ){
|
||||||
|
// in case the source list containing entirely the group
|
||||||
|
// then extend the group with extra sources
|
||||||
|
if ( c == SOURCELIST_FIRST_IN_SECOND ) {
|
||||||
|
canlink = true;
|
||||||
|
}
|
||||||
|
// stop the loop
|
||||||
|
// (ignore INTERSECT and EQUAL cases)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
canlink |= ( c == SOURCELIST_DISTINCT );
|
||||||
|
}
|
||||||
|
|
||||||
|
return canlink;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Session::link(SourceList sources, Group *parent)
|
||||||
{
|
{
|
||||||
// pointer to created MixingGroup
|
// pointer to created MixingGroup
|
||||||
MixingGroup *g = nullptr;
|
MixingGroup *g = nullptr;
|
||||||
|
|
||||||
// verify that all sources given are valid in the sesion
|
// verify that all sources given are valid in the sesion
|
||||||
SourceList valid_sources;
|
validate(sources);
|
||||||
for (auto _it = sources.begin(); _it != sources.end(); _it++) {
|
|
||||||
SourceList::iterator found = std::find(sources_.begin(), sources_.end(), *_it);
|
|
||||||
if ( found != sources_.end())
|
|
||||||
valid_sources.push_back(*found);
|
|
||||||
}
|
|
||||||
|
|
||||||
// try to create mixing group with valid sources (if it is a group of at least 2 sources)
|
// we need at least 2 sources to make a group
|
||||||
if (valid_sources.size() > 1) {
|
if (sources.size() > 1) {
|
||||||
|
|
||||||
// does this interfere with existing groups?
|
// does this interfere with existing groups?
|
||||||
SourceListCompare c = SOURCELIST_DISTINCT;
|
SourceListCompare c = SOURCELIST_DISTINCT;
|
||||||
for (auto group_it = mixing_groups_.begin(); group_it!= mixing_groups_.end(); group_it++) {
|
for (auto group_it = mixing_groups_.begin(); group_it!= mixing_groups_.end(); group_it++) {
|
||||||
|
// get the list of sources in the group
|
||||||
SourceList group_sources = (*group_it)->getCopy();
|
SourceList group_sources = (*group_it)->getCopy();
|
||||||
c = compare( group_sources, sources );
|
c = compare( group_sources, sources );
|
||||||
if ( c != SOURCELIST_DISTINCT ){
|
if ( c != SOURCELIST_DISTINCT ){
|
||||||
// case of source list containing entirely the group
|
// in case the source list containing entirely the group
|
||||||
|
// then extend the group with extra sources
|
||||||
if ( c == SOURCELIST_FIRST_IN_SECOND ) {
|
if ( c == SOURCELIST_FIRST_IN_SECOND ) {
|
||||||
// extend the group with extra sources
|
|
||||||
g = *group_it;
|
g = *group_it;
|
||||||
// add all sources (will ignore already linked sources)
|
// add all sources (will ignore already linked sources)
|
||||||
g->attach( sources );
|
g->attach( sources );
|
||||||
}
|
}
|
||||||
// case of mixing group containing entirely the source list
|
// in case the mixing group contains entirely the source list
|
||||||
|
// then reduce the group to the source list
|
||||||
else if ( c == SOURCELIST_SECOND_IN_FIRST ) {
|
else if ( c == SOURCELIST_SECOND_IN_FIRST ) {
|
||||||
// reduce the group from the extra sources
|
|
||||||
g = *group_it;
|
g = *group_it;
|
||||||
// keep only elements of group_sources that are not in sources
|
// i.e. keep elements of group_sources that are not in list
|
||||||
for (auto it = sources.begin(); it != sources.end(); it++)
|
for (auto it = sources.begin(); it != sources.end(); it++)
|
||||||
group_sources.remove(*it);
|
group_sources.remove(*it);
|
||||||
// remove all extra sources
|
// remove all extra sources
|
||||||
g->detach( group_sources );
|
g->detach( group_sources );
|
||||||
}
|
}
|
||||||
// stop the loop
|
// stop the loop
|
||||||
|
// (we ignore INTERSECT and EQUAL cases)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// the sourcelist is distinct from all existing groups
|
// remaining case: the sourcelist is distinct from all existing groups
|
||||||
// (NB: ignore INTERSECT and EQUAL cases)
|
|
||||||
if ( c == SOURCELIST_DISTINCT ) {
|
if ( c == SOURCELIST_DISTINCT ) {
|
||||||
// create and add a new mixing group
|
// create and add a new mixing group
|
||||||
g = new MixingGroup(valid_sources);
|
g = new MixingGroup(sources);
|
||||||
mixing_groups_.push_back(g);
|
mixing_groups_.push_back(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -393,40 +421,52 @@ bool Session::updateMixingGroup(SourceList sources, Group *parent)
|
|||||||
return ( g != nullptr );
|
return ( g != nullptr );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Session::removeMixingGroup (SourceList sources)
|
bool Session::unlink (SourceList sources)
|
||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
// verify that all sources given are valid in the sesion
|
// verify that all sources given are valid in the sesion
|
||||||
SourceList valid_sources;
|
validate(sources);
|
||||||
for (auto _it = sources.begin(); _it != sources.end(); _it++) {
|
|
||||||
SourceList::iterator found = std::find(sources_.begin(), sources_.end(), *_it);
|
|
||||||
if ( found != sources_.end())
|
|
||||||
valid_sources.push_back(*found);
|
|
||||||
}
|
|
||||||
|
|
||||||
// does this intersect with existing groups?
|
// we need at least 1 sources to make a decision
|
||||||
SourceListCompare c = SOURCELIST_DISTINCT;
|
if (sources.size() > 0) {
|
||||||
|
|
||||||
for (auto group_it = mixing_groups_.begin(); group_it!= mixing_groups_.end(); group_it++) {
|
// does this list intersect with existing groups?
|
||||||
SourceList group_sources = (*group_it)->getCopy();
|
SourceListCompare c = SOURCELIST_DISTINCT;
|
||||||
c = compare( group_sources, sources );
|
for (auto group_it = mixing_groups_.begin(); group_it!= mixing_groups_.end(); group_it++) {
|
||||||
if ( c == SOURCELIST_EQUAL ) {
|
// get the list of sources in the group
|
||||||
delete (*group_it);
|
SourceList group_sources = (*group_it)->getCopy();
|
||||||
mixing_groups_.erase(group_it);
|
c = compare( group_sources, sources );
|
||||||
// stop the loop
|
// in case the group source is the same or inside the list,
|
||||||
ret = true;
|
// then delete the group entirely
|
||||||
break;
|
if ( c == SOURCELIST_EQUAL || c == SOURCELIST_FIRST_IN_SECOND) {
|
||||||
}
|
delete (*group_it);
|
||||||
// case of mixing group containing entirely the source list
|
mixing_groups_.erase(group_it);
|
||||||
else if ( c == SOURCELIST_INTERSECT ) {
|
// did something
|
||||||
group_sources = intersect( group_sources, sources);
|
ret = true;
|
||||||
// remove all extra sources
|
// stop the loop
|
||||||
(*group_it)->detach( group_sources );
|
break;
|
||||||
// stop the loop
|
}
|
||||||
ret = true;
|
// in case of the source list is inside the group,
|
||||||
break;
|
// then remove the listed sources from the group
|
||||||
|
else if ( c == SOURCELIST_SECOND_IN_FIRST ) {
|
||||||
|
// remove all extra sources
|
||||||
|
(*group_it)->detach( sources );
|
||||||
|
// did something
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
// in case of the group source intersects with the list,
|
||||||
|
// then remove the listed sources from the group
|
||||||
|
else if ( c == SOURCELIST_INTERSECT ) {
|
||||||
|
group_sources = intersect( group_sources, sources);
|
||||||
|
// remove all extra sources
|
||||||
|
(*group_it)->detach( group_sources );
|
||||||
|
// did something
|
||||||
|
ret = true;
|
||||||
|
}
|
||||||
|
// (NB: we ignore DISTINCT case)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@@ -442,12 +482,6 @@ std::list<SourceList> Session::getMixingGroups () const
|
|||||||
return lmg;
|
return lmg;
|
||||||
}
|
}
|
||||||
|
|
||||||
MixingGroup *Session::lastMixingGroup ()
|
|
||||||
{
|
|
||||||
if (mixing_groups_.empty())
|
|
||||||
return nullptr;
|
|
||||||
return mixing_groups_.back();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::list<MixingGroup *>::iterator Session::deleteMixingGroup (std::list<MixingGroup *>::iterator g)
|
std::list<MixingGroup *>::iterator Session::deleteMixingGroup (std::list<MixingGroup *>::iterator g)
|
||||||
{
|
{
|
||||||
@@ -479,6 +513,19 @@ void Session::unlock()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Session::validate (SourceList &sources)
|
||||||
|
{
|
||||||
|
// verify that all sources given are valid in the sesion
|
||||||
|
// and remove the invalid sources
|
||||||
|
for (auto _it = sources.begin(); _it != sources.end(); ) {
|
||||||
|
SourceList::iterator found = std::find(sources_.begin(), sources_.end(), *_it);
|
||||||
|
if ( found == sources_.end() )
|
||||||
|
_it = sources.erase(_it);
|
||||||
|
else
|
||||||
|
_it++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Session *Session::load(const std::string& filename, uint recursion)
|
Session *Session::load(const std::string& filename, uint recursion)
|
||||||
{
|
{
|
||||||
// create session
|
// create session
|
||||||
|
|||||||
18
Session.h
18
Session.h
@@ -76,11 +76,19 @@ public:
|
|||||||
void setFilename (const std::string &filename) { filename_ = filename; }
|
void setFilename (const std::string &filename) { filename_ = filename; }
|
||||||
std::string filename () const { return filename_; }
|
std::string filename () const { return filename_; }
|
||||||
|
|
||||||
// mixing group
|
// get the list of sources in mixing groups
|
||||||
bool updateMixingGroup (SourceList sources, Group *parent = nullptr);
|
|
||||||
bool removeMixingGroup (SourceList sources);
|
|
||||||
MixingGroup *lastMixingGroup ();
|
|
||||||
std::list<SourceList> getMixingGroups () const;
|
std::list<SourceList> getMixingGroups () const;
|
||||||
|
// returns true if something can be done to create a mixing group
|
||||||
|
bool canlink (SourceList sources);
|
||||||
|
// try to link sources of the given list:
|
||||||
|
// can either create a new mixing group or extend an existing group
|
||||||
|
// returns true if something was done
|
||||||
|
bool link (SourceList sources, Group *parent = nullptr);
|
||||||
|
// try to unlink sources of the given list:
|
||||||
|
// can either delete an entire mixing group, or remove the given sources from existing groups
|
||||||
|
// returns true if something was done
|
||||||
|
bool unlink (SourceList sources);
|
||||||
|
// iterators for looping over mixing groups
|
||||||
std::list<MixingGroup *>::iterator beginMixingGroup ();
|
std::list<MixingGroup *>::iterator beginMixingGroup ();
|
||||||
std::list<MixingGroup *>::iterator endMixingGroup ();
|
std::list<MixingGroup *>::iterator endMixingGroup ();
|
||||||
std::list<MixingGroup *>::iterator deleteMixingGroup (std::list<MixingGroup *>::iterator g);
|
std::list<MixingGroup *>::iterator deleteMixingGroup (std::list<MixingGroup *>::iterator g);
|
||||||
@@ -94,6 +102,8 @@ protected:
|
|||||||
std::string filename_;
|
std::string filename_;
|
||||||
Source *failedSource_;
|
Source *failedSource_;
|
||||||
SourceList sources_;
|
SourceList sources_;
|
||||||
|
void validate(SourceList &sources);
|
||||||
|
|
||||||
std::list<MixingGroup *> mixing_groups_;
|
std::list<MixingGroup *> mixing_groups_;
|
||||||
std::map<View::Mode, Group*> config_;
|
std::map<View::Mode, Group*> config_;
|
||||||
bool active_;
|
bool active_;
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ void SessionCreator::load(const std::string& filename)
|
|||||||
// create groups
|
// create groups
|
||||||
std::list< SourceList > groups = getMixingGroups();
|
std::list< SourceList > groups = getMixingGroups();
|
||||||
for (auto group_it = groups.begin(); group_it != groups.end(); group_it++)
|
for (auto group_it = groups.begin(); group_it != groups.end(); group_it++)
|
||||||
session_->updateMixingGroup( *group_it );
|
session_->link( *group_it );
|
||||||
|
|
||||||
// all good
|
// all good
|
||||||
session_->setFilename(filename);
|
session_->setFilename(filename);
|
||||||
|
|||||||
@@ -516,6 +516,13 @@ void Source::setAlpha(float a)
|
|||||||
touch();
|
touch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Source::touch ()
|
||||||
|
{
|
||||||
|
need_update_ = true;
|
||||||
|
if (mixinggroup_)
|
||||||
|
mixinggroup_->setAction(MixingGroup::ACTION_UPDATE);
|
||||||
|
}
|
||||||
|
|
||||||
void Source::update(float dt)
|
void Source::update(float dt)
|
||||||
{
|
{
|
||||||
// keep delta-t
|
// keep delta-t
|
||||||
|
|||||||
2
Source.h
2
Source.h
@@ -90,7 +90,7 @@ public:
|
|||||||
inline MaskShader *maskShader () const { return maskshader_; }
|
inline MaskShader *maskShader () const { return maskshader_; }
|
||||||
|
|
||||||
// touch to request update
|
// touch to request update
|
||||||
inline void touch () { need_update_ = true; }
|
void touch ();
|
||||||
|
|
||||||
// informs if its ready (i.e. initialized)
|
// informs if its ready (i.e. initialized)
|
||||||
inline bool ready () const { return initialized_; }
|
inline bool ready () const { return initialized_; }
|
||||||
|
|||||||
Reference in New Issue
Block a user