ConnectionManagerXmlBuilder.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. public class ConnectionManagerXmlBuilder
  8. {
  9. public string GetXml()
  10. {
  11. return new ServiceXmlBuilder().GetXml(new ServiceActionListBuilder().GetActions(), GetStateVariables());
  12. }
  13. private static IEnumerable<StateVariable> GetStateVariables()
  14. {
  15. var list = new List<StateVariable>();
  16. list.Add(new StateVariable
  17. {
  18. Name = "SourceProtocolInfo",
  19. DataType = "string",
  20. SendsEvents = true
  21. });
  22. list.Add(new StateVariable
  23. {
  24. Name = "SinkProtocolInfo",
  25. DataType = "string",
  26. SendsEvents = true
  27. });
  28. list.Add(new StateVariable
  29. {
  30. Name = "CurrentConnectionIDs",
  31. DataType = "string",
  32. SendsEvents = true
  33. });
  34. list.Add(new StateVariable
  35. {
  36. Name = "A_ARG_TYPE_ConnectionStatus",
  37. DataType = "string",
  38. SendsEvents = false,
  39. AllowedValues = new string[]
  40. {
  41. "OK",
  42. "ContentFormatMismatch",
  43. "InsufficientBandwidth",
  44. "UnreliableChannel",
  45. "Unknown"
  46. }
  47. });
  48. list.Add(new StateVariable
  49. {
  50. Name = "A_ARG_TYPE_ConnectionManager",
  51. DataType = "string",
  52. SendsEvents = false
  53. });
  54. list.Add(new StateVariable
  55. {
  56. Name = "A_ARG_TYPE_Direction",
  57. DataType = "string",
  58. SendsEvents = false,
  59. AllowedValues = new string[]
  60. {
  61. "Output",
  62. "Input"
  63. }
  64. });
  65. list.Add(new StateVariable
  66. {
  67. Name = "A_ARG_TYPE_ProtocolInfo",
  68. DataType = "string",
  69. SendsEvents = false
  70. });
  71. list.Add(new StateVariable
  72. {
  73. Name = "A_ARG_TYPE_ConnectionID",
  74. DataType = "ui4",
  75. SendsEvents = false
  76. });
  77. list.Add(new StateVariable
  78. {
  79. Name = "A_ARG_TYPE_AVTransportID",
  80. DataType = "ui4",
  81. SendsEvents = false
  82. });
  83. list.Add(new StateVariable
  84. {
  85. Name = "A_ARG_TYPE_RcsID",
  86. DataType = "ui4",
  87. SendsEvents = false
  88. });
  89. return list;
  90. }
  91. }
  92. }