mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
AudioPlayHead: Move HostTimeNs out of AudioProcessor, to consolidate timing information
This commit is contained in:
parent
8fbd99c424
commit
752c913cd2
13 changed files with 107 additions and 122 deletions
|
|
@ -2907,6 +2907,10 @@ public:
|
|||
? makeOptional ((double) processContext.smpteOffsetSubframes / (80.0 * info.getFrameRate()->getEffectiveRate()))
|
||||
: nullopt);
|
||||
|
||||
info.setHostTimeNs ((processContext.state & Vst::ProcessContext::kSystemTimeValid) != 0
|
||||
? makeOptional ((uint64_t) processContext.systemTime)
|
||||
: nullopt);
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
|
|
@ -3346,9 +3350,6 @@ public:
|
|||
{
|
||||
processContext = *data.processContext;
|
||||
|
||||
if ((processContext.state & Vst::ProcessContext::kSystemTimeValid) != 0)
|
||||
getPluginInstance().setHostTimeNanos ((uint64_t) processContext.systemTime);
|
||||
|
||||
if (juceVST3EditController != nullptr)
|
||||
juceVST3EditController->vst3IsPlaying = (processContext.state & Vst::ProcessContext::kPlaying) != 0;
|
||||
}
|
||||
|
|
@ -3360,14 +3361,6 @@ public:
|
|||
juceVST3EditController->vst3IsPlaying = false;
|
||||
}
|
||||
|
||||
struct AtEndOfScope
|
||||
{
|
||||
~AtEndOfScope() { proc.setHostTimeNanos (nullopt); }
|
||||
AudioProcessor& proc;
|
||||
};
|
||||
|
||||
const AtEndOfScope scope { getPluginInstance() };
|
||||
|
||||
midiBuffer.clear();
|
||||
|
||||
if (data.inputParameterChanges != nullptr)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue