Parcourir la source

BooBass is listed without FL (it plays LYNX's own multisample); tests and the selftest follow the own starts

- natives::available: BooBass was still offered only with FL's engine file although round 190rh made it play LYNX's own
  multisample without it (the selftest's nofl190rh check and natives142 caught the mismatch after the merge).
- q3190ry_availability_memo: no listed FL effect needs FL's Default preset any more; the memo is tested on an engine made
  for the test. factory_presets_resolve_every_value_round129: a preset may be the whole state (Maximus).
- --selftest nofl190rh: a folder that went away is checked after the finder's next look (on Windows without LYNX_FL_INSTALL
  it asked before it).
Ka1-S il y a 6 jours
Parent
commit
a99467c8f6
4 fichiers modifiés avec 13 ajouts et 15 suppressions
  1. 4 0
      src/NoFl190rhCheck.inc
  2. 4 7
      src/core/NativeEngines.cpp
  3. 1 1
      tests/ParityTests129.inc
  4. 4 7
      tests/Q3190ryTests.inc

+ 4 - 0
src/NoFl190rhCheck.inc

@@ -93,6 +93,10 @@
                  || flStudioAccess().roots.factoryData != install.getFullPathName().toStdString() || nativedata::factoryData() != flStudioAccess().roots.factoryData)
             return done ("ERROR the FL Studio folder was not used without a restart");
         install.deleteRecursively();
+        // (the finder answers from its last look and looks again after 5 s: a folder that went away is passed over then;
+        // round 190sn: on Windows, without LYNX_FL_INSTALL, the check asked before that look)
+        for (int i = 0; i < 120 && findFlStudio().installDir == install; ++i)
+            juce::Thread::sleep (100);
         if (findFlStudio().installDir == install || flFolderSetting() != install.getFullPathName())
             return done ("ERROR a folder that is gone was used, or forgotten");
         return done ("OK");

+ 4 - 7
src/core/NativeEngines.cpp

@@ -444,14 +444,11 @@ bool remembered (const FlAccess& access, int group, int kind, Look&& look)
 
 bool available (const InstrumentEngine& e, const FlAccess& access)
 {
-    // an engine with a LYNX preset bank starts from it without FL (round 168n)
-    if (e.kind != InstrumentKind::boobass && (e.needs == Needs::nothing || banks::hasBank (e.kind)))
+    // an engine with a LYNX preset bank starts from it without FL (round 168n); BooBass plays LYNX's own multisample without
+    // FL's engine file (round 190rh; it was still listed only with the file, round 190sn)
+    if (e.needs == Needs::nothing || banks::hasBank (e.kind))
         return true;
-    return remembered (access, 0, (int) e.kind, [&] {
-        if (e.kind == InstrumentKind::boobass)
-            return ! booBassDll (access).empty();
-        return hasPresetCandidate (e.presetFolder, true, access);
-    });
+    return remembered (access, 0, (int) e.kind, [&] { return hasPresetCandidate (e.presetFolder, true, access); });
 }
 
 bool available (const EffectEngine& e, const FlAccess& access)

+ 1 - 1
tests/ParityTests129.inc

@@ -14,7 +14,7 @@ TEST (factory_presets_resolve_every_value_round129)
             if (! unresolved.empty())
                 std::printf ("  %s / %s: unresolved %s\n", lynx::effectInfo (kind).name, preset.name.c_str(), unresolved.front().c_str());
             CHECK (unresolved.empty());
-            CHECK (! preset.name.empty() && ! preset.values.empty());
+            CHECK (! preset.name.empty() && (! preset.values.empty() || ! preset.state.empty())); // (round 190sn: Maximus' presets are its whole state)
         }
 }
 

+ 4 - 7
tests/Q3190ryTests.inc

@@ -132,13 +132,10 @@ TEST (q3190ry_availability_memo)
 {
     using namespace lynx;
     using q3190ry::FakeFl;
-    const natives::EffectEngine* engine = nullptr;
-    for (const auto& e : natives::effectEngines())
-        if (engine == nullptr && e.needs != natives::Needs::nothing && std::string (e.presetFolder).size() > 0)
-            engine = &e;
-    CHECK (engine != nullptr);
-    if (engine == nullptr)
-        return;
+    // (round 190sn: every listed FL effect now has a start of LYNX's own, so none looks for FL's presets; an engine that
+    // needs FL's Default preset, as the listed ones did before round 190rh, is made here)
+    const natives::EffectEngine needsFl { EffectKind::maximus, "Maximus", natives::Needs::flStudio, false };
+    const auto* engine = &needsFl;
     FakeFl f;
     f.files = { "/fl/Data/Patches/Plugin presets/Effects/" + std::string (engine->presetFolder) + "/Big hall.fst" };
     auto fl = f.access();