bool CActiveAEDSP::TranslateCharInfo(DWORD dwInfo, std::string &strValue) const { bool bReturn = false; CSingleLock lock(m_critSection); if (m_activeProcessId < 0) { return false; } 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: bReturn = true; strValue = g_localizeStrings.Get(GetStreamTypeName(m_usedProcesses[m_activeProcessId]->GetUsedStreamType())); break; case ADSP_DETECTED_STREAM_TYPE: bReturn = true; strValue = g_localizeStrings.Get(GetStreamTypeName(m_usedProcesses[m_activeProcessId]->GetDetectedStreamType())); break; case ADSP_MASTER_NAME: { bReturn = true; 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()); } break; case ADSP_MASTER_INFO: bReturn = m_usedProcesses[m_activeProcessId]->GetMasterModeStreamInfoString(strValue); break; case ADSP_MASTER_OWN_ICON: bReturn = true; strValue = activeMaster->IconOwnModePath(); break; case ADSP_MASTER_OVERRIDE_ICON: bReturn = true; strValue = activeMaster->IconOverrideModePath(); break; default: strValue.clear(); bReturn = false; break; }; return bReturn; }
bool CActiveAEDSPDatabase::PersistModes(vector<CActiveAEDSPModePtr> &modes, int modeType) { bool bReturn(true); for (unsigned int iModePtr = 0; iModePtr < modes.size(); iModePtr++) { CActiveAEDSPModePtr member = modes.at(iModePtr); if (!member->IsInternal() && (member->IsChanged() || member->IsNew())) { bReturn &= AddUpdateMode(*member); } } bReturn &= CommitInsertQueries(); return bReturn; }
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; }
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; // Find first general settings dialog about mode if (CServiceBroker::GetADSP().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 && CServiceBroker::GetADSP().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__, g_localizeStrings.GetAddonString(Addon->ID(), ModePointer->ModeName()).c_str(), AddonName.c_str()); } return dialogId; }