Files
hdmiviewer/src/DeviceDialog.h

72 lines
2.4 KiB
C++

#pragma once
#include <QDialog>
#include <QString>
#include "Profile.h"
QT_BEGIN_NAMESPACE
class QComboBox;
class QPushButton;
class QCheckBox;
class QDoubleSpinBox;
class QSpinBox;
QT_END_NAMESPACE
class DeviceDialog : public QDialog
{
Q_OBJECT
public:
explicit DeviceDialog(QWidget* parent = nullptr);
QString selectedVideoDevice() const;
QString selectedAudioDevice() const;
int selectedFps() const;
bool selectedSmoothMode() const;
bool selectedRetroMode() const;
float selectedSharpenAmount() const;
int selectedHwBrightness() const; // -1 = unverändert lassen
int selectedHwContrast() const; // -1 = unverändert lassen
int selectedHwSaturation() const; // -1 = unverändert lassen
void setPreselectedVideo(const QString& device);
void setPreselectedAudio(const QString& device);
void setPreselectedFps(int fps);
void setPreselectedSmoothMode(bool enabled);
void setPreselectedRetroMode(bool enabled);
void setPreselectedSharpenAmount(float amount);
void setPreselectedHwBrightness(int value); // -1 = unverändert
void setPreselectedHwContrast(int value); // -1 = unverändert
void setPreselectedHwSaturation(int value); // -1 = unverändert
// Profile: aktueller Stand der Bild-Einstellungen im Dialog, und
// Profil-Auswahl passend zu den aktuellen Werten setzen (nach den
// setPreselected*-Aufrufen verwenden).
Profile currentProfile() const;
void refreshProfileSelection();
private:
void populateVideoDevices();
void populateAudioDevices();
void selectByData(QComboBox* combo, const QString& data);
void populateProfiles(const QString& select);
void loadProfileIntoControls(const QString& name);
void saveProfile();
void deleteProfile();
QComboBox* m_videoCombo = nullptr;
QComboBox* m_audioCombo = nullptr;
QComboBox* m_fpsCombo = nullptr;
QCheckBox* m_smoothCheck = nullptr;
QCheckBox* m_retroCheck = nullptr;
QDoubleSpinBox* m_sharpenSpin = nullptr;
QSpinBox* m_hwBrightnessSpin = nullptr;
QSpinBox* m_hwContrastSpin = nullptr;
QSpinBox* m_hwSaturationSpin = nullptr;
QComboBox* m_profileCombo = nullptr;
QPushButton* m_profileSaveBtn = nullptr;
QPushButton* m_profileDeleteBtn = nullptr;
bool m_loadingProfile = false;
};