Selaa lähdekoodia

V0.2.4
1、完成了声卡管理类

apple 3 viikkoa sitten
vanhempi
commit
29312470ba

+ 5 - 0
SettingLibrary/CMakeLists.txt

@@ -11,6 +11,8 @@ file(GLOB LOCAL_SRC
     ${CMAKE_SOURCE_DIR}/External/common/WebAPI/*.cpp
     ${CMAKE_SOURCE_DIR}/External/common/Thread/*.cpp
     ${CMAKE_SOURCE_DIR}/External/common/combox/*.cpp
+    ${CMAKE_SOURCE_DIR}/External/common/TipWidget/*.cpp
+    ${CMAKE_SOURCE_DIR}/External/common/TipWidget/*.qrc
     ${CMAKE_SOURCE_DIR}/External/module/mqtt/*.cpp
 
 
@@ -29,6 +31,7 @@ file(GLOB LOCAL_SRC
     ${CMAKE_CURRENT_SOURCE_DIR}/DialogBase/*.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/common/LHLog/*.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/Network/*.cpp
+    ${CMAKE_CURRENT_SOURCE_DIR}/DataManager/*.cpp
     
     ${LHQLog_SOURCE_DIRS}/*.cpp
     ${LHHTTPAPI_SOURCE_DIRS}/*.cpp
@@ -64,6 +67,7 @@ target_include_directories(${libName} PRIVATE
     ${CMAKE_SOURCE_DIR}/External/common/WebAPI
     ${CMAKE_SOURCE_DIR}/External/common/Thread
     ${CMAKE_SOURCE_DIR}/External/common/combox
+    ${CMAKE_SOURCE_DIR}/External/common/TipWidget
     ${CMAKE_SOURCE_DIR}/External/module
     ${CMAKE_SOURCE_DIR}/External/module/mqtt
 
@@ -79,6 +83,7 @@ target_include_directories(${libName} PRIVATE
     ${CMAKE_CURRENT_SOURCE_DIR}/DialogBase
     ${CMAKE_CURRENT_SOURCE_DIR}/common/LHLog
     ${CMAKE_CURRENT_SOURCE_DIR}/Network
+    ${CMAKE_CURRENT_SOURCE_DIR}/DataManager
 
     ${spdlog_INCLUDE_DIR}
     ${LHQLog_INCLUDE_DIRS}

+ 1 - 1
SettingLibrary/DataBase/GlobalVariable.cpp

@@ -34,7 +34,7 @@ CompareItemInfo_t& CompareItemInfo_t::operator=(const CompareItemInfo_t &other)
     nID = other.nID;
     strName = other.strName;
     isEnable = other.isEnable;
-    listChannels = other.listChannels;
+    listRoads = other.listRoads;
     muteParam = other.muteParam;
     overloadParam = other.overloadParam;
     phaseParam = other.phaseParam;

+ 57 - 27
SettingLibrary/DataBase/GlobalVariable.h

@@ -4,9 +4,58 @@
 
 #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 对比项信息在表格中的显示结构体
  * 
@@ -20,17 +69,15 @@ struct CompareItemTableItem_t
     int nChannelCount;          /* 通道数 */
 };
 
-/* ====================================================================
- * CompareItemInfo_t对比项结构体
- * ==================================================================== */
+
+
 /* 对比项的通道信息 */
-struct CompareItemChannelInfo_t
+struct CompareItemRoadInfo_t
 {
-    int nChannelID;             /* 通道ID */
-    QString strChannelName;     /* 通道名称 */
-    int nSoundCardNum;          /* 声卡通道编号 */
-    int strSoundCardName;       /* 声卡通道名称,可能使用这个名称打开录音通道 */
     bool isEnableRecord;        /* 是否开启录音 */
+    int nCompareRoadNum;        /* 对比通道编号,1是主通道,其余往后排 */
+    QString strCompareRoadName; /* 通道名称 */
+    SoundCardRoadInfo_t scRoadInfo; /* 声卡通道信息,包含声卡编号和通道编号 */
 };
 
 
@@ -50,7 +97,7 @@ struct CompareItemDetectParam_t
     bool isEnable = false;          /* 是否启用检测 */
     Threshold_t threshold;          /* 检测阈值 */
     int nLen = 0;                   /* 检测长度,单位秒 */
-    int nSensibility = 0.0;         /* 敏感度,0-100,0最不敏感,100最敏感 */
+    int nSensibility = 0;           /* 敏感度,0-100,0最不敏感,100最敏感 */
 
     CompareItemDetectParam_t() = default;
     CompareItemDetectParam_t(const CompareItemDetectParam_t &other);
@@ -66,7 +113,7 @@ struct CompareItemInfo_t
     int nID = -1;                               /* 对比项ID,对比项唯一识别号,不可更改 */
     QString strName;                            /* 对比项名称 */
     bool isEnable = false;                      /* 对比项状态,是否启用 */
-    QList<CompareItemChannelInfo_t> listChannels; /* 通道信息列表 */
+    QList<CompareItemRoadInfo_t> listRoads;     /* 通道信息列表 */
     CompareItemDetectParam_t muteParam;         /* 静音检测参数 */
     CompareItemDetectParam_t overloadParam;     /* 过载检测参数 */
     CompareItemDetectParam_t phaseParam;        /* 反相检测参数 */
@@ -77,23 +124,6 @@ struct CompareItemInfo_t
 };
 
 
-/* ====================================================================
- * 声卡相关信息结构体
- * ==================================================================== */
-
-/**
- * @brief 声卡信息,这里的信息都是设备上和物理声卡相关的
- * 
- */
-struct SoundCardInfo_t
-{
-    int nSoundCardNum;                  /* 声卡编号 */
-    QString strSoundCardID;             /* 声卡ID */
-    QString strSoundCardName;           /* 声卡名称 */
-    QString strSoundCardDriver;         /* 声卡驱动名称 */
-    
-    QList<int> listRecordChannels;      /* 录音通道列表,存储通道编号 */
-};
 
 
 

+ 54 - 0
SettingLibrary/DataManager/SoundCardData.cpp

@@ -0,0 +1,54 @@
+#include "SoundCardData.h"
+
+
+SoundCardDataManager::~SoundCardDataManager()
+{
+    m_listSoundCard.clear();
+}
+
+/* 初始化声卡列表 */
+void SoundCardDataManager::initSoundCardList(QList<SoundCardInfo_t>& listSoundCard)
+{
+    m_listSoundCard.clear();
+    m_listSoundCard = listSoundCard;
+
+    for(const auto& soundCard : m_listSoundCard)
+    {
+        SoundCardRoadInfo_t roadInfo;
+        roadInfo.nSoundCardNum = soundCard.nSoundCardNum;
+        roadInfo.strSoundCardID = soundCard.strSoundCardID;
+        roadInfo.strSoundCardName = soundCard.strSoundCardName;
+
+        for(const auto& road : soundCard.listRoad)
+        {
+            roadInfo.roadInfo = road; // 直接使用通道信息
+            m_listSoundCardRoad.append(roadInfo);
+        }
+    }
+}
+
+/* 根据声卡编号和录音通道编号获取声卡信息 */
+SoundCardRoadInfo_t SoundCardDataManager::getSoundCardRoadInfo(int nSoundCardNum, int nChannelID)
+{
+    for(const auto& soundCard : m_listSoundCardRoad)
+    {
+        if(soundCard.nSoundCardNum == nSoundCardNum && soundCard.roadInfo.nChannelID == nChannelID)
+        {
+            return soundCard; // 找到匹配的声卡和通道信息
+        }
+    }
+    SoundCardRoadInfo_t emptyInfo;
+    emptyInfo.nSoundCardNum = -1; // 未找到时返回无效信息
+    emptyInfo.strSoundCardID = "";
+    emptyInfo.strSoundCardName = "";
+    emptyInfo.roadInfo.nRoadNum = -1;
+    return emptyInfo;
+}
+
+/* 获取带有声卡信息的通道列表 */
+const QList<SoundCardRoadInfo_t>& SoundCardDataManager::getSoundCardRoadList() const
+{
+    return m_listSoundCardRoad;
+}
+
+

+ 40 - 0
SettingLibrary/DataManager/SoundCardData.h

@@ -2,6 +2,46 @@
 #define __SOUNDCARDDATA_H__
 
 #include "GlobalVariable.h"
+#include <qlist.h>
+
+
+/**
+ * @brief 声卡信息管理器
+ * 
+ */
+
+#define SoundCards SoundCardDataManager::getInstance()
+
+class SoundCardDataManager
+{
+
+    SoundCardDataManager() = default;
+    
+    SoundCardDataManager(const SoundCardDataManager&) = delete;
+    SoundCardDataManager& operator=(const SoundCardDataManager&) = delete;
+public:
+    ~SoundCardDataManager();
+    static SoundCardDataManager& getInstance()
+    {
+        static SoundCardDataManager instance;
+        return instance;
+    }
+    /* 初始化声卡列表 */
+    void initSoundCardList(QList<SoundCardInfo_t>& listSoundCard);
+
+    /* 获取声卡列表 */
+    const QList<SoundCardInfo_t>& getSoundCardList() const { return m_listSoundCard; }
+
+    /* 根据声卡编号和录音通道编号获取声卡信息 */
+    SoundCardRoadInfo_t getSoundCardRoadInfo(int nSoundCardNum, int nChannelID);
+    /* 获取带有声卡信息的通道列表 */
+    const QList<SoundCardRoadInfo_t>& getSoundCardRoadList() const;
+
+private:
+    QList<SoundCardInfo_t> m_listSoundCard;             /* 声卡信息列表 */
+    QList<SoundCardRoadInfo_t> m_listSoundCardRoad;     /* 带有声卡信息的通道列表,数据以上面的为准 */
+};
+
 
 
 

+ 1 - 1
SettingLibrary/Modules/Basic/CompareItemWidget.ui

@@ -131,7 +131,7 @@
              </widget>
             </item>
             <item>
-             <widget class="QLineEdit" name="lineEdit_6">
+             <widget class="QLineEdit" name="lineEdit_compareItmName">
               <property name="minimumSize">
                <size>
                 <width>320</width>

+ 55 - 5
SettingLibrary/Modules/Basic/compareitemdialog.cpp

@@ -2,6 +2,9 @@
 #include "ui_compareitemwidget.h"
 
 #include "UIStyleManager.h"
+#include "SoundCardData.h"
+#include "tipwidget.h"
+
 
 CompareItemDialog::CompareItemDialog(QWidget *parent)
     : DialogBase(parent)
@@ -27,6 +30,10 @@ CompareItemDialog::CompareItemDialog(QWidget *parent)
     ui->checkBoxOverload->setChecked(true);
     ui->checkBoxPhase->setChecked(true);
 
+    /* 设置已有两个通道的可选录音通道 */
+    ui->widget_mainRoad->setSoundCardRoadList(SoundCards.getSoundCardRoadList());
+    ui->widget_secondRoad->setSoundCardRoadList(SoundCards.getSoundCardRoadList());
+
     /* 设置样式 */
     setQSS();
 }
@@ -54,6 +61,8 @@ void CompareItemDialog::do_pBtn_add_clicked()
         connect(pWgt, &SingleCompareRoadWidget::deleted, this, &CompareItemDialog::do_CompareRoadWgtDeleted);
         pWgt->setIndex(m_listOtherRoadWgt.size() + 3);
         pWgt->setDelBtnVisible(true);
+        /* 设置可选通道列表 */
+        pWgt->setSoundCardRoadList(SoundCards.getSoundCardRoadList());
         pWgt->setStyleSheet(m_qssRecordRoad);
         pLayout->insertWidget(m_listOtherRoadWgt.size(), pWgt);
         m_listOtherRoadWgt.append(pWgt);
@@ -182,15 +191,56 @@ void CompareItemDialog::setMOPEditable(EDBType type, bool editable)
 bool CompareItemDialog::isOKClicked()
 {
     /* 获取对比项的信息 */
-    
+    if(!getCompareItemBaseInfo(m_compareItemInfo))
+    {
+        return false;
+    }
 
-    /* 获取主通道信息 */
+    /* 获取录音通道信息 */
+    if(!getCompareRoadInfo(m_compareItemInfo))
+    {
+        return false;
+    }
 
-    /* 获取第二通道信息 */
+    /* 获取音频检测信息 */
 
-    /* 获取其他通道信息 */
+    return true;
+}
 
-    /* 获取音频检测信息 */
+/* 获取对比项的基础信息 */
+bool CompareItemDialog::getCompareItemBaseInfo(CompareItemInfo_t& compareItemInfo)
+{
+    if(ui->lineEdit_compareItmName->text().isEmpty())
+    {
+        TipWidget::display(TipWidget::OPERATOR_WARN, "对比项名称不能为空");
+        return false;
+    }
+    compareItemInfo.strName = ui->lineEdit_compareItmName->text();
+    compareItemInfo.isEnable = ui->checkBox_enable->isChecked();
+
+    return true;
+}
+
+/* 获取各个通道信息 */
+bool CompareItemDialog::getCompareRoadInfo(CompareItemInfo_t& compareItemInfo)
+{
+    compareItemInfo.listRoads.clear();
+    /* 获取主通道信息 */
+    CompareItemRoadInfo_t mainRoadInfo;
+    mainRoadInfo.nCompareRoadNum = 1;
+    mainRoadInfo.strCompareRoadName = ui->widget_mainRoad->getRoadName();
+    if(mainRoadInfo.strCompareRoadName.isEmpty())
+    {
+        TipWidget::display(TipWidget::OPERATOR_WARN, "主通道名称不能为空");
+        return false;
+    }
+
+    return true;
+}
+
+/* 获取音频检测信息 */
+bool CompareItemDialog::getAudioDetectInfo(CompareItemInfo_t& compareItemInfo)
+{
 
     return true;
 }

+ 6 - 0
SettingLibrary/Modules/Basic/compareitemdialog.h

@@ -51,6 +51,12 @@ private:
     
     /* 重载按下关闭按钮之前的操作 */
     bool isOKClicked() override;
+    /* 获取对比项的基础信息 */
+    bool getCompareItemBaseInfo(CompareItemInfo_t& compareItemInfo);
+    /* 获取各个通道信息 */
+    bool getCompareRoadInfo(CompareItemInfo_t& compareItemInfo);
+    /* 获取音频检测信息 */
+    bool getAudioDetectInfo(CompareItemInfo_t& compareItemInfo);
 
 private:
     Ui::CompareItemWidget *ui;

+ 0 - 1293
SettingLibrary/Modules/Basic/compareitemdialog.ui

@@ -1,1293 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>CompareItemDialog</class>
- <widget class="QDialog" name="CompareItemDialog">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>1252</width>
-    <height>1032</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Dialog</string>
-  </property>
-  <property name="styleSheet">
-   <string notr="true">QWidget#widgetBackground
-{
-	background: #FFFFFF;
-	border-radius: 8px;
-}
-QWidget#widgetTop,#widgetMute,#widgetOverload,#widgetPhase
-{
-	border-bottom: 1px solid #E6E9F4;
-}
-
-QLabel
-{
-	font-weight: 400;
-	font-size: 14px;
-	color: #3A3F63;
-}
-QLabel#labelTitle
-{
-	font-weight: 500;
-	font-size: 18px;
-}
-QLabel#labelBase,#label
-{
-	font-weight: 500;
-	font-size: 16px;
-}
-QLabel#labelOtherRoad,#labelMute,#labelOverload,#labelPhase
-{
-	font-weight: 500;
-	font-size: 14px;
-}
-
-QPushButton#btnClose
-{
-	border-image: url(:/close.png);
-}
-QPushButton#btnClose:hover
-{
-	border-image: url(:/close_hover.png);
-}
-QPushButton#btnCancel
-{
-	background: #FFFFFF;
-	border-radius: 16px;
-	border: 1px solid #E6E9F4;
-	font-weight: 500;
-	font-size: 14px;
-	color: #3A3F63;
-}
-QPushButton#btnCancel:hover
-{
-	border: 1px solid #4458FE;
-	color: #4458FE;
-}
-QPushButton#btnOK
-{
-	background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 #4F8AFF, stop:1 #4B5EFF);
-	border-radius: 16px;
-	font-weight: 500;
-	font-size: 14px;
-	color: #FFFFFF;
-}
-QPushButton#btnOK:hover
-{
-	background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 #4F8AFF, stop:1 #7182ff);
-}
-QPushButton#btnAdd
-{
-	border-image: url(:/add.png);
-}
-QPushButton#btnAdd:hover
-{
-	border-image: url(:/add_hover.png);
-}
-
-QLineEdit
-{
-	background: #FFFFFF;
-	border-radius: 4px;
-	border: 1px solid #E6E9F4;
-	padding-left: 12px;
-	font-weight: 400;
-	font-size: 14px;
-	color: #3A3F63;
-}
-QLineEdit:hover,QLineEdit:focus
-{
-	border: 1px solid #4458FE;
-}
-
-QCheckBox#checkBoxItem
-{
-	font-weight: 400;
-	font-size: 14px;
-	color: #3A3F63;
-}
-QCheckBox#checkBoxItem::indicator
-{
-	width: 16px; 
-	height: 16px;
-}
-QCheckBox#checkBoxItem::indicator:unchecked
-{
-	image: url(:/unchecked.png);
-}
-QCheckBox#checkBoxItem::indicator:checked
-{
-	image: url(:/checked.png);
-}
-
-QCheckBox#checkBoxMute,#checkBoxOverload,#checkBoxPhase
-{
-	font-weight: 400;
-	font-size: 14px;
-	color: #3A3F63;
-}
-QCheckBox#checkBoxMute::indicator,
-#checkBoxOverload::indicator,
-#checkBoxPhase::indicator
-{
-	width: 44px; 
-	height: 22px;
-}
-QCheckBox#checkBoxMute::indicator:unchecked,
-#checkBoxOverload::indicator:unchecked,
-#checkBoxPhase::indicator:unchecked
-{
-	image: url(:/offswitch.png);
-}
-QCheckBox#checkBoxMute::indicator:checked,
-#checkBoxOverload::indicator:checked,
-#checkBoxPhase::indicator:checked
-{
-	image: url(:/onswitch.png);
-}
-
-QScrollArea,QWidget#scrollAreaWidgetContents
-{
-	background: transparent;
-	border: none;
-}
-
-QScrollBar:vertical
-{
-    width: 6px;
-	border:none;
-    background: transparent;
-    margin-right: 0px;
-}
-QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical
-{
-	background: transparent;
-	border: none;
-}
-QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical
-{
-	background: transparent;
-}
-QScrollBar::handle:vertical
-{
-    background: #E2E2E2;
-    border-radius: 1px;
-	margin-right: 1px;
-	margin-left: 1px;
-}
-QScrollBar::handle:vertical:hover
-{
-	background: rgb(234, 234, 234);
-	margin-right: 0px;
-	margin-left: 0px;
-	border-radius: 2px;
-}
-QScrollBar::handle:vertical:pressed
-{
-	background: rgb(234, 234, 234);
-	margin-right: 0px;
-	margin-left: 0px;
-	border-radius: 2px;
-}</string>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <property name="leftMargin">
-    <number>0</number>
-   </property>
-   <property name="topMargin">
-    <number>0</number>
-   </property>
-   <property name="rightMargin">
-    <number>0</number>
-   </property>
-   <property name="bottomMargin">
-    <number>0</number>
-   </property>
-   <property name="spacing">
-    <number>0</number>
-   </property>
-   <item row="0" column="0">
-    <widget class="QWidget" name="widgetBackground" native="true">
-     <layout class="QVBoxLayout" name="verticalLayout">
-      <property name="spacing">
-       <number>0</number>
-      </property>
-      <property name="leftMargin">
-       <number>0</number>
-      </property>
-      <property name="topMargin">
-       <number>0</number>
-      </property>
-      <property name="rightMargin">
-       <number>0</number>
-      </property>
-      <property name="bottomMargin">
-       <number>0</number>
-      </property>
-      <item>
-       <widget class="QWidget" name="widgetTop" native="true">
-        <property name="minimumSize">
-         <size>
-          <width>0</width>
-          <height>57</height>
-         </size>
-        </property>
-        <property name="maximumSize">
-         <size>
-          <width>16777215</width>
-          <height>57</height>
-         </size>
-        </property>
-        <layout class="QHBoxLayout" name="horizontalLayout">
-         <property name="spacing">
-          <number>0</number>
-         </property>
-         <property name="leftMargin">
-          <number>32</number>
-         </property>
-         <property name="topMargin">
-          <number>0</number>
-         </property>
-         <property name="rightMargin">
-          <number>16</number>
-         </property>
-         <property name="bottomMargin">
-          <number>0</number>
-         </property>
-         <item>
-          <widget class="QLabel" name="labelTitle">
-           <property name="text">
-            <string>对比项信息</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QPushButton" name="btnClose">
-           <property name="minimumSize">
-            <size>
-             <width>32</width>
-             <height>32</height>
-            </size>
-           </property>
-           <property name="maximumSize">
-            <size>
-             <width>32</width>
-             <height>32</height>
-            </size>
-           </property>
-           <property name="text">
-            <string/>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </widget>
-      </item>
-      <item>
-       <widget class="QWidget" name="widgetContent" native="true">
-        <layout class="QVBoxLayout" name="verticalLayout_4">
-         <property name="spacing">
-          <number>16</number>
-         </property>
-         <property name="leftMargin">
-          <number>32</number>
-         </property>
-         <property name="topMargin">
-          <number>32</number>
-         </property>
-         <property name="rightMargin">
-          <number>32</number>
-         </property>
-         <property name="bottomMargin">
-          <number>0</number>
-         </property>
-         <item>
-          <widget class="QWidget" name="widget_5" native="true">
-           <layout class="QVBoxLayout" name="verticalLayout_2">
-            <property name="spacing">
-             <number>16</number>
-            </property>
-            <property name="sizeConstraint">
-             <enum>QLayout::SetNoConstraint</enum>
-            </property>
-            <property name="leftMargin">
-             <number>0</number>
-            </property>
-            <property name="topMargin">
-             <number>0</number>
-            </property>
-            <property name="rightMargin">
-             <number>0</number>
-            </property>
-            <property name="bottomMargin">
-             <number>16</number>
-            </property>
-            <item>
-             <widget class="QLabel" name="labelBase">
-              <property name="text">
-               <string>基础信息</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QWidget" name="widget_3" native="true">
-              <property name="minimumSize">
-               <size>
-                <width>1094</width>
-                <height>32</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>1094</width>
-                <height>32</height>
-               </size>
-              </property>
-              <layout class="QHBoxLayout" name="horizontalLayout_3">
-               <property name="spacing">
-                <number>0</number>
-               </property>
-               <property name="leftMargin">
-                <number>0</number>
-               </property>
-               <property name="topMargin">
-                <number>0</number>
-               </property>
-               <property name="rightMargin">
-                <number>0</number>
-               </property>
-               <property name="bottomMargin">
-                <number>0</number>
-               </property>
-               <item>
-                <widget class="QLabel" name="label_11">
-                 <property name="minimumSize">
-                  <size>
-                   <width>92</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="maximumSize">
-                  <size>
-                   <width>92</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="text">
-                  <string>&lt;font color = #D21F21 &gt;*&lt;/font&gt;对比项名称:</string>
-                 </property>
-                 <property name="alignment">
-                  <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <widget class="QLineEdit" name="lineEdit_6">
-                 <property name="minimumSize">
-                  <size>
-                   <width>320</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="maximumSize">
-                  <size>
-                   <width>320</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <spacer name="horizontalSpacer_3">
-                 <property name="orientation">
-                  <enum>Qt::Horizontal</enum>
-                 </property>
-                 <property name="sizeType">
-                  <enum>QSizePolicy::Fixed</enum>
-                 </property>
-                 <property name="sizeHint" stdset="0">
-                  <size>
-                   <width>24</width>
-                   <height>20</height>
-                  </size>
-                 </property>
-                </spacer>
-               </item>
-               <item>
-                <widget class="QCheckBox" name="checkBoxItem">
-                 <property name="text">
-                  <string>勾选启用该对比项,否则不做任何检测及对比,同时客户端界面上也不显示</string>
-                 </property>
-                </widget>
-               </item>
-              </layout>
-             </widget>
-            </item>
-            <item>
-             <widget class="SingleCompareRoadWidget" name="widget_4" native="true">
-              <property name="minimumSize">
-               <size>
-                <width>1106</width>
-                <height>32</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>1106</width>
-                <height>32</height>
-               </size>
-              </property>
-              <property name="bDelBtnVisible" stdset="0">
-               <bool>false</bool>
-              </property>
-              <property name="nIndex" stdset="0">
-               <number>1</number>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="SingleCompareRoadWidget" name="widget_2" native="true">
-              <property name="minimumSize">
-               <size>
-                <width>1106</width>
-                <height>32</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>1106</width>
-                <height>32</height>
-               </size>
-              </property>
-              <property name="bDelBtnVisible" stdset="0">
-               <bool>false</bool>
-              </property>
-              <property name="nIndex" stdset="0">
-               <number>2</number>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QWidget" name="widget" native="true">
-              <property name="minimumSize">
-               <size>
-                <width>0</width>
-                <height>224</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>16777215</width>
-                <height>224</height>
-               </size>
-              </property>
-              <layout class="QVBoxLayout" name="verticalLayout_3">
-               <property name="spacing">
-                <number>16</number>
-               </property>
-               <property name="leftMargin">
-                <number>0</number>
-               </property>
-               <property name="topMargin">
-                <number>0</number>
-               </property>
-               <property name="rightMargin">
-                <number>0</number>
-               </property>
-               <property name="bottomMargin">
-                <number>0</number>
-               </property>
-               <item>
-                <widget class="QWidget" name="widget_6" native="true">
-                 <layout class="QHBoxLayout" name="horizontalLayout_5">
-                  <property name="spacing">
-                   <number>8</number>
-                  </property>
-                  <property name="leftMargin">
-                   <number>0</number>
-                  </property>
-                  <property name="topMargin">
-                   <number>0</number>
-                  </property>
-                  <property name="rightMargin">
-                   <number>0</number>
-                  </property>
-                  <property name="bottomMargin">
-                   <number>0</number>
-                  </property>
-                  <item>
-                   <widget class="QLabel" name="labelOtherRoad">
-                    <property name="text">
-                     <string>其他通道</string>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <widget class="QPushButton" name="pBtn_add">
-                    <property name="minimumSize">
-                     <size>
-                      <width>32</width>
-                      <height>32</height>
-                     </size>
-                    </property>
-                    <property name="maximumSize">
-                     <size>
-                      <width>32</width>
-                      <height>32</height>
-                     </size>
-                    </property>
-                    <property name="text">
-                     <string/>
-                    </property>
-                   </widget>
-                  </item>
-                  <item>
-                   <spacer name="horizontalSpacer_4">
-                    <property name="orientation">
-                     <enum>Qt::Horizontal</enum>
-                    </property>
-                    <property name="sizeHint" stdset="0">
-                     <size>
-                      <width>40</width>
-                      <height>20</height>
-                     </size>
-                    </property>
-                   </spacer>
-                  </item>
-                 </layout>
-                </widget>
-               </item>
-               <item>
-                <widget class="QScrollArea" name="scrollArea">
-                 <property name="verticalScrollBarPolicy">
-                  <enum>Qt::ScrollBarAsNeeded</enum>
-                 </property>
-                 <property name="horizontalScrollBarPolicy">
-                  <enum>Qt::ScrollBarAlwaysOff</enum>
-                 </property>
-                 <property name="widgetResizable">
-                  <bool>true</bool>
-                 </property>
-                 <widget class="QWidget" name="scrollAreaWidgetContents">
-                  <property name="geometry">
-                   <rect>
-                    <x>0</x>
-                    <y>0</y>
-                    <width>1188</width>
-                    <height>176</height>
-                   </rect>
-                  </property>
-                  <layout class="QVBoxLayout" name="verticalLayout_6">
-                   <property name="spacing">
-                    <number>16</number>
-                   </property>
-                   <property name="leftMargin">
-                    <number>0</number>
-                   </property>
-                   <property name="topMargin">
-                    <number>0</number>
-                   </property>
-                   <property name="rightMargin">
-                    <number>0</number>
-                   </property>
-                   <property name="bottomMargin">
-                    <number>0</number>
-                   </property>
-                   <item>
-                    <spacer name="verticalSpacer">
-                     <property name="orientation">
-                      <enum>Qt::Vertical</enum>
-                     </property>
-                     <property name="sizeHint" stdset="0">
-                      <size>
-                       <width>20</width>
-                       <height>173</height>
-                      </size>
-                     </property>
-                    </spacer>
-                   </item>
-                  </layout>
-                 </widget>
-                </widget>
-               </item>
-              </layout>
-             </widget>
-            </item>
-           </layout>
-          </widget>
-         </item>
-         <item>
-          <widget class="QWidget" name="widget_7" native="true">
-           <layout class="QVBoxLayout" name="verticalLayout_5">
-            <property name="spacing">
-             <number>16</number>
-            </property>
-            <property name="leftMargin">
-             <number>0</number>
-            </property>
-            <property name="topMargin">
-             <number>0</number>
-            </property>
-            <property name="rightMargin">
-             <number>0</number>
-            </property>
-            <property name="bottomMargin">
-             <number>0</number>
-            </property>
-            <item>
-             <widget class="QLabel" name="label">
-              <property name="minimumSize">
-               <size>
-                <width>0</width>
-                <height>16</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>16777215</width>
-                <height>16</height>
-               </size>
-              </property>
-              <property name="text">
-               <string>音频监测配置</string>
-              </property>
-             </widget>
-            </item>
-            <item>
-             <widget class="QWidget" name="widgetMute" native="true">
-              <property name="minimumSize">
-               <size>
-                <width>0</width>
-                <height>116</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>16777215</width>
-                <height>116</height>
-               </size>
-              </property>
-              <widget class="QLabel" name="labelMute">
-               <property name="geometry">
-                <rect>
-                 <x>0</x>
-                 <y>0</y>
-                 <width>41</width>
-                 <height>14</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>静音</string>
-               </property>
-              </widget>
-              <widget class="QLabel" name="label_3">
-               <property name="geometry">
-                <rect>
-                 <x>0</x>
-                 <y>30</y>
-                 <width>70</width>
-                 <height>22</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>静音检测:</string>
-               </property>
-              </widget>
-              <widget class="QCheckBox" name="checkBoxMute">
-               <property name="geometry">
-                <rect>
-                 <x>70</x>
-                 <y>30</y>
-                 <width>76</width>
-                 <height>22</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>开启</string>
-               </property>
-              </widget>
-              <widget class="QLabel" name="label_4">
-               <property name="geometry">
-                <rect>
-                 <x>0</x>
-                 <y>68</y>
-                 <width>70</width>
-                 <height>32</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>静音阈值:</string>
-               </property>
-              </widget>
-              <widget class="QLineEdit" name="lineEditMuteThreshold">
-               <property name="geometry">
-                <rect>
-                 <x>82</x>
-                 <y>68</y>
-                 <width>78</width>
-                 <height>32</height>
-                </rect>
-               </property>
-              </widget>
-              <widget class="QLabel" name="label_5">
-               <property name="geometry">
-                <rect>
-                 <x>164</x>
-                 <y>68</y>
-                 <width>82</width>
-                 <height>32</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>(40~84)dBFS</string>
-               </property>
-              </widget>
-              <widget class="QLabel" name="label_6">
-               <property name="geometry">
-                <rect>
-                 <x>70</x>
-                 <y>68</y>
-                 <width>5</width>
-                 <height>32</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>-</string>
-               </property>
-              </widget>
-              <widget class="QLabel" name="label_7">
-               <property name="geometry">
-                <rect>
-                 <x>270</x>
-                 <y>68</y>
-                 <width>70</width>
-                 <height>32</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>判断时长:</string>
-               </property>
-              </widget>
-              <widget class="QLineEdit" name="lineEditMuteLen">
-               <property name="geometry">
-                <rect>
-                 <x>340</x>
-                 <y>68</y>
-                 <width>90</width>
-                 <height>32</height>
-                </rect>
-               </property>
-              </widget>
-              <widget class="QLabel" name="label_8">
-               <property name="geometry">
-                <rect>
-                 <x>434</x>
-                 <y>68</y>
-                 <width>61</width>
-                 <height>32</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>(2~90)s</string>
-               </property>
-              </widget>
-              <widget class="QLabel" name="label_9">
-               <property name="geometry">
-                <rect>
-                 <x>684</x>
-                 <y>68</y>
-                 <width>81</width>
-                 <height>32</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>(22~100)%</string>
-               </property>
-              </widget>
-              <widget class="QLabel" name="label_10">
-               <property name="geometry">
-                <rect>
-                 <x>506</x>
-                 <y>68</y>
-                 <width>84</width>
-                 <height>32</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>静音灵敏度:</string>
-               </property>
-              </widget>
-              <widget class="QLineEdit" name="lineEditMuteSensibility">
-               <property name="geometry">
-                <rect>
-                 <x>590</x>
-                 <y>68</y>
-                 <width>90</width>
-                 <height>32</height>
-                </rect>
-               </property>
-              </widget>
-             </widget>
-            </item>
-            <item>
-             <widget class="QWidget" name="widgetOverload" native="true">
-              <property name="minimumSize">
-               <size>
-                <width>0</width>
-                <height>116</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>16777215</width>
-                <height>116</height>
-               </size>
-              </property>
-              <widget class="QLabel" name="labelOverload">
-               <property name="geometry">
-                <rect>
-                 <x>0</x>
-                 <y>0</y>
-                 <width>41</width>
-                 <height>14</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>过载</string>
-               </property>
-              </widget>
-              <widget class="QLabel" name="label_13">
-               <property name="geometry">
-                <rect>
-                 <x>0</x>
-                 <y>30</y>
-                 <width>70</width>
-                 <height>22</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>过载检测:</string>
-               </property>
-              </widget>
-              <widget class="QCheckBox" name="checkBoxOverload">
-               <property name="geometry">
-                <rect>
-                 <x>70</x>
-                 <y>30</y>
-                 <width>76</width>
-                 <height>22</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>开启</string>
-               </property>
-              </widget>
-              <widget class="QLabel" name="label_14">
-               <property name="geometry">
-                <rect>
-                 <x>0</x>
-                 <y>68</y>
-                 <width>70</width>
-                 <height>32</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>过载阈值:</string>
-               </property>
-              </widget>
-              <widget class="QLineEdit" name="lineEditOverloadThreshold">
-               <property name="geometry">
-                <rect>
-                 <x>82</x>
-                 <y>68</y>
-                 <width>78</width>
-                 <height>32</height>
-                </rect>
-               </property>
-              </widget>
-              <widget class="QLabel" name="label_15">
-               <property name="geometry">
-                <rect>
-                 <x>164</x>
-                 <y>68</y>
-                 <width>82</width>
-                 <height>32</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>(0~40)dBFS</string>
-               </property>
-              </widget>
-              <widget class="QLabel" name="label_16">
-               <property name="geometry">
-                <rect>
-                 <x>70</x>
-                 <y>68</y>
-                 <width>5</width>
-                 <height>32</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>-</string>
-               </property>
-              </widget>
-              <widget class="QLabel" name="label_17">
-               <property name="geometry">
-                <rect>
-                 <x>270</x>
-                 <y>68</y>
-                 <width>70</width>
-                 <height>32</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>判断时长:</string>
-               </property>
-              </widget>
-              <widget class="QLineEdit" name="lineEditOverloadLen">
-               <property name="geometry">
-                <rect>
-                 <x>340</x>
-                 <y>68</y>
-                 <width>90</width>
-                 <height>32</height>
-                </rect>
-               </property>
-              </widget>
-              <widget class="QLabel" name="label_18">
-               <property name="geometry">
-                <rect>
-                 <x>434</x>
-                 <y>68</y>
-                 <width>61</width>
-                 <height>32</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>(2~90)s</string>
-               </property>
-              </widget>
-              <widget class="QLabel" name="label_19">
-               <property name="geometry">
-                <rect>
-                 <x>684</x>
-                 <y>68</y>
-                 <width>81</width>
-                 <height>32</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>(22~100)%</string>
-               </property>
-              </widget>
-              <widget class="QLabel" name="label_20">
-               <property name="geometry">
-                <rect>
-                 <x>506</x>
-                 <y>68</y>
-                 <width>84</width>
-                 <height>32</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>过载灵敏度:</string>
-               </property>
-              </widget>
-              <widget class="QLineEdit" name="lineEditOverloadSensibility">
-               <property name="geometry">
-                <rect>
-                 <x>590</x>
-                 <y>68</y>
-                 <width>90</width>
-                 <height>32</height>
-                </rect>
-               </property>
-              </widget>
-             </widget>
-            </item>
-            <item>
-             <widget class="QWidget" name="widgetPhase" native="true">
-              <property name="minimumSize">
-               <size>
-                <width>0</width>
-                <height>116</height>
-               </size>
-              </property>
-              <property name="maximumSize">
-               <size>
-                <width>16777215</width>
-                <height>116</height>
-               </size>
-              </property>
-              <widget class="QLabel" name="labelPhase">
-               <property name="geometry">
-                <rect>
-                 <x>0</x>
-                 <y>0</y>
-                 <width>41</width>
-                 <height>14</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>反相</string>
-               </property>
-              </widget>
-              <widget class="QLabel" name="label_22">
-               <property name="geometry">
-                <rect>
-                 <x>0</x>
-                 <y>30</y>
-                 <width>70</width>
-                 <height>22</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>反相检测:</string>
-               </property>
-              </widget>
-              <widget class="QCheckBox" name="checkBoxPhase">
-               <property name="geometry">
-                <rect>
-                 <x>70</x>
-                 <y>30</y>
-                 <width>76</width>
-                 <height>22</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>开启</string>
-               </property>
-              </widget>
-              <widget class="QLabel" name="label_23">
-               <property name="geometry">
-                <rect>
-                 <x>0</x>
-                 <y>68</y>
-                 <width>70</width>
-                 <height>32</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>反相阈值:</string>
-               </property>
-              </widget>
-              <widget class="QLineEdit" name="lineEditPhaseThreshold">
-               <property name="geometry">
-                <rect>
-                 <x>82</x>
-                 <y>68</y>
-                 <width>78</width>
-                 <height>32</height>
-                </rect>
-               </property>
-              </widget>
-              <widget class="QLabel" name="label_24">
-               <property name="geometry">
-                <rect>
-                 <x>164</x>
-                 <y>68</y>
-                 <width>82</width>
-                 <height>32</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>(0~0.99)</string>
-               </property>
-              </widget>
-              <widget class="QLabel" name="label_25">
-               <property name="geometry">
-                <rect>
-                 <x>70</x>
-                 <y>68</y>
-                 <width>5</width>
-                 <height>32</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>-</string>
-               </property>
-              </widget>
-              <widget class="QLabel" name="label_26">
-               <property name="geometry">
-                <rect>
-                 <x>270</x>
-                 <y>68</y>
-                 <width>70</width>
-                 <height>32</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>判断时长:</string>
-               </property>
-              </widget>
-              <widget class="QLineEdit" name="lineEditPhaseLen">
-               <property name="geometry">
-                <rect>
-                 <x>340</x>
-                 <y>68</y>
-                 <width>90</width>
-                 <height>32</height>
-                </rect>
-               </property>
-              </widget>
-              <widget class="QLabel" name="label_27">
-               <property name="geometry">
-                <rect>
-                 <x>434</x>
-                 <y>68</y>
-                 <width>61</width>
-                 <height>32</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>(10~90)s</string>
-               </property>
-              </widget>
-              <widget class="QLabel" name="label_28">
-               <property name="geometry">
-                <rect>
-                 <x>684</x>
-                 <y>68</y>
-                 <width>81</width>
-                 <height>32</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>(22~100)%</string>
-               </property>
-              </widget>
-              <widget class="QLabel" name="label_29">
-               <property name="geometry">
-                <rect>
-                 <x>506</x>
-                 <y>68</y>
-                 <width>84</width>
-                 <height>32</height>
-                </rect>
-               </property>
-               <property name="text">
-                <string>反相灵敏度:</string>
-               </property>
-              </widget>
-              <widget class="QLineEdit" name="lineEditPhaseSensibility">
-               <property name="geometry">
-                <rect>
-                 <x>590</x>
-                 <y>68</y>
-                 <width>90</width>
-                 <height>32</height>
-                </rect>
-               </property>
-              </widget>
-             </widget>
-            </item>
-           </layout>
-          </widget>
-         </item>
-        </layout>
-       </widget>
-      </item>
-      <item>
-       <widget class="QWidget" name="widgetBottom" native="true">
-        <property name="minimumSize">
-         <size>
-          <width>0</width>
-          <height>96</height>
-         </size>
-        </property>
-        <property name="maximumSize">
-         <size>
-          <width>16777215</width>
-          <height>96</height>
-         </size>
-        </property>
-        <layout class="QHBoxLayout" name="horizontalLayout_2">
-         <property name="spacing">
-          <number>16</number>
-         </property>
-         <property name="leftMargin">
-          <number>32</number>
-         </property>
-         <property name="topMargin">
-          <number>0</number>
-         </property>
-         <property name="rightMargin">
-          <number>32</number>
-         </property>
-         <property name="bottomMargin">
-          <number>0</number>
-         </property>
-         <item>
-          <spacer name="horizontalSpacer">
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>40</width>
-             <height>20</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="btnCancel">
-           <property name="minimumSize">
-            <size>
-             <width>60</width>
-             <height>32</height>
-            </size>
-           </property>
-           <property name="maximumSize">
-            <size>
-             <width>60</width>
-             <height>32</height>
-            </size>
-           </property>
-           <property name="text">
-            <string>取消</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QPushButton" name="btnOK">
-           <property name="minimumSize">
-            <size>
-             <width>60</width>
-             <height>32</height>
-            </size>
-           </property>
-           <property name="maximumSize">
-            <size>
-             <width>60</width>
-             <height>32</height>
-            </size>
-           </property>
-           <property name="text">
-            <string>确定</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>SingleCompareRoadWidget</class>
-   <extends>QWidget</extends>
-   <header>Modules/Basic/singlecompareroadwidget.h</header>
-   <container>1</container>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>

+ 4 - 1
SettingLibrary/Modules/Basic/compareitemlistdialog.h

@@ -28,7 +28,10 @@ protected:
 
 
 
-
+/**
+ * @brief 对比项列表弹窗
+ * 
+ */
 namespace Ui {
 class CompareItemListWidget;
 }

+ 17 - 3
SettingLibrary/Modules/Basic/singlecompareroadwidget.cpp

@@ -26,6 +26,19 @@ void SingleCompareRoadWidget::setDelBtnVisible(bool bVisible)
     ui->btnDel->setVisible(bVisible);
 }
 
+
+/* 设置声卡通道列表 */
+void SingleCompareRoadWidget::setSoundCardRoadList(const QList<SoundCardRoadInfo_t>& listRoad)
+{
+    ui->comboBox_soundCardNum->clear();
+    for(const auto& road : listRoad)
+    {
+        /* 显示的内容 声卡名:通道号 */
+        QString str = QString("%1:%2").arg(road.strSoundCardName).arg(road.roadInfo.nRoadNum);
+        ui->comboBox_soundCardNum->addItem(str, QVariant::fromValue(road));
+    }
+}
+
 int SingleCompareRoadWidget::getIndex() const
 {
     return m_nIndex;
@@ -49,10 +62,11 @@ QString SingleCompareRoadWidget::getRoadName() const
 }
 
 /* 获取声卡录音通道编号 */
-int SingleCompareRoadWidget::getSoundCardRoadNum() const
+SoundCardRoadInfo_t SingleCompareRoadWidget::getSoundCardRoadInfo()
 {
-    /* 声卡要做映射,并取出映射值 */
-    return 0;
+    SoundCardRoadInfo_t roadInfo;
+    roadInfo = ui->comboBox_soundCardNum->currentData().value<SoundCardRoadInfo_t>();
+    return roadInfo;
 }
 
 /* 是否开启录音 */

+ 7 - 1
SettingLibrary/Modules/Basic/singlecompareroadwidget.h

@@ -3,6 +3,8 @@
 
 #include <QWidget>
 
+#include "SoundCardData.h"
+
 namespace Ui {
 class SingleCompareRoadWidget;
 }
@@ -18,16 +20,20 @@ public:
     explicit SingleCompareRoadWidget(QWidget *parent = nullptr);
     ~SingleCompareRoadWidget();
 
+    /* 设置删除按钮是否可见 */
     bool isDelBtnVisible() const;
     void setDelBtnVisible(bool bVisible);
 
+    /* 设置声卡通道列表 */
+    void setSoundCardRoadList(const QList<SoundCardRoadInfo_t>& listRoad);
+
     /* 获取设置编号 */
     int getIndex() const;
     void setIndex(int nIndex);
     /* 获取通道名称 */
     QString getRoadName() const;
     /* 获取声卡录音通道编号 */
-    int getSoundCardRoadNum() const;
+    SoundCardRoadInfo_t getSoundCardRoadInfo();
     /* 是否开启录音 */
     bool isRecordEnabled() const;