Merge pull request #1729 from MerryMage/null-sink
Audio Config: Implement null sink and implement sink configurationmaster
commit
c1f0044a4b
@ -0,0 +1,29 @@
|
|||||||
|
// Copyright 2016 Citra Emulator Project
|
||||||
|
// Licensed under GPLv2 or any later version
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
|
|
||||||
|
#include "audio_core/audio_core.h"
|
||||||
|
#include "audio_core/sink.h"
|
||||||
|
|
||||||
|
namespace AudioCore {
|
||||||
|
|
||||||
|
class NullSink final : public Sink {
|
||||||
|
public:
|
||||||
|
~NullSink() override = default;
|
||||||
|
|
||||||
|
unsigned int GetNativeSampleRate() const override {
|
||||||
|
return native_sample_rate;
|
||||||
|
}
|
||||||
|
|
||||||
|
void EnqueueSamples(const std::vector<s16>&) override {}
|
||||||
|
|
||||||
|
size_t SamplesInQueue() const override {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace AudioCore
|
@ -0,0 +1,18 @@
|
|||||||
|
// Copyright 2016 Citra Emulator Project
|
||||||
|
// Licensed under GPLv2 or any later version
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
#include "audio_core/null_sink.h"
|
||||||
|
#include "audio_core/sink_details.h"
|
||||||
|
|
||||||
|
namespace AudioCore {
|
||||||
|
|
||||||
|
// g_sink_details is ordered in terms of desirability, with the best choice at the top.
|
||||||
|
const std::vector<SinkDetails> g_sink_details = {
|
||||||
|
{ "null", []() { return std::make_unique<NullSink>(); } },
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace AudioCore
|
@ -0,0 +1,27 @@
|
|||||||
|
// Copyright 2016 Citra Emulator Project
|
||||||
|
// Licensed under GPLv2 or any later version
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
#include <memory>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
namespace AudioCore {
|
||||||
|
|
||||||
|
class Sink;
|
||||||
|
|
||||||
|
struct SinkDetails {
|
||||||
|
SinkDetails(const char* id_, std::function<std::unique_ptr<Sink>()> factory_)
|
||||||
|
: id(id_), factory(factory_) {}
|
||||||
|
|
||||||
|
/// Name for this sink.
|
||||||
|
const char* id;
|
||||||
|
/// A method to call to construct an instance of this type of sink.
|
||||||
|
std::function<std::unique_ptr<Sink>()> factory;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern const std::vector<SinkDetails> g_sink_details;
|
||||||
|
|
||||||
|
} // namespace AudioCore
|
Loading…
Reference in New Issue