private static UPnPError OnGetDeviceCapabilities(DvAction action, IList <object> inParams, out IList <object> outParams, CallContext context) { TraceLogger.DebugLogParams(inParams); outParams = action.OutArguments.Select(outArgument => outArgument.RelatedStateVar.Value).ToList(); TraceLogger.WriteLine(action.OutArguments[0].RelatedStateVar.DefaultValue); return(null); }
// not really implemented private static UPnPError OnSetPlayMode(DvAction action, IList <object> inParams, out IList <object> outParams, CallContext context) { TraceLogger.DebugLogParams(inParams); outParams = action.OutArguments.Select(outArgument => outArgument.RelatedStateVar.Value).ToList(); return(null); }
private static UPnPError OnSeek(DvAction action, IList <object> inParams, out IList <object> outParams, CallContext context) { TraceLogger.DebugLogParams(inParams); ChangeStateVariables(new List <string> { "A_ARG_TYPE_SeekMode", "A_ARG_TYPE_SeekTarget" }, new List <object> { inParams[1], inParams[2] }, action); outParams = action.OutArguments.Select(outArgument => outArgument.RelatedStateVar.Value).ToList(); if (inParams[1].ToString() == "REL_TIME") // we only support "REL_TIME" { OnEventSeek(); // FireEfent } else { return(new UPnPError(710, "The specified seek mode is not supported by the device.")); } return(null); }
private static UPnPError OnGetMediaInfo(DvAction action, IList <object> inParams, out IList <object> outParams, CallContext context) { TraceLogger.DebugLogParams(inParams); outParams = action.OutArguments.Select(outArgument => outArgument.RelatedStateVar.Value).ToList(); foreach (var outArgument in action.OutArguments) { TraceLogger.WriteLine("- " + outArgument.Name + " - " + outArgument.RelatedStateVar.Value); } return(null); }
private static UPnPError OnGetTransportInfo(DvAction action, IList <object> inParams, out IList <object> outParams, CallContext context) { TraceLogger.DebugLogParams(inParams); outParams = action.OutArguments.Select(outArgument => outArgument.RelatedStateVar.Value).ToList(); TraceLogger.WriteLine("OUTPUT:"); foreach (var outParam in outParams) { TraceLogger.WriteLine(outParam); } return(null); }
private static UPnPError OnGetCurrentTransportActions(DvAction action, IList <object> inParams, out IList <object> outParams, CallContext context) { TraceLogger.DebugLogParams(inParams); foreach (var inArgument in action.InArguments) { TraceLogger.WriteLine("In Argument: " + inArgument.Name); switch (inArgument.Name) { case "InstanceID": inArgument.RelatedStateVar.Value = inParams[0]; break; } } outParams = action.OutArguments.Select(outArgument => outArgument.RelatedStateVar.Value).ToList(); return(null); }
private static UPnPError OnPause(DvAction action, IList <object> inParams, out IList <object> outParams, CallContext context) { TraceLogger.DebugLogParams(inParams); if (action.ParentService.StateVariables["TransportState"].Value.ToString() == "PLAYING") { TraceLogger.WriteLine("TransPortState is PLAYING"); ChangeStateVariable("TransportState", "PAUSED_PLAYBACK", action); OnEventPause(); // FireEfent } else { TraceLogger.WriteLine("TransportState is not Playing"); } outParams = action.OutArguments.Select(outArgument => outArgument.RelatedStateVar.Value).ToList(); return(null); }
private static UPnPError OnStop(DvAction action, IList <object> inParams, out IList <object> outParams, CallContext context) { TraceLogger.DebugLogParams(inParams); ChangeStateVariables(new List <string> { "TransportState" }, new List <object> { "STOPPED" }, action); OnEventStop(); // FireEfent outParams = action.OutArguments.Select(outArgument => outArgument.RelatedStateVar.Value).ToList(); return(null); }
private static UPnPError OnSetVolume(DvAction action, IList <object> inParams, out IList <object> outParams, CallContext context) { TraceLogger.DebugLogParams(inParams); ChangeStateVariable("Volume", inParams[2], action); // we don't want to fire an event yet //action.ParentService.StateVariables["Volume"].Value = inParams[2]; OnEvenSetVolumeEventArgs eventArgs = new OnEvenSetVolumeEventArgs(); eventArgs.Volume = inParams[2]; OnEventVolume(eventArgs); // Fire Event outParams = action.OutArguments.Select(outArgument => outArgument.RelatedStateVar.Value).ToList(); return(null); }
private static UPnPError OnSetAVTransportURI(DvAction action, IList <object> inParams, out IList <object> outParams, CallContext context) { TraceLogger.DebugLogParams(inParams); ChangeStateVariables(new List <string> { "AVTransportURI", "AVTransportURIMetaData", "PlaybackStorageMedium" }, new List <object> { inParams[1], inParams[2], "NETWORK" // we always play from a network resource }, action); // From the Documentation: // If the current transport state is “NO MEDIA PRESENT” the transport state changes to “STOPPED”. // In all other cases, this action does not change the transport state of the specified instance. if (action.ParentService.StateVariables["TransportState"].Value.ToString() == "NO_MEDIA_PRESENT") { TraceLogger.WriteLine("Change State to STOPPED"); ChangeStateVariables(new List <string> { "TransportState" }, new List <object> { "STOPPED" }, action); } outParams = action.OutArguments.Select(outArgument => outArgument.RelatedStateVar.Value).ToList(); OnEventSetAVTransportURIEventArgs eventArgs = new OnEventSetAVTransportURIEventArgs { CurrentURI = inParams[1] as string, CurrentURIMetaData = inParams[2] as string }; OnEventSetAVTransportURI(eventArgs); TraceLogger.WriteLine("OnSetAVTransportURI RETURN"); return(null); }