GlobalVariable.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #ifndef __GLOBAL_VARIABLE_H__
  2. #define __GLOBAL_VARIABLE_H__
  3. #include <QString>
  4. #include <QList>
  5. /**
  6. * @brief 对比项信息在表格中的显示结构体
  7. *
  8. */
  9. struct CompareItemTableItem_t
  10. {
  11. int nSerialNum; /* 序号 */
  12. int nID; /* 对比项ID */
  13. QString strName; /* 对比项名称 */
  14. bool isEnable; /* 对比项状态,是否启用 */
  15. int nChannelCount; /* 通道数 */
  16. };
  17. /* ====================================================================
  18. * CompareItemInfo_t对比项结构体
  19. * ==================================================================== */
  20. /* 对比项的通道信息 */
  21. struct CompareItemChannelInfo_t
  22. {
  23. int nChannelID; /* 通道ID */
  24. QString strChannelName; /* 通道名称 */
  25. int nSoundCardNum; /* 声卡通道编号 */
  26. int strSoundCardName; /* 声卡通道名称,可能使用这个名称打开录音通道 */
  27. bool isEnableRecord; /* 是否开启录音 */
  28. };
  29. /* 检测阈值,静音和过载是整数,反相是小数 */
  30. union Threshold_t
  31. {
  32. uint64_t nThreshold; /* 静音和过载的阈值 */
  33. double dThreshold; /* 反相的阈值 */
  34. };
  35. /**
  36. * @brief 静音、过载、反相检测参数
  37. *
  38. */
  39. struct CompareItemDetectParam_t
  40. {
  41. bool isEnable = false; /* 是否启用检测 */
  42. Threshold_t threshold; /* 检测阈值 */
  43. int nLen = 0; /* 检测长度,单位秒 */
  44. int nSensibility = 0.0; /* 敏感度,0-100,0最不敏感,100最敏感 */
  45. CompareItemDetectParam_t() = default;
  46. CompareItemDetectParam_t(const CompareItemDetectParam_t &other);
  47. CompareItemDetectParam_t& operator=(const CompareItemDetectParam_t &other);
  48. };
  49. /**
  50. * @brief 对比项信息
  51. *
  52. */
  53. struct CompareItemInfo_t
  54. {
  55. int nID = -1; /* 对比项ID,对比项唯一识别号,不可更改 */
  56. QString strName; /* 对比项名称 */
  57. bool isEnable = false; /* 对比项状态,是否启用 */
  58. QList<CompareItemChannelInfo_t> listChannels; /* 通道信息列表 */
  59. CompareItemDetectParam_t muteParam; /* 静音检测参数 */
  60. CompareItemDetectParam_t overloadParam; /* 过载检测参数 */
  61. CompareItemDetectParam_t phaseParam; /* 反相检测参数 */
  62. CompareItemInfo_t() = default;
  63. CompareItemInfo_t(const CompareItemInfo_t &other);
  64. CompareItemInfo_t& operator=(const CompareItemInfo_t &other);
  65. };
  66. /* ====================================================================
  67. * 声卡相关信息结构体
  68. * ==================================================================== */
  69. /**
  70. * @brief 声卡信息,这里的信息都是设备上和物理声卡相关的
  71. *
  72. */
  73. struct SoundCardInfo_t
  74. {
  75. int nSoundCardNum; /* 声卡编号 */
  76. QString strSoundCardID; /* 声卡ID */
  77. QString strSoundCardName; /* 声卡名称 */
  78. QString strSoundCardDriver; /* 声卡驱动名称 */
  79. QList<int> listRecordChannels; /* 录音通道列表,存储通道编号 */
  80. };
  81. #endif // __GLOBAL_VARIABLE_H__