123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- #ifndef COMPAREITEMDIALOG_H
- #define COMPAREITEMDIALOG_H
- #include "DialogBase.h"
- #include "singlecompareroadwidget.h"
- #include "GlobalVariable.h"
- #include <QDialog>
- #include <QVBoxLayout>
- namespace Ui {
- class CompareItemWidget;
- }
- enum class EDBType
- {
- DBType_Mute,
- DBType_Overload,
- DBType_Phase
- };
- /**
- * @brief 对比项设置页面
- *
- */
- class CompareItemDialog : public DialogBase
- {
- Q_OBJECT
- public:
- explicit CompareItemDialog(QWidget *parent = nullptr);
- ~CompareItemDialog();
- /* 设置可选的声卡通道信息 */
- void setSoundCardRoadList(const SoundCardPCMInfo_t& soundCardInfo);
- /* 设置模式,是否是多项编辑 */
- void setMultiEditMode(bool multiEdit);
- /* 设置对比项名称列表。查重时使用 */
- void setCompareItemNameList(const QList<QString>& listItemNames);
- /* 设置默认的参数 */
- void setDefaultParams(const CompareItemInfo_t& item);
- /* 获取生成的对比项信息 */
- CompareItemInfo_t& getCompareItemInfo();
- /* 设置样式表 */
- void setQSS();
- protected:
- /* 重载按下关闭按钮之后,弹窗关闭之前的操作,在这里更新成员变量对比项信息 */
- bool isOKClicked() override;
- private slots:
- /* 新增通道 */
- void do_pBtn_add_clicked();
- /* 删除通道 */
- void do_CompareRoadWgtDeleted(int nIndex);
- /* 静音、过载、反相检测条件开关 */
- void do_checkBox_MOP_clicked(bool checked);
- /* 选择了一个录音通道,判断有没有重复的,有则去掉重复的 */
- void do_selectOneRecordRoad(QString strPCMName);
- private:
- /* 设置静音过载反相可编辑 */
- void setMOPEditable(EDBType type, bool editable);
- /* 设置检测参数输入栏只能输入数字 */
- void setDetectParamInputOnlyNumber();
- /* 新增一个通道 */
- SingleCompareRoadWidget* addOneRoadWidget(int nIndex, bool bDelBtnVisible = true);
- /* 获取对比项的基础信息 */
- bool getCompareItemBaseInfo(CompareItemInfo_t& compareItemInfo);
- /* 获取各个通道信息 */
- bool getCompareRoadInfo(CompareItemInfo_t& compareItemInfo);
- /* 获取音频检测信息 */
- bool getAudioDetectInfo(CompareItemInfo_t& compareItemInfo);
- /* 取消所有的报警 */
- void cancelAllWarn();
- private:
- Ui::CompareItemWidget *ui;
- bool m_isMultiEdit = false; /* 是否是多项编辑 */
- SoundCardPCMInfo_t m_soundCardInfo; /* 声卡信息 */
- QList<SingleCompareRoadWidget*> m_listOtherRoadWgt;
- CompareItemInfo_t m_compareItemInfo; /* 对比项信息 */
- QString m_qssRecordRoad; /* 录音通道的样式表 */
- QList<QString> m_listCompareItemNames; /* 已有的对比项名称列表 */
- /* 检测参数阈值 */
- int m_silenceThresholdLow = 40;
- int m_silenceThresholdHigh = 80;
- int m_silenceDurationLow = 2;
- int m_silenceDurationHigh = 90;
- int m_silenceSensitivityLow = 22;
- int m_silenceSensitivityHigh = 100;
- int m_overloadThresholdLow = 0;
- int m_overloadThresholdHigh = 40;
- int m_overloadDurationLow = 2;
- int m_overloadDurationHigh = 90;
- int m_overloadSensitivityLow = 22;
- int m_overloadSensitivityHigh = 100;
- double m_phaseThresholdLow = 0.0;
- double m_phaseThresholdHigh = 0.99;
- int m_phaseDurationLow = 10;
- int m_phaseDurationHigh = 90;
- int m_phaseSensitivityLow = 20;
- int m_phaseSensitivityHigh = 99;
- };
- #endif // COMPAREITEMDIALOG_H
|