2020-09-12 15:20:02 +00:00
|
|
|
#pragma once
|
|
|
|
#include "common/types.h"
|
|
|
|
#include "ui_postprocessingchainconfigwidget.h"
|
|
|
|
#include "frontend-common/postprocessing_chain.h"
|
|
|
|
#include <QtWidgets/QWidget>
|
|
|
|
#include <optional>
|
|
|
|
#include <memory>
|
|
|
|
#include <string_view>
|
|
|
|
|
|
|
|
namespace FrontendCommon {
|
|
|
|
class PostProcessingChain;
|
|
|
|
}
|
|
|
|
|
|
|
|
class PostProcessingChainConfigWidget : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
PostProcessingChainConfigWidget(QWidget* parent);
|
|
|
|
~PostProcessingChainConfigWidget();
|
|
|
|
|
2020-09-13 12:24:20 +00:00
|
|
|
ALWAYS_INLINE FrontendCommon::PostProcessingChain& getChain() { return m_chain; }
|
|
|
|
|
2020-09-12 15:20:02 +00:00
|
|
|
bool setConfigString(const std::string_view& config_string);
|
2020-09-13 12:24:20 +00:00
|
|
|
void setOptionsButtonVisible(bool visible);
|
2020-09-12 15:20:02 +00:00
|
|
|
|
|
|
|
Q_SIGNALS:
|
2020-09-13 12:24:20 +00:00
|
|
|
void selectedShaderChanged(qint32 index);
|
|
|
|
void chainAboutToChange();
|
2020-09-12 15:20:02 +00:00
|
|
|
void chainConfigStringChanged(const std::string& new_config_string);
|
|
|
|
|
|
|
|
private Q_SLOTS:
|
|
|
|
void onAddButtonClicked();
|
|
|
|
void onRemoveButtonClicked();
|
|
|
|
void onClearButtonClicked();
|
|
|
|
void onMoveUpButtonClicked();
|
|
|
|
void onMoveDownButtonClicked();
|
|
|
|
void onShaderConfigButtonClicked();
|
2020-09-13 10:21:33 +00:00
|
|
|
void onReloadButtonClicked();
|
2020-09-13 12:24:20 +00:00
|
|
|
void onSelectedShaderChanged();
|
2020-09-12 15:20:02 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void connectUi();
|
|
|
|
std::optional<u32> getSelectedIndex() const;
|
|
|
|
void updateList();
|
|
|
|
void configChanged();
|
2020-09-13 12:24:20 +00:00
|
|
|
void updateButtonStates(std::optional<u32> index);
|
2020-09-12 15:20:02 +00:00
|
|
|
|
|
|
|
Ui::PostProcessingChainConfigWidget m_ui;
|
|
|
|
|
|
|
|
FrontendCommon::PostProcessingChain m_chain;
|
|
|
|
};
|