Playlist cleanup (#1163)

* Functional rewrite of playlist
This commit is contained in:
Kyle Reed 2023-06-17 13:01:46 -07:00 committed by GitHub
parent 7f1c0f6f7e
commit 5743d3a3b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 304 additions and 296 deletions

View file

@ -60,3 +60,15 @@ TEST_CASE("Stash should save and restore value.") {
CHECK_EQ(val, 10);
}
TEST_CASE("ms_duration should return duration.") {
auto sample_rate = 48'000;
auto bytes_per_sample = 2; // 16 bit.
auto seconds = 5;
auto size = seconds * sample_rate * bytes_per_sample;
CHECK_EQ(ms_duration(size, sample_rate, bytes_per_sample), 5 * 1000);
}
TEST_CASE("ms_duration not fault when passed zero.") {
CHECK_EQ(ms_duration(0, 0, 0), 0);
}