]> 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) 2011 Sveriges Television AB <info@casparcg.com>\r
3 *\r
4 * This file is part of CasparCG (www.casparcg.com).\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 * Author: Nicklas P Andersson\r
20 */\r
21 \r
22  \r
23 #ifndef __AMCPCOMMANDSIMPL_H__\r
24 #define __AMCPCOMMANDSIMPL_H__\r
25 \r
26 #include "AMCPCommand.h"\r
27 \r
28 namespace caspar { namespace protocol {\r
29         \r
30 std::wstring ListMedia();\r
31 std::wstring ListTemplates();\r
32 \r
33 namespace amcp {\r
34         \r
35 class DiagnosticsCommand : public AMCPCommandBase<false, AddToQueue, 0>\r
36 {\r
37         std::wstring print() const { return L"DiagnosticsCommand";}\r
38         bool DoExecute();\r
39 };\r
40 \r
41 class CallCommand : public AMCPCommandBase<true, AddToQueue, 2>\r
42 {\r
43         std::wstring print() const { return L"CallCommand";}\r
44         bool DoExecute();\r
45 };\r
46 \r
47 class MixerCommand : public AMCPCommandBase<true, AddToQueue, 1>\r
48 {\r
49         std::wstring print() const { return L"MixerCommand";}\r
50         bool DoExecute();\r
51 };\r
52         \r
53 class AddCommand : public AMCPCommandBase<true, AddToQueue, 1>\r
54 {\r
55         std::wstring print() const { return L"AddCommand";}\r
56         bool DoExecute();\r
57 };\r
58 \r
59 class RemoveCommand : public AMCPCommandBase<true, AddToQueue, 0>\r
60 {\r
61         std::wstring print() const { return L"RemoveCommand";}\r
62         bool DoExecute();\r
63 };\r
64 \r
65 class SwapCommand : public AMCPCommandBase<true, AddToQueue, 1>\r
66 {\r
67         std::wstring print() const { return L"SwapCommand";}\r
68         bool DoExecute();\r
69 };\r
70 \r
71 class LoadCommand : public AMCPCommandBase<true, AddToQueue, 1>\r
72 {\r
73         std::wstring print() const { return L"LoadCommand";}\r
74         bool DoExecute();\r
75 };\r
76 \r
77 class LoadbgCommand : public AMCPCommandBase<true, AddToQueue, 1>\r
78 {\r
79         std::wstring print() const { return L"LoadbgCommand";}\r
80         bool DoExecute();\r
81 };\r
82 \r
83 class PlayCommand: public AMCPCommandBase<true, AddToQueue, 0>\r
84 {\r
85         std::wstring print() const { return L"PlayCommand";}\r
86         bool DoExecute();\r
87 };\r
88 \r
89 class PauseCommand: public AMCPCommandBase<true, AddToQueue, 0>\r
90 {\r
91         std::wstring print() const { return L"PauseCommand";}\r
92         bool DoExecute();\r
93 };\r
94 \r
95 class StopCommand : public AMCPCommandBase<true, AddToQueue, 0>\r
96 {\r
97         std::wstring print() const { return L"StopCommand";}\r
98         bool DoExecute();\r
99 };\r
100 \r
101 class ClearCommand : public AMCPCommandBase<true, AddToQueue, 0>\r
102 {\r
103         std::wstring print() const { return L"ClearCommand";}\r
104         bool DoExecute();\r
105 };\r
106 \r
107 class PrintCommand : public AMCPCommandBase<true, AddToQueue, 0>\r
108 {\r
109         std::wstring print() const { return L"PrintCommand";}\r
110         bool DoExecute();\r
111 };\r
112 \r
113 class LogCommand : public AMCPCommandBase<false, AddToQueue, 0>\r
114 {\r
115         std::wstring print() const { return L"LogCommand";}\r
116         bool DoExecute();\r
117 };\r
118 \r
119 class CGCommand : public AMCPCommandBase<true, AddToQueue, 1>\r
120 {\r
121         std::wstring print() const { return L"CGCommand";}\r
122         bool DoExecute();\r
123         bool ValidateLayer(const std::wstring& layerstring);\r
124 \r
125         bool DoExecuteAdd();\r
126         bool DoExecutePlay();\r
127         bool DoExecuteStop();\r
128         bool DoExecuteNext();\r
129         bool DoExecuteRemove();\r
130         bool DoExecuteClear();\r
131         bool DoExecuteUpdate();\r
132         bool DoExecuteInvoke();\r
133         bool DoExecuteInfo();\r
134 };\r
135 \r
136 class DataCommand : public AMCPCommandBase<false, AddToQueue, 1>\r
137 {\r
138         std::wstring print() const { return L"DataCommand";}\r
139         bool DoExecute();\r
140         bool DoExecuteStore();\r
141         bool DoExecuteRetrieve();\r
142         bool DoExecuteList();\r
143 };\r
144 \r
145 class ClsCommand : public AMCPCommandBase<false, AddToQueue, 0>\r
146 {\r
147         std::wstring print() const { return L"ClsCommand";}\r
148         bool DoExecute();\r
149 };\r
150 \r
151 class TlsCommand : public AMCPCommandBase<false, AddToQueue, 0>\r
152 {\r
153         std::wstring print() const { return L"TlsCommand";}\r
154         bool DoExecute();\r
155 };\r
156 \r
157 class CinfCommand : public AMCPCommandBase<false, AddToQueue, 1>\r
158 {\r
159         std::wstring print() const { return L"CinfCommand";}\r
160         bool DoExecute();\r
161 };\r
162 \r
163 class InfoCommand : public AMCPCommandBase<false, AddToQueue, 0>\r
164 {\r
165 public:\r
166         std::wstring print() const { return L"InfoCommand";}\r
167         InfoCommand(const std::vector<safe_ptr<core::video_channel>>& channels) : channels_(channels){}\r
168         bool DoExecute();\r
169 private:\r
170         const std::vector<safe_ptr<core::video_channel>>& channels_;\r
171 };\r
172 \r
173 class VersionCommand : public AMCPCommandBase<false, AddToQueue, 0>\r
174 {\r
175         std::wstring print() const { return L"VersionCommand";}\r
176         bool DoExecute();\r
177 };\r
178 \r
179 class ByeCommand : public AMCPCommandBase<false, AddToQueue, 0>\r
180 {\r
181         std::wstring print() const { return L"ByeCommand";}\r
182         bool DoExecute();\r
183 };\r
184 \r
185 class SetCommand : public AMCPCommandBase<true, AddToQueue, 2>\r
186 {\r
187         std::wstring print() const { return L"SetCommand";}\r
188         bool DoExecute();\r
189 };\r
190 \r
191 //class KillCommand : public AMCPCommand\r
192 //{\r
193 //public:\r
194 //      KillCommand() {}\r
195 //      virtual bool DoExecute();\r
196 //      virtual AMCPCommandCondition CheckConditions();\r
197 //\r
198 //      virtual bool NeedChannel() {\r
199 //              return false;\r
200 //      }\r
201 //      virtual AMCPCommandScheduling GetDefaultScheduling() {\r
202 //              return AddToQueue;\r
203 //      }\r
204 //      virtual int GetMinimumParameters() {\r
205 //              return 0;\r
206 //      }\r
207 //};\r
208 \r
209 }       //namespace amcp\r
210 }}      //namespace caspar\r
211 \r
212 #endif  //__AMCPCOMMANDSIMPL_H__