Пример #1
0
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;
}
Пример #2
0
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;
}
Пример #3
0
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;
}