ConnectionManagerXmlBuilder.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. #pragma warning disable CS1591
  2. using System.Collections.Generic;
  3. using Emby.Dlna.Common;
  4. using Emby.Dlna.Service;
  5. namespace Emby.Dlna.ConnectionManager
  6. {
  7. /// <summary>
  8. /// Defines the <see cref="ConnectionManagerXmlBuilder" />.
  9. /// </summary>
  10. public static class ConnectionManagerXmlBuilder
  11. {
  12. /// <summary>
  13. /// Gets the ConnectionManager:1 service template.
  14. /// See http://upnp.org/specs/av/UPnP-av-ConnectionManager-v1-Service.pdf.
  15. /// </summary>
  16. /// <returns>An XML description of this service.</returns>
  17. public static string GetXml()
  18. {
  19. return new ServiceXmlBuilder().GetXml(ServiceActionListBuilder.GetActions(), GetStateVariables());
  20. }
  21. /// <summary>
  22. /// Get the list of state variables for this invocation.
  23. /// </summary>
  24. /// <returns>The <see cref="IEnumerable{StateVariable}"/>.</returns>
  25. private static IEnumerable<StateVariable> GetStateVariables()
  26. {
  27. var list = new List<StateVariable>
  28. {
  29. new StateVariable
  30. {
  31. Name = "SourceProtocolInfo",
  32. DataType = "string",
  33. SendsEvents = true
  34. },
  35. new StateVariable
  36. {
  37. Name = "SinkProtocolInfo",
  38. DataType = "string",
  39. SendsEvents = true
  40. },
  41. new StateVariable
  42. {
  43. Name = "CurrentConnectionIDs",
  44. DataType = "string",
  45. SendsEvents = true
  46. },
  47. new StateVariable
  48. {
  49. Name = "A_ARG_TYPE_ConnectionStatus",
  50. DataType = "string",
  51. SendsEvents = false,
  52. AllowedValues = new[]
  53. {
  54. "OK",
  55. "ContentFormatMismatch",
  56. "InsufficientBandwidth",
  57. "UnreliableChannel",
  58. "Unknown"
  59. }
  60. },
  61. new StateVariable
  62. {
  63. Name = "A_ARG_TYPE_ConnectionManager",
  64. DataType = "string",
  65. SendsEvents = false
  66. },
  67. new StateVariable
  68. {
  69. Name = "A_ARG_TYPE_Direction",
  70. DataType = "string",
  71. SendsEvents = false,
  72. AllowedValues = new[]
  73. {
  74. "Output",
  75. "Input"
  76. }
  77. },
  78. new StateVariable
  79. {
  80. Name = "A_ARG_TYPE_ProtocolInfo",
  81. DataType = "string",
  82. SendsEvents = false
  83. },
  84. new StateVariable
  85. {
  86. Name = "A_ARG_TYPE_ConnectionID",
  87. DataType = "ui4",
  88. SendsEvents = false
  89. },
  90. new StateVariable
  91. {
  92. Name = "A_ARG_TYPE_AVTransportID",
  93. DataType = "ui4",
  94. SendsEvents = false
  95. },
  96. new StateVariable
  97. {
  98. Name = "A_ARG_TYPE_RcsID",
  99. DataType = "ui4",
  100. SendsEvents = false
  101. }
  102. };
  103. return list;
  104. }
  105. }
  106. }