mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-14 11:49:59 +01:00
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:
32
Session.h
32
Session.h
@@ -5,6 +5,7 @@
|
||||
|
||||
#include "SourceList.h"
|
||||
#include "RenderView.h"
|
||||
#include "Metronome.h"
|
||||
|
||||
namespace tinyxml2 {
|
||||
class XMLDocument;
|
||||
@@ -151,6 +152,22 @@ public:
|
||||
void removeFromPlayGroup(size_t i, Source *s);
|
||||
std::vector<SourceIdList> getPlayGroups() { return play_groups_; }
|
||||
|
||||
// callbacks associated to inputs
|
||||
void assignSourceCallback(uint input, Source *source, SourceCallback *callback);
|
||||
std::list< std::pair<Source *, SourceCallback*> > getSourceCallbacks(uint input);
|
||||
void deleteSourceCallback (SourceCallback *callback);
|
||||
void deleteSourceCallbacks(Source *source);
|
||||
void deleteSourceCallbacks(uint input);
|
||||
void clearSourceCallbacks ();
|
||||
std::list<uint> assignedInputs();
|
||||
bool inputAssigned(uint input);
|
||||
void swapSourceCallback(uint from, uint to);
|
||||
void copySourceCallback(uint from, uint to);
|
||||
|
||||
void setInputSynchrony(uint input, Metronome::Synchronicity sync);
|
||||
std::vector<Metronome::Synchronicity> getInputSynchrony();
|
||||
Metronome::Synchronicity inputSynchrony(uint input);
|
||||
|
||||
protected:
|
||||
bool active_;
|
||||
float activation_threshold_;
|
||||
@@ -186,7 +203,20 @@ protected:
|
||||
};
|
||||
Fading fading_;
|
||||
|
||||
// std::map<uint64_t,
|
||||
struct InputSourceCallback {
|
||||
bool active_;
|
||||
SourceCallback *model_;
|
||||
SourceCallback *reverse_;
|
||||
Source *source_;
|
||||
InputSourceCallback() {
|
||||
active_ = false;
|
||||
model_ = nullptr;
|
||||
reverse_ = nullptr;
|
||||
source_ = nullptr;
|
||||
}
|
||||
};
|
||||
std::multimap<uint, InputSourceCallback> input_callbacks_;
|
||||
std::vector<Metronome::Synchronicity> input_sync_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user