Change the midiState observer to a resource observer for tests
This commit is contained in:
parent
4ea11a31bf
commit
13edb6dfba
3 changed files with 7 additions and 5 deletions
|
|
@ -339,7 +339,7 @@ public:
|
|||
*/
|
||||
void disableFreeWheeling() noexcept;
|
||||
|
||||
const MidiState& getMidiState() const noexcept { return resources.midiState; }
|
||||
const Resources& getResources() const noexcept { return resources; }
|
||||
|
||||
/**
|
||||
* @brief Check if the SFZ should be reloaded.
|
||||
|
|
|
|||
|
|
@ -394,9 +394,10 @@ TEST_CASE("[Files] Default path is ignored for generators")
|
|||
TEST_CASE("[Files] Set CC applies properly")
|
||||
{
|
||||
sfz::Synth synth;
|
||||
const auto& midiState = synth.getResources().midiState;
|
||||
synth.loadSfzFile(fs::current_path() / "tests/TestFiles/set_cc.sfz");
|
||||
REQUIRE(synth.getMidiState().getCCValue(142) == 63_norm);
|
||||
REQUIRE(synth.getMidiState().getCCValue(61) == 122_norm);
|
||||
REQUIRE(midiState.getCCValue(142) == 63_norm);
|
||||
REQUIRE(midiState.getCCValue(61) == 122_norm);
|
||||
}
|
||||
|
||||
TEST_CASE("[Files] Note and octave offsets")
|
||||
|
|
|
|||
|
|
@ -140,10 +140,11 @@ TEST_CASE("[Synth] All notes offs/all sounds off")
|
|||
TEST_CASE("[Synth] Reset all controllers")
|
||||
{
|
||||
sfz::Synth synth;
|
||||
const auto& midiState = synth.getResources().midiState;
|
||||
synth.cc(0, 12, 64);
|
||||
REQUIRE(synth.getMidiState().getCCValue(12) == 64_norm);
|
||||
REQUIRE(midiState.getCCValue(12) == 64_norm);
|
||||
synth.cc(0, 121, 64);
|
||||
REQUIRE(synth.getMidiState().getCCValue(12) == 0_norm);
|
||||
REQUIRE(midiState.getCCValue(12) == 0_norm);
|
||||
}
|
||||
|
||||
TEST_CASE("[Synth] Releasing before the EG started smoothing (initial delay) kills the voice")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue