Lime3DS/src/citra_qt/dumping/option_set_dialog.h
zhupengfei 94bc09d3ae
citra_qt/dumping: Add option set dialog
This dialog allows changing the value and unsetting one option. There are three possible variants of this dialog:

1. The LineEdit layout. This is used for normal options like string and duration, and just features a textbox for the user to type in whatever they want to set.

2. The ComboBox layout. This is used when there are named constants for an option, or when the option accepts an enum value like sample_format or pixel_format. A description will be displayed for the currently selected named constant. The user can also select 'custom' and type in their own value.

3. The CheckBox-es layout. This is used for flags options. A checkbox will be displayed for each named constant and the user can tick the flags they want to set.
2020-02-27 16:55:14 +08:00

33 lines
915 B
C++

// Copyright 2020 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <memory>
#include <QDialog>
#include "core/dumping/ffmpeg_backend.h"
namespace Ui {
class OptionSetDialog;
}
class OptionSetDialog : public QDialog {
Q_OBJECT
public:
explicit OptionSetDialog(QWidget* parent, VideoDumper::OptionInfo option,
const std::string& initial_value);
~OptionSetDialog() override;
// {is_set, value}
std::pair<bool, std::string> GetCurrentValue();
private:
void InitializeUI(const std::string& initial_value);
void SetCheckBoxDefaults(const std::string& initial_value);
void UpdateUIDisplay();
std::unique_ptr<Ui::OptionSetDialog> ui;
VideoDumper::OptionInfo option;
bool is_set = true;
int layout_type = -1; // 0 - line edit, 1 - combo box, 2 - flags (check boxes)
};