void CAddonCallbacksADSP::ADSPAddMenuHook(void *addonData, AE_DSP_MENUHOOK *hook) { CActiveAEDSPAddon *client = GetAudioDSPAddon(addonData); if (!hook || !client) { CLog::Log(LOGERROR, "Audio DSP - %s - invalid handler data", __FUNCTION__); return; } AE_DSP_MENUHOOKS *hooks = client->GetMenuHooks(); if (hooks) { AE_DSP_MENUHOOK hookInt; hookInt.iHookId = hook->iHookId; hookInt.iLocalizedStringId = hook->iLocalizedStringId; hookInt.category = hook->category; hookInt.iRelevantModeId = hook->iRelevantModeId; hookInt.bNeedPlayback = hook->bNeedPlayback; /* add this new hook */ hooks->push_back(hookInt); } }
void CActiveAEDSPAddon::cb_remove_menu_hook(void *kodiInstance, AE_DSP_MENUHOOK *hook) { CActiveAEDSPAddon *client = static_cast<CActiveAEDSPAddon*>(kodiInstance); if (!hook || !client) { CLog::Log(LOGERROR, "Audio DSP - %s - invalid handler data", __FUNCTION__); return; } AE_DSP_MENUHOOKS *hooks = client->GetMenuHooks(); if (hooks) { for (unsigned int i = 0; i < hooks->size(); i++) { if (hooks->at(i).iHookId == hook->iHookId) { /* remove this hook */ hooks->erase(hooks->begin()+i); break; } } } }
void CAddonCallbacksADSP::ADSPRemoveMenuHook(void *addonData, AE_DSP_MENUHOOK *hook) { CActiveAEDSPAddon *client = GetAudioDSPAddon(addonData); if (!hook || !client) { CLog::Log(LOGERROR, "Audio DSP - %s - invalid handler data", __FUNCTION__); return; } AE_DSP_MENUHOOKS *hooks = client->GetMenuHooks(); if (hooks) { for (unsigned int i = 0; i < hooks->size(); i++) { if (hooks->at(i).iHookId == hook->iHookId) { /* remove this hook */ hooks->erase(hooks->begin()+i); break; } } } }
void CActiveAEDSPAddon::cb_add_menu_hook(void *kodiInstance, AE_DSP_MENUHOOK *hook) { CActiveAEDSPAddon *client = static_cast<CActiveAEDSPAddon*>(kodiInstance); if (!hook || !client) { CLog::Log(LOGERROR, "Audio DSP - %s - invalid handler data", __FUNCTION__); return; } AE_DSP_MENUHOOKS *hooks = client->GetMenuHooks(); if (hooks) { AE_DSP_MENUHOOK hookInt; hookInt.iHookId = hook->iHookId; hookInt.iLocalizedStringId = hook->iLocalizedStringId; hookInt.category = hook->category; hookInt.iRelevantModeId = hook->iRelevantModeId; hookInt.bNeedPlayback = hook->bNeedPlayback; /* add this new hook */ hooks->push_back(hookInt); } }