From 3c0b2c64e1a48a03070fe0e52304344115804777 Mon Sep 17 00:00:00 2001 From: Bruno Herbelin Date: Tue, 24 May 2022 21:30:54 +0200 Subject: [PATCH] Added opposite action of 'Group all sources' Mixer action ungroupAll expands all SessionGroupSources. --- Mixer.cpp | 14 +++++++++++++- Mixer.h | 4 ++-- UserInterfaceManager.cpp | 5 ++++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Mixer.cpp b/Mixer.cpp index d34c036..78e39e1 100644 --- a/Mixer.cpp +++ b/Mixer.cpp @@ -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 SessionGroupSource *sessiongroup = new SessionGroupSource; diff --git a/Mixer.h b/Mixer.h index f8e31b3..2388d4a 100644 --- a/Mixer.h +++ b/Mixer.h @@ -68,8 +68,8 @@ public: void deleteSelection (); void groupSelection (); void groupAll (); - - void flattenSession(); + void ungroupAll (); + void groupSession (); // current source Source *currentSource (); diff --git a/UserInterfaceManager.cpp b/UserInterfaceManager.cpp index fcba39b..767f477 100644 --- a/UserInterfaceManager.cpp +++ b/UserInterfaceManager.cpp @@ -989,7 +989,10 @@ void UserInterface::showMenuFile() // switch pannel to show first source (created) 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 ImGui::Separator();