blob: ad544d5ae1aadf0d9559791f96cd169dbc548cb0 [file] [log] [blame]
atraczyk14ba30c2016-09-22 18:31:59 -04001/**************************************************************************
2* Copyright (C) 2016 by Savoir-faire Linux *
3* Author: Jäger Nicolas <nicolas.jager@savoirfairelinux.com> *
4* Author: Traczyk Andreas <andreas.traczyk@savoirfairelinux.com> *
5* *
6* This program is free software; you can redistribute it and/or modify *
7* it under the terms of the GNU General Public License as published by *
8* the Free Software Foundation; either version 3 of the License, or *
9* (at your option) any later version. *
10* *
11* This program is distributed in the hope that it will be useful, *
12* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14* GNU General Public License for more details. *
15* *
16* You should have received a copy of the GNU General Public License *
17* along with this program. If not, see <http://www.gnu.org/licenses/>. *
18**************************************************************************/
19
20#pragma once
21
22using namespace Platform;
23
24namespace RingClientUWP
25{
26
27namespace Video
28{
29
30ref class Rate;
31ref class Resolution;
32ref class Device;
33
34public ref class Size sealed
35{
36internal:
37 unsigned int width ();
38 unsigned int height ();
39
40 void setWidth ( unsigned int width );
41 void setHeight ( unsigned int height );
42
43public:
44 Size() { };
45 Size(unsigned int w, unsigned int h):
46 m_Width(w),
47 m_Height(h) { };
48 Size(Size^ rhs):
49 m_Width(rhs->m_Width),
50 m_Height(rhs->m_Height) { };
51
52private:
53 unsigned int m_Width;
54 unsigned int m_Height;
55
56};
57
58public ref class Rate sealed
59{
60internal:
61 String^ name ();
62 unsigned int value ();
63
64 void setName ( String^ name );
65 void setValue ( unsigned int value );
66
67private:
68 String^ m_name;
69 unsigned int m_value;
70
71};
72
73public ref class Channel sealed
74{
75internal:
76 String^ name ();
77 Resolution^ currentResolution ();
78 Vector<Resolution^>^ resolutionList ();
79
80 void setName ( String^ name );
81 void setCurrentResolution ( Resolution^ currentResolution);
82
83public:
84 Channel();
85
86private:
87 String^ m_name;
88 Resolution^ m_currentResolution;
89 Vector<Resolution^>^ m_validResolutions;
90
91};
92
93public ref class Resolution sealed
94{
95internal:
96 String^ name ();
97 Rate^ activeRate ();
98 Vector<Rate^>^ rateList ();
99 Size^ size ();
100 String^ format ();
101
102 bool setActiveRate ( Rate^ rate );
103 void setWidth ( int width );
104 void setHeight ( int height );
105 void setFormat ( String^ format );
106
107public:
108 Resolution();
109 Resolution(Size^ size);
110
111private:
112 Rate^ m_currentRate;
113 Vector<Rate^>^ m_validRates;
114 Size^ m_size;
115 String^ m_format;
116
117};
118
119public ref class Device sealed
120{
121internal:
122 class PreferenceNames {
123 public:
124 constexpr static const char* RATE = "rate" ;
125 constexpr static const char* NAME = "name" ;
126 constexpr static const char* CHANNEL = "channel";
127 constexpr static const char* SIZE = "size" ;
128 };
129
130 Vector<Channel^>^ channelList ();
131 String^ id ();
132 String^ name ();
133 Channel^ channel ();
134
135 bool setCurrentChannel ( Channel^ channel );
136 void setName ( String^ name );
137
138
139public:
140 Device(String^ id);
141 void SetDeviceProperties(String^ format, int width, int height, int rate);
142
143 void save ();
144 bool isActive ();
145
146private:
147 String^ m_deviceId ;
148 String^ m_name ;
149 Channel^ m_currentChannel ;
150 Vector<Channel^>^ m_channels ;
151 bool m_requireSave ;
152
153};
154
155} /* namespace Video */
156} /* namespace RingClientUWP */