mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-13 07:30:21 +00:00
Add buffer-length assert; add <tuple> where std::tuple_size is used.
This commit is contained in:
parent
3a26f6b8bf
commit
e6fe36f45c
@ -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
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <tuple>
|
||||
|
||||
using namespace Amiga;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user