本文整理汇总了C++中CAddonDll::Author方法的典型用法代码示例。如果您正苦于以下问题:C++ CAddonDll::Author方法的具体用法?C++ CAddonDll::Author怎么用?C++ CAddonDll::Author使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAddonDll
的用法示例。
在下文中一共展示了CAddonDll::Author方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_addon_info
char* Interface_General::get_addon_info(void* kodiBase, const char* id)
{
CAddonDll* addon = static_cast<CAddonDll*>(kodiBase);
if (addon == nullptr || id == nullptr)
{
CLog::Log(LOGERROR, "Interface_General::%s - invalid data (addon='%p', id='%p')", __FUNCTION__, addon, id);
return nullptr;
}
std::string str;
if (strcmpi(id, "author") == 0)
str = addon->Author();
else if (strcmpi(id, "changelog") == 0)
str = addon->ChangeLog();
else if (strcmpi(id, "description") == 0)
str = addon->Description();
else if (strcmpi(id, "disclaimer") == 0)
str = addon->Disclaimer();
else if (strcmpi(id, "fanart") == 0)
str = addon->FanArt();
else if (strcmpi(id, "icon") == 0)
str = addon->Icon();
else if (strcmpi(id, "id") == 0)
str = addon->ID();
else if (strcmpi(id, "name") == 0)
str = addon->Name();
else if (strcmpi(id, "path") == 0)
str = addon->Path();
else if (strcmpi(id, "profile") == 0)
str = addon->Profile();
else if (strcmpi(id, "summary") == 0)
str = addon->Summary();
else if (strcmpi(id, "type") == 0)
str = ADDON::CAddonInfo::TranslateType(addon->Type());
else if (strcmpi(id, "version") == 0)
str = addon->Version().asString();
else
{
CLog::Log(LOGERROR, "Interface_General::%s - add-on '%s' requests invalid id '%s'",
__FUNCTION__, addon->Name().c_str(), id);
return nullptr;
}
char* buffer = strdup(str.c_str());
return buffer;
}
示例2: create
//@{
void* Interface_GUIWindow::create(void* kodiBase, const char* xml_filename,
const char* default_skin, bool as_dialog, bool is_media)
{
CAddonDll* addon = static_cast<CAddonDll*>(kodiBase);
if (!addon || !xml_filename || !default_skin)
{
CLog::Log(LOGERROR, "Interface_GUIWindow::%s - invalid handler data (xml_filename='%p', default_skin='%p') on addon '%s'",
__FUNCTION__, xml_filename, default_skin, addon ? addon->ID().c_str() : "unknown");
return nullptr;
}
if (as_dialog && is_media)
{
CLog::Log(LOGWARNING, "Interface_GUIWindow::%s: %s/%s - addon tries to create dialog as media window who not allowed, contact Developer '%s' of this addon",
__FUNCTION__, CAddonInfo::TranslateType(addon->Type()).c_str(), addon->Name().c_str(), addon->Author().c_str());
}
RESOLUTION_INFO res;
std::string strSkinPath = g_SkinInfo->GetSkinPath(xml_filename, &res);
if (!XFILE::CFile::Exists(strSkinPath))
{
std::string str("none");
ADDON::CAddonInfo addonInfo(str, ADDON::ADDON_SKIN);
// Check for the matching folder for the skin in the fallback skins folder
std::string fallbackPath = URIUtils::AddFileToFolder(addon->Path(), "resources", "skins");
std::string basePath = URIUtils::AddFileToFolder(fallbackPath, g_SkinInfo->ID());
strSkinPath = g_SkinInfo->GetSkinPath(xml_filename, &res, basePath);
// Check for the matching folder for the skin in the fallback skins folder (if it exists)
if (XFILE::CFile::Exists(basePath))
{
addonInfo.SetPath(basePath);
ADDON::CSkinInfo skinInfo(addonInfo, res);
skinInfo.Start();
strSkinPath = skinInfo.GetSkinPath(xml_filename, &res);
}
if (!XFILE::CFile::Exists(strSkinPath))
{
// Finally fallback to the DefaultSkin as it didn't exist in either the Kodi Skin folder or the fallback skin folder
addonInfo.SetPath(URIUtils::AddFileToFolder(fallbackPath, default_skin));
ADDON::CSkinInfo skinInfo(addonInfo, res);
skinInfo.Start();
strSkinPath = skinInfo.GetSkinPath(xml_filename, &res);
if (!XFILE::CFile::Exists(strSkinPath))
{
CLog::Log(LOGERROR, "Interface_GUIWindow::%s: %s/%s - XML File '%s' for Window is missing, contact Developer '%s' of this addon",
__FUNCTION__, CAddonInfo::TranslateType(addon->Type()).c_str(), addon->Name().c_str(), strSkinPath.c_str(), addon->Author().c_str());
return nullptr;
}
}
}
int id = GetNextAvailableWindowId();
if (id < 0)
return nullptr;
CGUIWindow *window;
if (!as_dialog)
window = new CGUIAddonWindow(id, strSkinPath, addon, is_media);
else
window = new CGUIAddonWindowDialog(id, strSkinPath, addon);
Interface_GUIGeneral::lock();
g_windowManager.Add(window);
Interface_GUIGeneral::unlock();
if (!dynamic_cast<CGUIWindow*>(g_windowManager.GetWindow(id)))
{
CLog::Log(LOGERROR, "Interface_GUIWindow::%s - Requested window id '%i' does not exist for addon '%s'",
__FUNCTION__, id, addon->ID().c_str());
delete window;
return nullptr;
}
window->SetCoordsRes(res);
return window;
}