本文整理汇总了C++中AE_DSP_ADDON::GetString方法的典型用法代码示例。如果您正苦于以下问题:C++ AE_DSP_ADDON::GetString方法的具体用法?C++ AE_DSP_ADDON::GetString怎么用?C++ AE_DSP_ADDON::GetString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AE_DSP_ADDON
的用法示例。
在下文中一共展示了AE_DSP_ADDON::GetString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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 = addon->GetString(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;
}
示例2: helper_GetDialogId
int CGUIDialogAudioDSPManager::helper_GetDialogId(CActiveAEDSPModePtr &ModePointer, AE_DSP_MENUHOOK_CAT &MenuHook, AE_DSP_ADDON &Addon, string AddonName)
{
int dialogId = 0;
if (ModePointer->HasSettingsDialog())
{
AE_DSP_MENUHOOKS hooks;
// Find first general settings dialog about mode
if (CActiveAEDSP::GetInstance().GetMenuHooks(ModePointer->AddonID(), AE_DSP_MENUHOOK_SETTING, hooks))
{
for (unsigned int i = 0; i < hooks.size() && dialogId == 0; i++)
{
if (hooks[i].iRelevantModeId == ModePointer->AddonModeNumber())
{
dialogId = hooks[i].iHookId;
}
}
}
// If nothing was present, check for playback settings
if (dialogId == 0 && CActiveAEDSP::GetInstance().GetMenuHooks(ModePointer->AddonID(), MenuHook, hooks))
{
for (unsigned int i = 0; i < hooks.size() && (dialogId == 0 || dialogId != -1); i++)
{
if (hooks[i].iRelevantModeId == ModePointer->AddonModeNumber())
{
if (!hooks[i].bNeedPlayback)
{
dialogId = hooks[i].iHookId;
}
else
{
dialogId = -1;
}
}
}
}
if (dialogId == 0)
CLog::Log(LOGERROR, "DSP Dialog Manager - %s - Present marked settings dialog of mode %s on addon %s not found",
__FUNCTION__,
Addon->GetString(ModePointer->ModeName()).c_str(),
AddonName.c_str());
}
return dialogId;
}
示例3: CFileItem
CFileItem *CGUIDialogAudioDSPManager::helper_CreateModeListItem(CActiveAEDSPModePtr &ModePointer, AE_DSP_MENUHOOK_CAT &MenuHook, int *ContinuesNo)
{
CFileItem *pItem = NULL;
if (!ContinuesNo)
{
return pItem;
}
// start to get Addon and Mode properties
const int AddonID = ModePointer->AddonID();
string addonName;
if (!CActiveAEDSP::GetInstance().GetAudioDSPAddonName(AddonID, addonName))
{
return pItem;
}
AE_DSP_ADDON addon;
if (!CActiveAEDSP::GetInstance().GetAudioDSPAddon(AddonID, addon))
{
return pItem;
}
string modeName = addon->GetString(ModePointer->ModeName());
string description;
if (ModePointer->ModeDescription() > -1)
{
description = addon->GetString(ModePointer->ModeDescription());
}
else
{
description = g_localizeStrings.Get(15063);
}
bool isActive = ModePointer->IsEnabled();
int number = ModePointer->ModePosition();
int dialogId = helper_GetDialogId(ModePointer, MenuHook, addon, addonName);
// end to get Addon and Mode properties
if (isActive)
{
if (number <= 0)
{
number = *ContinuesNo;
(*ContinuesNo)++;
}
string str = StringUtils::Format("%i:%i:%i:%s",
number,
AddonID,
ModePointer->AddonModeNumber(),
ModePointer->AddonModeName().c_str());
pItem = new CFileItem(str);
}
else
{
pItem = new CFileItem(modeName);
}
// set list item properties
pItem->SetProperty("ActiveMode", isActive);
pItem->SetProperty("Number", number);
pItem->SetProperty("Name", modeName);
pItem->SetProperty("Description", description);
pItem->SetProperty("Help", ModePointer->ModeHelp());
pItem->SetProperty("Icon", ModePointer->IconOwnModePath());
pItem->SetProperty("SettingsDialog", dialogId);
pItem->SetProperty("AddonId", AddonID);
pItem->SetProperty("AddonModeNumber", ModePointer->AddonModeNumber());
pItem->SetProperty("AddonName", addonName);
pItem->SetProperty("Changed", false);
return pItem;
}
示例4: OnContextButton
bool CGUIDialogAudioDSPManager::OnContextButton(int itemNumber, CONTEXT_BUTTON button, int listType)
{
CFileItemPtr pItem;
int listSize = 0;
if (listType == LIST_ACTIVE)
{
pItem = m_activeItems[m_iCurrentType]->Get(itemNumber);
listSize = m_activeItems[m_iCurrentType]->Size();
}
else if (listType == LIST_AVAILABLE)
{
pItem = m_availableItems[m_iCurrentType]->Get(itemNumber);
listSize = m_availableItems[m_iCurrentType]->Size();
}
/* Check file item is in list range and get his pointer */
if (!pItem || itemNumber < 0 || itemNumber >= listSize)
{
return false;
}
if (button == CONTEXT_BUTTON_HELP)
{
/*!
* Open audio dsp addon mode help text dialog
*/
AE_DSP_ADDON addon;
if (CActiveAEDSP::GetInstance().GetAudioDSPAddon((int)pItem->GetProperty("AddonId").asInteger(), addon))
{
CGUIDialogTextViewer* pDlgInfo = (CGUIDialogTextViewer*)g_windowManager.GetWindow(WINDOW_DIALOG_TEXT_VIEWER);
pDlgInfo->SetHeading(g_localizeStrings.Get(15062) + " - " + pItem->GetProperty("Name").asString());
pDlgInfo->SetText(addon->GetString((uint32_t)pItem->GetProperty("Help").asInteger()));
pDlgInfo->Open();
}
}
else if (button == CONTEXT_BUTTON_ACTIVATE)
{
/*!
* Deactivate selected processing mode
*/
if (pItem->GetProperty("ActiveMode").asBoolean())
{
// remove mode from active mode list and add it to available mode list
CFileItemPtr newItem(dynamic_cast<CFileItem*>(pItem->Clone()));
newItem->SetProperty("ActiveMode", false);
newItem->SetProperty("Changed", true);
m_activeItems[m_iCurrentType]->Remove(itemNumber);
m_availableItems[m_iCurrentType]->Add(newItem);
}
else
{
/*!
* Activate selected processing mode
*/
if ((m_iCurrentType == AE_DSP_MODE_TYPE_INPUT_RESAMPLE || m_iCurrentType == AE_DSP_MODE_TYPE_OUTPUT_RESAMPLE) && m_activeItems[m_iCurrentType]->Size() > 0)
{ // if there is already an active resampler, now we remove it
CFileItemPtr activeResampler = m_activeItems[m_iCurrentType]->Get(0);
if (activeResampler)
{
CFileItemPtr newItem(dynamic_cast<CFileItem*>(activeResampler->Clone()));
newItem->SetProperty("ActiveMode", false);
newItem->SetProperty("Changed", true);
m_availableItems[m_iCurrentType]->Add(newItem);
// clear active list, because only one active resampling mode is supported by ActiveAEDSP
m_activeItems[m_iCurrentType]->Clear();
}
}
// remove mode from available mode list and add it to active mode list
CFileItemPtr newItem(dynamic_cast<CFileItem*>(pItem->Clone()));
newItem->SetProperty("Number", (int)m_activeItems[m_iCurrentType]->Size() +1);
newItem->SetProperty("Changed", true);
newItem->SetProperty("ActiveMode", true);
m_availableItems[m_iCurrentType]->Remove(itemNumber);
m_activeItems[m_iCurrentType]->Add(newItem);
}
m_bContainsChanges = true;
if (m_bContinousSaving)
{
SaveList();
}
// reorder available mode list, so that the mode order is always consistent
m_availableItems[m_iCurrentType]->ClearSortState();
m_availableItems[m_iCurrentType]->Sort(SortByLabel, SortOrderAscending);
// update active and available mode list
Renumber();
m_availableViewControl.SetItems(*m_availableItems[m_iCurrentType]);
m_activeViewControl.SetItems(*m_activeItems[m_iCurrentType]);
}
else if (button == CONTEXT_BUTTON_MOVE)
{
m_bMovingMode = true;
pItem->Select(true);
//.........这里部分代码省略.........