#ifndef __SOUNDCARDDATA_H__ #define __SOUNDCARDDATA_H__ #include "GlobalVariable.h" #include /** * @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& mapSoundInfo); /* 获取声卡列表 */ const std::map& 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 m_mapSoundCardInfo; std::map m_mapSoundCardInfo; /* 当前选择的声卡 */ SoundCardPCMInfo_t m_currentSoundCardInfo; /* 带有声卡信息的通道列表,设置当前声卡信息的时候会更新 */ // QList m_listSoundCardRoad; }; #endif // __SOUNDCARDDATA_H__