]> git.sesse.net Git - casparcg/blob - protocol/amcp/AMCPCommandsImpl.h
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches...
[casparcg] / protocol / amcp / AMCPCommandsImpl.h
1 /*\r
2 * copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
3 *\r
4 *  This file is part of CasparCG.\r
5 *\r
6 *    CasparCG is free software: you can redistribute it and/or modify\r
7 *    it under the terms of the GNU General Public License as published by\r
8 *    the Free Software Foundation, either version 3 of the License, or\r
9 *    (at your option) any later version.\r
10 *\r
11 *    CasparCG is distributed in the hope that it will be useful,\r
12 *    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14 *    GNU General Public License for more details.\r
15 \r
16 *    You should have received a copy of the GNU General Public License\r
17 *    along with CasparCG.  If not, see <http://www.gnu.org/licenses/>.\r
18 *\r
19 */\r
20  \r
21 #ifndef __AMCPCOMMANDSIMPL_H__\r
22 #define __AMCPCOMMANDSIMPL_H__\r
23 \r
24 #include "AMCPCommand.h"\r
25 \r
26 namespace caspar { namespace protocol {\r
27         \r
28 std::wstring ListMedia();\r
29 std::wstring ListTemplates();\r
30 \r
31 namespace amcp {\r
32         \r
33 class DiagnosticsCommand : public AMCPCommandBase<false, AddToQueue, 0>\r
34 {\r
35         std::wstring print() const { return L"DiagnosticsCommand";}\r
36         bool DoExecute();\r
37 };\r
38 \r
39 class ParamCommand : public AMCPCommandBase<true, AddToQueue, 2>\r
40 {\r
41         std::wstring print() const { return L"ParamCommand";}\r
42         bool DoExecute();\r
43 };\r
44 \r
45 class MixerCommand : public AMCPCommandBase<true, AddToQueue, 1>\r
46 {\r
47         std::wstring print() const { return L"MixerCommand";}\r
48         bool DoExecute();\r
49 };\r
50         \r
51 class AddCommand : public AMCPCommandBase<true, AddToQueue, 1>\r
52 {\r
53         std::wstring print() const { return L"AddCommand";}\r
54         bool DoExecute();\r
55 };\r
56 \r
57 class RemoveCommand : public AMCPCommandBase<true, AddToQueue, 0>\r
58 {\r
59         std::wstring print() const { return L"RemoveCommand";}\r
60         bool DoExecute();\r
61 };\r
62 \r
63 class SwapCommand : public AMCPCommandBase<true, AddToQueue, 1>\r
64 {\r
65         std::wstring print() const { return L"SwapCommand";}\r
66         bool DoExecute();\r
67 };\r
68 \r
69 class LoadCommand : public AMCPCommandBase<true, AddToQueue, 1>\r
70 {\r
71         std::wstring print() const { return L"LoadCommand";}\r
72         bool DoExecute();\r
73 };\r
74 \r
75 class LoadbgCommand : public AMCPCommandBase<true, AddToQueue, 1>\r
76 {\r
77         std::wstring print() const { return L"LoadbgCommand";}\r
78         bool DoExecute();\r
79 };\r
80 \r
81 class PlayCommand: public AMCPCommandBase<true, AddToQueue, 0>\r
82 {\r
83         std::wstring print() const { return L"PlayCommand";}\r
84         bool DoExecute();\r
85 };\r
86 \r
87 class PauseCommand: public AMCPCommandBase<true, AddToQueue, 0>\r
88 {\r
89         std::wstring print() const { return L"PauseCommand";}\r
90         bool DoExecute();\r
91 };\r
92 \r
93 class StopCommand : public AMCPCommandBase<true, AddToQueue, 0>\r
94 {\r
95         std::wstring print() const { return L"StopCommand";}\r
96         bool DoExecute();\r
97 };\r
98 \r
99 class ClearCommand : public AMCPCommandBase<true, AddToQueue, 0>\r
100 {\r
101         std::wstring print() const { return L"ClearCommand";}\r
102         bool DoExecute();\r
103 };\r
104 \r
105 class PrintCommand : public AMCPCommandBase<true, AddToQueue, 0>\r
106 {\r
107         std::wstring print() const { return L"PrintCommand";}\r
108         bool DoExecute();\r
109 };\r
110 \r
111 class StatusCommand : public AMCPCommandBase<true, AddToQueue, 0>\r
112 {\r
113         std::wstring print() const { return L"StatusCommand";}\r
114         bool DoExecute();\r
115 };\r
116 \r
117 class LogCommand : public AMCPCommandBase<false, AddToQueue, 0>\r
118 {\r
119         std::wstring print() const { return L"LogCommand";}\r
120         bool DoExecute();\r
121 };\r
122 \r
123 class CGCommand : public AMCPCommandBase<true, AddToQueue, 1>\r
124 {\r
125         std::wstring print() const { return L"CGCommand";}\r
126         bool DoExecute();\r
127         bool ValidateLayer(const std::wstring& layerstring);\r
128 \r
129         bool DoExecuteAdd();\r
130         bool DoExecutePlay();\r
131         bool DoExecuteStop();\r
132         bool DoExecuteNext();\r
133         bool DoExecuteRemove();\r
134         bool DoExecuteClear();\r
135         bool DoExecuteUpdate();\r
136         bool DoExecuteInvoke();\r
137         bool DoExecuteInfo();\r
138 };\r
139 \r
140 class DataCommand : public AMCPCommandBase<false, AddToQueue, 1>\r
141 {\r
142         std::wstring print() const { return L"DataCommand";}\r
143         bool DoExecute();\r
144         bool DoExecuteStore();\r
145         bool DoExecuteRetrieve();\r
146         bool DoExecuteList();\r
147 };\r
148 \r
149 class ClsCommand : public AMCPCommandBase<false, AddToQueue, 0>\r
150 {\r
151         std::wstring print() const { return L"ClsCommand";}\r
152         bool DoExecute();\r
153 };\r
154 \r
155 class TlsCommand : public AMCPCommandBase<false, AddToQueue, 0>\r
156 {\r
157         std::wstring print() const { return L"TlsCommand";}\r
158         bool DoExecute();\r
159 };\r
160 \r
161 class CinfCommand : public AMCPCommandBase<false, AddToQueue, 1>\r
162 {\r
163         std::wstring print() const { return L"CinfCommand";}\r
164         bool DoExecute();\r
165 };\r
166 \r
167 class InfoCommand : public AMCPCommandBase<false, AddToQueue, 0>\r
168 {\r
169 public:\r
170         std::wstring print() const { return L"InfoCommand";}\r
171         InfoCommand(const std::vector<safe_ptr<core::video_channel>>& channels) : channels_(channels){}\r
172         bool DoExecute();\r
173 private:\r
174         const std::vector<safe_ptr<core::video_channel>>& channels_;\r
175 };\r
176 \r
177 class VersionCommand : public AMCPCommandBase<false, AddToQueue, 0>\r
178 {\r
179         std::wstring print() const { return L"VersionCommand";}\r
180         bool DoExecute();\r
181 };\r
182 \r
183 class ByeCommand : public AMCPCommandBase<false, AddToQueue, 0>\r
184 {\r
185         std::wstring print() const { return L"ByeCommand";}\r
186         bool DoExecute();\r
187 };\r
188 \r
189 class SetCommand : public AMCPCommandBase<true, AddToQueue, 2>\r
190 {\r
191         std::wstring print() const { return L"SetCommand";}\r
192         bool DoExecute();\r
193 };\r
194 \r
195 //class KillCommand : public AMCPCommand\r
196 //{\r
197 //public:\r
198 //      KillCommand() {}\r
199 //      virtual bool DoExecute();\r
200 //      virtual AMCPCommandCondition CheckConditions();\r
201 //\r
202 //      virtual bool NeedChannel() {\r
203 //              return false;\r
204 //      }\r
205 //      virtual AMCPCommandScheduling GetDefaultScheduling() {\r
206 //              return AddToQueue;\r
207 //      }\r
208 //      virtual int GetMinimumParameters() {\r
209 //              return 0;\r
210 //      }\r
211 //};\r
212 \r
213 }       //namespace amcp\r
214 }}      //namespace caspar\r
215 \r
216 #endif  //__AMCPCOMMANDSIMPL_H__