Reimplementation of SourceInputCallbacks into Session

Session should be the object holding the list of inputs parameters (e.g. synchrony) and the list of source callbacks. This also avoids mixing input when copying sources.  Code could be improved but is operational.
This commit is contained in:
Bruno Herbelin
2022-03-07 00:23:24 +01:00
parent 83e77681d9
commit 39b61fe331
18 changed files with 689 additions and 478 deletions

View File

@@ -148,14 +148,6 @@ public:
// add callback to each update
void call(SourceCallback *callback, bool override = false);
// callbacks associated to keys
void addInputCallback(uint input, SourceCallback *callback);
void removeInputCallback(SourceCallback *callback);
std::list<SourceCallback *> inputCallbacks(uint input);
std::list<uint> callbackInputs();
void swapInputCallback(uint from, uint to);
void clearInputCallbacks();
// update mode
inline bool active () const { return active_; }
virtual void setActive (bool on);
@@ -325,17 +317,6 @@ protected:
// callbacks
std::list<SourceCallback *> update_callbacks_;
std::mutex access_callbacks_;
struct InputCallback {
bool active_;
SourceCallback *model_;
SourceCallback *reverse_;
InputCallback() {
active_ = false;
model_ = nullptr;
reverse_ = nullptr;
}
};
std::multimap<uint, InputCallback> input_callbacks_;
void updateCallbacks(float dt);
// clones