本文整理汇总了C++中PLT_Service::SetStateVariableExtraAttribute方法的典型用法代码示例。如果您正苦于以下问题:C++ PLT_Service::SetStateVariableExtraAttribute方法的具体用法?C++ PLT_Service::SetStateVariableExtraAttribute怎么用?C++ PLT_Service::SetStateVariableExtraAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PLT_Service
的用法示例。
在下文中一共展示了PLT_Service::SetStateVariableExtraAttribute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//.........这里部分代码省略.........
"AVTransport",
"urn:schemas-upnp-org:metadata-1-0/AVT/");
NPT_CHECK_FATAL(service->SetSCPDXML((const char*) RDR_AVTransportSCPD));
NPT_CHECK_FATAL(AddService(service));
service->SetStateVariableRate("LastChange", NPT_TimeInterval(0.2f));
service->SetStateVariable("A_ARG_TYPE_InstanceID", "0");
// GetCurrentTransportActions
service->SetStateVariable("CurrentTransportActions", "Play,Pause,Stop,Seek,Next,Previous");
// GetDeviceCapabilities
service->SetStateVariable("PossiblePlaybackStorageMedia", "NONE,NETWORK,HDD,CD-DA,UNKNOWN");
service->SetStateVariable("PossibleRecordStorageMedia", "NOT_IMPLEMENTED");
service->SetStateVariable("PossibleRecordQualityModes", "NOT_IMPLEMENTED");
// GetMediaInfo
service->SetStateVariable("NumberOfTracks", "0");
service->SetStateVariable("CurrentMediaDuration", "00:00:00");
service->SetStateVariable("AVTransportURI", "");
service->SetStateVariable("AVTransportURIMetadata", "");;
service->SetStateVariable("NextAVTransportURI", "NOT_IMPLEMENTED");
service->SetStateVariable("NextAVTransportURIMetadata", "NOT_IMPLEMENTED");
service->SetStateVariable("PlaybackStorageMedium", "NONE");
service->SetStateVariable("RecordStorageMedium", "NOT_IMPLEMENTED");
service->SetStateVariable("RecordMediumWriteStatus", "NOT_IMPLEMENTED");
// GetPositionInfo
service->SetStateVariable("CurrentTrack", "0");
service->SetStateVariable("CurrentTrackDuration", "00:00:00");
service->SetStateVariable("CurrentTrackMetadata", "");
service->SetStateVariable("CurrentTrackURI", "");
service->SetStateVariable("RelativeTimePosition", "00:00:00");
service->SetStateVariable("AbsoluteTimePosition", "00:00:00");
service->SetStateVariable("RelativeCounterPosition", "2147483647"); // means NOT_IMPLEMENTED
service->SetStateVariable("AbsoluteCounterPosition", "2147483647"); // means NOT_IMPLEMENTED
// disable indirect eventing for certain state variables
PLT_StateVariable* var;
var = service->FindStateVariable("RelativeTimePosition");
if (var) var->DisableIndirectEventing();
var = service->FindStateVariable("AbsoluteTimePosition");
if (var) var->DisableIndirectEventing();
var = service->FindStateVariable("RelativeCounterPosition");
if (var) var->DisableIndirectEventing();
var = service->FindStateVariable("AbsoluteCounterPosition");
if (var) var->DisableIndirectEventing();
// GetTransportInfo
service->SetStateVariable("TransportState", "NO_MEDIA_PRESENT");
service->SetStateVariable("TransportStatus", "OK");
service->SetStateVariable("TransportPlaySpeed", "1");
// GetTransportSettings
service->SetStateVariable("CurrentPlayMode", "NORMAL");
service->SetStateVariable("CurrentRecordQualityMode", "NOT_IMPLEMENTED");
}
{
/* ConnectionManager */
service = new PLT_Service(
this,
"urn:schemas-upnp-org:service:ConnectionManager:1",
"urn:upnp-org:serviceId:ConnectionManager",
"ConnectionManager");
NPT_CHECK_FATAL(service->SetSCPDXML((const char*) RDR_ConnectionManagerSCPD));
NPT_CHECK_FATAL(AddService(service));
service->SetStateVariable("CurrentConnectionIDs", "0");
// put all supported mime types here instead
service->SetStateVariable("SinkProtocolInfo", "http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_PRO,http-get:*:video/x-ms-asf:DLNA.ORG_PN=MPEG4_P2_ASF_SP_G726,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_FULL,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_MED,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVMED_BASE,http-get:*:audio/L16;rate=44100;channels=1:DLNA.ORG_PN=LPCM,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_NTSC,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_PRO,http-get:*:audio/L16;rate=44100;channels=2:DLNA.ORG_PN=LPCM,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM,http-get:*:video/x-ms-asf:DLNA.ORG_PN=VC1_ASF_AP_L1_WMA,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMDRM_WMABASE,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVHIGH_FULL,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAFULL,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMABASE,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVSPLL_BASE,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_NTSC_XAC3,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMDRM_WMVSPLL_BASE,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVSPML_BASE,http-get:*:video/x-ms-asf:DLNA.ORG_PN=MPEG4_P2_ASF_ASP_L5_SO_G726,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_LRG,http-get:*:audio/mpeg:DLNA.ORG_PN=MP3,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL_XAC3,http-get:*:audio/x-ms-wma:DLNA.ORG_PN=WMAPRO,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG1,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_TN,http-get:*:video/x-ms-asf:DLNA.ORG_PN=MPEG4_P2_ASF_ASP_L4_SO_G726,http-get:*:audio/L16;rate=48000;channels=2:DLNA.ORG_PN=LPCM,http-get:*:audio/mpeg:DLNA.ORG_PN=MP3X,http-get:*:video/x-ms-wmv:DLNA.ORG_PN=WMVSPML_MP3,http-get:*:video/x-ms-wmv:*");
service->SetStateVariable("SourceProtocolInfo", "");
}
{
/* RenderingControl */
service = new PLT_Service(
this,
"urn:schemas-upnp-org:service:RenderingControl:1",
"urn:upnp-org:serviceId:RenderingControl",
"RenderingControl",
"urn:schemas-upnp-org:metadata-1-0/RCS/");
NPT_CHECK_FATAL(service->SetSCPDXML((const char*) RDR_RenderingControlSCPD));
NPT_CHECK_FATAL(AddService(service));
service->SetStateVariableRate("LastChange", NPT_TimeInterval(0.2f));
service->SetStateVariable("Mute", "0");
service->SetStateVariableExtraAttribute("Mute", "Channel", "Master");
service->SetStateVariable("Volume", "100");
service->SetStateVariableExtraAttribute("Volume", "Channel", "Master");
service->SetStateVariable("VolumeDB", "0");
service->SetStateVariableExtraAttribute("VolumeDB", "Channel", "Master");
service->SetStateVariable("PresetNameList", "FactoryDefaults");
}
return NPT_SUCCESS;
}
示例2:
//.........这里部分代码省略.........
",http-get:*:audio/ulaw:*"
",http-get:*:audio/ogg:*"
",http-get:*:audio/DVI4:*"
",http-get:*:audio/G722:*"
",http-get:*:audio/G723:*"
",http-get:*:audio/G726-16:*"
",http-get:*:audio/G726-24:*"
",http-get:*:audio/G726-32:*"
",http-get:*:audio/G726-40:*"
",http-get:*:audio/G728:*"
",http-get:*:audio/G729:*"
",http-get:*:audio/G729D:*"
",http-get:*:audio/G729E:*"
",http-get:*:audio/GSM:*"
",http-get:*:audio/GSM-EFR:*"
",http-get:*:audio/L8:*"
",http-get:*:audio/L16:*"
",http-get:*:audio/LPC:*"
",http-get:*:audio/MPA:*"
",http-get:*:audio/PCMA:*"
",http-get:*:audio/PCMU:*"
",http-get:*:audio/QCELP:*"
",http-get:*:audio/RED:*"
",http-get:*:audio/VDVI:*"
",http-get:*:audio/ac3:*"
",http-get:*:audio/vorbis:*"
",http-get:*:audio/speex:*"
",http-get:*:audio/x-aiff:*"
",http-get:*:audio/x-pn-realaudio:*"
",http-get:*:audio/x-realaudio:*"
",http-get:*:audio/x-wav:*"
",http-get:*:audio/x-ms-wma:*"
",http-get:*:audio/x-mpegurl:*"
",http-get:*:application/x-shockwave-flash:*"
",http-get:*:application/ogg:*"
",http-get:*:application/sdp:*"
",http-get:*:image/gif:*"
",http-get:*:image/jpeg:*"
",http-get:*:image/ief:*"
",http-get:*:image/png:*"
",http-get:*:image/tiff:*"
",http-get:*:video/avi:*"
",http-get:*:video/mpeg:*"
",http-get:*:video/fli:*"
",http-get:*:video/flv:*"
",http-get:*:video/quicktime:*"
",http-get:*:video/vnd.vivo:*"
",http-get:*:video/vc1:*"
",http-get:*:video/ogg:*"
",http-get:*:video/mp4:*"
",http-get:*:video/BT656:*"
",http-get:*:video/CelB:*"
",http-get:*:video/JPEG:*"
",http-get:*:video/H261:*"
",http-get:*:video/H263:*"
",http-get:*:video/H263-1998:*"
",http-get:*:video/H263-2000:*"
",http-get:*:video/MPV:*"
",http-get:*:video/MP2T:*"
",http-get:*:video/MP1S:*"
",http-get:*:video/MP2P:*"
",http-get:*:video/BMPEG:*"
",http-get:*:video/x-ms-wmv:*"
",http-get:*:video/x-ms-avi:*"
",http-get:*:video/x-flv:*"
",http-get:*:video/x-fli:*"
",http-get:*:video/x-ms-asf:*"
",http-get:*:video/x-ms-asx:*"
",http-get:*:video/x-ms-wmx:*"
",http-get:*:video/x-ms-wvx:*"
",http-get:*:video/x-msvideo:*"
);
service->SetStateVariable("SourceProtocolInfo", "");
}
{
/* RenderingControl */
service = new PLT_Service(
this,
"urn:schemas-upnp-org:service:RenderingControl:1",
"urn:upnp-org:serviceId:RenderingControl",
"RenderingControl",
"urn:schemas-upnp-org:metadata-1-0/RCS/");
NPT_CHECK_FATAL(service->SetSCPDXML((const char*) RDR_RenderingControlSCPD));
NPT_CHECK_FATAL(AddService(service));
service->SetStateVariableRate("LastChange", NPT_TimeInterval(0.2f));
service->SetStateVariable("Mute", "0");
service->SetStateVariableExtraAttribute("Mute", "Channel", "Master");
service->SetStateVariable("Volume", "100");
service->SetStateVariableExtraAttribute("Volume", "Channel", "Master");
service->SetStateVariable("VolumeDB", "0");
service->SetStateVariableExtraAttribute("VolumeDB", "Channel", "Master");
service->SetStateVariable("PresetNameList", "FactoryDefaults");
}
return NPT_SUCCESS;
}