本文整理汇总了C++中PLT_Service::FindActionDesc方法的典型用法代码示例。如果您正苦于以下问题:C++ PLT_Service::FindActionDesc方法的具体用法?C++ PLT_Service::FindActionDesc怎么用?C++ PLT_Service::FindActionDesc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PLT_Service
的用法示例。
在下文中一共展示了PLT_Service::FindActionDesc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: action
/*----------------------------------------------------------------------
| PLT_MediaBrowser::Browse
+---------------------------------------------------------------------*/
NPT_Result
PLT_MediaBrowser::Browse(PLT_DeviceDataReference& device,
const char* obj_id,
NPT_UInt32 start_index,
NPT_UInt32 count,
bool browse_metadata,
const char* filter,
const char* sort_criteria,
void* userdata)
{
// look for the service
PLT_Service* service;
NPT_String type;
type = "urn:schemas-upnp-org:service:ContentDirectory:1";
if (NPT_FAILED(device->FindServiceByType(type, service))) {
NPT_LOG_WARNING_1("Service %s not found", (const char*)type);
return NPT_FAILURE;
}
PLT_ActionDesc* action_desc = service->FindActionDesc("Browse");
if (action_desc == NULL) {
NPT_LOG_WARNING("Action Browse not found in service");
return NPT_FAILURE;
}
PLT_ActionReference action(new PLT_Action(action_desc));
// Set the object id
PLT_Arguments args;
if (NPT_FAILED(action->SetArgumentValue("ObjectID", obj_id))) {
return NPT_ERROR_INVALID_PARAMETERS;
}
// set the browse_flag
if (NPT_FAILED(action->SetArgumentValue("BrowseFlag", browse_metadata?"BrowseMetadata":"BrowseDirectChildren"))) {
return NPT_ERROR_INVALID_PARAMETERS;
}
// set the Filter
if (NPT_FAILED(action->SetArgumentValue("Filter", filter))) {
return NPT_ERROR_INVALID_PARAMETERS;
}
// set the Starting Index
if (NPT_FAILED(action->SetArgumentValue("StartingIndex", NPT_String::FromInteger(start_index)))) {
return NPT_ERROR_INVALID_PARAMETERS;
}
// set the Requested Count
if (NPT_FAILED(action->SetArgumentValue("RequestedCount", NPT_String::FromInteger(count)))) {
return NPT_ERROR_INVALID_PARAMETERS;
}
// set the Requested Count
if (NPT_FAILED(action->SetArgumentValue("SortCriteria", sort_criteria))) {
return NPT_ERROR_INVALID_PARAMETERS;
}
// set the arguments on the action, this will check the argument values
if (NPT_FAILED(m_CtrlPoint->InvokeAction(action, userdata))) {
return NPT_ERROR_INVALID_PARAMETERS;
}
return NPT_SUCCESS;
}