settings_page.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef __SETTINGS_H__
  2. #define __SETTINGS_H__
  3. #include "encoder/audio_encoder.h"
  4. #include "encoder/video_encoder.h"
  5. #include <QComboBox>
  6. #include <QDialog>
  7. #include <QGroupBox>
  8. #include <QLabel>
  9. #include <QLayout>
  10. #include <QLineEdit>
  11. #include <QPushButton>
  12. #include <QSpinBox>
  13. class SettingsPage : public QDialog {
  14. public:
  15. struct Param {
  16. Encoder<MediaType::AUDIO>::Param audioParam;
  17. Encoder<MediaType::VIDEO>::Param videoParam;
  18. std::string outputDir;
  19. std::string liveUrl;
  20. std::string liveName;
  21. };
  22. SettingsPage(Param* param, QWidget* parent = nullptr);
  23. private:
  24. void _InitUi();
  25. void _InitConnect();
  26. void _WriteSettings();
  27. QGroupBox* _InitVideoUi();
  28. QGroupBox* _InitAudioUi();
  29. QGroupBox* _InitOutputUi();
  30. Param* _param = nullptr;
  31. QSpinBox* _videoBitRateBox = nullptr;
  32. QSpinBox* _videoFpsBox = nullptr;
  33. QComboBox* _videoEncoderBox = nullptr;
  34. QSpinBox* _audioBitRateBox = nullptr;
  35. QLineEdit* _fileDirEdit = nullptr;
  36. QPushButton* _selDirBtn = nullptr;
  37. QPushButton* _applyBtn = nullptr;
  38. QPushButton* _cancelBtn = nullptr;
  39. QPushButton* _yesBtn = nullptr;
  40. QHBoxLayout* _CreateDescription(std::string_view text, std::string_view textEx, QWidget* widget);
  41. };
  42. #endif