1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-09 01:10:10 +00:00
CLK/Machines/Apple/Macintosh/DeferredAudio.hpp

33 lines
647 B
C++
Raw Normal View History

//
// DeferredAudio.hpp
// Clock Signal
//
// Created by Thomas Harte on 01/06/2019.
// Copyright © 2019 Thomas Harte. All rights reserved.
//
#ifndef DeferredAudio_h
#define DeferredAudio_h
#include "Audio.hpp"
#include "../../../Outputs/Speaker/Implementation/LowpassSpeaker.hpp"
2023-05-10 21:02:18 +00:00
namespace Apple::Macintosh {
struct DeferredAudio {
2022-07-16 18:41:04 +00:00
Concurrency::AsyncTaskQueue<false> queue;
Audio audio;
Outputs::Speaker::PullLowpass<Audio> speaker;
HalfCycles time_since_update;
DeferredAudio() : audio(queue), speaker(audio) {}
void flush() {
speaker.run_for(queue, time_since_update.flush<Cycles>());
}
};
}
#endif /* DeferredAudio_h */