Browse Source
Merge pull request #1729 from MerryMage/null-sink
Merge pull request #1729 from MerryMage/null-sink
Audio Config: Implement null sink and implement sink configurationnce_cpp
13 changed files with 155 additions and 4 deletions
-
3src/audio_core/CMakeLists.txt
-
33src/audio_core/audio_core.cpp
-
5src/audio_core/audio_core.h
-
9src/audio_core/hle/dsp.cpp
-
11src/audio_core/hle/dsp.h
-
29src/audio_core/null_sink.h
-
18src/audio_core/sink_details.cpp
-
27src/audio_core/sink_details.h
-
3src/citra/config.cpp
-
5src/citra/default_ini.h
-
8src/citra_qt/config.cpp
-
5src/core/settings.cpp
-
3src/core/settings.h
@ -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 |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue