mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-20 02:13:56 +02:00
Remove cache_time_info and always cache time info
It sort of goes against yabridge's principles to not do these unnecessary `audioMasterGetTime()` calls if the plugin does that, but it also hurts the user experience to not have this as a default.
This commit is contained in:
@@ -77,12 +77,20 @@ class Vst2Bridge : public HostBridge {
|
||||
intptr_t host_callback(AEffect*, int, int, intptr_t, void*, float);
|
||||
|
||||
/**
|
||||
* With the `audioMasterGetTime` host callback the plugin expects the return
|
||||
* value from the calblack to be a pointer to a VstTimeInfo struct. If the
|
||||
* host did not support a certain time info query, than we'll store the
|
||||
* returned null pointer as a nullopt.
|
||||
* The time information returned by the host after the plugin calls
|
||||
* `audioMasterGetTime()`. We'll have to return a pointer to this, so we'll
|
||||
* store it here. If the host returned a null pointer, then we'll just store
|
||||
* a nullopt.
|
||||
*
|
||||
* We'll keep this information around for the entire processing cycle, in
|
||||
* case a plugin somehow calls this function more than once, like the SWAM
|
||||
* Cello plugin does.
|
||||
*
|
||||
* XXX: We don't have any logging for when the plugin calls
|
||||
* `audioMasterGetTime()` more than once, but printing some message
|
||||
* 44100 times per second also doesn't sound great
|
||||
*/
|
||||
std::optional<VstTimeInfo> time_info;
|
||||
std::optional<VstTimeInfo> cached_time_info;
|
||||
|
||||
private:
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user