2018-05-20 22:03:40 +00:00
|
|
|
// Copyright 2018 Dolphin Emulator Project
|
2021-07-05 01:22:19 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2018-05-20 22:03:40 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <string>
|
|
|
|
#include <unordered_map>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
#include "VideoCommon/PostProcessing.h"
|
|
|
|
|
|
|
|
class EnhancementsWidget;
|
|
|
|
class QCheckBox;
|
|
|
|
class QDialogButtonBox;
|
|
|
|
class QGridLayout;
|
|
|
|
class QLineEdit;
|
|
|
|
class QSlider;
|
|
|
|
class QTabWidget;
|
|
|
|
class QWidget;
|
|
|
|
|
|
|
|
class PostProcessingConfigWindow final : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit PostProcessingConfigWindow(EnhancementsWidget* parent, const std::string& shader);
|
|
|
|
~PostProcessingConfigWindow();
|
|
|
|
|
|
|
|
private:
|
|
|
|
class ConfigGroup final
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit ConfigGroup(
|
2019-02-15 01:59:50 +00:00
|
|
|
const VideoCommon::PostProcessingConfiguration::ConfigurationOption* config_option);
|
2018-05-20 22:03:40 +00:00
|
|
|
|
|
|
|
const std::string& GetGUIName() const noexcept;
|
|
|
|
const std::string& GetParent() const noexcept;
|
|
|
|
const std::string& GetOptionName() const noexcept;
|
|
|
|
void AddSubGroup(std::unique_ptr<ConfigGroup>&& subgroup);
|
|
|
|
bool HasSubGroups() const noexcept;
|
|
|
|
const std::vector<std::unique_ptr<ConfigGroup>>& GetSubGroups() const noexcept;
|
|
|
|
u32 AddWidgets(PostProcessingConfigWindow* parent, QGridLayout* grid, u32 row);
|
|
|
|
void EnableSuboptions(bool state);
|
|
|
|
int GetSliderValue(size_t index) const;
|
|
|
|
void SetSliderText(size_t index, const QString& text);
|
|
|
|
|
|
|
|
private:
|
|
|
|
u32 AddBool(PostProcessingConfigWindow* parent, QGridLayout* grid, u32 row);
|
|
|
|
u32 AddInteger(PostProcessingConfigWindow* parent, QGridLayout* grid, u32 row);
|
|
|
|
u32 AddFloat(PostProcessingConfigWindow* parent, QGridLayout* grid, u32 row);
|
|
|
|
|
|
|
|
QCheckBox* m_checkbox;
|
|
|
|
std::vector<QSlider*> m_sliders;
|
|
|
|
std::vector<QLineEdit*> m_value_boxes;
|
|
|
|
|
2019-02-15 01:59:50 +00:00
|
|
|
const VideoCommon::PostProcessingConfiguration::ConfigurationOption* m_config_option;
|
2018-05-20 22:03:40 +00:00
|
|
|
std::vector<std::unique_ptr<ConfigGroup>> m_subgroups;
|
|
|
|
};
|
|
|
|
void Create();
|
|
|
|
void ConnectWidgets();
|
|
|
|
QWidget* CreateDependentTab(const std::unique_ptr<ConfigGroup>& config_group);
|
|
|
|
void PopulateGroups();
|
|
|
|
void UpdateBool(ConfigGroup* config_group, bool state);
|
|
|
|
void UpdateInteger(ConfigGroup* config_group, int value);
|
|
|
|
void UpdateFloat(ConfigGroup* config_group, int value);
|
|
|
|
|
|
|
|
QTabWidget* m_tabs;
|
|
|
|
QDialogButtonBox* m_buttons;
|
|
|
|
|
|
|
|
const std::string& m_shader;
|
2019-02-15 01:59:50 +00:00
|
|
|
VideoCommon::PostProcessingConfiguration* m_post_processor;
|
2018-05-20 22:03:40 +00:00
|
|
|
std::unordered_map<std::string, ConfigGroup*> m_config_map;
|
|
|
|
std::vector<std::unique_ptr<ConfigGroup>> m_config_groups;
|
|
|
|
};
|