diff options
author | Chris Robinson <[email protected]> | 2022-11-03 02:17:54 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-11-03 02:17:54 -0700 |
commit | d8361bdd6fa807a4200e18e8ef7ffd13ab849b74 (patch) | |
tree | 1df40b4006ade3e715c84701916fab23af65d612 /core/voice.h | |
parent | b73e0ecbc55cb09788d056131aaec0ed27f6046a (diff) |
Add the ability to start a voice at a particular time
Diffstat (limited to 'core/voice.h')
-rw-r--r-- | core/voice.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/voice.h b/core/voice.h index cf558341..df0c8c9e 100644 --- a/core/voice.h +++ b/core/voice.h @@ -4,6 +4,7 @@ #include <array> #include <atomic> #include <bitset> +#include <chrono> #include <memory> #include <stddef.h> #include <string> @@ -209,6 +210,8 @@ struct Voice { */ std::atomic<VoiceBufferItem*> mLoopBuffer; + std::chrono::nanoseconds mStartTime{}; + /* Properties for the attached buffer(s). */ FmtChannels mFmtChannels; FmtType mFmtType; @@ -262,7 +265,8 @@ struct Voice { Voice(const Voice&) = delete; Voice& operator=(const Voice&) = delete; - void mix(const State vstate, ContextBase *Context, const uint SamplesToDo); + void mix(const State vstate, ContextBase *Context, const std::chrono::nanoseconds deviceTime, + const uint SamplesToDo); void prepare(DeviceBase *device); |