]> git.sesse.net Git - casparcg/blob - protocol/cii/CIICommandsImpl.h
set svn:eol-style native on .h and .cpp files
[casparcg] / protocol / cii / CIICommandsImpl.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 #pragma once
24
25 #include "ciicommand.h"
26
27 namespace caspar { namespace protocol {
28
29 namespace cii {
30
31 class CIIProtocolStrategy;
32
33 class MediaCommand : public ICIICommand
34 {
35 public:
36         MediaCommand(CIIProtocolStrategy* pPS) : pCIIStrategy_(pPS)
37         {}
38
39         virtual int GetMinimumParameters() {
40                 return 1;
41         }
42
43         virtual void Setup(const std::vector<std::wstring>& parameters);
44         virtual void Execute();
45
46 private:
47         std::wstring graphicProfile_;
48
49         CIIProtocolStrategy* pCIIStrategy_;
50 };
51
52 class WriteCommand : public ICIICommand
53 {
54 public:
55         WriteCommand(CIIProtocolStrategy* pPS) : pCIIStrategy_(pPS)
56         {}
57
58         virtual int GetMinimumParameters() {
59                 return 2;
60         }
61
62         virtual void Setup(const std::vector<std::wstring>& parameters);
63         virtual void Execute();
64
65 private:
66         std::wstring targetName_;
67         std::wstring templateName_;
68         std::wstring xmlData_;
69
70         CIIProtocolStrategy* pCIIStrategy_;
71 };
72
73 class MiscellaneousCommand : public ICIICommand
74 {
75 public:
76         MiscellaneousCommand(CIIProtocolStrategy* pPS) : pCIIStrategy_(pPS), state_(-1), layer_(0)
77         {}
78
79         virtual int GetMinimumParameters() {
80                 return 5;
81         }
82
83         virtual void Setup(const std::vector<std::wstring>& parameters);
84         virtual void Execute();
85
86 private:
87         std::wstring filename_;
88         std::wstring xmlData_;
89         int state_;
90         int layer_;
91
92         CIIProtocolStrategy* pCIIStrategy_;
93 };
94
95 class ImagestoreCommand : public ICIICommand
96 {
97 public:
98         ImagestoreCommand(CIIProtocolStrategy* pPS) : pCIIStrategy_(pPS)
99         {}
100
101         virtual int GetMinimumParameters() {
102                 return 1;
103         }
104
105         virtual void Setup(const std::vector<std::wstring>& parameters);
106         virtual void Execute();
107
108 private:
109         std::wstring titleName_;
110
111         CIIProtocolStrategy* pCIIStrategy_;
112 };
113
114 class KeydataCommand : public ICIICommand
115 {
116 public:
117         KeydataCommand(CIIProtocolStrategy* pPS) : pCIIStrategy_(pPS), state_(-1), layer_(0), casparLayer_(0)
118         {}
119
120         virtual int GetMinimumParameters() {
121                 return 1;
122         }
123
124         virtual void Setup(const std::vector<std::wstring>& parameters);
125         virtual void Execute();
126
127 private:
128         std::wstring titleName_;
129         int state_;
130         int layer_;
131         int casparLayer_;
132
133         CIIProtocolStrategy* pCIIStrategy_;
134 };
135
136 }       //namespace cii
137 }}      //namespace caspar