mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-20 20:49:12 +12:00
Audio device pt 2
This commit is contained in:
parent
486e2ea5cb
commit
4b7fedb65c
4 changed files with 41 additions and 42 deletions
|
@ -8,17 +8,17 @@
|
|||
class AudioDeviceInterface {
|
||||
protected:
|
||||
using Samples = Common::RingBuffer<s16, 0x2000 * 2>;
|
||||
using RenderBatchCallback = usize (*)(const s16*, usize);
|
||||
|
||||
Samples* samples = nullptr;
|
||||
|
||||
const AudioDeviceConfig& audioSettings;
|
||||
// Store the last stereo sample we output. We play this when underruning to avoid pops.
|
||||
std::array<s16, 2> lastStereoSample{};
|
||||
|
||||
public:
|
||||
AudioDeviceInterface(Samples* samples, const AudioDeviceConfig& audioSettings) : samples(samples), audioSettings(audioSettings) {}
|
||||
|
||||
// Store the last stereo sample we output. We play this when underruning to avoid pops.
|
||||
// TODO: Make this protected again before merging!!!
|
||||
std::array<s16, 2> lastStereoSample{};
|
||||
|
||||
bool running = false;
|
||||
Samples* getSamples() { return samples; }
|
||||
|
||||
|
@ -28,4 +28,7 @@ class AudioDeviceInterface {
|
|||
|
||||
virtual void start() = 0;
|
||||
virtual void stop() = 0;
|
||||
|
||||
// Only used for audio devices that render multiple audio frames in one go, eg the libretro audio device.
|
||||
virtual void renderBatch(RenderBatchCallback callback) {}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue