]> git.sesse.net Git - casparcg/blob - protocol/amcp/AMCPCommandsImpl.h
Applied patch which adds support for creating directories that does not exist with...
[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 ChannelGridCommand : public AMCPCommandBase<false, AddToQueue, 0>\r
36 {\r
37         std::wstring print() const { return L"ChannelGridCommand";}\r
38         bool DoExecute();\r
39 };\r
40 \r
41 class DiagnosticsCommand : public AMCPCommandBase<false, AddToQueue, 0>\r
42 {\r
43         std::wstring print() const { return L"DiagnosticsCommand";}\r
44         bool DoExecute();\r
45 };\r
46 \r
47 class CallCommand : public AMCPCommandBase<true, AddToQueue, 1>\r
48 {\r
49         std::wstring print() const { return L"CallCommand";}\r
50         bool DoExecute();\r
51 };\r
52 \r
53 class MixerCommand : public AMCPCommandBase<true, AddToQueue, 1>\r
54 {\r
55         std::wstring print() const { return L"MixerCommand";}\r
56         bool DoExecute();\r
57 };\r
58         \r
59 class AddCommand : public AMCPCommandBase<true, AddToQueue, 1>\r
60 {\r
61         std::wstring print() const { return L"AddCommand";}\r
62         bool DoExecute();\r
63 };\r
64 \r
65 class RemoveCommand : public AMCPCommandBase<true, AddToQueue, 0>\r
66 {\r
67         std::wstring print() const { return L"RemoveCommand";}\r
68         bool DoExecute();\r
69 };\r
70 \r
71 class SwapCommand : public AMCPCommandBase<true, AddToQueue, 1>\r
72 {\r
73         std::wstring print() const { return L"SwapCommand";}\r
74         bool DoExecute();\r
75 };\r
76 \r
77 class LoadCommand : public AMCPCommandBase<true, AddToQueue, 1>\r
78 {\r
79         std::wstring print() const { return L"LoadCommand";}\r
80         bool DoExecute();\r
81 };\r
82 \r
83 class LoadbgCommand : public AMCPCommandBase<true, AddToQueue, 1>\r
84 {\r
85         std::wstring print() const { return L"LoadbgCommand";}\r
86         bool DoExecute();\r
87 };\r
88 \r
89 class PlayCommand: public AMCPCommandBase<true, AddToQueue, 0>\r
90 {\r
91         std::wstring print() const { return L"PlayCommand";}\r
92         bool DoExecute();\r
93 };\r
94 \r
95 class PauseCommand: public AMCPCommandBase<true, AddToQueue, 0>\r
96 {\r
97         std::wstring print() const { return L"PauseCommand";}\r
98         bool DoExecute();\r
99 };\r
100 \r
101 class StopCommand : public AMCPCommandBase<true, AddToQueue, 0>\r
102 {\r
103         std::wstring print() const { return L"StopCommand";}\r
104         bool DoExecute();\r
105 };\r
106 \r
107 class ClearCommand : public AMCPCommandBase<true, ImmediatelyAndClear, 0>\r
108 {\r
109         std::wstring print() const { return L"ClearCommand";}\r
110         bool DoExecute();\r
111 };\r
112 \r
113 class PrintCommand : public AMCPCommandBase<true, AddToQueue, 0>\r
114 {\r
115         std::wstring print() const { return L"PrintCommand";}\r
116         bool DoExecute();\r
117 };\r
118 \r
119 class LogCommand : public AMCPCommandBase<false, AddToQueue, 0>\r
120 {\r
121         std::wstring print() const { return L"LogCommand";}\r
122         bool DoExecute();\r
123 };\r
124 \r
125 class CGCommand : public AMCPCommandBase<true, AddToQueue, 1>\r
126 {\r
127         std::wstring print() const { return L"CGCommand";}\r
128         bool DoExecute();\r
129         bool ValidateLayer(const std::wstring& layerstring);\r
130 \r
131         bool DoExecuteAdd();\r
132         bool DoExecutePlay();\r
133         bool DoExecuteStop();\r
134         bool DoExecuteNext();\r
135         bool DoExecuteRemove();\r
136         bool DoExecuteClear();\r
137         bool DoExecuteUpdate();\r
138         bool DoExecuteInvoke();\r
139         bool DoExecuteInfo();\r
140 };\r
141 \r
142 class DataCommand : public AMCPCommandBase<false, AddToQueue, 1>\r
143 {\r
144         std::wstring print() const { return L"DataCommand";}\r
145         bool DoExecute();\r
146         bool DoExecuteStore();\r
147         bool DoExecuteRetrieve();\r
148         bool DoExecuteRemove();\r
149         bool DoExecuteList();\r
150 };\r
151 \r
152 class ClsCommand : public AMCPCommandBase<false, AddToQueue, 0>\r
153 {\r
154         std::wstring print() const { return L"ClsCommand";}\r
155         bool DoExecute();\r
156 };\r
157 \r
158 class TlsCommand : public AMCPCommandBase<false, AddToQueue, 0>\r
159 {\r
160         std::wstring print() const { return L"TlsCommand";}\r
161         bool DoExecute();\r
162 };\r
163 \r
164 class CinfCommand : public AMCPCommandBase<false, AddToQueue, 1>\r
165 {\r
166         std::wstring print() const { return L"CinfCommand";}\r
167         bool DoExecute();\r
168 };\r
169 \r
170 class InfoCommand : public AMCPCommandBase<false, AddToQueue, 0>\r
171 {\r
172 public:\r
173         std::wstring print() const { return L"InfoCommand";}\r
174         InfoCommand(const std::vector<safe_ptr<core::video_channel>>& channels) : channels_(channels){}\r
175         bool DoExecute();\r
176 private:\r
177         const std::vector<safe_ptr<core::video_channel>>& channels_;\r
178 };\r
179 \r
180 class VersionCommand : public AMCPCommandBase<false, AddToQueue, 0>\r
181 {\r
182         std::wstring print() const { return L"VersionCommand";}\r
183         bool DoExecute();\r
184 };\r
185 \r
186 class ByeCommand : public AMCPCommandBase<false, AddToQueue, 0>\r
187 {\r
188         std::wstring print() const { return L"ByeCommand";}\r
189         bool DoExecute();\r
190 };\r
191 \r
192 class SetCommand : public AMCPCommandBase<true, AddToQueue, 2>\r
193 {\r
194         std::wstring print() const { return L"SetCommand";}\r
195         bool DoExecute();\r
196 };\r
197 \r
198 //class KillCommand : public AMCPCommand\r
199 //{\r
200 //public:\r
201 //      KillCommand() {}\r
202 //      virtual bool DoExecute();\r
203 //      virtual AMCPCommandCondition CheckConditions();\r
204 //\r
205 //      virtual bool NeedChannel() {\r
206 //              return false;\r
207 //      }\r
208 //      virtual AMCPCommandScheduling GetDefaultScheduling() {\r
209 //              return AddToQueue;\r
210 //      }\r
211 //      virtual int GetMinimumParameters() {\r
212 //              return 0;\r
213 //      }\r
214 //};\r
215 \r
216 }       //namespace amcp\r
217 }}      //namespace caspar\r
218 \r
219 #endif  //__AMCPCOMMANDSIMPL_H__