2019-06-01 19:03:15 +00:00
|
|
|
//
|
|
|
|
// 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 {
|
2019-06-01 19:03:15 +00:00
|
|
|
|
|
|
|
struct DeferredAudio {
|
2022-07-16 18:41:04 +00:00
|
|
|
Concurrency::AsyncTaskQueue<false> queue;
|
2019-06-01 19:03:15 +00:00
|
|
|
Audio audio;
|
2021-11-21 20:37:29 +00:00
|
|
|
Outputs::Speaker::PullLowpass<Audio> speaker;
|
2019-06-01 19:03:15 +00:00
|
|
|
HalfCycles time_since_update;
|
|
|
|
|
|
|
|
DeferredAudio() : audio(queue), speaker(audio) {}
|
|
|
|
|
|
|
|
void flush() {
|
2019-07-29 01:49:54 +00:00
|
|
|
speaker.run_for(queue, time_since_update.flush<Cycles>());
|
2019-06-01 19:03:15 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* DeferredAudio_h */
|