mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
Revert "Remove cache_time_info and always cache time info"
This reverts commit cfb171c991.
No idea why, but this cache breaks SPL Transient Designer Plus. Perhaps
it overwrites the time info?
This commit is contained in:
@@ -99,13 +99,6 @@ TODO: Add an updated screenshot with some fancy VST3-only plugins to the readme
|
|||||||
with, and it then applies the change conditionally to be able to support
|
with, and it then applies the change conditionally to be able to support
|
||||||
building with both older and newer versions of Wine.
|
building with both older and newer versions of Wine.
|
||||||
|
|
||||||
### Removed
|
|
||||||
|
|
||||||
- The `cache_time_info` option for VST2 plugins has been removed and this
|
|
||||||
behaviour is now always enabled. This option would cache VST2 time information
|
|
||||||
during a single processing cycle in case the plugin asks for this information
|
|
||||||
more than once.
|
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- VST2 plugin editor resizing in **REAPER** would not cause the FX window to be
|
- VST2 plugin editor resizing in **REAPER** would not cause the FX window to be
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ plugin._
|
|||||||
|
|
||||||
| Option | Values | Description |
|
| Option | Values | Description |
|
||||||
| --------------------- | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| --------------------- | -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `cache_time_info` | `{true,false}` | Compatibility option for plugins that call `audioMasterGetTime()` multiple times during a single processing cycle. With this option subsequent calls during a single audio processing cycle will reuse the value returned by the first call to this function. This is a bug in the plugin, and this option serves as a temporary workaround until the plugin fixes the issue. _This is enabled by default on the master branch._ |
|
| `cache_time_info` | `{true,false}` | Compatibility option for plugins that call `audioMasterGetTime()` multiple times during a single processing cycle. With this option subsequent calls during a single audio processing cycle will reuse the value returned by the first call to this function. This is a bug in the plugin, and this option serves as a temporary workaround until the plugin fixes the issue. |
|
||||||
| `editor_double_embed` | `{true,false}` | Compatibility option for plugins that rely on the absolute screen coordinates of the window they're embedded in. Since the Wine window gets embedded inside of a window provided by your DAW, these coordinates won't match up and the plugin would end up drawing in the wrong location without this option. Currently the only known plugins that require this option are _PSPaudioware_ plugins with expandable GUIs, such as E27. Defaults to `false`. |
|
| `editor_double_embed` | `{true,false}` | Compatibility option for plugins that rely on the absolute screen coordinates of the window they're embedded in. Since the Wine window gets embedded inside of a window provided by your DAW, these coordinates won't match up and the plugin would end up drawing in the wrong location without this option. Currently the only known plugins that require this option are _PSPaudioware_ plugins with expandable GUIs, such as E27. Defaults to `false`. |
|
||||||
| `editor_force_dnd` | `{true,false}` | This option forcefully enables drag-and-drop support in _REAPER_. Because REAPER's FX window supports drag-and-drop itself, dragging a file onto a plugin editor will cause the drop to be intercepted by the FX window. This makes it impossible to drag files onto plugins in REAPER under normal circumstances. Setting this option to `true` will strip drag-and-drop support from the FX window, thus allowing files to be dragged onto the plugin again. Defaults to `false`. _This option is only availble on the master branch._ |
|
| `editor_force_dnd` | `{true,false}` | This option forcefully enables drag-and-drop support in _REAPER_. Because REAPER's FX window supports drag-and-drop itself, dragging a file onto a plugin editor will cause the drop to be intercepted by the FX window. This makes it impossible to drag files onto plugins in REAPER under normal circumstances. Setting this option to `true` will strip drag-and-drop support from the FX window, thus allowing files to be dragged onto the plugin again. Defaults to `false`. _This option is only availble on the master branch._ |
|
||||||
| `editor_xembed` | `{true,false}` | Use Wine's XEmbed implementation instead of yabridge's normal window embedding method. Some plugins will have redrawing issues when using XEmbed and editor resizing won't always work properly with it, but it could be useful in certain setups. You may need to use [this Wine patch](https://github.com/psycha0s/airwave/blob/master/fix-xembed-wine-windows.patch) if you're getting blank editor windows. Defaults to `false`. _This option is only availble on the master branch._ |
|
| `editor_xembed` | `{true,false}` | Use Wine's XEmbed implementation instead of yabridge's normal window embedding method. Some plugins will have redrawing issues when using XEmbed and editor resizing won't always work properly with it, but it could be useful in certain setups. You may need to use [this Wine patch](https://github.com/psycha0s/airwave/blob/master/fix-xembed-wine-windows.patch) if you're getting blank editor windows. Defaults to `false`. _This option is only availble on the master branch._ |
|
||||||
@@ -324,6 +324,9 @@ editor_double_embed = true
|
|||||||
["Analog Lab 3.so"]
|
["Analog Lab 3.so"]
|
||||||
editor_xembed = true
|
editor_xembed = true
|
||||||
|
|
||||||
|
["SWAM Cello 64bit.so"]
|
||||||
|
cache_time_info = true
|
||||||
|
|
||||||
["sforzando VST_x64.so"]
|
["sforzando VST_x64.so"]
|
||||||
editor_force_dnd = true
|
editor_force_dnd = true
|
||||||
frame_rate = 24
|
frame_rate = 24
|
||||||
|
|||||||
@@ -78,7 +78,13 @@ Configuration::Configuration(const fs::path& config_path,
|
|||||||
// their defaults. At this point I'd really wish C++ could do pattern
|
// their defaults. At this point I'd really wish C++ could do pattern
|
||||||
// matching.
|
// matching.
|
||||||
for (const auto& [key, value] : table) {
|
for (const auto& [key, value] : table) {
|
||||||
if (key == "editor_double_embed") {
|
if (key == "cache_time_info") {
|
||||||
|
if (const auto parsed_value = value.as_boolean()) {
|
||||||
|
cache_time_info = parsed_value->get();
|
||||||
|
} else {
|
||||||
|
invalid_options.push_back(key);
|
||||||
|
}
|
||||||
|
} else if (key == "editor_double_embed") {
|
||||||
if (const auto parsed_value = value.as_boolean()) {
|
if (const auto parsed_value = value.as_boolean()) {
|
||||||
editor_double_embed = parsed_value->get();
|
editor_double_embed = parsed_value->get();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -74,6 +74,20 @@ class Configuration {
|
|||||||
Configuration(const boost::filesystem::path& config_path,
|
Configuration(const boost::filesystem::path& config_path,
|
||||||
const boost::filesystem::path& yabridge_path);
|
const boost::filesystem::path& yabridge_path);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If set to `true`, then after an `audioMasterGetTime()` call all
|
||||||
|
* subsequent calls to that function during a single processing cycle will
|
||||||
|
* reuse the results from the first call. In theory it would be a bug on the
|
||||||
|
* host's side if this did _not_ return the same value every time, but since
|
||||||
|
* yabridge tries to not have any behaviour of its own and since this
|
||||||
|
* function should only be called at most once every processing cycle this
|
||||||
|
* option is not enabled by default. An example of a situation where this
|
||||||
|
* does become necessary is the SWAM Cello plugin, which calls
|
||||||
|
* `audioMasterGetTime()` for every sample instead of only once. This would
|
||||||
|
* tank performance without this caching behaviour.
|
||||||
|
*/
|
||||||
|
bool cache_time_info = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If this is set to `true`, then the plugin editor should be embedded in
|
* If this is set to `true`, then the plugin editor should be embedded in
|
||||||
* yet another window. This would result in an embedding sequence of
|
* yet another window. This would result in an embedding sequence of
|
||||||
@@ -166,6 +180,7 @@ class Configuration {
|
|||||||
|
|
||||||
template <typename S>
|
template <typename S>
|
||||||
void serialize(S& s) {
|
void serialize(S& s) {
|
||||||
|
s.value1b(cache_time_info);
|
||||||
s.value1b(editor_double_embed);
|
s.value1b(editor_double_embed);
|
||||||
s.value1b(editor_force_dnd);
|
s.value1b(editor_force_dnd);
|
||||||
s.value1b(editor_xembed);
|
s.value1b(editor_xembed);
|
||||||
|
|||||||
@@ -168,6 +168,9 @@ class PluginBridge {
|
|||||||
|
|
||||||
init_msg << "other options: ";
|
init_msg << "other options: ";
|
||||||
std::vector<std::string> other_options;
|
std::vector<std::string> other_options;
|
||||||
|
if (config.cache_time_info) {
|
||||||
|
other_options.push_back("hack: time info cache");
|
||||||
|
}
|
||||||
if (config.editor_double_embed) {
|
if (config.editor_double_embed) {
|
||||||
other_options.push_back("editor: double embed");
|
other_options.push_back("editor: double embed");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,7 +178,9 @@ Vst2Bridge::Vst2Bridge(MainContext& main_context,
|
|||||||
// value returned by this function during an audio
|
// value returned by this function during an audio
|
||||||
// processing cycle will be reused for the rest of the
|
// processing cycle will be reused for the rest of the
|
||||||
// cycle.
|
// cycle.
|
||||||
cached_time_info.reset();
|
if (config.cache_time_info) {
|
||||||
|
time_info.reset();
|
||||||
|
}
|
||||||
|
|
||||||
// Since the host should only be calling one of `process()`,
|
// Since the host should only be calling one of `process()`,
|
||||||
// processReplacing()` or `processDoubleReplacing()`, we can all
|
// processReplacing()` or `processDoubleReplacing()`, we can all
|
||||||
@@ -546,14 +548,15 @@ intptr_t Vst2Bridge::host_callback(AEffect* effect,
|
|||||||
void* data,
|
void* data,
|
||||||
float option) {
|
float option) {
|
||||||
// HACK: Workaround for a bug in SWAM Cello where it would call
|
// HACK: Workaround for a bug in SWAM Cello where it would call
|
||||||
// `audioMasterGetTime()` once for every sample. The `time_info` value
|
// `audioMasterGetTime()` once for every sample. When this option is
|
||||||
// is assigned inside of `HostCallbackDataConverter::write()`. At the
|
// enabled `time_info` should be reset in the process function. The
|
||||||
// beginning of the processing cycle this value will be reset.
|
// `time_info` value is assigned inside of
|
||||||
if (cached_time_info) {
|
// `HostCallbackDataConverter::write()`.
|
||||||
return reinterpret_cast<intptr_t>(&*cached_time_info);
|
if (config.cache_time_info && time_info) {
|
||||||
|
return reinterpret_cast<intptr_t>(&*time_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
HostCallbackDataConverter converter(effect, cached_time_info);
|
HostCallbackDataConverter converter(effect, time_info);
|
||||||
return sockets.vst_host_callback.send_event(converter, std::nullopt, opcode,
|
return sockets.vst_host_callback.send_event(converter, std::nullopt, opcode,
|
||||||
index, value, data, option);
|
index, value, data, option);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,20 +77,12 @@ class Vst2Bridge : public HostBridge {
|
|||||||
intptr_t host_callback(AEffect*, int, int, intptr_t, void*, float);
|
intptr_t host_callback(AEffect*, int, int, intptr_t, void*, float);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The time information returned by the host after the plugin calls
|
* With the `audioMasterGetTime` host callback the plugin expects the return
|
||||||
* `audioMasterGetTime()`. We'll have to return a pointer to this, so we'll
|
* value from the calblack to be a pointer to a VstTimeInfo struct. If the
|
||||||
* store it here. If the host returned a null pointer, then we'll just store
|
* host did not support a certain time info query, than we'll store the
|
||||||
* a nullopt.
|
* returned null pointer as 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> cached_time_info;
|
std::optional<VstTimeInfo> time_info;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user