2 * Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
4 * This file is part of CasparCG (www.casparcg.com).
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.
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.
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/>.
19 * Author: Nicklas P Andersson
23 #ifndef __AMCPCOMMANDSIMPL_H__
24 #define __AMCPCOMMANDSIMPL_H__
26 #include "AMCPCommand.h"
28 namespace caspar { namespace protocol {
30 std::wstring ListMedia();
31 std::wstring ListTemplates();
35 class ChannelGridCommand : public AMCPCommandBase<0>
38 explicit ChannelGridCommand(IO::ClientInfoPtr client) : AMCPCommandBase(client) {}
39 std::wstring print() const { return L"ChannelGridCommand";}
43 class DiagnosticsCommand : public AMCPCommandBase<0>
46 explicit DiagnosticsCommand(IO::ClientInfoPtr client) : AMCPCommandBase(client) {}
47 std::wstring print() const { return L"DiagnosticsCommand";}
51 class CallCommand : public AMCPChannelCommandBase<1>
54 CallCommand(IO::ClientInfoPtr client, const channel_context& channel, unsigned int channel_index, int layer_index) : AMCPChannelCommandBase(client, channel, channel_index, layer_index)
58 std::wstring print() const { return L"CallCommand";}
62 class MixerCommand : public AMCPChannelCommandBase<1>
65 MixerCommand(IO::ClientInfoPtr client, const channel_context& channel, unsigned int channel_index, int layer_index) : AMCPChannelCommandBase(client, channel, channel_index, layer_index)
69 std::wstring print() const { return L"MixerCommand";}
73 class AddCommand : public AMCPChannelCommandBase<1>
76 AddCommand(IO::ClientInfoPtr client, const channel_context& channel, unsigned int channel_index, int layer_index) : AMCPChannelCommandBase(client, channel, channel_index, layer_index)
80 std::wstring print() const { return L"AddCommand";}
84 class RemoveCommand : public AMCPChannelCommandBase<0>
87 RemoveCommand(IO::ClientInfoPtr client, const channel_context& channel, unsigned int channel_index, int layer_index) : AMCPChannelCommandBase(client, channel, channel_index, layer_index)
91 std::wstring print() const { return L"RemoveCommand";}
95 class SwapCommand : public AMCPChannelCommandBase<1>, AMCPChannelsAwareCommand
98 SwapCommand(IO::ClientInfoPtr client, const channel_context& channel, unsigned int channel_index, int layer_index, const std::vector<channel_context>& channels) : AMCPChannelCommandBase(client, channel, channel_index, layer_index), AMCPChannelsAwareCommand(channels)
102 std::wstring print() const { return L"SwapCommand";}
106 class LoadCommand : public AMCPChannelCommandBase<1>
109 LoadCommand(IO::ClientInfoPtr client, const channel_context& channel, unsigned int channel_index, int layer_index) : AMCPChannelCommandBase(client, channel, channel_index, layer_index)
113 std::wstring print() const { return L"LoadCommand";}
118 class PlayCommand: public AMCPChannelCommandBase<0>, public AMCPChannelsAwareCommand
121 PlayCommand(IO::ClientInfoPtr client, const channel_context& channel, unsigned int channel_index, int layer_index, const std::vector<channel_context>& channels) : AMCPChannelCommandBase(client, channel, channel_index, layer_index), AMCPChannelsAwareCommand(channels)
125 std::wstring print() const { return L"PlayCommand";}
129 class LoadbgCommand : public AMCPChannelCommandBase<1>, public AMCPChannelsAwareCommand
132 LoadbgCommand(IO::ClientInfoPtr client, const channel_context& channel, unsigned int channel_index, int layer_index, const std::vector<channel_context>& channels) : AMCPChannelCommandBase(client, channel, channel_index, layer_index), AMCPChannelsAwareCommand(channels)
134 LoadbgCommand(const PlayCommand& rhs) : AMCPChannelCommandBase<1>(rhs), AMCPChannelsAwareCommand(rhs) {}
137 std::wstring print() const { return L"LoadbgCommand";}
141 class PauseCommand: public AMCPChannelCommandBase<0>
144 PauseCommand(IO::ClientInfoPtr client, const channel_context& channel, unsigned int channel_index, int layer_index) : AMCPChannelCommandBase(client, channel, channel_index, layer_index)
148 std::wstring print() const { return L"PauseCommand";}
152 class StopCommand : public AMCPChannelCommandBase<0>
155 StopCommand(IO::ClientInfoPtr client, const channel_context& channel, unsigned int channel_index, int layer_index) : AMCPChannelCommandBase(client, channel, channel_index, layer_index)
159 std::wstring print() const { return L"StopCommand";}
163 class ClearCommand : public AMCPChannelCommandBase<0>
166 ClearCommand(IO::ClientInfoPtr client, const channel_context& channel, unsigned int channel_index, int layer_index) : AMCPChannelCommandBase(client, channel, channel_index, layer_index)
170 std::wstring print() const { return L"ClearCommand";}
174 class PrintCommand : public AMCPChannelCommandBase<0>
177 PrintCommand(IO::ClientInfoPtr client, const channel_context& channel, unsigned int channel_index, int layer_index) : AMCPChannelCommandBase(client, channel, channel_index, layer_index)
181 std::wstring print() const { return L"PrintCommand";}
185 class LogCommand : public AMCPCommandBase<2>
188 explicit LogCommand(IO::ClientInfoPtr client) : AMCPCommandBase(client) {}
189 std::wstring print() const { return L"LogCommand";}
193 class CGCommand : public AMCPChannelCommandBase<1>
196 CGCommand(IO::ClientInfoPtr client, const channel_context& channel, unsigned int channel_index, int layer_index) : AMCPChannelCommandBase(client, channel, channel_index, layer_index)
200 std::wstring print() const { return L"CGCommand";}
202 bool ValidateLayer(const std::wstring& layerstring);
205 bool DoExecutePlay();
206 bool DoExecuteStop();
207 bool DoExecuteNext();
208 bool DoExecuteRemove();
209 bool DoExecuteClear();
210 bool DoExecuteUpdate();
211 bool DoExecuteInvoke();
212 bool DoExecuteInfo();
215 class DataCommand : public AMCPCommandBase<1>
218 explicit DataCommand(IO::ClientInfoPtr client) : AMCPCommandBase(client) {}
220 std::wstring print() const { return L"DataCommand";}
222 bool DoExecuteStore();
223 bool DoExecuteRetrieve();
224 bool DoExecuteRemove();
225 bool DoExecuteList();
228 class ClsCommand : public AMCPCommandBase<0>
231 explicit ClsCommand(IO::ClientInfoPtr client) : AMCPCommandBase(client) {}
232 std::wstring print() const { return L"ClsCommand";}
236 class TlsCommand : public AMCPCommandBase<0>
239 explicit TlsCommand(IO::ClientInfoPtr client) : AMCPCommandBase(client) {}
240 std::wstring print() const { return L"TlsCommand";}
244 class CinfCommand : public AMCPCommandBase<1>
247 explicit CinfCommand(IO::ClientInfoPtr client) : AMCPCommandBase(client) {}
248 std::wstring print() const { return L"CinfCommand";}
252 class InfoCommand : public AMCPCommandBase<0>, AMCPChannelsAwareCommand
255 InfoCommand(IO::ClientInfoPtr client, const std::vector<channel_context>& channels) : AMCPChannelsAwareCommand(channels), AMCPCommandBase(client) {}
256 std::wstring print() const { return L"InfoCommand";}
260 class VersionCommand : public AMCPCommandBase<0>
263 explicit VersionCommand(IO::ClientInfoPtr client) : AMCPCommandBase(client) {}
264 std::wstring print() const { return L"VersionCommand";}
268 class ByeCommand : public AMCPCommandBase<0>
271 explicit ByeCommand(IO::ClientInfoPtr client) : AMCPCommandBase(client) {}
272 std::wstring print() const { return L"ByeCommand";}
276 class SetCommand : public AMCPChannelCommandBase<2>
279 SetCommand(IO::ClientInfoPtr client, const channel_context& channel, unsigned int channel_index, int layer_index) : AMCPChannelCommandBase(client, channel, channel_index, layer_index)
283 std::wstring print() const { return L"SetCommand";}
287 class LockCommand : public AMCPCommandBase<1>, AMCPChannelsAwareCommand
290 LockCommand(IO::ClientInfoPtr client, const std::vector<channel_context>& channels) : AMCPChannelsAwareCommand(channels), AMCPCommandBase(client) {}
291 std::wstring print() const { return L"LockCommand";}
295 //class KillCommand : public AMCPCommand
299 // virtual bool DoExecute();
300 // virtual AMCPCommandCondition CheckConditions();
302 // virtual bool NeedChannel() {
305 // virtual AMCPCommandScheduling GetDefaultScheduling() {
306 // return AddToQueue;
308 // virtual int GetMinimumParameters() {
314 }} //namespace caspar
316 #endif //__AMCPCOMMANDSIMPL_H__