properties-view.moc.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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, const media_frames_per_second &b)
  14. {
  15. return a.numerator != b.numerator || a.denominator != b.denominator;
  16. }
  17. static bool operator==(const media_frames_per_second &a, const media_frames_per_second &b)
  18. {
  19. return !(a != b);
  20. }
  21. using frame_rate_range_t = std::pair<media_frames_per_second, media_frames_per_second>;
  22. using frame_rate_ranges_t = std::vector<frame_rate_range_t>;
  23. class OBSFrameRatePropertyWidget : public QWidget {
  24. Q_OBJECT
  25. public:
  26. frame_rate_ranges_t fps_ranges;
  27. QComboBox *modeSelect = nullptr;
  28. QStackedWidget *modeDisplay = nullptr;
  29. QWidget *labels = nullptr;
  30. QLabel *currentFPS = nullptr;
  31. QLabel *timePerFrame = nullptr;
  32. QLabel *minLabel = nullptr;
  33. QLabel *maxLabel = nullptr;
  34. QComboBox *simpleFPS = nullptr;
  35. QComboBox *fpsRange = nullptr;
  36. QSpinBox *numEdit = nullptr;
  37. QSpinBox *denEdit = nullptr;
  38. bool updating = false;
  39. const char *name = nullptr;
  40. obs_data_t *settings = nullptr;
  41. QLabel *warningLabel = nullptr;
  42. OBSFrameRatePropertyWidget() = default;
  43. };