mirror of
https://github.com/TomHarte/CLK.git
synced 2024-07-01 14:29:51 +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 "../../Outputs/Log.hpp"
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <tuple>
|
||||||
|
|
||||||
using namespace Amiga;
|
using namespace Amiga;
|
||||||
|
|
||||||
|
@ -100,6 +101,7 @@ void Audio::output() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Left.
|
// Left.
|
||||||
|
static_assert(std::tuple_size<AudioBuffer>::value % 2 == 0);
|
||||||
buffer_[buffer_pointer_][sample_pointer_] = int16_t(
|
buffer_[buffer_pointer_][sample_pointer_] = int16_t(
|
||||||
(
|
(
|
||||||
channels_[1].output_level * channels_[1].output_enabled +
|
channels_[1].output_level * channels_[1].output_enabled +
|
||||||
|
@ -108,7 +110,7 @@ void Audio::output() {
|
||||||
);
|
);
|
||||||
|
|
||||||
// Right.
|
// 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_[0].output_level * channels_[0].output_enabled +
|
||||||
channels_[3].output_level * channels_[3].output_enabled
|
channels_[3].output_level * channels_[3].output_enabled
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <tuple>
|
||||||
|
|
||||||
using namespace Amiga;
|
using namespace Amiga;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user