1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-29 00:29:34 +00:00

Add buffer-length assert; add <tuple> where std::tuple_size is used.

This commit is contained in:
Thomas Harte 2021-12-02 12:53:20 -05:00
parent 3a26f6b8bf
commit e6fe36f45c
2 changed files with 4 additions and 1 deletions

View File

@ -14,6 +14,7 @@
#include "../../Outputs/Log.hpp"
#include <cassert>
#include <tuple>
using namespace Amiga;
@ -100,6 +101,7 @@ void Audio::output() {
}
// Left.
static_assert(std::tuple_size<AudioBuffer>::value % 2 == 0);
buffer_[buffer_pointer_][sample_pointer_] = int16_t(
(
channels_[1].output_level * channels_[1].output_enabled +
@ -108,7 +110,7 @@ void Audio::output() {
);
// Right.
buffer_[buffer_pointer_][sample_pointer_+1] = int16_t(
buffer_[buffer_pointer_][sample_pointer_ + 1] = int16_t(
(
channels_[0].output_level * channels_[0].output_enabled +
channels_[3].output_level * channels_[3].output_enabled

View File

@ -17,6 +17,7 @@
#include <algorithm>
#include <cassert>
#include <tuple>
using namespace Amiga;