mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +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:
@@ -247,6 +247,23 @@ void Metronome::executeAtPhase( std::function<void()> f )
|
||||
std::thread( delay, f, timeToPhase() ).detach();
|
||||
}
|
||||
|
||||
float Metronome::timeToSync(Synchronicity sync)
|
||||
{
|
||||
float ret = 0.f;
|
||||
if ( sync > Metronome::SYNC_BEAT ) {
|
||||
// SYNC TO PHASE
|
||||
std::chrono::duration<float, std::milli> fp_ms = Metronome::manager().timeToPhase();
|
||||
ret = fp_ms.count();
|
||||
}
|
||||
else if ( sync > Metronome::SYNC_NONE ) {
|
||||
// SYNC TO BEAT
|
||||
std::chrono::duration<float, std::milli> fp_ms = Metronome::manager().timeToBeat();
|
||||
ret = fp_ms.count();
|
||||
}
|
||||
// SYNC NONE
|
||||
return ret;
|
||||
}
|
||||
|
||||
size_t Metronome::peers() const
|
||||
{
|
||||
return link_.numPeers();
|
||||
|
||||
Reference in New Issue
Block a user