2020-01-22 21:00:07 +01:00
|
|
|
#pragma warning disable CS1591
|
|
|
|
|
2019-01-13 20:16:19 +01:00
|
|
|
using System.Collections.Generic;
|
2019-01-06 21:50:43 +01:00
|
|
|
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
|
|
|
{
|
2020-09-13 15:18:15 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Defines the <see cref="ConnectionManagerXmlBuilder" />.
|
|
|
|
/// </summary>
|
|
|
|
public static class ConnectionManagerXmlBuilder
|
2016-10-30 00:22:20 +02:00
|
|
|
{
|
2020-09-13 15:18:15 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the ConnectionManager:1 service template.
|
|
|
|
/// See http://upnp.org/specs/av/UPnP-av-ConnectionManager-v1-Service.pdf.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>An XML description of this service.</returns>
|
|
|
|
public static string GetXml()
|
2016-10-30 00:22:20 +02:00
|
|
|
{
|
2020-09-13 15:18:15 +02:00
|
|
|
return new ServiceXmlBuilder().GetXml(ServiceActionListBuilder.GetActions(), GetStateVariables());
|
2016-10-30 00:22:20 +02:00
|
|
|
}
|
|
|
|
|
2020-09-13 15:18:15 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Get the list of state variables for this invocation.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>The <see cref="IEnumerable{StateVariable}"/>.</returns>
|
2019-01-06 21:50:43 +01:00
|
|
|
private static IEnumerable<StateVariable> GetStateVariables()
|
2016-10-30 00:22:20 +02:00
|
|
|
{
|
2023-03-01 00:44:57 +01:00
|
|
|
return new StateVariable[]
|
2016-10-30 00:22:20 +02:00
|
|
|
{
|
2020-09-13 15:18:15 +02:00
|
|
|
new StateVariable
|
|
|
|
{
|
|
|
|
Name = "SourceProtocolInfo",
|
|
|
|
DataType = "string",
|
|
|
|
SendsEvents = true
|
|
|
|
},
|
2016-10-30 00:22:20 +02:00
|
|
|
|
2020-09-13 15:18:15 +02:00
|
|
|
new StateVariable
|
|
|
|
{
|
|
|
|
Name = "SinkProtocolInfo",
|
|
|
|
DataType = "string",
|
|
|
|
SendsEvents = true
|
|
|
|
},
|
2016-10-30 00:22:20 +02:00
|
|
|
|
2020-09-13 15:18:15 +02:00
|
|
|
new StateVariable
|
|
|
|
{
|
|
|
|
Name = "CurrentConnectionIDs",
|
|
|
|
DataType = "string",
|
|
|
|
SendsEvents = true
|
|
|
|
},
|
2016-10-30 00:22:20 +02:00
|
|
|
|
2020-09-13 15:18:15 +02:00
|
|
|
new StateVariable
|
|
|
|
{
|
|
|
|
Name = "A_ARG_TYPE_ConnectionStatus",
|
|
|
|
DataType = "string",
|
|
|
|
SendsEvents = false,
|
2016-10-30 00:22:20 +02:00
|
|
|
|
2020-09-13 15:18:15 +02:00
|
|
|
AllowedValues = new[]
|
2016-10-30 00:22:20 +02:00
|
|
|
{
|
|
|
|
"OK",
|
|
|
|
"ContentFormatMismatch",
|
|
|
|
"InsufficientBandwidth",
|
|
|
|
"UnreliableChannel",
|
|
|
|
"Unknown"
|
|
|
|
}
|
2020-09-13 15:18:15 +02:00
|
|
|
},
|
2016-10-30 00:22:20 +02:00
|
|
|
|
2020-09-13 15:18:15 +02:00
|
|
|
new StateVariable
|
|
|
|
{
|
|
|
|
Name = "A_ARG_TYPE_ConnectionManager",
|
|
|
|
DataType = "string",
|
|
|
|
SendsEvents = false
|
|
|
|
},
|
2016-10-30 00:22:20 +02:00
|
|
|
|
2020-09-13 15:18:15 +02:00
|
|
|
new StateVariable
|
|
|
|
{
|
|
|
|
Name = "A_ARG_TYPE_Direction",
|
|
|
|
DataType = "string",
|
|
|
|
SendsEvents = false,
|
2016-10-30 00:22:20 +02:00
|
|
|
|
2020-09-13 15:18:15 +02:00
|
|
|
AllowedValues = new[]
|
2016-10-30 00:22:20 +02:00
|
|
|
{
|
|
|
|
"Output",
|
|
|
|
"Input"
|
|
|
|
}
|
2020-09-13 15:18:15 +02:00
|
|
|
},
|
2016-10-30 00:22:20 +02:00
|
|
|
|
2020-09-13 15:18:15 +02:00
|
|
|
new StateVariable
|
|
|
|
{
|
|
|
|
Name = "A_ARG_TYPE_ProtocolInfo",
|
|
|
|
DataType = "string",
|
|
|
|
SendsEvents = false
|
|
|
|
},
|
2016-10-30 00:22:20 +02:00
|
|
|
|
2020-09-13 15:18:15 +02:00
|
|
|
new StateVariable
|
|
|
|
{
|
|
|
|
Name = "A_ARG_TYPE_ConnectionID",
|
|
|
|
DataType = "ui4",
|
|
|
|
SendsEvents = false
|
|
|
|
},
|
2016-10-30 00:22:20 +02:00
|
|
|
|
2020-09-13 15:18:15 +02:00
|
|
|
new StateVariable
|
|
|
|
{
|
|
|
|
Name = "A_ARG_TYPE_AVTransportID",
|
|
|
|
DataType = "ui4",
|
|
|
|
SendsEvents = false
|
|
|
|
},
|
2016-10-30 00:22:20 +02:00
|
|
|
|
2020-09-13 15:18:15 +02:00
|
|
|
new StateVariable
|
|
|
|
{
|
|
|
|
Name = "A_ARG_TYPE_RcsID",
|
|
|
|
DataType = "ui4",
|
|
|
|
SendsEvents = false
|
|
|
|
}
|
|
|
|
};
|
2016-10-30 00:22:20 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|