diff --git a/Mixer.cpp b/Mixer.cpp index e3bf0f9..b95a529 100644 --- a/Mixer.cpp +++ b/Mixer.cpp @@ -642,6 +642,21 @@ void Mixer::setCurrentNext() } } +void Mixer::setCurrentPrevious() +{ + if (session_->numSource() > 0) { + + SourceList::iterator it = current_source_; + + if (it == session_->begin()) { + it = session_->end(); + } + + it--; + setCurrentSource( it ); + } +} + void Mixer::unsetCurrentSource() { // discard overlay for previously current source diff --git a/Mixer.h b/Mixer.h index 1739e79..c256d2f 100644 --- a/Mixer.h +++ b/Mixer.h @@ -59,6 +59,7 @@ public: void setCurrentSource (Node *node); void setCurrentSource (uint64_t id); void setCurrentNext (); + void setCurrentPrevious (); void unsetCurrentSource (); void setCurrentIndex (int index); diff --git a/UserInterfaceManager.cpp b/UserInterfaceManager.cpp index c691a99..526e398 100644 --- a/UserInterfaceManager.cpp +++ b/UserInterfaceManager.cpp @@ -382,8 +382,12 @@ void UserInterface::handleKeyboard() else if (ImGui::IsKeyPressed( GLFW_KEY_INSERT )) navigator.togglePannelNew(); // button tab to select next - else if (ImGui::IsKeyPressed( GLFW_KEY_TAB )) - Mixer::manager().setCurrentNext(); + else if (ImGui::IsKeyPressed( GLFW_KEY_TAB )) { + if (shift_modifier_active) + Mixer::manager().setCurrentPrevious(); + else + Mixer::manager().setCurrentNext(); + } } }