16#include <catch2/catch.hpp>
26 const auto direction =
29 SECTION(
"simple test case")
31 const auto numChannels = GENERATE(1u, 2u);
34 std::make_shared<FloatVectorClip>(
36 std::make_shared<FloatVectorClip>(
42 if (numChannels == 1u)
45 std::vector<float> { 1.f, 2.f, 3.f } :
46 std::vector<float> { 3.f, 2.f, 1.f };
54 std::vector<std::vector<float>> { { 1.f, 2.f, 3.f },
55 { -1.f, -2.f, -3.f } } :
56 std::vector<std::vector<float>> { { 3.f, 2.f, 1.f },
57 { -3.f, -2.f, -1.f } };
63 SECTION(
"accounts for playback offset")
65 const auto clip = std::make_shared<FloatVectorClip>(
67 const auto numSamples = clip->GetVisibleSampleCount().as_size_t();
69 constexpr auto playbackOffset = 2 /
static_cast<double>(
sampleRate);
70 ClipSegment sut { *clip, playbackOffset, direction };
74 std::vector<float> { 3.f, 4.f, 5.f, 0.f, 0.f } :
75 std::vector<float> { 3.f, 2.f, 1.f, 0.f, 0.f };
std::vector< std::vector< float > > FloatVectorVector
constexpr auto sampleRate
std::vector< float * > channelPointers
std::vector< std::vector< float > > channelVectors