本文整理汇总了C++中PLT_ActionReference::SetArgumentsOutFromStateVariable方法的典型用法代码示例。如果您正苦于以下问题:C++ PLT_ActionReference::SetArgumentsOutFromStateVariable方法的具体用法?C++ PLT_ActionReference::SetArgumentsOutFromStateVariable怎么用?C++ PLT_ActionReference::SetArgumentsOutFromStateVariable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PLT_ActionReference
的用法示例。
在下文中一共展示了PLT_ActionReference::SetArgumentsOutFromStateVariable方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PlayMedia
/*----------------------------------------------------------------------
| CUPnPRenderer::OnSetAVTransportURI
+---------------------------------------------------------------------*/
NPT_Result
CUPnPRenderer::OnSetAVTransportURI(PLT_ActionReference& action)
{
NPT_String uri, meta;
PLT_Service* service;
NPT_CHECK_SEVERE(FindServiceByType("urn:schemas-upnp-org:service:AVTransport:1", service));
NPT_CHECK_SEVERE(action->GetArgumentValue("CurrentURI", uri));
NPT_CHECK_SEVERE(action->GetArgumentValue("CurrentURIMetaData", meta));
// if not playing already, just keep around uri & metadata
// and wait for play command
if (!g_application.m_pPlayer->IsPlaying() && g_windowManager.GetActiveWindow() != WINDOW_SLIDESHOW) {
service->SetStateVariable("TransportState", "STOPPED");
service->SetStateVariable("TransportStatus", "OK");
service->SetStateVariable("TransportPlaySpeed", "1");
service->SetStateVariable("AVTransportURI", uri);
service->SetStateVariable("AVTransportURIMetaData", meta);
service->SetStateVariable("NextAVTransportURI", "");
service->SetStateVariable("NextAVTransportURIMetaData", "");
NPT_CHECK_SEVERE(action->SetArgumentsOutFromStateVariable());
return NPT_SUCCESS;
}
return PlayMedia(uri, meta, action.AsPointer());
}
示例2:
/*----------------------------------------------------------------------
| PLT_MediaRenderer::OnSetAVTransportURI
+---------------------------------------------------------------------*/
NPT_Result
PLT_MediaRenderer::OnSetAVTransportURI(PLT_ActionReference& action)
{
if (m_Delegate) {
return m_Delegate->OnSetAVTransportURI(action);
}
// default implementation is using state variable
NPT_String uri;
NPT_CHECK_WARNING(action->GetArgumentValue("CurrentURI", uri));
NPT_String metadata;
NPT_CHECK_WARNING(action->GetArgumentValue("CurrentURIMetaData", metadata));
PLT_Service* serviceAVT;
NPT_CHECK_WARNING(FindServiceByType("urn:schemas-upnp-org:service:AVTransport:1", serviceAVT));
// update service state variables
serviceAVT->SetStateVariable("AVTransportURI", uri);
serviceAVT->SetStateVariable("AVTransportURIMetaData", metadata);
serviceAVT->SetStateVariable("TransportState", "STOPPED");
serviceAVT->SetStateVariable("TransportStatus", "OK");
serviceAVT->SetStateVariable("TransportPlaySpeed", "1");
NPT_CHECK_SEVERE(action->SetArgumentsOutFromStateVariable());
return NPT_SUCCESS;
}
示例3:
/*----------------------------------------------------------------------
| PLT_MediaServer::OnGetSystemUpdateID
+---------------------------------------------------------------------*/
NPT_Result
PLT_MediaServer::OnGetSystemUpdateID(PLT_ActionReference& action,
const PLT_HttpRequestContext& context)
{
NPT_COMPILER_UNUSED(context);
return action->SetArgumentsOutFromStateVariable();
}
示例4: msg
/*----------------------------------------------------------------------
| CUPnPRenderer::OnSetAVTransportURI
+---------------------------------------------------------------------*/
NPT_Result
CUPnPRenderer::OnSetNextAVTransportURI(PLT_ActionReference& action)
{
NPT_String uri, meta;
PLT_Service* service;
NPT_CHECK_SEVERE(FindServiceByType("urn:schemas-upnp-org:service:AVTransport:1", service));
NPT_CHECK_SEVERE(action->GetArgumentValue("NextURI", uri));
NPT_CHECK_SEVERE(action->GetArgumentValue("NextURIMetaData", meta));
CFileItemPtr item = GetFileItem(uri, meta);
if (!item) {
return NPT_FAILURE;
}
#if 0
if (g_application.m_pPlayer->IsPlaying()) {
int playlist = PLAYLIST_MUSIC;
if(item->IsVideo())
playlist = PLAYLIST_VIDEO;
{ CSingleLock lock(g_graphicsContext);
g_playlistPlayer.ClearPlaylist(playlist);
g_playlistPlayer.Add(playlist, item);
g_playlistPlayer.SetCurrentSong(-1);
g_playlistPlayer.SetCurrentPlaylist(playlist);
}
CGUIMessage msg(GUI_MSG_PLAYLIST_CHANGED, 0, 0);
g_windowManager.SendThreadMessage(msg);
service->SetStateVariable("NextAVTransportURI", uri);
service->SetStateVariable("NextAVTransportURIMetaData", meta);
NPT_CHECK_SEVERE(action->SetArgumentsOutFromStateVariable());
return NPT_SUCCESS;
} else if (g_windowManager.GetActiveWindow() == WINDOW_SLIDESHOW) {
return NPT_FAILURE;
} else {
return NPT_FAILURE;
}
#endif
return NPT_SUCCESS;
}
示例5: OnGetCurrentConnectionInfo
/*----------------------------------------------------------------------
| PLT_MediaRenderer::OnAction
+---------------------------------------------------------------------*/
NPT_Result
PLT_MediaRenderer::OnAction(PLT_ActionReference& action, NPT_SocketInfo* info /* = NULL */)
{
NPT_COMPILER_UNUSED(info);
/* parse the action name */
NPT_String name = action->GetActionDesc()->GetName();
/* Is it a ConnectionManager Service Action ? */
if (name.Compare("GetCurrentConnectionIDs", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetProtocolInfo", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetCurrentConnectionInfo", true) == 0) {
return OnGetCurrentConnectionInfo(action);
}
/* Is it a AVTransport Service Action ? */
// since all actions take an instance ID and we only support 1 instance
// verify that the Instance ID is 0 and return an error here now if not
NPT_String serviceType = action->GetActionDesc()->GetService()->GetServiceType();
if (serviceType.Compare("urn:schemas-upnp-org:service:AVTransport:1", true) == 0) {
if (NPT_FAILED(action->VerifyArgumentValue("InstanceID", "0"))) {
action->SetError(802,"Not valid InstanceID.");
return NPT_FAILURE;
}
}
if (name.Compare("GetCurrentTransportActions", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetDeviceCapabilities", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetMediaInfo", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetPositionInfo", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetTransportInfo", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetTransportSettings", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("Next", true) == 0) {
return OnNext(action);
}
if (name.Compare("Pause", true) == 0) {
return OnPause(action);
}
if (name.Compare("Play", true) == 0) {
return OnPlay(action);
}
if (name.Compare("Previous", true) == 0) {
return OnPrevious(action);
}
if (name.Compare("Seek", true) == 0) {
return OnSeek(action);
}
if (name.Compare("Stop", true) == 0) {
return OnStop(action);
}
if (name.Compare("SetAVTransportURI", true) == 0) {
return OnSetAVTransportURI(action);
}
if (name.Compare("SetPlayMode", true) == 0) {
return OnSetPlayMode(action);
}
//.........这里部分代码省略.........
示例6: OnGetCurrentConnectionInfo
/*----------------------------------------------------------------------
| PLT_MediaRenderer::OnAction
+---------------------------------------------------------------------*/
NPT_Result
PLT_MediaRenderer::OnAction(PLT_ActionReference& action,
const PLT_HttpRequestContext& context)
{
NPT_COMPILER_UNUSED(context);
/* parse the action name */
NPT_String name = action->GetActionDesc().GetName();
// since all actions take an instance ID and we only support 1 instance
// verify that the Instance ID is 0 and return an error here now if not
NPT_String serviceType = action->GetActionDesc().GetService()->GetServiceType();
if (serviceType.Compare("urn:schemas-upnp-org:service:AVTransport:1", true) == 0) {
if (NPT_FAILED(action->VerifyArgumentValue("InstanceID", "0"))) {
action->SetError(718, "Not valid InstanceID");
return NPT_FAILURE;
}
}
serviceType = action->GetActionDesc().GetService()->GetServiceType();
if (serviceType.Compare("urn:schemas-upnp-org:service:RenderingControl:1", true) == 0) {
if (NPT_FAILED(action->VerifyArgumentValue("InstanceID", "0"))) {
action->SetError(702, "Not valid InstanceID");
return NPT_FAILURE;
}
}
/* Is it a ConnectionManager Service Action ? */
if (name.Compare("GetCurrentConnectionInfo", true) == 0) {
return OnGetCurrentConnectionInfo(action);
}
/* Is it a AVTransport Service Action ? */
if (name.Compare("Next", true) == 0) {
return OnNext(action);
}
if (name.Compare("Pause", true) == 0) {
return OnPause(action);
}
if (name.Compare("Play", true) == 0) {
return OnPlay(action);
}
if (name.Compare("Previous", true) == 0) {
return OnPrevious(action);
}
if (name.Compare("Seek", true) == 0) {
return OnSeek(action);
}
if (name.Compare("Stop", true) == 0) {
return OnStop(action);
}
if (name.Compare("SetAVTransportURI", true) == 0) {
return OnSetAVTransportURI(action);
}
if (name.Compare("SetNextAVTransportURI", true) == 0) {
return OnSetNextAVTransportURI(action);
}
if (name.Compare("SetPlayMode", true) == 0) {
return OnSetPlayMode(action);
}
/* Is it a RendererControl Service Action ? */
if (name.Compare("SetVolume", true) == 0) {
return OnSetVolume(action);
}
if (name.Compare("SetVolumeDB", true) == 0) {
return OnSetVolumeDB(action);
}
if (name.Compare("GetVolumeDBRange", true) == 0) {
return OnGetVolumeDBRange(action);
}
if (name.Compare("SetMute", true) == 0) {
return OnSetMute(action);
}
// other actions rely on state variables
NPT_CHECK_LABEL_WARNING(action->SetArgumentsOutFromStateVariable(), failure);
return NPT_SUCCESS;
failure:
action->SetError(401,"No Such Action.");
return NPT_FAILURE;
}
示例7: OnGetCurrentConnectionInfo
NPT_Result
GPAC_MediaRenderer::OnAction(PLT_ActionReference& action,
const PLT_HttpRequestContext& context)
{
NPT_COMPILER_UNUSED(context);
/* parse the action name */
NPT_String name = action->GetActionDesc().GetName();
m_ip_src = context.GetRemoteAddress().GetIpAddress().ToString();
/* Is it a ConnectionManager Service Action ? */
if (name.Compare("GetCurrentConnectionIDs", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetProtocolInfo", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetCurrentConnectionInfo", true) == 0) {
return OnGetCurrentConnectionInfo(action);
}
if (name.Compare("StopForMigration", true) == 0) {
NPT_String res = m_pUPnP->OnMigrate();
m_pMigrationService->SetStateVariable("MigrationStatus", "OK");
m_pMigrationService->SetStateVariable("MigrationMetaData", res);
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
/* Is it a AVTransport Service Action ? */
// since all actions take an instance ID and we only support 1 instance
// verify that the Instance ID is 0 and return an error here now if not
NPT_String serviceType = action->GetActionDesc().GetService()->GetServiceType();
if (serviceType.Compare("urn:schemas-upnp-org:service:AVTransport:1", true) == 0) {
if (NPT_FAILED(action->VerifyArgumentValue("InstanceID", "0"))) {
action->SetError(802,"Not valid InstanceID.");
return NPT_FAILURE;
}
}
if (name.Compare("GetCurrentTransportActions", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetDeviceCapabilities", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetMediaInfo", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetPositionInfo", true) == 0) {
if (m_pUPnP->m_pTerm->root_scene) {
char szVal[100];
m_pAVService->SetStateVariable("CurrentTrack", "0");
format_time_string(szVal, m_Duration);
m_pAVService->SetStateVariable("CurrentTrackDuration", szVal);
m_pAVService->SetStateVariable("CurrentTrackMetadata", "");
m_pAVService->SetStateVariable("CurrentTrackURI", "");
format_time_string(szVal, m_Time);
m_pAVService->SetStateVariable("RelativeTimePosition", szVal);
m_pAVService->SetStateVariable("AbsoluteTimePosition", szVal);
m_pAVService->SetStateVariable("RelativeCounterPosition", "2147483647"); // means NOT_IMPLEMENTED
m_pAVService->SetStateVariable("AbsoluteCounterPosition", "2147483647"); // means NOT_IMPLEMENTED
} else {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
}
return NPT_SUCCESS;
}
if (name.Compare("GetTransportInfo", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
return NPT_SUCCESS;
}
if (name.Compare("GetTransportSettings", true) == 0) {
if (NPT_FAILED(action->SetArgumentsOutFromStateVariable())) {
return NPT_FAILURE;
}
//.........这里部分代码省略.........