mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-22 05:15:51 +12:00
Adding audio interface part 1
This commit is contained in:
parent
be071ffb78
commit
486e2ea5cb
7 changed files with 91 additions and 51 deletions
33
include/audio/libretro_audio_device.hpp
Normal file
33
include/audio/libretro_audio_device.hpp
Normal file
|
@ -0,0 +1,33 @@
|
|||
#pragma once
|
||||
#include <atomic>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "audio/audio_device.hpp"
|
||||
|
||||
class LibretroAudioDevice : public AudioDeviceInterface {
|
||||
bool initialized = false;
|
||||
|
||||
public:
|
||||
LibretroAudioDevice(const AudioDeviceConfig& audioSettings) : AudioDeviceInterface(nullptr, audioSettings), initialized(false) {
|
||||
running = false;
|
||||
}
|
||||
|
||||
void init(Samples& samples, bool safe = false) override {
|
||||
this->samples = &samples;
|
||||
|
||||
initialized = true;
|
||||
running = false;
|
||||
}
|
||||
|
||||
void close() override {
|
||||
initialized = false;
|
||||
running = false;
|
||||
};
|
||||
|
||||
void start() override { running = true; }
|
||||
void stop() override { running = false; };
|
||||
|
||||
bool isInitialized() const { return initialized; }
|
||||
bool isRunning() const { return running; }
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue