properties-view.moc.hpp 1.3 KB

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