1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-04-23 14:25:11 +00:00

Tried to be less lazy with lambda captures.

This is primarily defensive.
This commit is contained in:
Thomas Harte
2020-02-14 23:39:08 -05:00
parent 65e6c3a9fe
commit 9ca2d8f9f2
12 changed files with 26 additions and 27 deletions
+3 -3
View File
@@ -17,13 +17,13 @@ AudioGenerator::AudioGenerator(Concurrency::DeferringAsyncTaskQueue &audio_queue
void AudioGenerator::set_volume(uint8_t volume) {
audio_queue_.defer([=]() {
volume_ = static_cast<int16_t>(volume) * range_multiplier_;
audio_queue_.defer([this, volume]() {
volume_ = int16_t(volume) * range_multiplier_;
});
}
void AudioGenerator::set_control(int channel, uint8_t value) {
audio_queue_.defer([=]() {
audio_queue_.defer([this, channel, value]() {
control_registers_[channel] = value;
});
}