\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
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