2016-02-23 23:16:51 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QComboBox>
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QSpinBox>
|
|
|
|
#include <QStackedWidget>
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
#include <media-io/frame-rate.h>
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
#pragma warning(disable : 4505)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static bool operator!=(const media_frames_per_second &a,
|
2019-09-22 21:19:10 +00:00
|
|
|
const media_frames_per_second &b)
|
2016-02-23 23:16:51 +00:00
|
|
|
{
|
|
|
|
return a.numerator != b.numerator || a.denominator != b.denominator;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool operator==(const media_frames_per_second &a,
|
2019-09-22 21:19:10 +00:00
|
|
|
const media_frames_per_second &b)
|
2016-02-23 23:16:51 +00:00
|
|
|
{
|
|
|
|
return !(a != b);
|
|
|
|
}
|
|
|
|
|
|
|
|
using frame_rate_range_t =
|
|
|
|
std::pair<media_frames_per_second, media_frames_per_second>;
|
|
|
|
using frame_rate_ranges_t = std::vector<frame_rate_range_t>;
|
|
|
|
|
|
|
|
class OBSFrameRatePropertyWidget : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
frame_rate_ranges_t fps_ranges;
|
|
|
|
|
2019-09-22 21:19:10 +00:00
|
|
|
QComboBox *modeSelect = nullptr;
|
|
|
|
QStackedWidget *modeDisplay = nullptr;
|
2016-02-23 23:16:51 +00:00
|
|
|
|
2019-09-22 21:19:10 +00:00
|
|
|
QWidget *labels = nullptr;
|
|
|
|
QLabel *currentFPS = nullptr;
|
|
|
|
QLabel *timePerFrame = nullptr;
|
|
|
|
QLabel *minLabel = nullptr;
|
|
|
|
QLabel *maxLabel = nullptr;
|
2016-02-23 23:16:51 +00:00
|
|
|
|
2019-09-22 21:19:10 +00:00
|
|
|
QComboBox *simpleFPS = nullptr;
|
2016-02-23 23:16:51 +00:00
|
|
|
|
2019-09-22 21:19:10 +00:00
|
|
|
QComboBox *fpsRange = nullptr;
|
|
|
|
QSpinBox *numEdit = nullptr;
|
|
|
|
QSpinBox *denEdit = nullptr;
|
2016-02-23 23:16:51 +00:00
|
|
|
|
2019-09-22 21:19:10 +00:00
|
|
|
bool updating = false;
|
2016-02-23 23:16:51 +00:00
|
|
|
|
2019-09-22 21:19:10 +00:00
|
|
|
const char *name = nullptr;
|
|
|
|
obs_data_t *settings = nullptr;
|
2016-02-23 23:16:51 +00:00
|
|
|
|
2019-09-22 21:19:10 +00:00
|
|
|
QLabel *warningLabel = nullptr;
|
2016-02-23 23:16:51 +00:00
|
|
|
|
|
|
|
OBSFrameRatePropertyWidget() = default;
|
|
|
|
};
|