2022-04-23 10:59:50 +02:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2018-07-28 19:40:50 +02:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "audio_core/sink.h"
|
|
|
|
|
|
|
|
namespace AudioCore {
|
|
|
|
|
|
|
|
class NullSink final : public Sink {
|
|
|
|
public:
|
2018-12-13 22:23:31 +01:00
|
|
|
explicit NullSink(std::string_view) {}
|
2018-07-28 19:40:50 +02:00
|
|
|
~NullSink() override = default;
|
|
|
|
|
2018-08-03 00:54:25 +02:00
|
|
|
SinkStream& AcquireSinkStream(u32 /*sample_rate*/, u32 /*num_channels*/,
|
|
|
|
const std::string& /*name*/) override {
|
2018-07-28 19:40:50 +02:00
|
|
|
return null_sink_stream;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
struct NullSinkStreamImpl final : SinkStream {
|
2018-08-04 06:03:12 +02:00
|
|
|
void EnqueueSamples(u32 /*num_channels*/, const std::vector<s16>& /*samples*/) override {}
|
2018-08-23 14:33:03 +02:00
|
|
|
|
2018-09-15 15:21:06 +02:00
|
|
|
std::size_t SamplesInQueue(u32 /*num_channels*/) const override {
|
2018-08-23 14:33:03 +02:00
|
|
|
return 0;
|
|
|
|
}
|
2018-09-12 19:07:16 +02:00
|
|
|
|
|
|
|
void Flush() override {}
|
2018-07-28 19:40:50 +02:00
|
|
|
} null_sink_stream;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace AudioCore
|