#ifndef __GLOBAL_VARIABLE_H__ #define __GLOBAL_VARIABLE_H__ #include #include /** * @brief 对比项信息在表格中的显示结构体 * */ struct CompareItemTableItem_t { int nSerialNum; /* 序号 */ int nID; /* 对比项ID */ QString strName; /* 对比项名称 */ bool isEnable; /* 对比项状态,是否启用 */ int nChannelCount; /* 通道数 */ }; /* ==================================================================== * CompareItemInfo_t对比项结构体 * ==================================================================== */ /* 对比项的通道信息 */ struct CompareItemChannelInfo_t { int nChannelID; /* 通道ID */ QString strChannelName; /* 通道名称 */ int nSoundCardNum; /* 声卡通道编号 */ int strSoundCardName; /* 声卡通道名称,可能使用这个名称打开录音通道 */ bool isEnableRecord; /* 是否开启录音 */ }; /* 检测阈值,静音和过载是整数,反相是小数 */ 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; /* 敏感度,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 listChannels; /* 通道信息列表 */ CompareItemDetectParam_t muteParam; /* 静音检测参数 */ CompareItemDetectParam_t overloadParam; /* 过载检测参数 */ CompareItemDetectParam_t phaseParam; /* 反相检测参数 */ CompareItemInfo_t() = default; CompareItemInfo_t(const CompareItemInfo_t &other); CompareItemInfo_t& operator=(const CompareItemInfo_t &other); }; /* ==================================================================== * 声卡相关信息结构体 * ==================================================================== */ /** * @brief 声卡信息,这里的信息都是设备上和物理声卡相关的 * */ struct SoundCardInfo_t { int nSoundCardNum; /* 声卡编号 */ QString strSoundCardID; /* 声卡ID */ QString strSoundCardName; /* 声卡名称 */ QString strSoundCardDriver; /* 声卡驱动名称 */ QList listRecordChannels; /* 录音通道列表,存储通道编号 */ }; #endif // __GLOBAL_VARIABLE_H__