]> git.sesse.net Git - casparcg/blob - protocol/amcp/AMCPCommandsImpl.h
429c7cd821c8c64b694c6801b21e6bbec8090998
[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 DoExecuteList();
149 };
150
151 class ClsCommand : public AMCPCommandBase<false, 0>
152 {
153         std::wstring print() const { return L"ClsCommand";}
154         bool DoExecute();
155 };
156
157 class TlsCommand : public AMCPCommandBase<false, 0>
158 {
159         std::wstring print() const { return L"TlsCommand";}
160         bool DoExecute();
161 };
162
163 class CinfCommand : public AMCPCommandBase<false, 1>
164 {
165         std::wstring print() const { return L"CinfCommand";}
166         bool DoExecute();
167 };
168
169 class InfoCommand : public AMCPCommandBase<false, 0>
170 {
171 public:
172         std::wstring print() const { return L"InfoCommand";}
173         InfoCommand(const std::vector<spl::shared_ptr<core::video_channel>>& channels) : channels_(channels){}
174         bool DoExecute();
175 private:
176         const std::vector<spl::shared_ptr<core::video_channel>>& channels_;
177 };
178
179 class VersionCommand : public AMCPCommandBase<false, 0>
180 {
181         std::wstring print() const { return L"VersionCommand";}
182         bool DoExecute();
183 };
184
185 class ByeCommand : public AMCPCommandBase<false, 0>
186 {
187         std::wstring print() const { return L"ByeCommand";}
188         bool DoExecute();
189 };
190
191 class SetCommand : public AMCPCommandBase<true, 2>
192 {
193         std::wstring print() const { return L"SetCommand";}
194         bool DoExecute();
195 };
196
197 //class KillCommand : public AMCPCommand
198 //{
199 //public:
200 //      KillCommand() {}
201 //      virtual bool DoExecute();
202 //      virtual AMCPCommandCondition CheckConditions();
203 //
204 //      virtual bool NeedChannel() {
205 //              return false;
206 //      }
207 //      virtual AMCPCommandScheduling GetDefaultScheduling() {
208 //              return AddToQueue;
209 //      }
210 //      virtual int GetMinimumParameters() {
211 //              return 0;
212 //      }
213 //};
214
215 }       //namespace amcp
216 }}      //namespace caspar
217
218 #endif  //__AMCPCOMMANDSIMPL_H__