properties-view.moc.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #pragma once
  2. #include <QComboBox>
  3. #include <QLabel>
  4. #include <QSpinBox>
  5. #include <QStackedWidget>
  6. #include <QWidget>
  7. #include <media-io/frame-rate.h>
  8. #include <vector>
  9. static bool operator!=(const media_frames_per_second &a,
  10. const media_frames_per_second &b)
  11. {
  12. return a.numerator != b.numerator || a.denominator != b.denominator;
  13. }
  14. static bool operator==(const media_frames_per_second &a,
  15. const media_frames_per_second &b)
  16. {
  17. return !(a != b);
  18. }
  19. using frame_rate_range_t =
  20. std::pair<media_frames_per_second, media_frames_per_second>;
  21. using frame_rate_ranges_t = std::vector<frame_rate_range_t>;
  22. class OBSFrameRatePropertyWidget : public QWidget {
  23. Q_OBJECT
  24. public:
  25. frame_rate_ranges_t fps_ranges;
  26. QComboBox *modeSelect = nullptr;
  27. QStackedWidget *modeDisplay = nullptr;
  28. QWidget *labels = nullptr;
  29. QLabel *currentFPS = nullptr;
  30. QLabel *timePerFrame = nullptr;
  31. QLabel *minLabel = nullptr;
  32. QLabel *maxLabel = nullptr;
  33. QComboBox *simpleFPS = nullptr;
  34. QComboBox *fpsRange = nullptr;
  35. QSpinBox *numEdit = nullptr;
  36. QSpinBox *denEdit = nullptr;
  37. bool updating = false;
  38. const char *name = nullptr;
  39. obs_data_t *settings = nullptr;
  40. QLabel *warningLabel = nullptr;
  41. OBSFrameRatePropertyWidget() = default;
  42. };