compareitemdialog.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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 setMultiEditMode(bool multiEdit);
  31. /* 设置对比项名称列表。查重时使用 */
  32. void setCompareItemNameList(const QList<QString>& listItemNames);
  33. /* 设置默认的参数 */
  34. void setDefaultParams(const CompareItemInfo_t& item);
  35. /* 获取生成的对比项信息 */
  36. CompareItemInfo_t& getCompareItemInfo();
  37. /* 设置样式表 */
  38. void setQSS();
  39. protected:
  40. /* 重载按下关闭按钮之后,弹窗关闭之前的操作,在这里更新成员变量对比项信息 */
  41. bool isOKClicked() override;
  42. private slots:
  43. /* 新增通道 */
  44. void do_pBtn_add_clicked();
  45. /* 删除通道 */
  46. void do_CompareRoadWgtDeleted(int nIndex);
  47. /* 静音、过载、反相检测条件开关 */
  48. void do_checkBox_MOP_clicked(bool checked);
  49. /* 选择了一个录音通道,判断有没有重复的,有则去掉重复的 */
  50. void do_selectOneRecordRoad(QString strPCMName);
  51. private:
  52. /* 设置静音过载反相可编辑 */
  53. void setMOPEditable(EDBType type, bool editable);
  54. /* 设置检测参数输入栏只能输入数字 */
  55. void setDetectParamInputOnlyNumber();
  56. /* 新增一个通道 */
  57. SingleCompareRoadWidget* addOneRoadWidget(int nIndex, bool bDelBtnVisible = true);
  58. /* 获取对比项的基础信息 */
  59. bool getCompareItemBaseInfo(CompareItemInfo_t& compareItemInfo);
  60. /* 获取各个通道信息 */
  61. bool getCompareRoadInfo(CompareItemInfo_t& compareItemInfo);
  62. /* 获取音频检测信息 */
  63. bool getAudioDetectInfo(CompareItemInfo_t& compareItemInfo);
  64. /* 取消所有的报警 */
  65. void cancelAllWarn();
  66. private:
  67. Ui::CompareItemWidget *ui;
  68. bool m_isMultiEdit = false; /* 是否是多项编辑 */
  69. SoundCardPCMInfo_t m_soundCardInfo; /* 声卡信息 */
  70. QList<SingleCompareRoadWidget*> m_listOtherRoadWgt;
  71. CompareItemInfo_t m_compareItemInfo; /* 对比项信息 */
  72. QString m_qssRecordRoad; /* 录音通道的样式表 */
  73. QList<QString> m_listCompareItemNames; /* 已有的对比项名称列表 */
  74. /* 检测参数阈值 */
  75. int m_silenceThresholdLow = 40;
  76. int m_silenceThresholdHigh = 80;
  77. int m_silenceDurationLow = 2;
  78. int m_silenceDurationHigh = 90;
  79. int m_silenceSensitivityLow = 22;
  80. int m_silenceSensitivityHigh = 100;
  81. int m_overloadThresholdLow = 0;
  82. int m_overloadThresholdHigh = 40;
  83. int m_overloadDurationLow = 2;
  84. int m_overloadDurationHigh = 90;
  85. int m_overloadSensitivityLow = 22;
  86. int m_overloadSensitivityHigh = 100;
  87. double m_phaseThresholdLow = 0.0;
  88. double m_phaseThresholdHigh = 0.99;
  89. int m_phaseDurationLow = 10;
  90. int m_phaseDurationHigh = 90;
  91. int m_phaseSensitivityLow = 20;
  92. int m_phaseSensitivityHigh = 99;
  93. };
  94. #endif // COMPAREITEMDIALOG_H