ServiceActionListBuilder.cs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. #pragma warning disable CS1591
  2. using System.Collections.Generic;
  3. using Emby.Dlna.Common;
  4. namespace Emby.Dlna.ConnectionManager
  5. {
  6. public class ServiceActionListBuilder
  7. {
  8. public IEnumerable<ServiceAction> GetActions()
  9. {
  10. var list = new List<ServiceAction>
  11. {
  12. GetCurrentConnectionInfo(),
  13. GetProtocolInfo(),
  14. GetCurrentConnectionIDs(),
  15. ConnectionComplete(),
  16. PrepareForConnection()
  17. };
  18. return list;
  19. }
  20. private static ServiceAction PrepareForConnection()
  21. {
  22. var action = new ServiceAction
  23. {
  24. Name = "PrepareForConnection"
  25. };
  26. action.ArgumentList.Add(new Argument
  27. {
  28. Name = "RemoteProtocolInfo",
  29. Direction = "in",
  30. RelatedStateVariable = "A_ARG_TYPE_ProtocolInfo"
  31. });
  32. action.ArgumentList.Add(new Argument
  33. {
  34. Name = "PeerConnectionManager",
  35. Direction = "in",
  36. RelatedStateVariable = "A_ARG_TYPE_ConnectionManager"
  37. });
  38. action.ArgumentList.Add(new Argument
  39. {
  40. Name = "PeerConnectionID",
  41. Direction = "in",
  42. RelatedStateVariable = "A_ARG_TYPE_ConnectionID"
  43. });
  44. action.ArgumentList.Add(new Argument
  45. {
  46. Name = "Direction",
  47. Direction = "in",
  48. RelatedStateVariable = "A_ARG_TYPE_Direction"
  49. });
  50. action.ArgumentList.Add(new Argument
  51. {
  52. Name = "ConnectionID",
  53. Direction = "out",
  54. RelatedStateVariable = "A_ARG_TYPE_ConnectionID"
  55. });
  56. action.ArgumentList.Add(new Argument
  57. {
  58. Name = "AVTransportID",
  59. Direction = "out",
  60. RelatedStateVariable = "A_ARG_TYPE_AVTransportID"
  61. });
  62. action.ArgumentList.Add(new Argument
  63. {
  64. Name = "RcsID",
  65. Direction = "out",
  66. RelatedStateVariable = "A_ARG_TYPE_RcsID"
  67. });
  68. return action;
  69. }
  70. private static ServiceAction GetCurrentConnectionInfo()
  71. {
  72. var action = new ServiceAction
  73. {
  74. Name = "GetCurrentConnectionInfo"
  75. };
  76. action.ArgumentList.Add(new Argument
  77. {
  78. Name = "ConnectionID",
  79. Direction = "in",
  80. RelatedStateVariable = "A_ARG_TYPE_ConnectionID"
  81. });
  82. action.ArgumentList.Add(new Argument
  83. {
  84. Name = "RcsID",
  85. Direction = "out",
  86. RelatedStateVariable = "A_ARG_TYPE_RcsID"
  87. });
  88. action.ArgumentList.Add(new Argument
  89. {
  90. Name = "AVTransportID",
  91. Direction = "out",
  92. RelatedStateVariable = "A_ARG_TYPE_AVTransportID"
  93. });
  94. action.ArgumentList.Add(new Argument
  95. {
  96. Name = "ProtocolInfo",
  97. Direction = "out",
  98. RelatedStateVariable = "A_ARG_TYPE_ProtocolInfo"
  99. });
  100. action.ArgumentList.Add(new Argument
  101. {
  102. Name = "PeerConnectionManager",
  103. Direction = "out",
  104. RelatedStateVariable = "A_ARG_TYPE_ConnectionManager"
  105. });
  106. action.ArgumentList.Add(new Argument
  107. {
  108. Name = "PeerConnectionID",
  109. Direction = "out",
  110. RelatedStateVariable = "A_ARG_TYPE_ConnectionID"
  111. });
  112. action.ArgumentList.Add(new Argument
  113. {
  114. Name = "Direction",
  115. Direction = "out",
  116. RelatedStateVariable = "A_ARG_TYPE_Direction"
  117. });
  118. action.ArgumentList.Add(new Argument
  119. {
  120. Name = "Status",
  121. Direction = "out",
  122. RelatedStateVariable = "A_ARG_TYPE_ConnectionStatus"
  123. });
  124. return action;
  125. }
  126. private ServiceAction GetProtocolInfo()
  127. {
  128. var action = new ServiceAction
  129. {
  130. Name = "GetProtocolInfo"
  131. };
  132. action.ArgumentList.Add(new Argument
  133. {
  134. Name = "Source",
  135. Direction = "out",
  136. RelatedStateVariable = "SourceProtocolInfo"
  137. });
  138. action.ArgumentList.Add(new Argument
  139. {
  140. Name = "Sink",
  141. Direction = "out",
  142. RelatedStateVariable = "SinkProtocolInfo"
  143. });
  144. return action;
  145. }
  146. private ServiceAction GetCurrentConnectionIDs()
  147. {
  148. var action = new ServiceAction
  149. {
  150. Name = "GetCurrentConnectionIDs"
  151. };
  152. action.ArgumentList.Add(new Argument
  153. {
  154. Name = "ConnectionIDs",
  155. Direction = "out",
  156. RelatedStateVariable = "CurrentConnectionIDs"
  157. });
  158. return action;
  159. }
  160. private ServiceAction ConnectionComplete()
  161. {
  162. var action = new ServiceAction
  163. {
  164. Name = "ConnectionComplete"
  165. };
  166. action.ArgumentList.Add(new Argument
  167. {
  168. Name = "ConnectionID",
  169. Direction = "in",
  170. RelatedStateVariable = "A_ARG_TYPE_ConnectionID"
  171. });
  172. return action;
  173. }
  174. }
  175. }