Implemented TAB navigation to switch source.

This commit is contained in:
brunoherbelin
2020-06-03 21:36:12 +02:00
parent efeaf959b3
commit f57f3d4650
3 changed files with 17 additions and 0 deletions

View File

@@ -394,6 +394,19 @@ void Mixer::setCurrentSource(int index)
setCurrentSource( session_->find(index) );
}
void Mixer::setCurrentNext()
{
SourceList::iterator it = current_source_;
it++;
if (it == session_->end()) {
it = session_->begin();
}
setCurrentSource( it );
}
void Mixer::unsetCurrentSource()
{
// discard overlay for previously current source

View File

@@ -48,6 +48,7 @@ public:
void setCurrentSource(Node *node);
void setCurrentSource(int index);
void setCurrentSource(Source *s);
void setCurrentNext();
void unsetCurrentSource();
void cloneCurrentSource();
void deleteCurrentSource();

View File

@@ -279,6 +279,9 @@ void UserInterface::handleKeyboard()
// button home to toggle menu
else if (ImGui::IsKeyPressed( GLFW_KEY_INSERT ))
navigator.togglePannelNew();
// button tab to select next
else if (ImGui::IsKeyPressed( GLFW_KEY_TAB ))
Mixer::manager().setCurrentNext();
}
}