private SearchResult Browse(string action, uint startIndex = 0u, uint requestedCount = 100u) { var arguments = new UPnPArgument[10]; arguments[0] = new UPnPArgument("ObjectID", action); arguments[1] = new UPnPArgument("BrowseFlag", "BrowseDirectChildren"); arguments[2] = new UPnPArgument("Filter", ""); arguments[3] = new UPnPArgument("StartingIndex", startIndex); arguments[4] = new UPnPArgument("RequestedCount", requestedCount); arguments[5] = new UPnPArgument("SortCriteria", ""); arguments[6] = new UPnPArgument("Result", ""); arguments[7] = new UPnPArgument("NumberReturned", 0u); arguments[8] = new UPnPArgument("TotalMatches", 0u); arguments[9] = new UPnPArgument("UpdateID", 0u); ContentDirectory.InvokeSync("Browse", arguments); var result = arguments[6].DataValue as string; return(new SearchResult { Result = result, StartingIndex = startIndex, NumberReturned = (uint)arguments[7].DataValue, TotalMatches = (uint)arguments[8].DataValue }); }
public int GetProtocolInfo() { UPnPArgument[] args = new UPnPArgument[2]; args[0] = new UPnPArgument("Source", ""); args[1] = new UPnPArgument("Sink", ""); return(_S.InvokeAsync("GetProtocolInfo", args, new UPnPService.UPnPServiceInvokeHandler(Sink_GetProtocolInfo), new UPnPService.UPnPServiceInvokeErrorHandler(Error_Sink_GetProtocolInfo))); }
public void InvokeAsync(UPnPService S, string Action, byte[] InArgs, string Caller, int Handle) { UPnPAction A = S.GetAction(Action); ArrayList AList = new ArrayList(); foreach (UPnPArgument arg in A.ArgumentList) { if (arg.IsReturnValue == false && arg.Direction == "out") { UPnPArgument _arg = (UPnPArgument)arg.Clone(); _arg.DataValue = UPnPService.CreateObjectInstance(arg.RelatedStateVar.GetNetType(), null); AList.Add(_arg); } } UPnPArgument[] Temp = ParseArguments(InArgs); foreach (UPnPArgument _arg in Temp) { _arg.DataType = A.GetArg(_arg.Name).RelatedStateVar.ValueType; _arg.Direction = "in"; AList.Add(_arg); } UPnPArgument[] Arguments = (UPnPArgument[])AList.ToArray(typeof(UPnPArgument)); (new UPnPDebugObject(S)).SetProperty("ValidationMode", false); S.InvokeAsync(Action, Arguments, new Object[2] { Caller, Handle }, A_ICB, A_IECB); }
private ArrayList BasicControlTest_BuildActionArgs(UPnPAction A) { ArrayList ArgList = new ArrayList(); foreach (UPnPArgument arg in A.ArgumentList) { if (arg.IsReturnValue == false) { UPnPArgument NArg; // if(arg.RelatedStateVar.GetNetType().FullName=="System.String") // { // NArg = new UPnPArgument(arg.Name,"Sample String"); // } // else // { NArg = new UPnPArgument(arg.Name, UPnPService.CreateObjectInstance(arg.RelatedStateVar.GetNetType(), null)); // } if (arg.RelatedStateVar.AllowedStringValues != null) { NArg.DataValue = arg.RelatedStateVar.AllowedStringValues[0]; } if (arg.RelatedStateVar.Minimum != null) { NArg.DataValue = arg.RelatedStateVar.Minimum; } if (arg.RelatedStateVar.Maximum != null) { NArg.DataValue = arg.RelatedStateVar.Maximum; } ArgList.Add(NArg); } } return(ArgList); }
private void A_InvokeSink(UPnPService sender, String MethodName, UPnPArgument[] Args, Object ReturnValue, object Tag) { object[] state = (object[])Tag; string Caller = (string)state[0]; int Handle = (int)state[1]; ArrayList RetList = new ArrayList(); UPnPAction A = sender.GetAction(MethodName); if (A.HasReturnValue == true) { UPnPArgument RA = (UPnPArgument)A.GetRetArg().Clone(); RA.DataValue = ReturnValue; RetList.Add(RA); } foreach (UPnPArgument OA in Args) { if (OA.Direction == "out") { RetList.Add(OA); } } byte[] OutArgs = BuildArguments((UPnPArgument[])RetList.ToArray(typeof(UPnPArgument))); CpGateKeeper C = (CpGateKeeper)RegisteredTable[Caller]; C.InvokeAsyncResponse(Handle, OutArgs, 0, ""); }
public PlayerInfo GetPositionInfo() { var arguments = new UPnPArgument[9]; arguments[0] = new UPnPArgument("InstanceID", 0u); arguments[1] = new UPnPArgument("Track", 0u); arguments[2] = new UPnPArgument("TrackDuration", null); arguments[3] = new UPnPArgument("TrackMetaData", null); arguments[4] = new UPnPArgument("TrackURI", null); arguments[5] = new UPnPArgument("RelTime", null); arguments[6] = new UPnPArgument("AbsTime", null); arguments[7] = new UPnPArgument("RelCount", 0); arguments[8] = new UPnPArgument("AbsCount", 0); AVTransport.InvokeSync("GetPositionInfo", arguments); TimeSpan trackDuration; TimeSpan relTime; TimeSpan.TryParse((string)arguments[2].DataValue, out trackDuration); TimeSpan.TryParse((string)arguments[5].DataValue, out relTime); return(new PlayerInfo { TrackIndex = (uint)arguments[1].DataValue, TrackMetaData = (string)arguments[3].DataValue, TrackURI = (string)arguments[4].DataValue, TrackDuration = trackDuration, RelTime = relTime }); }
private void addArgButton_Click(object sender, System.EventArgs e) { if (action == null) { return; } if (action.ParentService.GetStateVariables().Length == 0) { MessageBox.Show(this, "No state variables available", "Argument Creation", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); return; } UPnPArgument arg = new UPnPArgument("", null); arg.Direction = "in"; UPnpArgumentEditControl argEdit = new UPnpArgumentEditControl(this, action, arg); argEdit.Dock = DockStyle.Top; ArrayList list = new ArrayList(argPanel.Controls); list.Insert(0, argEdit); argPanel.Controls.Clear(); argPanel.Controls.AddRange(list.ToArray(typeof(Control)) as Control[]); }
public bool Play() { if (device == null) { return(false); } var service = device.GetServices(UPNP_SERVICE_AVTRANSPORT)[0]; UPnPArgument[] args = new UPnPArgument[] { new UPnPArgument("InstanceID", (uint)0), new UPnPArgument("Speed", "1") }; try { service.InvokeSync("Play", args); return(true); } catch (Exception ex) { Console.WriteLine("ControlPoint - Play: " + ex.Message); Console.WriteLine("UPNP exception: " + ((OpenSource.UPnP.UPnPInvokeException)ex).UPNP.ErrorDescription); MessageBox.Show(((OpenSource.UPnP.UPnPInvokeException)ex).UPNP.ErrorDescription, ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } }
private void InvokeResponseSink(int ErrorCode, string ErrorString, byte[] Args, int Handle) { try { UPnPAction A = (UPnPAction)this.PendingActionTable[Handle]; PendingActionTable.Remove(Handle); if (ErrorCode == 0) { UPnPArgument[] OutArgs = Gatekeeper.ParseArguments(Args); object RetObj = null; if (A.HasReturnValue) { UPnPArgument RA = A.GetRetArg(); foreach (UPnPArgument OA in OutArgs) { if (OA.Name == RA.Name) { RetObj = OA.DataValue; break; } } } A.ParentService.DelayedInvokeResponse(0, RetObj, OutArgs, null); } else { A.ParentService.DelayedInvokeResponse(0, null, null, new UPnPCustomException(ErrorCode, ErrorString)); } } catch (Exception) { } }
private string Browse(string action, uint startIndex = 0u, uint requestedCount = 100u) { try { var arguments = new UPnPArgument[10]; arguments[0] = new UPnPArgument("ObjectID", action); arguments[1] = new UPnPArgument("BrowseFlag", "BrowseDirectChildren"); arguments[2] = new UPnPArgument("Filter", ""); arguments[3] = new UPnPArgument("StartingIndex", startIndex); arguments[4] = new UPnPArgument("RequestedCount", requestedCount); arguments[5] = new UPnPArgument("SortCriteria", ""); arguments[6] = new UPnPArgument("Result", ""); arguments[7] = new UPnPArgument("NumberReturned", 0u); arguments[8] = new UPnPArgument("TotalMatches", 0u); arguments[9] = new UPnPArgument("UpdateID", 0u); _parentPlayer.Server.ContentDirectory.InvokeSync("Browse", arguments); string result = arguments[6].DataValue as string; return(result); } catch (Exception ex) { Console.WriteLine(ex); return(null); } }
public void PrepareForConnection(System.String RemoteProtocolInfo, System.String PeerConnectionManager, System.Int32 PeerConnectionID, Enum_A_ARG_TYPE_Direction Direction, object _Tag, Delegate_OnResult_PrepareForConnection _Callback) { UPnPArgument[] args = new UPnPArgument[7]; args[0] = new UPnPArgument("RemoteProtocolInfo", RemoteProtocolInfo); args[1] = new UPnPArgument("PeerConnectionManager", PeerConnectionManager); args[2] = new UPnPArgument("PeerConnectionID", PeerConnectionID); switch (Direction) { case Enum_A_ARG_TYPE_Direction.INPUT: args[3] = new UPnPArgument("Direction", "Input"); break; case Enum_A_ARG_TYPE_Direction.OUTPUT: args[3] = new UPnPArgument("Direction", "Output"); break; default: args[3] = new UPnPArgument("Direction", GetUnspecifiedValue("Enum_A_ARG_TYPE_Direction")); break; } args[4] = new UPnPArgument("ConnectionID", ""); args[5] = new UPnPArgument("AVTransportID", ""); args[6] = new UPnPArgument("RcsID", ""); _S.InvokeAsync("PrepareForConnection", args, new object[2] { _Tag, _Callback }, new UPnPService.UPnPServiceInvokeHandler(Sink_PrepareForConnection), new UPnPService.UPnPServiceInvokeErrorHandler(Error_Sink_PrepareForConnection)); }
public void Pause() { var arguments = new UPnPArgument[1]; arguments[0] = new UPnPArgument("InstanceID", 0u); AVTransport.InvokeAsync("Pause", arguments); }
public void Sync_ConnectionComplete(System.Int32 ConnectionID) { UPnPArgument[] args = new UPnPArgument[1]; args[0] = new UPnPArgument("ConnectionID", ConnectionID); _S.InvokeSync("ConnectionComplete", args); ConnectionID = (System.Int32)args[0].DataValue; return; }
public void Play() { var arguments = new UPnPArgument[2]; arguments[0] = new UPnPArgument("InstanceID", 0u); arguments[1] = new UPnPArgument("Speed", "1"); AVTransport.InvokeAsync("Play", arguments); }
public void ConnectionComplete(System.Int32 ConnectionID, object _Tag, Delegate_OnResult_ConnectionComplete _Callback) { UPnPArgument[] args = new UPnPArgument[1]; args[0] = new UPnPArgument("ConnectionID", ConnectionID); _S.InvokeAsync("ConnectionComplete", args, new object[2] { _Tag, _Callback }, new UPnPService.UPnPServiceInvokeHandler(Sink_ConnectionComplete), new UPnPService.UPnPServiceInvokeErrorHandler(Error_Sink_ConnectionComplete)); }
public void GetCurrentConnectionIDs(object _Tag, Delegate_OnResult_GetCurrentConnectionIDs _Callback) { UPnPArgument[] args = new UPnPArgument[1]; args[0] = new UPnPArgument("ConnectionIDs", ""); _S.InvokeAsync("GetCurrentConnectionIDs", args, new object[2] { _Tag, _Callback }, new UPnPService.UPnPServiceInvokeHandler(Sink_GetCurrentConnectionIDs), new UPnPService.UPnPServiceInvokeErrorHandler(Error_Sink_GetCurrentConnectionIDs)); }
public void Sync_GetCurrentConnectionIDs(out System.String ConnectionIDs) { UPnPArgument[] args = new UPnPArgument[1]; args[0] = new UPnPArgument("ConnectionIDs", ""); _S.InvokeSync("GetCurrentConnectionIDs", args); ConnectionIDs = (System.String)args[0].DataValue; return; }
private void SetNextAVTransportURI(Track track) { var arguments = new UPnPArgument[3]; arguments[0] = new UPnPArgument("InstanceID", 0u); arguments[1] = new UPnPArgument("NextURI", track.Uri); arguments[2] = new UPnPArgument("NextURIMetaData", track.MetaData); AVTransport.InvokeAsync("SetNextAVTransportURI", arguments); }
public void GetProtocolInfo(object _Tag, Delegate_OnResult_GetProtocolInfo _Callback) { UPnPArgument[] args = new UPnPArgument[2]; args[0] = new UPnPArgument("Source", ""); args[1] = new UPnPArgument("Sink", ""); _S.InvokeAsync("GetProtocolInfo", args, new object[2] { _Tag, _Callback }, new UPnPService.UPnPServiceInvokeHandler(Sink_GetProtocolInfo), new UPnPService.UPnPServiceInvokeErrorHandler(Error_Sink_GetProtocolInfo)); }
public void UnMute() { var arguments = new UPnPArgument[3]; arguments[0] = new UPnPArgument("InstanceID", 0u); arguments[1] = new UPnPArgument("Channel", "Master"); arguments[2] = new UPnPArgument("DesiredMute", false); RenderingControl.InvokeAsync("SetMute", arguments); }
public void Seek(uint position) { var arguments = new UPnPArgument[3]; arguments[0] = new UPnPArgument("InstanceID", 0u); arguments[1] = new UPnPArgument("Unit", "TRACK_NR"); arguments[2] = new UPnPArgument("Target", position.ToString()); AVTransport.InvokeAsync("Seek", arguments); }
public void SetAVTransportURI(SonosTrack track) { var arguments = new UPnPArgument[3]; arguments[0] = new UPnPArgument("InstanceID", 0u); arguments[1] = new UPnPArgument("CurrentURI", track.Uri); arguments[2] = new UPnPArgument("CurrentURIMetaData", track.MetaData); AVTransport.InvokeAsync("SetAVTransportURI", arguments); }
public void Sync_PrepareForConnection(System.String RemoteProtocolInfo, System.String PeerConnectionManager, System.Int32 PeerConnectionID, Enum_A_ARG_TYPE_Direction Direction, out System.Int32 ConnectionID, out System.Int32 AVTransportID, out System.Int32 RcsID) { UPnPArgument[] args = new UPnPArgument[7]; args[0] = new UPnPArgument("RemoteProtocolInfo", RemoteProtocolInfo); args[1] = new UPnPArgument("PeerConnectionManager", PeerConnectionManager); args[2] = new UPnPArgument("PeerConnectionID", PeerConnectionID); switch (Direction) { case Enum_A_ARG_TYPE_Direction.INPUT: args[3] = new UPnPArgument("Direction", "Input"); break; case Enum_A_ARG_TYPE_Direction.OUTPUT: args[3] = new UPnPArgument("Direction", "Output"); break; default: args[3] = new UPnPArgument("Direction", GetUnspecifiedValue("Enum_A_ARG_TYPE_Direction")); break; } args[4] = new UPnPArgument("ConnectionID", ""); args[5] = new UPnPArgument("AVTransportID", ""); args[6] = new UPnPArgument("RcsID", ""); _S.InvokeSync("PrepareForConnection", args); for (int i = 0; i < args.Length; ++i) { switch (args[i].Name) { case "Direction": switch ((string)args[i].DataValue) { case "Input": args[i].DataValue = Enum_A_ARG_TYPE_Direction.INPUT; break; case "Output": args[i].DataValue = Enum_A_ARG_TYPE_Direction.OUTPUT; break; default: SetUnspecifiedValue("Enum_A_ARG_TYPE_Direction", (string)args[i].DataValue); args[i].DataValue = Enum_A_ARG_TYPE_Direction._UNSPECIFIED_; break; } break; } } RemoteProtocolInfo = (System.String)args[0].DataValue; PeerConnectionManager = (System.String)args[1].DataValue; PeerConnectionID = (System.Int32)args[2].DataValue; Direction = (Enum_A_ARG_TYPE_Direction)args[3].DataValue; ConnectionID = (System.Int32)args[4].DataValue; AVTransportID = (System.Int32)args[5].DataValue; RcsID = (System.Int32)args[6].DataValue; return; }
/// <summary> /// Seeks to a position in the current track /// </summary> /// <param name="seekValue">the time in hh:mm:ss format</param> public void Seek(string seekValue) { var arguments = new UPnPArgument[3]; arguments[0] = new UPnPArgument("InstanceID", 0u); //arguments[1] = new UPnPArgument("Unit", "ABS_TIME"); arguments[1] = new UPnPArgument("Unit", "REL_TIME"); arguments[2] = new UPnPArgument("Target", seekValue); AVTransport.InvokeAsync("Seek", arguments); }
public void SetVolume(ushort vol) { vol = Math.Min(Math.Max(vol, (ushort)0), (ushort)100); var arguments = new UPnPArgument[3]; arguments[0] = new UPnPArgument("InstanceID", 0u); arguments[1] = new UPnPArgument("Channel", "Master"); arguments[2] = new UPnPArgument("DesiredVolume", vol); RenderingControl.InvokeAsync("SetVolume", arguments); }
private bool GetMute() { var arguments = new UPnPArgument[3]; arguments[0] = new UPnPArgument("InstanceID", 0u); arguments[1] = new UPnPArgument("Channel", "Master"); arguments[2] = new UPnPArgument("CurrentMute", 1); RenderingControl.InvokeSync("GetMute", arguments); return((bool)arguments[2].DataValue); }
public ushort GetVolume() { var arguments = new UPnPArgument[3]; arguments[0] = new UPnPArgument("InstanceID", 0u); arguments[1] = new UPnPArgument("Channel", "Master"); arguments[2] = new UPnPArgument("CurrentVolume", 0u); RenderingControl.InvokeSync("GetVolume", arguments); return((ushort)arguments[2].DataValue); }
public void Sync_GetProtocolInfo(out System.String Source, out System.String Sink) { UPnPArgument[] args = new UPnPArgument[2]; args[0] = new UPnPArgument("Source", ""); args[1] = new UPnPArgument("Sink", ""); _S.InvokeSync("GetProtocolInfo", args); Source = (System.String)args[0].DataValue; Sink = (System.String)args[1].DataValue; return; }
/// <summary> /// TODO: Does this work for any renderer? /// </summary> /// <returns></returns> private string GetPlaylistInfo() { string playListInfo = null; var arguments = new UPnPArgument[3]; arguments[0] = new UPnPArgument("InstanceID", 0u); arguments[1] = new UPnPArgument("PlaylistType", "Streaming"); arguments[2] = new UPnPArgument("PlaylistInfo", playListInfo); AVTransport.InvokeAsync("GetPlaylistInfo", arguments); return(arguments[2].ToString()); }
public static UPnPArgument ParseArgument(byte[] buffer, int offset, int count) { UTF8Encoding U = new UTF8Encoding(); int LON = BitConverter.ToInt32(buffer, offset + 4); string name = U.GetString(buffer, offset + 8, LON); int LOV = BitConverter.ToInt32(buffer, offset + 8 + LON); string StringValue = U.GetString(buffer, offset + 12 + LON, LOV); UPnPArgument RetVal = new UPnPArgument(name, StringValue); return(RetVal); }
private void Error_Sink_ConnectionComplete(UPnPService sender, string MethodName, UPnPArgument[] Args, UPnPInvokeException e, int Handle) { if(OnResult_ConnectionComplete != null) { OnResult_ConnectionComplete((System.Int32 )Args[0].DataValue, e, Handle); } WeakReference[] w = (WeakReference[])WeakList_ConnectionComplete.ToArray(typeof(WeakReference)); foreach(WeakReference wr in w) { if(wr.IsAlive==true) { ((Delegate_OnResult_ConnectionComplete)wr.Target)((System.Int32 )Args[0].DataValue, e, Handle); } else { WeakList_ConnectionComplete.Remove(wr); } } }
public int ConnectionComplete(System.Int32 ConnectionID) { UPnPArgument[] args = new UPnPArgument[1]; args[0] = new UPnPArgument("ConnectionID", ConnectionID); return(_S.InvokeAsync("ConnectionComplete", args, new UPnPService.UPnPServiceInvokeHandler(Sink_ConnectionComplete), new UPnPService.UPnPServiceInvokeErrorHandler(Error_Sink_ConnectionComplete))); }
public int Record(System.UInt32 InstanceID) { UPnPArgument[] args = new UPnPArgument[1]; args[0] = new UPnPArgument("InstanceID", InstanceID); return(_S.InvokeAsync("Record", args, new UPnPService.UPnPServiceInvokeHandler(Sink_Record), new UPnPService.UPnPServiceInvokeErrorHandler(Error_Sink_Record))); }
private void Sink_GetCurrentConnectionIDs(UPnPService sender, string MethodName, UPnPArgument[] Args, object RetVal, int Handle) { if(OnResult_GetCurrentConnectionIDs != null) { OnResult_GetCurrentConnectionIDs((System.String )Args[0].DataValue, null, Handle); } WeakReference[] w = (WeakReference[])WeakList_GetCurrentConnectionIDs.ToArray(typeof(WeakReference)); foreach(WeakReference wr in w) { if(wr.IsAlive==true) { ((Delegate_OnResult_GetCurrentConnectionIDs)wr.Target)((System.String )Args[0].DataValue, null, Handle); } else { WeakList_GetCurrentConnectionIDs.Remove(wr); } } }
public void Sync_Record(System.UInt32 InstanceID) { UPnPArgument[] args = new UPnPArgument[1]; args[0] = new UPnPArgument("InstanceID", InstanceID); _S.InvokeSync("Record", args); InstanceID = (System.UInt32) args[0].DataValue; return; }
private void Error_Sink_GetCurrentConnectionInfo(UPnPService sender, string MethodName, UPnPArgument[] Args, UPnPInvokeException e, int Handle) { if(OnResult_GetCurrentConnectionInfo != null) { OnResult_GetCurrentConnectionInfo((System.Int32 )Args[0].DataValue, (System.Int32)UPnPService.CreateObjectInstance(typeof(System.Int32),null), (System.Int32)UPnPService.CreateObjectInstance(typeof(System.Int32),null), (System.String)UPnPService.CreateObjectInstance(typeof(System.String),null), (System.String)UPnPService.CreateObjectInstance(typeof(System.String),null), (System.Int32)UPnPService.CreateObjectInstance(typeof(System.Int32),null), (Enum_A_ARG_TYPE_Direction)0, (Enum_A_ARG_TYPE_ConnectionStatus)0, e, Handle); } WeakReference[] w = (WeakReference[])WeakList_GetCurrentConnectionInfo.ToArray(typeof(WeakReference)); foreach(WeakReference wr in w) { if(wr.IsAlive==true) { ((Delegate_OnResult_GetCurrentConnectionInfo)wr.Target)((System.Int32 )Args[0].DataValue, (System.Int32)UPnPService.CreateObjectInstance(typeof(System.Int32),null), (System.Int32)UPnPService.CreateObjectInstance(typeof(System.Int32),null), (System.String)UPnPService.CreateObjectInstance(typeof(System.String),null), (System.String)UPnPService.CreateObjectInstance(typeof(System.String),null), (System.Int32)UPnPService.CreateObjectInstance(typeof(System.Int32),null), (Enum_A_ARG_TYPE_Direction)0, (Enum_A_ARG_TYPE_ConnectionStatus)0, e, Handle); } else { WeakList_GetCurrentConnectionInfo.Remove(wr); } } }
public void Sync_GetCurrentConnectionIDs(out System.String ConnectionIDs) { UPnPArgument[] args = new UPnPArgument[1]; args[0] = new UPnPArgument("ConnectionIDs", ""); _S.InvokeSync("GetCurrentConnectionIDs", args); ConnectionIDs = (System.String) args[0].DataValue; return; }
public int GetCurrentConnectionInfo(System.Int32 ConnectionID) { UPnPArgument[] args = new UPnPArgument[8]; args[0] = new UPnPArgument("ConnectionID", ConnectionID); args[1] = new UPnPArgument("RcsID", ""); args[2] = new UPnPArgument("AVTransportID", ""); args[3] = new UPnPArgument("ProtocolInfo", ""); args[4] = new UPnPArgument("PeerConnectionManager", ""); args[5] = new UPnPArgument("PeerConnectionID", ""); args[6] = new UPnPArgument("Direction", ""); args[7] = new UPnPArgument("Status", ""); return(_S.InvokeAsync("GetCurrentConnectionInfo", args, new UPnPService.UPnPServiceInvokeHandler(Sink_GetCurrentConnectionInfo), new UPnPService.UPnPServiceInvokeErrorHandler(Error_Sink_GetCurrentConnectionInfo))); }
private void Sink_GetCurrentConnectionInfo(UPnPService sender, string MethodName, UPnPArgument[] Args, object RetVal, int Handle) { for(int i=0;i<Args.Length;++i) { switch(Args[i].Name) { case "Direction": switch((string)Args[i].DataValue) { case "Input": Args[i].DataValue = Enum_A_ARG_TYPE_Direction.INPUT; break; case "Output": Args[i].DataValue = Enum_A_ARG_TYPE_Direction.OUTPUT; break; default: SetUnspecifiedValue("Enum_A_ARG_TYPE_Direction", (string)Args[i].DataValue); Args[i].DataValue = Enum_A_ARG_TYPE_Direction._UNSPECIFIED_; break; } break; case "Status": switch((string)Args[i].DataValue) { case "OK": Args[i].DataValue = Enum_A_ARG_TYPE_ConnectionStatus.OK; break; case "ContentFormatMismatch": Args[i].DataValue = Enum_A_ARG_TYPE_ConnectionStatus.CONTENTFORMATMISMATCH; break; case "InsufficientBandwidth": Args[i].DataValue = Enum_A_ARG_TYPE_ConnectionStatus.INSUFFICIENTBANDWIDTH; break; case "UnreliableChannel": Args[i].DataValue = Enum_A_ARG_TYPE_ConnectionStatus.UNRELIABLECHANNEL; break; case "Unknown": Args[i].DataValue = Enum_A_ARG_TYPE_ConnectionStatus.UNKNOWN; break; default: SetUnspecifiedValue("Enum_A_ARG_TYPE_ConnectionStatus", (string)Args[i].DataValue); Args[i].DataValue = Enum_A_ARG_TYPE_ConnectionStatus._UNSPECIFIED_; break; } break; } } if(OnResult_GetCurrentConnectionInfo != null) { OnResult_GetCurrentConnectionInfo((System.Int32 )Args[0].DataValue, (System.Int32 )Args[1].DataValue, (System.Int32 )Args[2].DataValue, (System.String )Args[3].DataValue, (System.String )Args[4].DataValue, (System.Int32 )Args[5].DataValue, (Enum_A_ARG_TYPE_Direction )Args[6].DataValue, (Enum_A_ARG_TYPE_ConnectionStatus )Args[7].DataValue, null, Handle); } WeakReference[] w = (WeakReference[])WeakList_GetCurrentConnectionInfo.ToArray(typeof(WeakReference)); foreach(WeakReference wr in w) { if(wr.IsAlive==true) { ((Delegate_OnResult_GetCurrentConnectionInfo)wr.Target)((System.Int32 )Args[0].DataValue, (System.Int32 )Args[1].DataValue, (System.Int32 )Args[2].DataValue, (System.String )Args[3].DataValue, (System.String )Args[4].DataValue, (System.Int32 )Args[5].DataValue, (Enum_A_ARG_TYPE_Direction )Args[6].DataValue, (Enum_A_ARG_TYPE_ConnectionStatus )Args[7].DataValue, null, Handle); } else { WeakList_GetCurrentConnectionInfo.Remove(wr); } } }
public void Sync_GetCurrentConnectionInfo(System.Int32 ConnectionID, out System.Int32 RcsID, out System.Int32 AVTransportID, out System.String ProtocolInfo, out System.String PeerConnectionManager, out System.Int32 PeerConnectionID, out Enum_A_ARG_TYPE_Direction Direction, out Enum_A_ARG_TYPE_ConnectionStatus Status) { UPnPArgument[] args = new UPnPArgument[8]; args[0] = new UPnPArgument("ConnectionID", ConnectionID); args[1] = new UPnPArgument("RcsID", ""); args[2] = new UPnPArgument("AVTransportID", ""); args[3] = new UPnPArgument("ProtocolInfo", ""); args[4] = new UPnPArgument("PeerConnectionManager", ""); args[5] = new UPnPArgument("PeerConnectionID", ""); args[6] = new UPnPArgument("Direction", ""); args[7] = new UPnPArgument("Status", ""); _S.InvokeSync("GetCurrentConnectionInfo", args); for(int i=0;i<args.Length;++i) { switch(args[i].Name) { case "Direction": switch((string)args[i].DataValue) { case "Input": args[i].DataValue = Enum_A_ARG_TYPE_Direction.INPUT; break; case "Output": args[i].DataValue = Enum_A_ARG_TYPE_Direction.OUTPUT; break; default: SetUnspecifiedValue("Enum_A_ARG_TYPE_Direction", (string)args[i].DataValue); args[i].DataValue = Enum_A_ARG_TYPE_Direction._UNSPECIFIED_; break; } break; case "Status": switch((string)args[i].DataValue) { case "OK": args[i].DataValue = Enum_A_ARG_TYPE_ConnectionStatus.OK; break; case "ContentFormatMismatch": args[i].DataValue = Enum_A_ARG_TYPE_ConnectionStatus.CONTENTFORMATMISMATCH; break; case "InsufficientBandwidth": args[i].DataValue = Enum_A_ARG_TYPE_ConnectionStatus.INSUFFICIENTBANDWIDTH; break; case "UnreliableChannel": args[i].DataValue = Enum_A_ARG_TYPE_ConnectionStatus.UNRELIABLECHANNEL; break; case "Unknown": args[i].DataValue = Enum_A_ARG_TYPE_ConnectionStatus.UNKNOWN; break; default: SetUnspecifiedValue("Enum_A_ARG_TYPE_ConnectionStatus", (string)args[i].DataValue); args[i].DataValue = Enum_A_ARG_TYPE_ConnectionStatus._UNSPECIFIED_; break; } break; } } ConnectionID = (System.Int32) args[0].DataValue; RcsID = (System.Int32) args[1].DataValue; AVTransportID = (System.Int32) args[2].DataValue; ProtocolInfo = (System.String) args[3].DataValue; PeerConnectionManager = (System.String) args[4].DataValue; PeerConnectionID = (System.Int32) args[5].DataValue; Direction = (Enum_A_ARG_TYPE_Direction) args[6].DataValue; Status = (Enum_A_ARG_TYPE_ConnectionStatus) args[7].DataValue; return; }
private void Sink_GetTransportInfo(UPnPService sender, string MethodName, UPnPArgument[] Args, object RetVal, int Handle) { for(int i=0;i<Args.Length;++i) { switch(Args[i].Name) { case "CurrentTransportState": switch((string)Args[i].DataValue) { case "STOPPED": Args[i].DataValue = Enum_TransportState.STOPPED; break; case "PAUSED_PLAYBACK": Args[i].DataValue = Enum_TransportState.PAUSED_PLAYBACK; break; case "PAUSED_RECORDING": Args[i].DataValue = Enum_TransportState.PAUSED_RECORDING; break; case "PLAYING": Args[i].DataValue = Enum_TransportState.PLAYING; break; case "RECORDING": Args[i].DataValue = Enum_TransportState.RECORDING; break; case "TRANSITIONING": Args[i].DataValue = Enum_TransportState.TRANSITIONING; break; case "NO_MEDIA_PRESENT": Args[i].DataValue = Enum_TransportState.NO_MEDIA_PRESENT; break; default: SetUnspecifiedValue("Enum_TransportState", (string)Args[i].DataValue); Args[i].DataValue = Enum_TransportState._UNSPECIFIED_; break; } break; case "CurrentTransportStatus": switch((string)Args[i].DataValue) { case "OK": Args[i].DataValue = Enum_TransportStatus.OK; break; case "ERROR_OCCURRED": Args[i].DataValue = Enum_TransportStatus.ERROR_OCCURRED; break; case " vendor-defined ": Args[i].DataValue = Enum_TransportStatus._VENDOR_DEFINED_; break; default: SetUnspecifiedValue("Enum_TransportStatus", (string)Args[i].DataValue); Args[i].DataValue = Enum_TransportStatus._UNSPECIFIED_; break; } break; case "CurrentSpeed": switch((string)Args[i].DataValue) { case "1": Args[i].DataValue = Enum_TransportPlaySpeed._1; break; case " vendor-defined ": Args[i].DataValue = Enum_TransportPlaySpeed._VENDOR_DEFINED_; break; default: SetUnspecifiedValue("Enum_TransportPlaySpeed", (string)Args[i].DataValue); Args[i].DataValue = Enum_TransportPlaySpeed._UNSPECIFIED_; break; } break; } } if(OnResult_GetTransportInfo != null) { OnResult_GetTransportInfo((System.UInt32 )Args[0].DataValue, (Enum_TransportState )Args[1].DataValue, (Enum_TransportStatus )Args[2].DataValue, (Enum_TransportPlaySpeed )Args[3].DataValue, null, Handle); } WeakReference[] w = (WeakReference[])WeakList_GetTransportInfo.ToArray(typeof(WeakReference)); foreach(WeakReference wr in w) { if(wr.IsAlive==true) { ((Delegate_OnResult_GetTransportInfo)wr.Target)((System.UInt32 )Args[0].DataValue, (Enum_TransportState )Args[1].DataValue, (Enum_TransportStatus )Args[2].DataValue, (Enum_TransportPlaySpeed )Args[3].DataValue, null, Handle); } else { WeakList_GetTransportInfo.Remove(wr); } } }
private void Error_Sink_SetRecordQualityMode(UPnPService sender, string MethodName, UPnPArgument[] Args, UPnPInvokeException e, int Handle) { for(int i=0;i<Args.Length;++i) { switch(Args[i].Name) { case "NewRecordQualityMode": switch((string)Args[i].DataValue) { case "0:EP": Args[i].DataValue = Enum_CurrentRecordQualityMode._0_EP; break; case "1:LP": Args[i].DataValue = Enum_CurrentRecordQualityMode._1_LP; break; case "2:SP": Args[i].DataValue = Enum_CurrentRecordQualityMode._2_SP; break; case "0:BASIC": Args[i].DataValue = Enum_CurrentRecordQualityMode._0_BASIC; break; case "1:MEDIUM": Args[i].DataValue = Enum_CurrentRecordQualityMode._1_MEDIUM; break; case "2:HIGH": Args[i].DataValue = Enum_CurrentRecordQualityMode._2_HIGH; break; case "NOT_IMPLEMENTED": Args[i].DataValue = Enum_CurrentRecordQualityMode.NOT_IMPLEMENTED; break; case " vendor-defined ": Args[i].DataValue = Enum_CurrentRecordQualityMode._VENDOR_DEFINED_; break; } break; } } if(OnResult_SetRecordQualityMode != null) { OnResult_SetRecordQualityMode((System.UInt32 )Args[0].DataValue, (Enum_CurrentRecordQualityMode )Args[1].DataValue, e, Handle); } WeakReference[] w = (WeakReference[])WeakList_SetRecordQualityMode.ToArray(typeof(WeakReference)); foreach(WeakReference wr in w) { if(wr.IsAlive==true) { ((Delegate_OnResult_SetRecordQualityMode)wr.Target)((System.UInt32 )Args[0].DataValue, (Enum_CurrentRecordQualityMode )Args[1].DataValue, e, Handle); } else { WeakList_SetRecordQualityMode.Remove(wr); } } }
public void Sync_GetProtocolInfo(out System.String Source, out System.String Sink) { UPnPArgument[] args = new UPnPArgument[2]; args[0] = new UPnPArgument("Source", ""); args[1] = new UPnPArgument("Sink", ""); _S.InvokeSync("GetProtocolInfo", args); Source = (System.String) args[0].DataValue; Sink = (System.String) args[1].DataValue; return; }
public void Sync_PrepareForConnection(System.String RemoteProtocolInfo, System.String PeerConnectionManager, System.Int32 PeerConnectionID, Enum_A_ARG_TYPE_Direction Direction, out System.Int32 ConnectionID, out System.Int32 AVTransportID, out System.Int32 RcsID) { UPnPArgument[] args = new UPnPArgument[7]; args[0] = new UPnPArgument("RemoteProtocolInfo", RemoteProtocolInfo); args[1] = new UPnPArgument("PeerConnectionManager", PeerConnectionManager); args[2] = new UPnPArgument("PeerConnectionID", PeerConnectionID); switch(Direction) { case Enum_A_ARG_TYPE_Direction.INPUT: args[3] = new UPnPArgument("Direction", "Input"); break; case Enum_A_ARG_TYPE_Direction.OUTPUT: args[3] = new UPnPArgument("Direction", "Output"); break; default: args[3] = new UPnPArgument("Direction", GetUnspecifiedValue("Enum_A_ARG_TYPE_Direction")); break; } args[4] = new UPnPArgument("ConnectionID", ""); args[5] = new UPnPArgument("AVTransportID", ""); args[6] = new UPnPArgument("RcsID", ""); _S.InvokeSync("PrepareForConnection", args); for(int i=0;i<args.Length;++i) { switch(args[i].Name) { case "Direction": switch((string)args[i].DataValue) { case "Input": args[i].DataValue = Enum_A_ARG_TYPE_Direction.INPUT; break; case "Output": args[i].DataValue = Enum_A_ARG_TYPE_Direction.OUTPUT; break; default: SetUnspecifiedValue("Enum_A_ARG_TYPE_Direction", (string)args[i].DataValue); args[i].DataValue = Enum_A_ARG_TYPE_Direction._UNSPECIFIED_; break; } break; } } RemoteProtocolInfo = (System.String) args[0].DataValue; PeerConnectionManager = (System.String) args[1].DataValue; PeerConnectionID = (System.Int32) args[2].DataValue; Direction = (Enum_A_ARG_TYPE_Direction) args[3].DataValue; ConnectionID = (System.Int32) args[4].DataValue; AVTransportID = (System.Int32) args[5].DataValue; RcsID = (System.Int32) args[6].DataValue; return; }
public int GetProtocolInfo() { UPnPArgument[] args = new UPnPArgument[2]; args[0] = new UPnPArgument("Source", ""); args[1] = new UPnPArgument("Sink", ""); return(_S.InvokeAsync("GetProtocolInfo", args, new UPnPService.UPnPServiceInvokeHandler(Sink_GetProtocolInfo), new UPnPService.UPnPServiceInvokeErrorHandler(Error_Sink_GetProtocolInfo))); }
private void Error_Sink_Seek(UPnPService sender, string MethodName, UPnPArgument[] Args, UPnPInvokeException e, int Handle) { for(int i=0;i<Args.Length;++i) { switch(Args[i].Name) { case "Unit": switch((string)Args[i].DataValue) { case "ABS_TIME": Args[i].DataValue = Enum_A_ARG_TYPE_SeekMode.ABS_TIME; break; case "REL_TIME": Args[i].DataValue = Enum_A_ARG_TYPE_SeekMode.REL_TIME; break; case "ABS_COUNT": Args[i].DataValue = Enum_A_ARG_TYPE_SeekMode.ABS_COUNT; break; case "REL_COUNT": Args[i].DataValue = Enum_A_ARG_TYPE_SeekMode.REL_COUNT; break; case "TRACK_NR": Args[i].DataValue = Enum_A_ARG_TYPE_SeekMode.TRACK_NR; break; case "CHANNEL_FREQ": Args[i].DataValue = Enum_A_ARG_TYPE_SeekMode.CHANNEL_FREQ; break; case "TAPE-INDEX": Args[i].DataValue = Enum_A_ARG_TYPE_SeekMode.TAPE_INDEX; break; case "FRAME": Args[i].DataValue = Enum_A_ARG_TYPE_SeekMode.FRAME; break; } break; } } if(OnResult_Seek != null) { OnResult_Seek((System.UInt32 )Args[0].DataValue, (Enum_A_ARG_TYPE_SeekMode )Args[1].DataValue, (System.String )Args[2].DataValue, e, Handle); } WeakReference[] w = (WeakReference[])WeakList_Seek.ToArray(typeof(WeakReference)); foreach(WeakReference wr in w) { if(wr.IsAlive==true) { ((Delegate_OnResult_Seek)wr.Target)((System.UInt32 )Args[0].DataValue, (Enum_A_ARG_TYPE_SeekMode )Args[1].DataValue, (System.String )Args[2].DataValue, e, Handle); } else { WeakList_Seek.Remove(wr); } } }
public int GetCurrentConnectionIDs() { UPnPArgument[] args = new UPnPArgument[1]; args[0] = new UPnPArgument("ConnectionIDs", ""); return(_S.InvokeAsync("GetCurrentConnectionIDs", args, new UPnPService.UPnPServiceInvokeHandler(Sink_GetCurrentConnectionIDs), new UPnPService.UPnPServiceInvokeErrorHandler(Error_Sink_GetCurrentConnectionIDs))); }
public int Seek(System.UInt32 InstanceID, Enum_A_ARG_TYPE_SeekMode Unit, System.String Target) { UPnPArgument[] args = new UPnPArgument[3]; args[0] = new UPnPArgument("InstanceID", InstanceID); switch(Unit) { case Enum_A_ARG_TYPE_SeekMode.ABS_TIME: args[1] = new UPnPArgument("Unit", "ABS_TIME"); break; case Enum_A_ARG_TYPE_SeekMode.REL_TIME: args[1] = new UPnPArgument("Unit", "REL_TIME"); break; case Enum_A_ARG_TYPE_SeekMode.ABS_COUNT: args[1] = new UPnPArgument("Unit", "ABS_COUNT"); break; case Enum_A_ARG_TYPE_SeekMode.REL_COUNT: args[1] = new UPnPArgument("Unit", "REL_COUNT"); break; case Enum_A_ARG_TYPE_SeekMode.TRACK_NR: args[1] = new UPnPArgument("Unit", "TRACK_NR"); break; case Enum_A_ARG_TYPE_SeekMode.CHANNEL_FREQ: args[1] = new UPnPArgument("Unit", "CHANNEL_FREQ"); break; case Enum_A_ARG_TYPE_SeekMode.TAPE_INDEX: args[1] = new UPnPArgument("Unit", "TAPE-INDEX"); break; case Enum_A_ARG_TYPE_SeekMode.FRAME: args[1] = new UPnPArgument("Unit", "FRAME"); break; default: args[1] = new UPnPArgument("Unit", GetUnspecifiedValue("Enum_A_ARG_TYPE_SeekMode")); break; } args[2] = new UPnPArgument("Target", Target); return(_S.InvokeAsync("Seek", args, new UPnPService.UPnPServiceInvokeHandler(Sink_Seek), new UPnPService.UPnPServiceInvokeErrorHandler(Error_Sink_Seek))); }
private void Error_Sink_GetCurrentConnectionIDs(UPnPService sender, string MethodName, UPnPArgument[] Args, UPnPInvokeException e, int Handle) { if(OnResult_GetCurrentConnectionIDs != null) { OnResult_GetCurrentConnectionIDs((System.String)UPnPService.CreateObjectInstance(typeof(System.String),null), e, Handle); } WeakReference[] w = (WeakReference[])WeakList_GetCurrentConnectionIDs.ToArray(typeof(WeakReference)); foreach(WeakReference wr in w) { if(wr.IsAlive==true) { ((Delegate_OnResult_GetCurrentConnectionIDs)wr.Target)((System.String)UPnPService.CreateObjectInstance(typeof(System.String),null), e, Handle); } else { WeakList_GetCurrentConnectionIDs.Remove(wr); } } }
public int GetPositionInfo(System.UInt32 InstanceID) { UPnPArgument[] args = new UPnPArgument[9]; args[0] = new UPnPArgument("InstanceID", InstanceID); args[1] = new UPnPArgument("Track", ""); args[2] = new UPnPArgument("TrackDuration", ""); args[3] = new UPnPArgument("TrackMetaData", ""); args[4] = new UPnPArgument("TrackURI", ""); args[5] = new UPnPArgument("RelTime", ""); args[6] = new UPnPArgument("AbsTime", ""); args[7] = new UPnPArgument("RelCount", ""); args[8] = new UPnPArgument("AbsCount", ""); return(_S.InvokeAsync("GetPositionInfo", args, new UPnPService.UPnPServiceInvokeHandler(Sink_GetPositionInfo), new UPnPService.UPnPServiceInvokeErrorHandler(Error_Sink_GetPositionInfo))); }
private void Sink_GetPositionInfo(UPnPService sender, string MethodName, UPnPArgument[] Args, object RetVal, int Handle) { if(OnResult_GetPositionInfo != null) { OnResult_GetPositionInfo((System.UInt32 )Args[0].DataValue, (System.UInt32 )Args[1].DataValue, (System.String )Args[2].DataValue, (System.String )Args[3].DataValue, (System.String )Args[4].DataValue, (System.String )Args[5].DataValue, (System.String )Args[6].DataValue, (System.Int32 )Args[7].DataValue, (System.Int32 )Args[8].DataValue, null, Handle); } WeakReference[] w = (WeakReference[])WeakList_GetPositionInfo.ToArray(typeof(WeakReference)); foreach(WeakReference wr in w) { if(wr.IsAlive==true) { ((Delegate_OnResult_GetPositionInfo)wr.Target)((System.UInt32 )Args[0].DataValue, (System.UInt32 )Args[1].DataValue, (System.String )Args[2].DataValue, (System.String )Args[3].DataValue, (System.String )Args[4].DataValue, (System.String )Args[5].DataValue, (System.String )Args[6].DataValue, (System.Int32 )Args[7].DataValue, (System.Int32 )Args[8].DataValue, null, Handle); } else { WeakList_GetPositionInfo.Remove(wr); } } }
public void Sync_ConnectionComplete(System.Int32 ConnectionID) { UPnPArgument[] args = new UPnPArgument[1]; args[0] = new UPnPArgument("ConnectionID", ConnectionID); _S.InvokeSync("ConnectionComplete", args); ConnectionID = (System.Int32) args[0].DataValue; return; }
public void Sync_Seek(System.UInt32 InstanceID, Enum_A_ARG_TYPE_SeekMode Unit, System.String Target) { UPnPArgument[] args = new UPnPArgument[3]; args[0] = new UPnPArgument("InstanceID", InstanceID); switch(Unit) { case Enum_A_ARG_TYPE_SeekMode.ABS_TIME: args[1] = new UPnPArgument("Unit", "ABS_TIME"); break; case Enum_A_ARG_TYPE_SeekMode.REL_TIME: args[1] = new UPnPArgument("Unit", "REL_TIME"); break; case Enum_A_ARG_TYPE_SeekMode.ABS_COUNT: args[1] = new UPnPArgument("Unit", "ABS_COUNT"); break; case Enum_A_ARG_TYPE_SeekMode.REL_COUNT: args[1] = new UPnPArgument("Unit", "REL_COUNT"); break; case Enum_A_ARG_TYPE_SeekMode.TRACK_NR: args[1] = new UPnPArgument("Unit", "TRACK_NR"); break; case Enum_A_ARG_TYPE_SeekMode.CHANNEL_FREQ: args[1] = new UPnPArgument("Unit", "CHANNEL_FREQ"); break; case Enum_A_ARG_TYPE_SeekMode.TAPE_INDEX: args[1] = new UPnPArgument("Unit", "TAPE-INDEX"); break; case Enum_A_ARG_TYPE_SeekMode.FRAME: args[1] = new UPnPArgument("Unit", "FRAME"); break; default: args[1] = new UPnPArgument("Unit", GetUnspecifiedValue("Enum_A_ARG_TYPE_SeekMode")); break; } args[2] = new UPnPArgument("Target", Target); _S.InvokeSync("Seek", args); for(int i=0;i<args.Length;++i) { switch(args[i].Name) { case "Unit": switch((string)args[i].DataValue) { case "ABS_TIME": args[i].DataValue = Enum_A_ARG_TYPE_SeekMode.ABS_TIME; break; case "REL_TIME": args[i].DataValue = Enum_A_ARG_TYPE_SeekMode.REL_TIME; break; case "ABS_COUNT": args[i].DataValue = Enum_A_ARG_TYPE_SeekMode.ABS_COUNT; break; case "REL_COUNT": args[i].DataValue = Enum_A_ARG_TYPE_SeekMode.REL_COUNT; break; case "TRACK_NR": args[i].DataValue = Enum_A_ARG_TYPE_SeekMode.TRACK_NR; break; case "CHANNEL_FREQ": args[i].DataValue = Enum_A_ARG_TYPE_SeekMode.CHANNEL_FREQ; break; case "TAPE-INDEX": args[i].DataValue = Enum_A_ARG_TYPE_SeekMode.TAPE_INDEX; break; case "FRAME": args[i].DataValue = Enum_A_ARG_TYPE_SeekMode.FRAME; break; default: SetUnspecifiedValue("Enum_A_ARG_TYPE_SeekMode", (string)args[i].DataValue); args[i].DataValue = Enum_A_ARG_TYPE_SeekMode._UNSPECIFIED_; break; } break; } } InstanceID = (System.UInt32) args[0].DataValue; Unit = (Enum_A_ARG_TYPE_SeekMode) args[1].DataValue; Target = (System.String) args[2].DataValue; return; }
public void Sync_SetRecordQualityMode(System.UInt32 InstanceID, Enum_CurrentRecordQualityMode NewRecordQualityMode) { UPnPArgument[] args = new UPnPArgument[2]; args[0] = new UPnPArgument("InstanceID", InstanceID); switch(NewRecordQualityMode) { case Enum_CurrentRecordQualityMode._0_EP: args[1] = new UPnPArgument("NewRecordQualityMode", "0:EP"); break; case Enum_CurrentRecordQualityMode._1_LP: args[1] = new UPnPArgument("NewRecordQualityMode", "1:LP"); break; case Enum_CurrentRecordQualityMode._2_SP: args[1] = new UPnPArgument("NewRecordQualityMode", "2:SP"); break; case Enum_CurrentRecordQualityMode._0_BASIC: args[1] = new UPnPArgument("NewRecordQualityMode", "0:BASIC"); break; case Enum_CurrentRecordQualityMode._1_MEDIUM: args[1] = new UPnPArgument("NewRecordQualityMode", "1:MEDIUM"); break; case Enum_CurrentRecordQualityMode._2_HIGH: args[1] = new UPnPArgument("NewRecordQualityMode", "2:HIGH"); break; case Enum_CurrentRecordQualityMode.NOT_IMPLEMENTED: args[1] = new UPnPArgument("NewRecordQualityMode", "NOT_IMPLEMENTED"); break; case Enum_CurrentRecordQualityMode._VENDOR_DEFINED_: args[1] = new UPnPArgument("NewRecordQualityMode", " vendor-defined "); break; default: args[1] = new UPnPArgument("NewRecordQualityMode", GetUnspecifiedValue("Enum_CurrentRecordQualityMode")); break; } _S.InvokeSync("SetRecordQualityMode", args); for(int i=0;i<args.Length;++i) { switch(args[i].Name) { case "NewRecordQualityMode": switch((string)args[i].DataValue) { case "0:EP": args[i].DataValue = Enum_CurrentRecordQualityMode._0_EP; break; case "1:LP": args[i].DataValue = Enum_CurrentRecordQualityMode._1_LP; break; case "2:SP": args[i].DataValue = Enum_CurrentRecordQualityMode._2_SP; break; case "0:BASIC": args[i].DataValue = Enum_CurrentRecordQualityMode._0_BASIC; break; case "1:MEDIUM": args[i].DataValue = Enum_CurrentRecordQualityMode._1_MEDIUM; break; case "2:HIGH": args[i].DataValue = Enum_CurrentRecordQualityMode._2_HIGH; break; case "NOT_IMPLEMENTED": args[i].DataValue = Enum_CurrentRecordQualityMode.NOT_IMPLEMENTED; break; case " vendor-defined ": args[i].DataValue = Enum_CurrentRecordQualityMode._VENDOR_DEFINED_; break; default: SetUnspecifiedValue("Enum_CurrentRecordQualityMode", (string)args[i].DataValue); args[i].DataValue = Enum_CurrentRecordQualityMode._UNSPECIFIED_; break; } break; } } InstanceID = (System.UInt32) args[0].DataValue; NewRecordQualityMode = (Enum_CurrentRecordQualityMode) args[1].DataValue; return; }
public int PrepareForConnection(System.String RemoteProtocolInfo, System.String PeerConnectionManager, System.Int32 PeerConnectionID, Enum_A_ARG_TYPE_Direction Direction) { UPnPArgument[] args = new UPnPArgument[7]; args[0] = new UPnPArgument("RemoteProtocolInfo", RemoteProtocolInfo); args[1] = new UPnPArgument("PeerConnectionManager", PeerConnectionManager); args[2] = new UPnPArgument("PeerConnectionID", PeerConnectionID); switch(Direction) { case Enum_A_ARG_TYPE_Direction.INPUT: args[3] = new UPnPArgument("Direction", "Input"); break; case Enum_A_ARG_TYPE_Direction.OUTPUT: args[3] = new UPnPArgument("Direction", "Output"); break; default: args[3] = new UPnPArgument("Direction", GetUnspecifiedValue("Enum_A_ARG_TYPE_Direction")); break; } args[4] = new UPnPArgument("ConnectionID", ""); args[5] = new UPnPArgument("AVTransportID", ""); args[6] = new UPnPArgument("RcsID", ""); return(_S.InvokeAsync("PrepareForConnection", args, new UPnPService.UPnPServiceInvokeHandler(Sink_PrepareForConnection), new UPnPService.UPnPServiceInvokeErrorHandler(Error_Sink_PrepareForConnection))); }
public void Sync_GetPositionInfo(System.UInt32 InstanceID, out System.UInt32 Track, out System.String TrackDuration, out System.String TrackMetaData, out System.String TrackURI, out System.String RelTime, out System.String AbsTime, out System.Int32 RelCount, out System.Int32 AbsCount) { UPnPArgument[] args = new UPnPArgument[9]; args[0] = new UPnPArgument("InstanceID", InstanceID); args[1] = new UPnPArgument("Track", ""); args[2] = new UPnPArgument("TrackDuration", ""); args[3] = new UPnPArgument("TrackMetaData", ""); args[4] = new UPnPArgument("TrackURI", ""); args[5] = new UPnPArgument("RelTime", ""); args[6] = new UPnPArgument("AbsTime", ""); args[7] = new UPnPArgument("RelCount", ""); args[8] = new UPnPArgument("AbsCount", ""); _S.InvokeSync("GetPositionInfo", args); InstanceID = (System.UInt32) args[0].DataValue; Track = (System.UInt32) args[1].DataValue; TrackDuration = (System.String) args[2].DataValue; TrackMetaData = (System.String) args[3].DataValue; TrackURI = (System.String) args[4].DataValue; RelTime = (System.String) args[5].DataValue; AbsTime = (System.String) args[6].DataValue; RelCount = (System.Int32) args[7].DataValue; AbsCount = (System.Int32) args[8].DataValue; return; }
private void Sink_PrepareForConnection(UPnPService sender, string MethodName, UPnPArgument[] Args, object RetVal, int Handle) { for(int i=0;i<Args.Length;++i) { switch(Args[i].Name) { case "Direction": switch((string)Args[i].DataValue) { case "Input": Args[i].DataValue = Enum_A_ARG_TYPE_Direction.INPUT; break; case "Output": Args[i].DataValue = Enum_A_ARG_TYPE_Direction.OUTPUT; break; default: SetUnspecifiedValue("Enum_A_ARG_TYPE_Direction", (string)Args[i].DataValue); Args[i].DataValue = Enum_A_ARG_TYPE_Direction._UNSPECIFIED_; break; } break; } } if(OnResult_PrepareForConnection != null) { OnResult_PrepareForConnection((System.String )Args[0].DataValue, (System.String )Args[1].DataValue, (System.Int32 )Args[2].DataValue, (Enum_A_ARG_TYPE_Direction )Args[3].DataValue, (System.Int32 )Args[4].DataValue, (System.Int32 )Args[5].DataValue, (System.Int32 )Args[6].DataValue, null, Handle); } WeakReference[] w = (WeakReference[])WeakList_PrepareForConnection.ToArray(typeof(WeakReference)); foreach(WeakReference wr in w) { if(wr.IsAlive==true) { ((Delegate_OnResult_PrepareForConnection)wr.Target)((System.String )Args[0].DataValue, (System.String )Args[1].DataValue, (System.Int32 )Args[2].DataValue, (Enum_A_ARG_TYPE_Direction )Args[3].DataValue, (System.Int32 )Args[4].DataValue, (System.Int32 )Args[5].DataValue, (System.Int32 )Args[6].DataValue, null, Handle); } else { WeakList_PrepareForConnection.Remove(wr); } } }
private void Error_Sink_PrepareForConnection(UPnPService sender, string MethodName, UPnPArgument[] Args, UPnPInvokeException e, int Handle) { for(int i=0;i<Args.Length;++i) { switch(Args[i].Name) { case "Direction": switch((string)Args[i].DataValue) { case "Input": Args[i].DataValue = Enum_A_ARG_TYPE_Direction.INPUT; break; case "Output": Args[i].DataValue = Enum_A_ARG_TYPE_Direction.OUTPUT; break; } break; } } if(OnResult_PrepareForConnection != null) { OnResult_PrepareForConnection((System.String )Args[0].DataValue, (System.String )Args[1].DataValue, (System.Int32 )Args[2].DataValue, (Enum_A_ARG_TYPE_Direction )Args[3].DataValue, (System.Int32)UPnPService.CreateObjectInstance(typeof(System.Int32),null), (System.Int32)UPnPService.CreateObjectInstance(typeof(System.Int32),null), (System.Int32)UPnPService.CreateObjectInstance(typeof(System.Int32),null), e, Handle); } WeakReference[] w = (WeakReference[])WeakList_PrepareForConnection.ToArray(typeof(WeakReference)); foreach(WeakReference wr in w) { if(wr.IsAlive==true) { ((Delegate_OnResult_PrepareForConnection)wr.Target)((System.String )Args[0].DataValue, (System.String )Args[1].DataValue, (System.Int32 )Args[2].DataValue, (Enum_A_ARG_TYPE_Direction )Args[3].DataValue, (System.Int32)UPnPService.CreateObjectInstance(typeof(System.Int32),null), (System.Int32)UPnPService.CreateObjectInstance(typeof(System.Int32),null), (System.Int32)UPnPService.CreateObjectInstance(typeof(System.Int32),null), e, Handle); } else { WeakList_PrepareForConnection.Remove(wr); } } }
public int SetRecordQualityMode(System.UInt32 InstanceID, Enum_CurrentRecordQualityMode NewRecordQualityMode) { UPnPArgument[] args = new UPnPArgument[2]; args[0] = new UPnPArgument("InstanceID", InstanceID); switch(NewRecordQualityMode) { case Enum_CurrentRecordQualityMode._0_EP: args[1] = new UPnPArgument("NewRecordQualityMode", "0:EP"); break; case Enum_CurrentRecordQualityMode._1_LP: args[1] = new UPnPArgument("NewRecordQualityMode", "1:LP"); break; case Enum_CurrentRecordQualityMode._2_SP: args[1] = new UPnPArgument("NewRecordQualityMode", "2:SP"); break; case Enum_CurrentRecordQualityMode._0_BASIC: args[1] = new UPnPArgument("NewRecordQualityMode", "0:BASIC"); break; case Enum_CurrentRecordQualityMode._1_MEDIUM: args[1] = new UPnPArgument("NewRecordQualityMode", "1:MEDIUM"); break; case Enum_CurrentRecordQualityMode._2_HIGH: args[1] = new UPnPArgument("NewRecordQualityMode", "2:HIGH"); break; case Enum_CurrentRecordQualityMode.NOT_IMPLEMENTED: args[1] = new UPnPArgument("NewRecordQualityMode", "NOT_IMPLEMENTED"); break; case Enum_CurrentRecordQualityMode._VENDOR_DEFINED_: args[1] = new UPnPArgument("NewRecordQualityMode", " vendor-defined "); break; default: args[1] = new UPnPArgument("NewRecordQualityMode", GetUnspecifiedValue("Enum_CurrentRecordQualityMode")); break; } return(_S.InvokeAsync("SetRecordQualityMode", args, new UPnPService.UPnPServiceInvokeHandler(Sink_SetRecordQualityMode), new UPnPService.UPnPServiceInvokeErrorHandler(Error_Sink_SetRecordQualityMode))); }
private void Error_Sink_GetTransportInfo(UPnPService sender, string MethodName, UPnPArgument[] Args, UPnPInvokeException e, int Handle) { if(OnResult_GetTransportInfo != null) { OnResult_GetTransportInfo((System.UInt32 )Args[0].DataValue, (Enum_TransportState)0, (Enum_TransportStatus)0, (Enum_TransportPlaySpeed)0, e, Handle); } WeakReference[] w = (WeakReference[])WeakList_GetTransportInfo.ToArray(typeof(WeakReference)); foreach(WeakReference wr in w) { if(wr.IsAlive==true) { ((Delegate_OnResult_GetTransportInfo)wr.Target)((System.UInt32 )Args[0].DataValue, (Enum_TransportState)0, (Enum_TransportStatus)0, (Enum_TransportPlaySpeed)0, e, Handle); } else { WeakList_GetTransportInfo.Remove(wr); } } }