jellyfin/Emby.Dlna/ConnectionManager/ConnectionManagerXmlBuilder.cs

109 lines
2.8 KiB
C#
Raw Normal View History

#pragma warning disable CS1591
2019-01-13 20:16:19 +01:00
using System.Collections.Generic;
using Emby.Dlna.Common;
2016-10-30 00:34:54 +02:00
using Emby.Dlna.Service;
2016-10-30 00:22:20 +02:00
2016-10-30 00:34:54 +02:00
namespace Emby.Dlna.ConnectionManager
2016-10-30 00:22:20 +02:00
{
public class ConnectionManagerXmlBuilder
{
public string GetXml()
{
return new ServiceXmlBuilder().GetXml(new ServiceActionListBuilder().GetActions(), GetStateVariables());
}
private static IEnumerable<StateVariable> GetStateVariables()
2016-10-30 00:22:20 +02:00
{
var list = new List<StateVariable>();
list.Add(new StateVariable
{
Name = "SourceProtocolInfo",
DataType = "string",
SendsEvents = true
});
list.Add(new StateVariable
{
Name = "SinkProtocolInfo",
DataType = "string",
SendsEvents = true
});
list.Add(new StateVariable
{
Name = "CurrentConnectionIDs",
DataType = "string",
SendsEvents = true
});
list.Add(new StateVariable
{
Name = "A_ARG_TYPE_ConnectionStatus",
DataType = "string",
SendsEvents = false,
2020-08-20 17:01:04 +02:00
AllowedValues = new[]
2016-10-30 00:22:20 +02:00
{
"OK",
"ContentFormatMismatch",
"InsufficientBandwidth",
"UnreliableChannel",
"Unknown"
}
});
list.Add(new StateVariable
{
Name = "A_ARG_TYPE_ConnectionManager",
DataType = "string",
SendsEvents = false
});
list.Add(new StateVariable
{
Name = "A_ARG_TYPE_Direction",
DataType = "string",
SendsEvents = false,
2020-08-20 17:01:04 +02:00
AllowedValues = new[]
2016-10-30 00:22:20 +02:00
{
"Output",
"Input"
}
});
list.Add(new StateVariable
{
Name = "A_ARG_TYPE_ProtocolInfo",
DataType = "string",
SendsEvents = false
});
list.Add(new StateVariable
{
Name = "A_ARG_TYPE_ConnectionID",
DataType = "ui4",
SendsEvents = false
});
list.Add(new StateVariable
{
Name = "A_ARG_TYPE_AVTransportID",
DataType = "ui4",
SendsEvents = false
});
list.Add(new StateVariable
{
Name = "A_ARG_TYPE_RcsID",
DataType = "ui4",
SendsEvents = false
});
return list;
}
}
}