1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-11 04:28:58 +00:00
CLK/Machines/Apple/Macintosh/DeferredAudio.hpp
Thomas Harte 6d985866ee All proper inputs are now provided to the audio generator.
Hopefully. The next job is to generate audio. If that sounds correct, then the disk motor speed question can be tackled.
2019-06-01 15:03:15 -04:00

35 lines
664 B
C++

//
// 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"
namespace Apple {
namespace Macintosh {
struct DeferredAudio {
Concurrency::DeferringAsyncTaskQueue queue;
Audio audio;
Outputs::Speaker::LowpassSpeaker<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 */