本文整理汇总了C++中AE_DSP_ADDON类的典型用法代码示例。如果您正苦于以下问题:C++ AE_DSP_ADDON类的具体用法?C++ AE_DSP_ADDON怎么用?C++ AE_DSP_ADDON使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AE_DSP_ADDON类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetSettingsLabel
std::string CGUIDialogAudioDSPSettings::GetSettingsLabel(CSetting *pSetting)
{
if (pSetting->GetLabel() == 15041)
{
const std::string &settingId = pSetting->GetId();
int ptr = -1;
AE_DSP_ADDON addon;
if (settingId.substr(0, 27) == SETTING_STREAM_INFO_MODE_CPU_USAGE)
{
ptr = strtol(settingId.substr(27).c_str(), NULL, 0);
if (ptr >= 0 && CActiveAEDSP::GetInstance().GetAudioDSPAddon(m_ActiveModes[ptr]->AddonID(), addon))
return m_ActiveModesData[ptr].MenuName;
}
else
{
if (settingId.substr(0, 21) == SETTING_AUDIO_MASTER_SETTINGS_MENUS)
ptr = strtol(settingId.substr(21).c_str(), NULL, 0);
else if (settingId.substr(0, 19) == SETTING_AUDIO_PROC_SETTINGS_MENUS)
ptr = strtol(settingId.substr(19).c_str(), NULL, 0);
if (ptr >= 0 && CActiveAEDSP::GetInstance().GetAudioDSPAddon(m_Menus[ptr].addonId, addon))
return g_localizeStrings.GetAddonString(addon->ID(), m_Menus[ptr].hook.iLocalizedStringId);
}
}
return GetLocalizedString(pSetting->GetLabel());
}
示例2: bReturn
bool CActiveAEDSP::GetAudioDSPAddonName(int iAddonId, std::string &strName) const
{
bool bReturn(false);
AE_DSP_ADDON addon;
if ((bReturn = GetReadyAudioDSPAddon(iAddonId, addon)) == true)
strName = addon->GetAudioDSPName();
return bReturn;
}
示例3: GetAudioDSPAddon
void CActiveAEDSP::UpdateAddons()
{
AE_DSP_ADDON dspAddon;
BinaryAddonBaseList addonInfos;
CServiceBroker::GetBinaryAddonManager().GetAddonInfos(addonInfos, false, ADDON_ADSPDLL);
if (addonInfos.empty())
return;
for (auto &addonInfo : addonInfos)
{
bool bEnabled = !CServiceBroker::GetAddonMgr().IsAddonDisabled(addonInfo->ID());
if (bEnabled && (!IsKnownAudioDSPAddon(addonInfo->ID()) || !IsReadyAudioDSPAddon(addonInfo)))
{
std::hash<std::string> hasher;
int iAddonId = static_cast<int>(hasher(addonInfo->ID()));
if (iAddonId < 0)
iAddonId = -iAddonId;
if (IsKnownAudioDSPAddon(addonInfo->ID()))
{
AE_DSP_ADDON dspAddon;
GetAudioDSPAddon(iAddonId, dspAddon);
dspAddon->Create(iAddonId);
}
else
{
AE_DSP_ADDON dspAddon = std::make_shared<CActiveAEDSPAddon>(addonInfo);
dspAddon.get()->Create(iAddonId);
CSingleLock lock(m_critSection);
// register the add-on
if (m_addonMap.find(iAddonId) == m_addonMap.end())
{
m_addonMap.insert(std::make_pair(iAddonId, dspAddon));
m_addonNameIds.insert(make_pair(addonInfo->ID(), iAddonId));
}
}
}
else if (!bEnabled && IsKnownAudioDSPAddon(addonInfo->ID()))
{
CLog::Log(LOGDEBUG, "Disabling AudioDSP add-on: %s", addonInfo->ID().c_str());
CSingleLock lock(m_critSection);
AE_DSP_ADDONMAP::iterator iter = m_addonMap.find(GetAudioDSPAddonId(addonInfo->ID()));
if (iter != m_addonMap.end())
{
m_addonMap.erase(iter);
m_addonToDestroy.push_back(dspAddon);
}
}
}
TriggerModeUpdate();
}
示例4: GetAudioDSPAddon
void CActiveAEDSP::UpdateAddons()
{
VECADDONS addons;
AE_DSP_ADDON dspAddon;
CAddonMgr::GetInstance().GetAddons(addons, ADDON_ADSPDLL);
if (addons.empty())
return;
for (auto &addon : addons)
{
bool bEnabled = !CAddonMgr::GetInstance().IsAddonDisabled(addon->ID());
if (bEnabled && (!IsKnownAudioDSPAddon(addon) || !IsReadyAudioDSPAddon(addon)))
{
std::hash<std::string> hasher;
int iAddonId = static_cast<int>(hasher(addon->ID()));
if (iAddonId < 0)
iAddonId = -iAddonId;
/* create and open database */
if (!m_databaseDSP.IsOpen())
m_databaseDSP.Open();
if (IsKnownAudioDSPAddon(addon))
{
AE_DSP_ADDON dspAddon;
GetAudioDSPAddon(iAddonId, dspAddon);
dspAddon->Create(iAddonId);
}
else
{
AE_DSP_ADDON dspAddon = std::dynamic_pointer_cast<CActiveAEDSPAddon>(addon);
if (!dspAddon)
{
CLog::Log(LOGERROR, "CActiveAEDSP::UpdateAndInitialiseAddons - severe error, incorrect add type");
continue;
}
dspAddon.get()->Create(iAddonId);
// register the add-on
if (m_addonMap.find(iAddonId) == m_addonMap.end())
{
m_addonMap.insert(std::make_pair(iAddonId, dspAddon));
m_addonNameIds.insert(make_pair(addon->ID(), iAddonId));
}
}
}
}
TriggerModeUpdate();
}
示例5: lock
//@{
bool CActiveAEDSP::StopAudioDSPAddon(AddonPtr addon, bool bRestart)
{
CSingleLock lock(m_critSection);
int iId = GetAudioDSPAddonId(addon);
AE_DSP_ADDON mappedAddon;
if (GetReadyAudioDSPAddon(iId, mappedAddon))
{
if (bRestart)
mappedAddon->ReCreate();
else
mappedAddon->Destroy();
return true;
}
return false;
}
示例6: UpdateAddons
bool CActiveAEDSP::UpdateAddons(void)
{
VECADDONS addons;
AE_DSP_ADDON dspAddon;
bool bReturn(CAddonMgr::GetInstance().GetAddons(ADDON_ADSPDLL, addons, true));
size_t usableAddons;
if (bReturn)
{
CSingleLock lock(m_critUpdateSection);
m_addons = addons;
}
usableAddons = m_addons.size();
/* handle "new" addons which aren't yet in the db - these have to be added first */
for (VECADDONS::const_iterator itr = addons.begin(); itr != addons.end(); ++itr)
{
dspAddon = std::dynamic_pointer_cast<CActiveAEDSPAddon>(*itr);
bool newRegistration = false;
if (RegisterAudioDSPAddon(dspAddon, &newRegistration) < 0 || newRegistration)
{
CAddonMgr::GetInstance().DisableAddon(dspAddon->ID());
--usableAddons;
}
}
if ((!bReturn || usableAddons == 0) && !m_noAddonWarningDisplayed &&
!CAddonMgr::GetInstance().HasAddons(ADDON_ADSPDLL, false) &&
IsActivated())
{
// No audio DSP add-ons could be found
// You need a add-on installed for the process of audio DSP signal. System becomes disabled.
m_noAddonWarningDisplayed = true;
CGUIDialogOK::ShowAndGetInput(CVariant{19273}, CVariant{19274});
CSettings::GetInstance().SetBool(CSettings::SETTING_AUDIOOUTPUT_DSPADDONSENABLED, false);
CGUIMessage msg(GUI_MSG_UPDATE, WINDOW_SETTINGS_SYSTEM, 0);
g_windowManager.SendThreadMessage(msg, WINDOW_SETTINGS_SYSTEM);
CApplicationMessenger::GetInstance().SendMsg(TMSG_SETAUDIODSPSTATE, ACTIVE_AE_DSP_STATE_OFF);
}
return bReturn;
}
示例7: GetAudioDSPMenus
void CGUIDialogAudioDSPSettings::GetAudioDSPMenus(CSettingGroup *group, AE_DSP_MENUHOOK_CAT category)
{
AE_DSP_ADDONMAP addonMap;
if (CActiveAEDSP::GetInstance().GetEnabledAudioDSPAddons(addonMap) > 0)
{
for (AE_DSP_ADDONMAP_ITR itr = addonMap.begin(); itr != addonMap.end(); itr++)
{
AE_DSP_MENUHOOKS hooks;
if (CActiveAEDSP::GetInstance().GetMenuHooks(itr->second->GetID(), category, hooks))
{
for (unsigned int i = 0; i < hooks.size(); i++)
{
if (category != hooks[i].category || (category != AE_DSP_MENUHOOK_MISCELLANEOUS &&
!m_ActiveStreamProcess->IsMenuHookModeActive(hooks[i].category, itr->second->GetID(), hooks[i].iRelevantModeId)))
continue;
MenuHookMember menu;
menu.addonId = itr->second->GetID();
menu.hook.category = hooks[i].category;
menu.hook.iHookId = hooks[i].iHookId;
menu.hook.iLocalizedStringId = hooks[i].iLocalizedStringId;
menu.hook.iRelevantModeId = hooks[i].iRelevantModeId;
m_Menus.push_back(menu);
}
}
}
}
for (unsigned int i = 0; i < m_Menus.size(); i++)
{
AE_DSP_ADDON addon;
if (CActiveAEDSP::GetInstance().GetAudioDSPAddon(m_Menus[i].addonId, addon) && category == m_Menus[i].hook.category)
{
std::string modeName = g_localizeStrings.GetAddonString(addon->ID(), m_Menus[i].hook.iLocalizedStringId);
if (modeName.empty())
modeName = g_localizeStrings.Get(15041);
std::string setting = StringUtils::Format("%s%i", SETTING_AUDIO_PROC_SETTINGS_MENUS, i);
AddButton(group, setting, 15041, 0);
}
}
}
示例8: OpenAudioDSPMenu
bool CGUIDialogAudioDSPSettings::OpenAudioDSPMenu(unsigned int setupEntry)
{
if (setupEntry >= m_Menus.size())
return false;
AE_DSP_ADDON addon;
if (!CActiveAEDSP::GetInstance().GetAudioDSPAddon(m_Menus[setupEntry].addonId, addon))
return false;
AE_DSP_MENUHOOK hook;
AE_DSP_MENUHOOK_DATA hookData;
hook.category = m_Menus[setupEntry].hook.category;
hook.iHookId = m_Menus[setupEntry].hook.iHookId;
hook.iLocalizedStringId = m_Menus[setupEntry].hook.iLocalizedStringId;
hook.iRelevantModeId = m_Menus[setupEntry].hook.iRelevantModeId;
hookData.category = m_Menus[setupEntry].hook.category;
switch (hookData.category)
{
case AE_DSP_MENUHOOK_PRE_PROCESS:
case AE_DSP_MENUHOOK_MASTER_PROCESS:
case AE_DSP_MENUHOOK_RESAMPLE:
case AE_DSP_MENUHOOK_POST_PROCESS:
hookData.data.iStreamId = m_ActiveStreamId;
break;
default:
break;
}
/*!
* @note the addon dialog becomes always opened on the back of Kodi ones for this reason a
* "<animation effect="fade" start="100" end="0" time="400" condition="Window.IsVisible(Addon)">Conditional</animation>"
* on skin is needed to hide dialog.
*/
addon->CallMenuHook(hook, hookData);
return true;
}
示例9: helper_GetDialogId
int CGUIDialogAudioDSPManager::helper_GetDialogId(CActiveAEDSPModePtr &ModePointer, AE_DSP_MENUHOOK_CAT &MenuHook, AE_DSP_ADDON &Addon, std::string AddonName)
{
int dialogId = 0;
if (ModePointer->HasSettingsDialog())
{
AE_DSP_MENUHOOKS hooks;
if (dialogId == 0)
CLog::Log(LOGERROR, "DSP Dialog Manager - %s - Present marked settings dialog of mode %s on addon %s not found",
__FUNCTION__,
g_localizeStrings.GetAddonString(Addon->ID(), ModePointer->ModeName()).c_str(),
AddonName.c_str());
}
return dialogId;
}
示例10: GetReadyAudioDSPAddon
bool CActiveAEDSP::GetReadyAudioDSPAddon(int iAddonId, AE_DSP_ADDON &addon) const
{
if (GetAudioDSPAddon(iAddonId, addon))
return addon->ReadyToUse();
return false;
}
示例11: AddCategory
void CGUIDialogAudioDSPSettings::InitializeSettings()
{
CGUIDialogSettingsManualBase::InitializeSettings();
CSettingCategory *category = AddCategory(SETTING_AUDIO_CAT_MAIN, -1);
if (category == NULL)
{
CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings category 'audiodspmainsettings'");
return;
}
// get all necessary setting groups
CSettingGroup *groupAudioModeSel = AddGroup(category);
if (groupAudioModeSel == NULL)
{
CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings group 'groupAudioModeSel'");
return;
}
CSettingGroup *groupAudioVolumeSel = AddGroup(category);
if (groupAudioVolumeSel == NULL)
{
CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings group 'groupAudioVolumeSel'");
return;
}
CSettingGroup *groupAudioSubmenuSel = AddGroup(category);
if (groupAudioSubmenuSel == NULL)
{
CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings group 'groupAudioSubmenuSel'");
return;
}
CSettingGroup *groupSaveAsDefault = AddGroup(category);
if (groupSaveAsDefault == NULL)
{
CLog::Log(LOGERROR, "CGUIDialogAudioDSPSettings: unable to setup settings group 'groupSaveAsDefault'");
return;
}
bool usePopup = g_SkinInfo->HasSkinFile("DialogSlider.xml");
CVideoSettings &videoSettings = CMediaSettings::GetInstance().GetCurrentVideoSettings();
m_audioCaps.clear();
if (g_application.m_pPlayer->HasPlayer())
g_application.m_pPlayer->GetAudioCapabilities(m_audioCaps);
m_ActiveStreamId = CActiveAEDSP::GetInstance().GetActiveStreamId();
m_ActiveStreamProcess = CActiveAEDSP::GetInstance().GetDSPProcess(m_ActiveStreamId);
if (m_ActiveStreamId == (unsigned int)-1 || !m_ActiveStreamProcess)
{
m_iCategory = FindCategoryIndex(SETTING_AUDIO_CAT_MAIN);
Close(true);
return;
}
int modeUniqueId;
m_ActiveStreamProcess->GetMasterModeTypeInformation(m_streamTypeUsed, m_baseTypeUsed, modeUniqueId);
int modesAvailable = 0;
for (int i = 0; i < AE_DSP_ASTREAM_AUTO; i++)
{
m_MasterModes[i].clear();
m_ActiveStreamProcess->GetAvailableMasterModes((AE_DSP_STREAMTYPE)i, m_MasterModes[i]);
if (!m_MasterModes[i].empty()) modesAvailable++;
}
if (modesAvailable > 0)
{
/* about size() > 1, it is always the fallback (ignore of master processing) present. */
StaticIntegerSettingOptions modeEntries;
if (m_MasterModes[AE_DSP_ASTREAM_BASIC].size() > 1)
modeEntries.push_back(std::pair<int, int>(CActiveAEDSP::GetInstance().GetStreamTypeName(AE_DSP_ASTREAM_BASIC), AE_DSP_ASTREAM_BASIC));
if (m_MasterModes[AE_DSP_ASTREAM_MUSIC].size() > 1)
modeEntries.push_back(std::pair<int, int>(CActiveAEDSP::GetInstance().GetStreamTypeName(AE_DSP_ASTREAM_MUSIC), AE_DSP_ASTREAM_MUSIC));
if (m_MasterModes[AE_DSP_ASTREAM_MOVIE].size() > 1)
modeEntries.push_back(std::pair<int, int>(CActiveAEDSP::GetInstance().GetStreamTypeName(AE_DSP_ASTREAM_MOVIE), AE_DSP_ASTREAM_MOVIE));
if (m_MasterModes[AE_DSP_ASTREAM_GAME].size() > 1)
modeEntries.push_back(std::pair<int, int>(CActiveAEDSP::GetInstance().GetStreamTypeName(AE_DSP_ASTREAM_GAME), AE_DSP_ASTREAM_GAME));
if (m_MasterModes[AE_DSP_ASTREAM_APP].size() > 1)
modeEntries.push_back(std::pair<int, int>(CActiveAEDSP::GetInstance().GetStreamTypeName(AE_DSP_ASTREAM_APP), AE_DSP_ASTREAM_APP));
if (m_MasterModes[AE_DSP_ASTREAM_MESSAGE].size() > 1)
modeEntries.push_back(std::pair<int, int>(CActiveAEDSP::GetInstance().GetStreamTypeName(AE_DSP_ASTREAM_MESSAGE), AE_DSP_ASTREAM_MESSAGE));
if (m_MasterModes[AE_DSP_ASTREAM_PHONE].size() > 1)
modeEntries.push_back(std::pair<int, int>(CActiveAEDSP::GetInstance().GetStreamTypeName(AE_DSP_ASTREAM_PHONE), AE_DSP_ASTREAM_PHONE));
if (modesAvailable > 1 && m_MasterModes[m_streamTypeUsed].size() > 1)
modeEntries.insert(modeEntries.begin(), std::pair<int, int>(CActiveAEDSP::GetInstance().GetStreamTypeName(AE_DSP_ASTREAM_AUTO), AE_DSP_ASTREAM_AUTO));
AddSpinner(groupAudioModeSel,
SETTING_AUDIO_MAIN_STREAMTYPE, 15021, 0,
(AE_DSP_STREAMTYPE)CMediaSettings::GetInstance().GetCurrentAudioSettings().m_MasterStreamTypeSel,
modeEntries);
}
bool AddonMasterModeSetupPresent = false;
m_ModeList.clear();
for (unsigned int i = 0; i < m_MasterModes[m_streamTypeUsed].size(); i++)
{
if (m_MasterModes[m_streamTypeUsed][i])
{
AE_DSP_ADDON addon;
int modeId = m_MasterModes[m_streamTypeUsed][i]->ModeID();
//.........这里部分代码省略.........