From 0bfcf22b50ed8e6978a78e305a3bf5faf82e6955 Mon Sep 17 00:00:00 2001 From: Benjamin Klum Date: Tue, 3 Sep 2024 18:00:53 +0200 Subject: [PATCH] #1152 Fix sporadic "FX not loadable" errors --- Cargo.lock | 16 ++++++++-------- main/src/domain/main_processor.rs | 1 - main/src/domain/targets/browse_fxs_target.rs | 4 ++-- main/src/domain/targets/fx_open_target.rs | 4 ++-- main/src/infrastructure/plugin/backbone_shell.rs | 2 +- pot-browser/src/pot_browser_panel.rs | 2 +- pot/src/lib.rs | 8 ++++---- 7 files changed, 18 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0b25cb6ad..beab1bb08 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5064,7 +5064,7 @@ dependencies = [ [[package]] name = "reaper-common-types" version = "0.1.0" -source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#f86bc31b59943a943b9d048022fabfaccbc74a4a" +source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#7db51ac6c6c4d29dc08827d02c4726ba8e800d2d" dependencies = [ "hex-literal", "nutype", @@ -5075,7 +5075,7 @@ dependencies = [ [[package]] name = "reaper-fluent" version = "0.1.0" -source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#f86bc31b59943a943b9d048022fabfaccbc74a4a" +source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#7db51ac6c6c4d29dc08827d02c4726ba8e800d2d" dependencies = [ "fragile", "reaper-low", @@ -5086,7 +5086,7 @@ dependencies = [ [[package]] name = "reaper-high" version = "0.1.0" -source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#f86bc31b59943a943b9d048022fabfaccbc74a4a" +source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#7db51ac6c6c4d29dc08827d02c4726ba8e800d2d" dependencies = [ "backtrace", "base64 0.13.0", @@ -5115,7 +5115,7 @@ dependencies = [ [[package]] name = "reaper-low" version = "0.1.0" -source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#f86bc31b59943a943b9d048022fabfaccbc74a4a" +source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#7db51ac6c6c4d29dc08827d02c4726ba8e800d2d" dependencies = [ "c_str_macro", "cc 1.0.83", @@ -5129,7 +5129,7 @@ dependencies = [ [[package]] name = "reaper-macros" version = "0.1.0" -source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#f86bc31b59943a943b9d048022fabfaccbc74a4a" +source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#7db51ac6c6c4d29dc08827d02c4726ba8e800d2d" dependencies = [ "darling 0.10.2", "quote", @@ -5139,7 +5139,7 @@ dependencies = [ [[package]] name = "reaper-medium" version = "0.1.0" -source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#f86bc31b59943a943b9d048022fabfaccbc74a4a" +source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#7db51ac6c6c4d29dc08827d02c4726ba8e800d2d" dependencies = [ "c_str_macro", "camino", @@ -5160,7 +5160,7 @@ dependencies = [ [[package]] name = "reaper-rx" version = "0.1.0" -source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#f86bc31b59943a943b9d048022fabfaccbc74a4a" +source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#7db51ac6c6c4d29dc08827d02c4726ba8e800d2d" dependencies = [ "crossbeam-channel", "helgoboss-midi", @@ -5414,7 +5414,7 @@ checksum = "3cd14fd5e3b777a7422cca79358c57a8f6e3a703d9ac187448d0daf220c2407f" [[package]] name = "rppxml-parser" version = "0.1.0" -source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#f86bc31b59943a943b9d048022fabfaccbc74a4a" +source = "git+https://github.com/helgoboss/reaper-rs.git?branch=master#7db51ac6c6c4d29dc08827d02c4726ba8e800d2d" dependencies = [ "splitty", ] diff --git a/main/src/domain/main_processor.rs b/main/src/domain/main_processor.rs index 0ee1ca966..4b3f8c5fa 100644 --- a/main/src/domain/main_processor.rs +++ b/main/src/domain/main_processor.rs @@ -1919,7 +1919,6 @@ impl MainProcessor { // This only filters out "matched" outcomes, not "consumed" ones. This is important because it lets // combination shortcuts through that are not matched. E.g. Cmd+B is let through if there is an active // mapping listening to a "Cmd" (a modifier!) but there is no active mapping with source 'B'. - // TODO-high CONTINUE Check If this works on Windows as well. let filter_out_event = match_outcome.matched(); KeyProcessingResult { match_outcome, diff --git a/main/src/domain/targets/browse_fxs_target.rs b/main/src/domain/targets/browse_fxs_target.rs index 0927312c1..c0d2212a8 100644 --- a/main/src/domain/targets/browse_fxs_target.rs +++ b/main/src/domain/targets/browse_fxs_target.rs @@ -131,7 +131,7 @@ impl RealearnTarget for BrowseFxsTarget { if i == fx_index as usize { fx.show_in_floating_window(); } else { - fx.hide_floating_window(); + fx.hide_floating_window()?; } } } @@ -140,7 +140,7 @@ impl RealearnTarget for BrowseFxsTarget { .fx_chain .index_based_fx_by_index(fx_index) .ok_or("FX not available")?; - fx.show_in_chain(); + fx.show_in_chain()?; } }, } diff --git a/main/src/domain/targets/fx_open_target.rs b/main/src/domain/targets/fx_open_target.rs index c58f46490..1fc9a6777 100644 --- a/main/src/domain/targets/fx_open_target.rs +++ b/main/src/domain/targets/fx_open_target.rs @@ -64,7 +64,7 @@ impl RealearnTarget for FxOpenTarget { if value.to_unit_value()?.is_zero() { match self.display_type { FloatingWindow => { - self.fx.hide_floating_window(); + self.fx.hide_floating_window()?; } Chain => { self.fx.chain().hide(); @@ -76,7 +76,7 @@ impl RealearnTarget for FxOpenTarget { self.fx.show_in_floating_window(); } Chain => { - self.fx.show_in_chain(); + self.fx.show_in_chain()?; } } } diff --git a/main/src/infrastructure/plugin/backbone_shell.rs b/main/src/infrastructure/plugin/backbone_shell.rs index 2fcc23e0f..76729e25c 100644 --- a/main/src/infrastructure/plugin/backbone_shell.rs +++ b/main/src/infrastructure/plugin/backbone_shell.rs @@ -2906,7 +2906,7 @@ mod playtime_impl { "It was not possible to add Helgobox VST plug-in, probably because you have VST scanning disabled in the REAPER preferences!\n\nPlease open REAPER's FX browser and press F5 to rescan. After that, try again!\n\nAs an alternative, re-enable VST scanning in Preferences/Plug-ins/VST and restart REAPER." } })?; - fx.hide_floating_window(); + fx.hide_floating_window()?; // The rest needs to be done async because the instance initializes itself async // (because FX not yet available when plug-in instantiated). Global::task_support() diff --git a/pot-browser/src/pot_browser_panel.rs b/pot-browser/src/pot_browser_panel.rs index 62fbee232..5cedbcaf9 100644 --- a/pot-browser/src/pot_browser_panel.rs +++ b/pot-browser/src/pot_browser_panel.rs @@ -753,7 +753,7 @@ fn run_main_ui( .on_hover_text("Shows the FX chain") .clicked() { - fx.show_in_chain(); + fx.show_in_chain().unwrap(); } if ui .small_button("FX") diff --git a/pot/src/lib.rs b/pot/src/lib.rs index 62f91c8ac..05e513bd5 100644 --- a/pot/src/lib.rs +++ b/pot/src/lib.rs @@ -1624,7 +1624,7 @@ fn load_audio_preset( let window_is_open_now = fx.window_is_open(); if window_is_open_now { if !fx.window_has_focus() { - fx.hide_floating_window(); + fx.hide_floating_window()?; fx.show_in_floating_window(); } } else { @@ -1860,12 +1860,12 @@ impl LoadPresetWindowBehavior { match self { LoadPresetWindowBehavior::NeverShow => { if now_is_open { - fx.hide_floating_window(); + fx.hide_floating_window().unwrap(); } } LoadPresetWindowBehavior::ShowOnlyIfPreviouslyShown => { if !was_open_before && now_is_open { - fx.hide_floating_window(); + fx.hide_floating_window().unwrap(); } else if was_open_before && !now_is_open { fx.show_in_floating_window(); } @@ -1881,7 +1881,7 @@ impl LoadPresetWindowBehavior { fx.show_in_floating_window() } } else if !was_open_before && now_is_open { - fx.hide_floating_window(); + fx.hide_floating_window().unwrap(); } else if was_open_before && !now_is_open { fx.show_in_floating_window(); }