2019-02-27 22:13:51 +00:00
|
|
|
// Copyright 2018 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <vector>
|
|
|
|
#include "core/frontend/mic.h"
|
|
|
|
|
|
|
|
namespace AudioCore {
|
|
|
|
|
|
|
|
class CubebInput final : public Frontend::Mic::Interface {
|
|
|
|
public:
|
2019-11-01 18:33:06 +00:00
|
|
|
explicit CubebInput(std::string device_id);
|
2019-03-05 05:47:24 +00:00
|
|
|
~CubebInput() override;
|
2019-02-27 22:13:51 +00:00
|
|
|
|
2019-03-06 18:16:43 +00:00
|
|
|
void StartSampling(const Frontend::Mic::Parameters& params) override;
|
2019-02-27 22:13:51 +00:00
|
|
|
|
|
|
|
void StopSampling() override;
|
|
|
|
|
|
|
|
void AdjustSampleRate(u32 sample_rate) override;
|
|
|
|
|
2019-03-05 05:47:24 +00:00
|
|
|
Frontend::Mic::Samples Read() override;
|
|
|
|
|
2019-02-27 22:13:51 +00:00
|
|
|
private:
|
|
|
|
struct Impl;
|
|
|
|
std::unique_ptr<Impl> impl;
|
2019-11-01 18:33:06 +00:00
|
|
|
std::string device_id;
|
2019-02-27 22:13:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
std::vector<std::string> ListCubebInputDevices();
|
|
|
|
|
2020-12-31 00:21:03 +00:00
|
|
|
class CubebFactory final : public Frontend::Mic::RealMicFactory {
|
|
|
|
public:
|
|
|
|
~CubebFactory() override;
|
|
|
|
|
|
|
|
std::unique_ptr<Frontend::Mic::Interface> Create(std::string mic_device_name) override;
|
|
|
|
};
|
|
|
|
|
2019-02-27 22:13:51 +00:00
|
|
|
} // namespace AudioCore
|