DSPark 1.8.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
dspark::plugin::vst3::UiTicker Class Reference

A ~30 Hz tick on the host's UI thread. More...

#include <DSParkVst3.h>

Public Types

using Callback = void(*)(void *context) noexcept
 

Public Member Functions

 UiTicker () noexcept=default
 
 UiTicker (const UiTicker &)=delete
 
UiTicker & operator= (const UiTicker &)=delete
 
 ~UiTicker ()
 
bool start (Steinberg_FUnknown *hostContext, Callback callback, void *context) noexcept
 
void stop () noexcept
 
bool running () const noexcept
 

Detailed Description

A ~30 Hz tick on the host's UI thread.

VST3 allows IComponentHandler::restartComponent() from the UI thread only, but a latency change is usually detected on the audio thread (automation moved a lookahead parameter). The audio thread therefore only raises a flag - no host call, no allocation - and this tick hands the request to the host. Windows: a thread timer (SetTimer) on the UI thread that started it; macOS: a libdispatch timer on the main queue; Linux: the host's IRunLoop, when the initialize() context offers one. start() and stop() run on the UI thread; running() may be read from any thread.

Definition at line 109 of file DSParkVst3.h.

Member Typedef Documentation

◆ Callback

using dspark::plugin::vst3::UiTicker::Callback = void (*)(void* context) noexcept

Definition at line 112 of file DSParkVst3.h.

Constructor & Destructor Documentation

◆ UiTicker() [1/2]

dspark::plugin::vst3::UiTicker::UiTicker ( )
defaultnoexcept

◆ UiTicker() [2/2]

dspark::plugin::vst3::UiTicker::UiTicker ( const UiTicker &  )
delete

◆ ~UiTicker()

dspark::plugin::vst3::UiTicker::~UiTicker ( )
inline

Definition at line 117 of file DSParkVst3.h.

Member Function Documentation

◆ operator=()

UiTicker & dspark::plugin::vst3::UiTicker::operator= ( const UiTicker &  )
delete

◆ running()

bool dspark::plugin::vst3::UiTicker::running ( ) const
inlinenoexcept

Definition at line 197 of file DSParkVst3.h.

◆ start()

bool dspark::plugin::vst3::UiTicker::start ( Steinberg_FUnknown *  hostContext,
Callback  callback,
void *  context 
)
inlinenoexcept

Starts ticking callback(context); false when this platform or host offers no UI-thread tick (callers then fall back).

Definition at line 121 of file DSParkVst3.h.

◆ stop()

void dspark::plugin::vst3::UiTicker::stop ( )
inlinenoexcept

Stops the tick; no callback runs after it returns (UI thread).

Definition at line 169 of file DSParkVst3.h.


The documentation for this class was generated from the following file: