]> git.sesse.net Git - casparcg/blobdiff - protocol/clk/CLKProtocolStrategy.h
Changed date format in logging and added millisecond
[casparcg] / protocol / clk / CLKProtocolStrategy.h
index 4b89eb365131d85ab9535f9fa83386fb5b5eed09..a2b8ab5dc717e8c43f3da2409237b16e8e22ac74 100644 (file)
  \r
 #pragma once\r
 \r
-#include "CLKCommand.h"\r
-#include "../util/ProtocolStrategy.h"\r
+#include <vector>\r
+#include <string>\r
+#include <sstream>\r
+\r
 #include <core/video_channel.h>\r
 \r
+#include "clk_command_processor.h"\r
+#include "../util/ProtocolStrategy.h"\r
+\r
 namespace caspar { namespace protocol { namespace CLK {\r
 \r
+/**\r
+ * Can only handle one connection at a time safely, therefore it should be\r
+ * wrapped in a stateful_protocol_strategy_wrapper.\r
+ */\r
 class CLKProtocolStrategy : public IO::IProtocolStrategy\r
 {\r
 public:\r
@@ -37,22 +46,20 @@ public:
        UINT GetCodepage() { return 28591; }    //ISO 8859-1\r
        \r
 private:\r
+       void reset();\r
+\r
        enum ParserState\r
        {\r
                ExpectingNewCommand,\r
                ExpectingCommand,\r
-               ExpectingClockID,\r
-               ExpectingTime,\r
                ExpectingParameter\r
        };\r
 \r
        ParserState     currentState_;\r
-       CLKCommand currentCommand_;\r
        std::wstringstream currentCommandString_;\r
-\r
-       safe_ptr<core::video_channel> pChannel_;\r
-\r
-       bool bClockLoaded_;\r
+       std::wstring command_name_;\r
+       std::vector<std::wstring> parameters_;\r
+       clk_command_processor command_processor_;\r
 };\r
 \r
 }}}\r