]> git.sesse.net Git - casparcg/blob - protocol/clk/CLKCommand.h
e0b95ef5a0fef686f019a27850784548eb6f2997
[casparcg] / protocol / clk / CLKCommand.h
1 /*\r
2 * Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>\r
3 *\r
4 * This file is part of CasparCG (www.casparcg.com).\r
5 *\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
10 *\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
15 *\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
18 *\r
19 * Author: Nicklas P Andersson\r
20 */\r
21 \r
22  \r
23 #pragma once\r
24 \r
25 namespace caspar { namespace protocol { namespace CLK {\r
26 \r
27 class CLKCommand\r
28 {\r
29 public:\r
30         enum CLKCommands \r
31         {\r
32                 CLKDuration,\r
33                 CLKNewDuration,\r
34                 CLKNextEvent,\r
35                 CLKStop,\r
36                 CLKUntil,\r
37                 CLKAdd,\r
38                 CLKSub,\r
39                 CLKReset,\r
40                 CLKInvalidCommand\r
41         };\r
42 \r
43         CLKCommand();\r
44         virtual ~CLKCommand();\r
45 \r
46         bool SetCommand();\r
47         bool NeedsTime() const \r
48         {\r
49                 return !(command_ == CLKNextEvent || command_ == CLKStop);\r
50         }\r
51 \r
52         void Clear();\r
53         const std::wstring& GetData();\r
54 \r
55         std::wstring dataCache_;\r
56         std::wstring commandString_;\r
57         CLKCommands command_;\r
58         int clockID_;\r
59         std::wstring time_;\r
60         std::vector<std::wstring> parameters_;\r
61 };\r
62 \r
63 }}}