Also cache audioMasterGetCurrentProcessLevel()

Melda plugins seem to call this during every processing cycle.
This commit is contained in:
Robbert van der Helm
2021-04-29 01:02:10 +02:00
parent 383b0c3f10
commit c82eb35243
5 changed files with 52 additions and 8 deletions
+9 -2
View File
@@ -559,11 +559,16 @@ struct AudioBuffers {
* We'll send the current transport information as part of an audio
* processing call. This lets us a void an unnecessary callback (or in some
* cases, more than one) during every processing cycle.
*
* TODO: Do the same thing for the current process level
*/
std::optional<VstTimeInfo> current_time_info;
/**
* Some plugins will also ask for the current process level during audio
* processing. To prevent unnecessary expensive callbacks, we'll send this
* information along with the processing call.
*/
int current_process_level;
/**
* We'll periodically synchronize the realtime priority setting of the
* host's audio thread with the Wine plugin host. We'll do this
@@ -592,6 +597,8 @@ struct AudioBuffers {
s.value4b(sample_frames);
s.ext(current_time_info, bitsery::ext::StdOptional{});
s.value4b(current_process_level);
s.ext(new_realtime_priority, bitsery::ext::StdOptional{},
[](S& s, int& priority) { s.value4b(priority); });
}