Added opposite action of 'Group all sources'

Mixer action ungroupAll expands all SessionGroupSources.
This commit is contained in:
Bruno Herbelin
2022-05-24 21:30:54 +02:00
parent ed7d42cf6d
commit 3c0b2c64e1
3 changed files with 19 additions and 4 deletions

View File

@@ -794,7 +794,19 @@ void Mixer::groupAll()
} }
} }
void Mixer::flattenSession() void Mixer::ungroupAll()
{
for (auto source_iter = session_->begin(); source_iter != session_->end(); source_iter++)
{
SessionGroupSource *ss = dynamic_cast< SessionGroupSource * >(*source_iter);
if ( ss != nullptr )
import(ss);
}
}
void Mixer::groupSession()
{ {
// new session group containing current session // new session group containing current session
SessionGroupSource *sessiongroup = new SessionGroupSource; SessionGroupSource *sessiongroup = new SessionGroupSource;

View File

@@ -68,8 +68,8 @@ public:
void deleteSelection (); void deleteSelection ();
void groupSelection (); void groupSelection ();
void groupAll (); void groupAll ();
void ungroupAll ();
void flattenSession(); void groupSession ();
// current source // current source
Source *currentSource (); Source *currentSource ();

View File

@@ -989,7 +989,10 @@ void UserInterface::showMenuFile()
// switch pannel to show first source (created) // switch pannel to show first source (created)
navigator.showPannelSource(0); navigator.showPannelSource(0);
} }
// TODO : FLATTEN (import all sources from all groups) if (ImGuiToolkit::MenuItemIcon(7, 2, "Expand all groups", false, Mixer::manager().numSource() > 0)) {
// create a new group session with all sources
Mixer::manager().ungroupAll();
}
// HELP AND QUIT // HELP AND QUIT
ImGui::Separator(); ImGui::Separator();