@ -6,39 +6,51 @@ using Emby.Dlna.Service;
namespace Emby.Dlna.ConnectionManager
namespace Emby.Dlna.ConnectionManager
{
{
public class ConnectionManagerXmlBuilder
/// <summary>
/// Defines the <see cref="ConnectionManagerXmlBuilder" />.
/// </summary>
public static class ConnectionManagerXmlBuilder
{
{
public string GetXml ( )
/// <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 ( )
{
{
return new ServiceXmlBuilder ( ) . GetXml ( new ServiceActionListBuilder ( ) . GetActions ( ) , GetStateVariables ( ) ) ;
return new ServiceXmlBuilder ( ) . GetXml ( ServiceActionListBuilder . GetActions ( ) , GetStateVariables ( ) ) ;
}
}
/// <summary>
/// Get the list of state variables for this invocation.
/// </summary>
/// <returns>The <see cref="IEnumerable{StateVariable}"/>.</returns>
private static IEnumerable < StateVariable > GetStateVariables ( )
private static IEnumerable < StateVariable > GetStateVariables ( )
{
{
var list = new List < StateVariable > ( ) ;
var list = new List < StateVariable >
{
list . Add ( new StateVariable
new StateVariable
{
{
Name = "SourceProtocolInfo" ,
Name = "SourceProtocolInfo" ,
DataType = "string" ,
DataType = "string" ,
SendsEvents = true
SendsEvents = true
} ) ;
} ,
list . Add ( new StateVariable
new StateVariable
{
{
Name = "SinkProtocolInfo" ,
Name = "SinkProtocolInfo" ,
DataType = "string" ,
DataType = "string" ,
SendsEvents = true
SendsEvents = true
} ) ;
} ,
list . Add ( new StateVariable
new StateVariable
{
{
Name = "CurrentConnectionIDs" ,
Name = "CurrentConnectionIDs" ,
DataType = "string" ,
DataType = "string" ,
SendsEvents = true
SendsEvents = true
} ) ;
} ,
list . Add ( new StateVariable
new StateVariable
{
{
Name = "A_ARG_TYPE_ConnectionStatus" ,
Name = "A_ARG_TYPE_ConnectionStatus" ,
DataType = "string" ,
DataType = "string" ,
@ -52,16 +64,16 @@ namespace Emby.Dlna.ConnectionManager
"UnreliableChannel" ,
"UnreliableChannel" ,
"Unknown"
"Unknown"
}
}
} ) ;
} ,
list . Add ( new StateVariable
new StateVariable
{
{
Name = "A_ARG_TYPE_ConnectionManager" ,
Name = "A_ARG_TYPE_ConnectionManager" ,
DataType = "string" ,
DataType = "string" ,
SendsEvents = false
SendsEvents = false
} ) ;
} ,
list . Add ( new StateVariable
new StateVariable
{
{
Name = "A_ARG_TYPE_Direction" ,
Name = "A_ARG_TYPE_Direction" ,
DataType = "string" ,
DataType = "string" ,
@ -72,35 +84,36 @@ namespace Emby.Dlna.ConnectionManager
"Output" ,
"Output" ,
"Input"
"Input"
}
}
} ) ;
} ,
list . Add ( new StateVariable
new StateVariable
{
{
Name = "A_ARG_TYPE_ProtocolInfo" ,
Name = "A_ARG_TYPE_ProtocolInfo" ,
DataType = "string" ,
DataType = "string" ,
SendsEvents = false
SendsEvents = false
} ) ;
} ,
list . Add ( new StateVariable
new StateVariable
{
{
Name = "A_ARG_TYPE_ConnectionID" ,
Name = "A_ARG_TYPE_ConnectionID" ,
DataType = "ui4" ,
DataType = "ui4" ,
SendsEvents = false
SendsEvents = false
} ) ;
} ,
list . Add ( new StateVariable
new StateVariable
{
{
Name = "A_ARG_TYPE_AVTransportID" ,
Name = "A_ARG_TYPE_AVTransportID" ,
DataType = "ui4" ,
DataType = "ui4" ,
SendsEvents = false
SendsEvents = false
} ) ;
} ,
list . Add ( new StateVariable
new StateVariable
{
{
Name = "A_ARG_TYPE_RcsID" ,
Name = "A_ARG_TYPE_RcsID" ,
DataType = "ui4" ,
DataType = "ui4" ,
SendsEvents = false
SendsEvents = false
} ) ;
}
} ;
return list ;
return list ;
}
}