mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
Support for Shift-Tab to loop backward in list of sources.
This commit is contained in:
15
Mixer.cpp
15
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
|
||||
|
||||
1
Mixer.h
1
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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user