properties-view.moc.hpp 1.3 KB

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