aboutsummaryrefslogtreecommitdiff
path: root/Emby.Dlna/ConnectionManager/ConnectionManagerXmlBuilder.cs
blob: f5873455a65c32389ee511490e78ee19d9da979a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
using System.Collections.Generic;
using Emby.Dlna.Common;
using Emby.Dlna.Service;

namespace Emby.Dlna.ConnectionManager
{
    public class ConnectionManagerXmlBuilder
    {
        public string GetXml()
        {
            return new ServiceXmlBuilder().GetXml(new ServiceActionListBuilder().GetActions(), GetStateVariables());
        }

        private static IEnumerable<StateVariable> GetStateVariables()
        {
            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,

                AllowedValues = new string[]
                {
                    "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,

                AllowedValues = new string[]
                {
                    "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;
        }
    }
}