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