123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- #ifndef __GLOBAL_VARIABLE_H__
- #define __GLOBAL_VARIABLE_H__
- #include <QString>
- #include <QList>
- #include <QChar>
- /* ====================================================================
- * 声卡相关信息结构体
- * ==================================================================== */
- /* 单个录音通道信息,带有频道信息 */
- struct OneRoadInfo_t
- {
- int nRoadNum = -1; /* 录音通道编号 */
- int nChannelID = -1; /* 频道ID */
- QString strChannelName; /* 频道名称 */
- };
- /**
- * @brief 声卡信息,这里的信息都是设备上和物理声卡相关的
- *
- */
- struct SoundCardInfo_t
- {
- int nSoundCardNum = -1; /* 声卡编号 */
- QString strSoundCardID; /* 声卡ID,这个是声卡名称,可以用来打开 */
- QString strSoundCardName; /* 声卡名称 */
- QString strSoundCardDriver; /* 声卡驱动名称 */
-
- QList<OneRoadInfo_t> listRoad; /* 录音通道列表,存储通道编号 */
- };
- /**
- * @brief 单个声卡通道信息,带有声卡自身的信息
- *
- */
- struct SoundCardRoadInfo_t
- {
- int nSoundCardNum = -1; /* 声卡编号 */
- QString strSoundCardID; /* 声卡ID,这个是声卡名称,可以用来打开 */
- QString strSoundCardName; /* 声卡名称 */
- OneRoadInfo_t roadInfo; /* 单个通道信息 */
- };
- /* 注册数据类型到系统 */
- Q_DECLARE_METATYPE(SoundCardRoadInfo_t)
- /* ====================================================================
- * CompareItemInfo_t对比项结构体
- * ==================================================================== */
- /**
- * @brief 对比项信息在表格中的显示结构体
- *
- */
- struct CompareItemTableItem_t
- {
- int nSerialNum; /* 序号,在表格中的序号 */
- int nID; /* 对比项ID */
- QString strName; /* 对比项名称 */
- bool isEnable; /* 对比项状态,是否启用 */
- int nChannelCount; /* 通道数 */
- };
- /* 对比项的通道信息 */
- struct CompareItemRoadInfo_t
- {
- bool isEnableRecord; /* 是否开启录音 */
- int nCompareRoadNum; /* 对比通道编号,1是主通道,其余往后排 */
- QString strCompareRoadName; /* 通道名称 */
- SoundCardRoadInfo_t scRoadInfo; /* 声卡通道信息,包含声卡编号和通道编号 */
- };
- /* 检测阈值,静音和过载是整数,反相是小数 */
- union Threshold_t
- {
- uint64_t nThreshold; /* 静音和过载的阈值 */
- double dThreshold; /* 反相的阈值 */
- };
- /**
- * @brief 静音、过载、反相检测参数
- *
- */
- struct CompareItemDetectParam_t
- {
- bool isEnable = false; /* 是否启用检测 */
- Threshold_t threshold; /* 检测阈值 */
- int nLen = 0; /* 检测长度,单位秒 */
- int nSensibility = 0; /* 敏感度,0-100,0最不敏感,100最敏感 */
- CompareItemDetectParam_t() = default;
- CompareItemDetectParam_t(const CompareItemDetectParam_t &other);
- CompareItemDetectParam_t& operator=(const CompareItemDetectParam_t &other);
- };
- /**
- * @brief 对比项信息
- *
- */
- struct CompareItemInfo_t
- {
- int nID = -1; /* 对比项ID,对比项唯一识别号,不可更改 */
- QString strName; /* 对比项名称 */
- bool isEnable = false; /* 对比项状态,是否启用 */
- QList<CompareItemRoadInfo_t> listRoads; /* 通道信息列表 */
- CompareItemDetectParam_t paramMute; /* 静音检测参数 */
- CompareItemDetectParam_t paramOverload; /* 过载检测参数 */
- CompareItemDetectParam_t paramPhase; /* 反相检测参数 */
- CompareItemInfo_t() = default;
- CompareItemInfo_t(const CompareItemInfo_t &other);
- CompareItemInfo_t& operator=(const CompareItemInfo_t &other);
- };
- #endif // __GLOBAL_VARIABLE_H__
|