123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234 |
- #pragma warning disable CS1591
- using System.Collections.Generic;
- using Emby.Dlna.Common;
- namespace Emby.Dlna.ConnectionManager
- {
- /// <summary>
- /// Defines the <see cref="ServiceActionListBuilder" />.
- /// </summary>
- public static class ServiceActionListBuilder
- {
- /// <summary>
- /// Returns an enumerable of the ConnectionManagar:1 DLNA actions.
- /// </summary>
- /// <returns>An <see cref="IEnumerable{ServiceAction}"/>.</returns>
- public static IEnumerable<ServiceAction> GetActions()
- {
- var list = new List<ServiceAction>
- {
- GetCurrentConnectionInfo(),
- GetProtocolInfo(),
- GetCurrentConnectionIDs(),
- ConnectionComplete(),
- PrepareForConnection()
- };
- return list;
- }
- /// <summary>
- /// Returns the action details for "PrepareForConnection".
- /// </summary>
- /// <returns>The <see cref="ServiceAction"/>.</returns>
- private static ServiceAction PrepareForConnection()
- {
- var action = new ServiceAction
- {
- Name = "PrepareForConnection"
- };
- action.ArgumentList.Add(new Argument
- {
- Name = "RemoteProtocolInfo",
- Direction = "in",
- RelatedStateVariable = "A_ARG_TYPE_ProtocolInfo"
- });
- action.ArgumentList.Add(new Argument
- {
- Name = "PeerConnectionManager",
- Direction = "in",
- RelatedStateVariable = "A_ARG_TYPE_ConnectionManager"
- });
- action.ArgumentList.Add(new Argument
- {
- Name = "PeerConnectionID",
- Direction = "in",
- RelatedStateVariable = "A_ARG_TYPE_ConnectionID"
- });
- action.ArgumentList.Add(new Argument
- {
- Name = "Direction",
- Direction = "in",
- RelatedStateVariable = "A_ARG_TYPE_Direction"
- });
- action.ArgumentList.Add(new Argument
- {
- Name = "ConnectionID",
- Direction = "out",
- RelatedStateVariable = "A_ARG_TYPE_ConnectionID"
- });
- action.ArgumentList.Add(new Argument
- {
- Name = "AVTransportID",
- Direction = "out",
- RelatedStateVariable = "A_ARG_TYPE_AVTransportID"
- });
- action.ArgumentList.Add(new Argument
- {
- Name = "RcsID",
- Direction = "out",
- RelatedStateVariable = "A_ARG_TYPE_RcsID"
- });
- return action;
- }
- /// <summary>
- /// Returns the action details for "GetCurrentConnectionInfo".
- /// </summary>
- /// <returns>The <see cref="ServiceAction"/>.</returns>
- private static ServiceAction GetCurrentConnectionInfo()
- {
- var action = new ServiceAction
- {
- Name = "GetCurrentConnectionInfo"
- };
- action.ArgumentList.Add(new Argument
- {
- Name = "ConnectionID",
- Direction = "in",
- RelatedStateVariable = "A_ARG_TYPE_ConnectionID"
- });
- action.ArgumentList.Add(new Argument
- {
- Name = "RcsID",
- Direction = "out",
- RelatedStateVariable = "A_ARG_TYPE_RcsID"
- });
- action.ArgumentList.Add(new Argument
- {
- Name = "AVTransportID",
- Direction = "out",
- RelatedStateVariable = "A_ARG_TYPE_AVTransportID"
- });
- action.ArgumentList.Add(new Argument
- {
- Name = "ProtocolInfo",
- Direction = "out",
- RelatedStateVariable = "A_ARG_TYPE_ProtocolInfo"
- });
- action.ArgumentList.Add(new Argument
- {
- Name = "PeerConnectionManager",
- Direction = "out",
- RelatedStateVariable = "A_ARG_TYPE_ConnectionManager"
- });
- action.ArgumentList.Add(new Argument
- {
- Name = "PeerConnectionID",
- Direction = "out",
- RelatedStateVariable = "A_ARG_TYPE_ConnectionID"
- });
- action.ArgumentList.Add(new Argument
- {
- Name = "Direction",
- Direction = "out",
- RelatedStateVariable = "A_ARG_TYPE_Direction"
- });
- action.ArgumentList.Add(new Argument
- {
- Name = "Status",
- Direction = "out",
- RelatedStateVariable = "A_ARG_TYPE_ConnectionStatus"
- });
- return action;
- }
- /// <summary>
- /// Returns the action details for "GetProtocolInfo".
- /// </summary>
- /// <returns>The <see cref="ServiceAction"/>.</returns>
- private static ServiceAction GetProtocolInfo()
- {
- var action = new ServiceAction
- {
- Name = "GetProtocolInfo"
- };
- action.ArgumentList.Add(new Argument
- {
- Name = "Source",
- Direction = "out",
- RelatedStateVariable = "SourceProtocolInfo"
- });
- action.ArgumentList.Add(new Argument
- {
- Name = "Sink",
- Direction = "out",
- RelatedStateVariable = "SinkProtocolInfo"
- });
- return action;
- }
- /// <summary>
- /// Returns the action details for "GetCurrentConnectionIDs".
- /// </summary>
- /// <returns>The <see cref="ServiceAction"/>.</returns>
- private static ServiceAction GetCurrentConnectionIDs()
- {
- var action = new ServiceAction
- {
- Name = "GetCurrentConnectionIDs"
- };
- action.ArgumentList.Add(new Argument
- {
- Name = "ConnectionIDs",
- Direction = "out",
- RelatedStateVariable = "CurrentConnectionIDs"
- });
- return action;
- }
- /// <summary>
- /// Returns the action details for "ConnectionComplete".
- /// </summary>
- /// <returns>The <see cref="ServiceAction"/>.</returns>
- private static ServiceAction ConnectionComplete()
- {
- var action = new ServiceAction
- {
- Name = "ConnectionComplete"
- };
- action.ArgumentList.Add(new Argument
- {
- Name = "ConnectionID",
- Direction = "in",
- RelatedStateVariable = "A_ARG_TYPE_ConnectionID"
- });
- return action;
- }
- }
- }
|