2022-04-23 04:59:50 -04:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
|
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2018-07-30 23:57:53 -04:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2023-05-18 17:54:22 -04:00
|
|
|
#include <forward_list>
|
|
|
|
|
#include <functional>
|
2018-07-30 23:57:53 -04:00
|
|
|
#include <memory>
|
|
|
|
|
#include <QWidget>
|
2023-05-05 23:30:59 -04:00
|
|
|
#include "yuzu/configuration/configuration_shared.h"
|
2023-05-18 17:54:22 -04:00
|
|
|
#include "yuzu/configuration/shared_translation.h"
|
|
|
|
|
|
2023-05-18 23:05:21 -04:00
|
|
|
class QComboBox;
|
2020-07-14 15:42:12 -04:00
|
|
|
|
2021-09-02 21:40:55 -04:00
|
|
|
namespace Core {
|
|
|
|
|
class System;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-30 23:57:53 -04:00
|
|
|
namespace Ui {
|
|
|
|
|
class ConfigureAudio;
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-05 23:30:59 -04:00
|
|
|
class ConfigureAudio : public ConfigurationShared::Tab {
|
2018-07-30 23:57:53 -04:00
|
|
|
public:
|
2023-05-18 22:17:36 -04:00
|
|
|
explicit ConfigureAudio(
|
|
|
|
|
const Core::System& system_,
|
|
|
|
|
std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group,
|
|
|
|
|
const ConfigurationShared::TranslationMap& translations_,
|
|
|
|
|
const ConfigurationShared::ComboboxTranslationMap& combobox_translations_,
|
|
|
|
|
QWidget* parent = nullptr);
|
2018-12-02 14:10:28 -05:00
|
|
|
~ConfigureAudio() override;
|
2018-07-30 23:57:53 -04:00
|
|
|
|
2023-05-05 23:30:59 -04:00
|
|
|
void ApplyConfiguration() override;
|
|
|
|
|
void SetConfiguration() override;
|
2018-07-30 23:57:53 -04:00
|
|
|
|
2018-12-02 14:14:32 -05:00
|
|
|
private:
|
2019-06-05 18:39:46 -04:00
|
|
|
void changeEvent(QEvent* event) override;
|
|
|
|
|
|
2022-07-16 23:48:45 +01:00
|
|
|
void InitializeAudioSinkComboBox();
|
2019-06-05 18:39:46 -04:00
|
|
|
|
|
|
|
|
void RetranslateUI();
|
|
|
|
|
|
2019-05-26 00:39:23 -04:00
|
|
|
void UpdateAudioDevices(int sink_index);
|
2018-07-30 23:57:53 -04:00
|
|
|
|
2019-05-26 00:39:23 -04:00
|
|
|
void SetOutputSinkFromSinkID();
|
2022-07-16 23:48:45 +01:00
|
|
|
void SetAudioDevicesFromDeviceID();
|
2018-07-30 23:57:53 -04:00
|
|
|
|
2023-05-18 17:54:22 -04:00
|
|
|
void Setup();
|
2020-07-09 22:42:09 -04:00
|
|
|
|
2018-07-30 23:57:53 -04:00
|
|
|
std::unique_ptr<Ui::ConfigureAudio> ui;
|
2021-09-02 21:40:55 -04:00
|
|
|
|
2021-07-30 10:07:32 -04:00
|
|
|
const Core::System& system;
|
2023-05-18 17:54:22 -04:00
|
|
|
const ConfigurationShared::TranslationMap& translations;
|
2023-05-18 22:17:36 -04:00
|
|
|
const ConfigurationShared::ComboboxTranslationMap& combobox_translations;
|
2023-05-18 17:54:22 -04:00
|
|
|
|
|
|
|
|
std::forward_list<std::function<void(bool)>> apply_funcs{};
|
|
|
|
|
|
|
|
|
|
QComboBox* sink_combo_box;
|
|
|
|
|
QComboBox* output_device_combo_box;
|
|
|
|
|
QComboBox* input_device_combo_box;
|
2018-07-30 23:57:53 -04:00
|
|
|
};
|