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