Added tests for looped regions in files
This commit is contained in:
parent
2cc2d54685
commit
3608b3145a
3 changed files with 19 additions and 0 deletions
|
|
@ -429,3 +429,19 @@ TEST_CASE("[Files] Off modes")
|
||||||
REQUIRE( !normalVoice->isFree() );
|
REQUIRE( !normalVoice->isFree() );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_CASE("[Files] Looped regions taken from files and possibly overriden")
|
||||||
|
{
|
||||||
|
sfz::Synth synth;
|
||||||
|
synth.setSamplesPerBlock(256);
|
||||||
|
synth.setSampleRate(44100);
|
||||||
|
synth.loadSfzFile(fs::current_path() / "tests/TestFiles/looped_regions.sfz");
|
||||||
|
REQUIRE( synth.getNumRegions() == 3 );
|
||||||
|
REQUIRE( synth.getRegionView(0)->loopMode == SfzLoopMode::loop_continuous );
|
||||||
|
REQUIRE( synth.getRegionView(1)->loopMode == SfzLoopMode::no_loop );
|
||||||
|
REQUIRE( synth.getRegionView(2)->loopMode == SfzLoopMode::loop_continuous );
|
||||||
|
|
||||||
|
REQUIRE( synth.getRegionView(0)->loopRange == sfz::Range<uint32_t>{ 77554, 186582 } );
|
||||||
|
REQUIRE( synth.getRegionView(1)->loopRange == sfz::Range<uint32_t>{ 77554, 186582 } );
|
||||||
|
REQUIRE( synth.getRegionView(2)->loopRange == sfz::Range<uint32_t>{ 4, 124 } );
|
||||||
|
}
|
||||||
|
|
|
||||||
BIN
tests/TestFiles/looped_flute.wav
Executable file
BIN
tests/TestFiles/looped_flute.wav
Executable file
Binary file not shown.
3
tests/TestFiles/looped_regions.sfz
Normal file
3
tests/TestFiles/looped_regions.sfz
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<region> sample=looped_flute.wav
|
||||||
|
<region> loop_mode=no_loop sample=looped_flute.wav
|
||||||
|
<region> loop_start=4 loop_end=124 sample=looped_flute.wav
|
||||||
Loading…
Add table
Reference in a new issue