compareitemdialog.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #ifndef COMPAREITEMDIALOG_H
  2. #define COMPAREITEMDIALOG_H
  3. #include "DialogBase.h"
  4. #include "singlecompareroadwidget.h"
  5. #include "GlobalVariable.h"
  6. #include <QDialog>
  7. #include <QVBoxLayout>
  8. namespace Ui {
  9. class CompareItemWidget;
  10. }
  11. enum class EDBType
  12. {
  13. DBType_Mute,
  14. DBType_Overload,
  15. DBType_Phase
  16. };
  17. /**
  18. * @brief 对比项设置页面
  19. *
  20. */
  21. class CompareItemDialog : public DialogBase
  22. {
  23. Q_OBJECT
  24. public:
  25. explicit CompareItemDialog(QWidget *parent = nullptr);
  26. ~CompareItemDialog();
  27. /* 设置可选的声卡通道信息 */
  28. void setSoundCardRoadList(const SoundCardPCMInfo_t& soundCardInfo);
  29. /* 设置默认的参数 */
  30. void setDefaultParams(const CompareItemInfo_t& item);
  31. /* 获取生成的对比项信息 */
  32. CompareItemInfo_t& getCompareItemInfo();
  33. /* 设置样式表 */
  34. void setQSS();
  35. private slots:
  36. /* 新增通道 */
  37. void do_pBtn_add_clicked();
  38. /* 删除通道 */
  39. void do_CompareRoadWgtDeleted(int nIndex);
  40. /* 静音、过载、反相检测条件开关 */
  41. void do_checkBox_MOP_clicked(bool checked);
  42. /* 选择了一个录音通道,判断有没有重复的,有则去掉重复的 */
  43. void do_selectOneRecordRoad(QString strPCMName);
  44. private:
  45. /* 设置静音过载反相可编辑 */
  46. void setMOPEditable(EDBType type, bool editable);
  47. /* 设置检测参数输入栏只能输入数字 */
  48. void setDetectParamInputOnlyNumber();
  49. /* 新增一个通道 */
  50. SingleCompareRoadWidget* addOneRoadWidget(int nIndex, bool bDelBtnVisible = true);
  51. /* 重载按下关闭按钮之后,弹窗关闭之前的操作,在这里更新成员变量对比项信息 */
  52. bool isOKClicked() override;
  53. /* 获取对比项的基础信息 */
  54. bool getCompareItemBaseInfo(CompareItemInfo_t& compareItemInfo);
  55. /* 获取各个通道信息 */
  56. bool getCompareRoadInfo(CompareItemInfo_t& compareItemInfo);
  57. /* 获取音频检测信息 */
  58. bool getAudioDetectInfo(CompareItemInfo_t& compareItemInfo);
  59. /* 取消所有的报警 */
  60. void cancelAllWarn();
  61. private:
  62. Ui::CompareItemWidget *ui;
  63. SoundCardPCMInfo_t m_soundCardInfo; /* 声卡信息 */
  64. QList<SingleCompareRoadWidget*> m_listOtherRoadWgt;
  65. CompareItemInfo_t m_compareItemInfo; /* 对比项信息 */
  66. QString m_qssRecordRoad; /* 录音通道的样式表 */
  67. };
  68. #endif // COMPAREITEMDIALOG_H