本文整理汇总了C++中AE_DSP_ADDON::ID方法的典型用法代码示例。如果您正苦于以下问题:C++ AE_DSP_ADDON::ID方法的具体用法?C++ AE_DSP_ADDON::ID怎么用?C++ AE_DSP_ADDON::ID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AE_DSP_ADDON
的用法示例。
在下文中一共展示了AE_DSP_ADDON::ID方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: TranslateCharInfo
bool CActiveAEDSP::TranslateCharInfo(DWORD dwInfo, std::string &strValue) const
{
bool bReturn(true);
CSingleLock lock(m_critSection);
if (!IsProcessing() || !m_usedProcesses[m_activeProcessId])
return false;
CActiveAEDSPModePtr activeMaster = m_usedProcesses[m_activeProcessId]->GetActiveMasterMode();
if (activeMaster == NULL)
return false;
switch (dwInfo)
{
case ADSP_ACTIVE_STREAM_TYPE:
strValue = g_localizeStrings.Get(GetStreamTypeName(m_usedProcesses[m_activeProcessId]->GetUsedStreamType()));
break;
case ADSP_DETECTED_STREAM_TYPE:
strValue = g_localizeStrings.Get(GetStreamTypeName(m_usedProcesses[m_activeProcessId]->GetDetectedStreamType()));
break;
case ADSP_MASTER_NAME:
{
AE_DSP_ADDON addon;
int modeId = activeMaster->ModeID();
if (modeId == AE_DSP_MASTER_MODE_ID_PASSOVER || modeId >= AE_DSP_MASTER_MODE_ID_INTERNAL_TYPES)
strValue = g_localizeStrings.Get(activeMaster->ModeName());
else if (CActiveAEDSP::GetInstance().GetAudioDSPAddon(activeMaster->AddonID(), addon))
strValue = g_localizeStrings.GetAddonString(addon->ID(), activeMaster->ModeName());
}
break;
case ADSP_MASTER_INFO:
bReturn = m_usedProcesses[m_activeProcessId]->GetMasterModeStreamInfoString(strValue);
break;
case ADSP_MASTER_OWN_ICON:
strValue = activeMaster->IconOwnModePath();
break;
case ADSP_MASTER_OVERRIDE_ICON:
strValue = activeMaster->IconOverrideModePath();
break;
default:
strValue.clear();
bReturn = false;
break;
};
return bReturn;
}
示例3: 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;
}
示例4: 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;
}
示例5: 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);
}
}
}
示例6: UpdateAndInitialiseAudioDSPAddons
bool CActiveAEDSP::UpdateAndInitialiseAudioDSPAddons(bool bInitialiseAllAudioDSPAddons /* = false */)
{
bool bReturn(true);
VECADDONS map;
VECADDONS disableAddons;
{
CSingleLock lock(m_critUpdateSection);
map = m_addons;
}
if (map.empty())
return false;
for (unsigned iAddonPtr = 0; iAddonPtr < map.size(); ++iAddonPtr)
{
const AddonPtr dspAddon = map.at(iAddonPtr);
bool bEnabled = !CAddonMgr::GetInstance().IsAddonDisabled(dspAddon->ID());
if (!bEnabled && IsKnownAudioDSPAddon(dspAddon))
{
CSingleLock lock(m_critUpdateSection);
/* stop the dsp addon and remove it from the db */
StopAudioDSPAddon(dspAddon, false);
VECADDONS::iterator addonPtr = std::find(m_addons.begin(), m_addons.end(), dspAddon);
if (addonPtr != m_addons.end())
m_addons.erase(addonPtr);
}
else if (bEnabled && (bInitialiseAllAudioDSPAddons || !IsKnownAudioDSPAddon(dspAddon) || !IsReadyAudioDSPAddon(dspAddon)))
{
bool bDisabled(false);
/* register the add-on in the audio dsp db, and create the CActiveAEDSPAddon instance */
int iAddonId = RegisterAudioDSPAddon(dspAddon);
if (iAddonId < 0)
{
/* failed to register or create the add-on, disable it */
CLog::Log(LOGWARNING, "ActiveAE DSP - %s - failed to register add-on %s, disabling it", __FUNCTION__, dspAddon->Name().c_str());
disableAddons.push_back(dspAddon);
bDisabled = true;
}
else
{
ADDON_STATUS status(ADDON_STATUS_UNKNOWN);
AE_DSP_ADDON addon;
{
CSingleLock lock(m_critUpdateSection);
if (!GetAudioDSPAddon(iAddonId, addon))
{
CLog::Log(LOGWARNING, "ActiveAE DSP - %s - failed to find add-on %s, disabling it", __FUNCTION__, dspAddon->Name().c_str());
disableAddons.push_back(dspAddon);
bDisabled = true;
}
}
/* re-check the enabled status. newly installed dsps get disabled when they're added to the db */
if (!bDisabled && !CAddonMgr::GetInstance().IsAddonDisabled(addon->ID()) && (status = addon->Create(iAddonId)) != ADDON_STATUS_OK)
{
CLog::Log(LOGWARNING, "ActiveAE DSP - %s - failed to create add-on %s, status = %d", __FUNCTION__, dspAddon->Name().c_str(), status);
if (!addon.get() || !addon->DllLoaded() || status == ADDON_STATUS_PERMANENT_FAILURE)
{
/* failed to load the dll of this add-on, disable it */
CLog::Log(LOGWARNING, "ActiveAE DSP - %s - failed to load the dll for add-on %s, disabling it", __FUNCTION__, dspAddon->Name().c_str());
disableAddons.push_back(dspAddon);
bDisabled = true;
}
}
}
if (bDisabled && IsActivated())
CGUIDialogOK::ShowAndGetInput(24070, 24071, 16029, 0);
}
}
/* disable add-ons that failed to initialise */
if (!disableAddons.empty())
{
CSingleLock lock(m_critUpdateSection);
for (VECADDONS::iterator itr = disableAddons.begin(); itr != disableAddons.end(); ++itr)
{
/* disable in the add-on db */
CAddonMgr::GetInstance().DisableAddon((*itr)->ID());
/* remove from the audio dsp add-on list */
VECADDONS::iterator addonPtr = std::find(m_addons.begin(), m_addons.end(), *itr);
if (addonPtr != m_addons.end())
m_addons.erase(addonPtr);
}
}
return bReturn;
}
示例7: InitializeSettings
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();
//.........这里部分代码省略.........