2023-05-01 20:17:45 +01:00
|
|
|
// Copyright 2019 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <vector>
|
|
|
|
#include "audio_core/input.h"
|
|
|
|
#include "common/swap.h"
|
|
|
|
#include "common/threadsafe_queue.h"
|
|
|
|
|
|
|
|
namespace AudioCore {
|
|
|
|
|
|
|
|
class StaticInput final : public Input {
|
|
|
|
public:
|
|
|
|
StaticInput();
|
2023-11-12 21:03:07 +00:00
|
|
|
~StaticInput() = default;
|
2023-05-01 20:17:45 +01:00
|
|
|
|
2023-11-12 21:03:07 +00:00
|
|
|
void StartSampling(const InputParameters& params) {
|
|
|
|
parameters = params;
|
|
|
|
is_sampling = true;
|
|
|
|
}
|
2023-05-01 20:17:45 +01:00
|
|
|
|
2023-11-12 21:03:07 +00:00
|
|
|
void StopSampling() {
|
|
|
|
is_sampling = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IsSampling() {
|
|
|
|
return is_sampling;
|
|
|
|
}
|
|
|
|
|
|
|
|
void AdjustSampleRate(u32 sample_rate) {}
|
|
|
|
|
|
|
|
Samples Read() {
|
|
|
|
return (parameters.sample_size == 8) ? CACHE_8_BIT : CACHE_16_BIT;
|
|
|
|
}
|
2023-05-01 20:17:45 +01:00
|
|
|
|
|
|
|
private:
|
2023-11-12 21:03:07 +00:00
|
|
|
bool is_sampling = false;
|
2023-05-01 20:17:45 +01:00
|
|
|
std::vector<u8> CACHE_8_BIT;
|
|
|
|
std::vector<u8> CACHE_16_BIT;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace AudioCore
|