Changed mechanism of Source Callback and Input Mapping

Session stores list of all callback instances and reacts on input release by calling the reverse callback if it exists, or by finishing the ongoing callback. This means the behavior of Callbacks is different for those who are reversible (i.e. returns a non-null reverse) from those which do not have reverse. The reversible callbacks enforce to be exclusive while active (key pressed), others can be repeated and complementary (run in parallel).
This commit is contained in:
Bruno Herbelin
2023-02-09 23:18:24 +01:00
parent 7433772606
commit 128e8834e8
8 changed files with 103 additions and 165 deletions

View File

@@ -217,14 +217,14 @@ protected:
struct InputSourceCallback {
bool active_;
SourceCallback *model_;
std::map<uint64_t, SourceCallback *> reverse_;
std::map<uint64_t, std::pair< SourceCallback *, SourceCallback *> > instances_;
Target target_;
InputSourceCallback() {
active_ = false;
model_ = nullptr;
target_ = nullptr;
}
void clearReverse();
void clear();
};
std::multimap<uint, InputSourceCallback> input_callbacks_;
std::vector<Metronome::Synchronicity> input_sync_;