2 * Copyright 2013 Sveriges Television AB http://casparcg.com/
\r
4 * This file is part of CasparCG (www.casparcg.com).
\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
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
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
19 * Author: Nicklas P Andersson
\r
23 #ifndef __AMCPCOMMANDSIMPL_H__
\r
24 #define __AMCPCOMMANDSIMPL_H__
\r
26 #include "AMCPCommand.h"
\r
31 struct frame_transform;
\r
32 struct frame_producer;
\r
35 namespace protocol {
\r
37 std::wstring ListMedia();
\r
38 std::wstring ListTemplates();
\r
42 class ChannelGridCommand : public AMCPCommandBase<false, AddToQueue, 0>
\r
44 std::wstring print() const { return L"ChannelGridCommand";}
\r
48 class DiagnosticsCommand : public AMCPCommandBase<false, AddToQueue, 0>
\r
50 std::wstring print() const { return L"DiagnosticsCommand";}
\r
54 class CallCommand : public AMCPCommandBase<true, AddToQueue, 1>
\r
56 std::wstring print() const { return L"CallCommand";}
\r
60 class MixerCommand : public AMCPCommandBase<true, AddToQueue, 1>
\r
62 std::wstring print() const { return L"MixerCommand";}
\r
63 core::frame_transform get_current_transform();
\r
64 template<typename Func>
\r
65 bool reply_value(const Func& extractor)
\r
67 auto value = extractor(get_current_transform());
\r
69 SetReplyString(L"201 MIXER OK\r\n"
\r
70 + boost::lexical_cast<std::wstring>(value) + L"\r\n");
\r
77 class AddCommand : public AMCPCommandBase<true, AddToQueue, 1>
\r
79 std::wstring print() const { return L"AddCommand";}
\r
83 class RemoveCommand : public AMCPCommandBase<true, AddToQueue, 0>
\r
85 std::wstring print() const { return L"RemoveCommand";}
\r
89 class SwapCommand : public AMCPCommandBase<true, AddToQueue, 1>
\r
91 std::wstring print() const { return L"SwapCommand";}
\r
95 class RouteCommand : public AMCPCommandBase<true, AddToQueue, 1>
\r
97 std::wstring print() const { return L"RouteCommand";}
\r
100 static safe_ptr<core::frame_producer> TryCreateProducer(AMCPCommand& command, std::wstring const& uri);
\r
103 /*class RouteCommand : public AMCPCommandBase<true, AddToQueue, 1>
\r
105 std::wstring print() const { return L"RouteCommand";}
\r
109 class LoadCommand : public AMCPCommandBase<true, AddToQueue, 1>
\r
111 std::wstring print() const { return L"LoadCommand";}
\r
115 class LoadbgCommand : public AMCPCommandBase<true, AddToQueue, 1>
\r
117 std::wstring print() const { return L"LoadbgCommand";}
\r
121 class PlayCommand: public AMCPCommandBase<true, AddToQueue, 0>
\r
123 std::wstring print() const { return L"PlayCommand";}
\r
127 class PauseCommand: public AMCPCommandBase<true, AddToQueue, 0>
\r
129 std::wstring print() const { return L"PauseCommand";}
\r
133 class StopCommand : public AMCPCommandBase<true, AddToQueue, 0>
\r
135 std::wstring print() const { return L"StopCommand";}
\r
139 class ClearCommand : public AMCPCommandBase<true, AddToQueue, 0>
\r
141 std::wstring print() const { return L"ClearCommand";}
\r
145 class PrintCommand : public AMCPCommandBase<true, AddToQueue, 0>
\r
147 std::wstring print() const { return L"PrintCommand";}
\r
151 class LogCommand : public AMCPCommandBase<false, AddToQueue, 0>
\r
153 std::wstring print() const { return L"LogCommand";}
\r
157 class CGCommand : public AMCPCommandBase<true, AddToQueue, 1>
\r
159 std::wstring print() const { return L"CGCommand";}
\r
161 bool ValidateLayer(const std::wstring& layerstring);
\r
163 bool DoExecuteAdd();
\r
164 bool DoExecutePlay();
\r
165 bool DoExecuteStop();
\r
166 bool DoExecuteNext();
\r
167 bool DoExecuteRemove();
\r
168 bool DoExecuteClear();
\r
169 bool DoExecuteUpdate();
\r
170 bool DoExecuteInvoke();
\r
171 bool DoExecuteInfo();
\r
174 class DataCommand : public AMCPCommandBase<false, AddToQueue, 1>
\r
176 std::wstring print() const { return L"DataCommand";}
\r
178 bool DoExecuteStore();
\r
179 bool DoExecuteRetrieve();
\r
180 bool DoExecuteRemove();
\r
181 bool DoExecuteList();
\r
184 class ThumbnailCommand : public AMCPCommandBase<false, AddToQueue, 1>
\r
186 std::wstring print() const { return L"ThumbnailCommand";}
\r
188 bool DoExecuteRetrieve();
\r
189 bool DoExecuteList();
\r
190 bool DoExecuteGenerate();
\r
191 bool DoExecuteGenerateAll();
\r
194 class ClsCommand : public AMCPCommandBase<false, AddToQueue, 0>
\r
196 std::wstring print() const { return L"ClsCommand";}
\r
200 class TlsCommand : public AMCPCommandBase<false, AddToQueue, 0>
\r
202 std::wstring print() const { return L"TlsCommand";}
\r
206 class CinfCommand : public AMCPCommandBase<false, AddToQueue, 1>
\r
208 std::wstring print() const { return L"CinfCommand";}
\r
212 class InfoCommand : public AMCPCommandBase<false, AddToQueue, 0>
\r
215 std::wstring print() const { return L"InfoCommand";}
\r
216 InfoCommand(const std::vector<safe_ptr<core::video_channel>>& channels) : channels_(channels){}
\r
219 const std::vector<safe_ptr<core::video_channel>>& channels_;
\r
222 class VersionCommand : public AMCPCommandBase<false, AddToQueue, 0>
\r
224 std::wstring print() const { return L"VersionCommand";}
\r
228 class ByeCommand : public AMCPCommandBase<false, AddToQueue, 0>
\r
230 std::wstring print() const { return L"ByeCommand";}
\r
234 class SetCommand : public AMCPCommandBase<true, AddToQueue, 2>
\r
236 std::wstring print() const { return L"SetCommand";}
\r
240 class KillCommand : public AMCPCommandBase<false, AddToQueue, 0>
\r
242 std::wstring print() const { return L"KillCommand";}
\r
246 class RestartCommand : public AMCPCommandBase<false, AddToQueue, 0>
\r
248 std::wstring print() const { return L"RestartCommand";}
\r
253 }} //namespace caspar
\r
255 #endif //__AMCPCOMMANDSIMPL_H__