123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #ifndef __SOUNDCARDDATA_H__
- #define __SOUNDCARDDATA_H__
- #include "GlobalVariable.h"
- #include <qlist.h>
- /**
- * @brief 声卡信息管理器
- * 1、这里可以设置当前声卡信息,获取当前选择的声卡信息,以免多个窗口声卡传递链特别长
- *
- */
- #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 setSoundCardInfo(std::map<std::string, SoundCardPCMInfo_t>& mapSoundInfo);
- /* 获取声卡列表 */
- const std::map<std::string, SoundCardPCMInfo_t>& getSoundCardInfo() const { return m_mapSoundCardInfo; }
- /* 设置当前声卡 */
- bool setCurrentSoundCard(std::string strSoundCardName);
- /* 获取当前声卡信息 */
- const SoundCardPCMInfo_t& getCurrentSoundCardInfo() const { return m_currentSoundCardInfo; }
-
- void setShowSoundCardDesc(bool bShow) { m_isShowSoundCardDesc = bShow; }
- bool isShowSoundCardDesc() const { return m_isShowSoundCardDesc; }
- private:
- bool m_isShowSoundCardDesc = false; /* 是否显示PCM通道的描述信息,为false,则显示PCM名 */
- /* 声卡信息,key为声卡编号 */
- // QMap<int, SoundCardInfo_t> m_mapSoundCardInfo;
- std::map<std::string, SoundCardPCMInfo_t> m_mapSoundCardInfo;
- /* 当前选择的声卡 */
- SoundCardPCMInfo_t m_currentSoundCardInfo;
- /* 带有声卡信息的通道列表,设置当前声卡信息的时候会更新 */
- // QList<SoundCardRoadInfo_t> m_listSoundCardRoad;
- };
- #endif // __SOUNDCARDDATA_H__
|