ConnectionManagerXmlBuilder.cs 2.8 KB

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