X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=protocol%2Fclk%2FCLKProtocolStrategy.h;h=044cff4086f820d44a701031591855fc82df77ba;hb=c0eb56796b07e6f3c2480b8284e06152a4ed24d9;hp=4b89eb365131d85ab9535f9fa83386fb5b5eed09;hpb=32989c0d2fdf3b106caafafc948316c5486179c9;p=casparcg diff --git a/protocol/clk/CLKProtocolStrategy.h b/protocol/clk/CLKProtocolStrategy.h index 4b89eb365..044cff408 100644 --- a/protocol/clk/CLKProtocolStrategy.h +++ b/protocol/clk/CLKProtocolStrategy.h @@ -1,58 +1,45 @@ -/* -* Copyright (c) 2011 Sveriges Television AB -* -* This file is part of CasparCG (www.casparcg.com). -* -* CasparCG is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* CasparCG is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with CasparCG. If not, see . -* -* Author: Nicklas P Andersson -*/ - - -#pragma once - -#include "CLKCommand.h" -#include "../util/ProtocolStrategy.h" -#include - -namespace caspar { namespace protocol { namespace CLK { - -class CLKProtocolStrategy : public IO::IProtocolStrategy -{ -public: - CLKProtocolStrategy(const std::vector>& channels); - - void Parse(const TCHAR* pData, int charCount, IO::ClientInfoPtr pClientInfo); - UINT GetCodepage() { return 28591; } //ISO 8859-1 - -private: - enum ParserState - { - ExpectingNewCommand, - ExpectingCommand, - ExpectingClockID, - ExpectingTime, - ExpectingParameter - }; - - ParserState currentState_; - CLKCommand currentCommand_; - std::wstringstream currentCommandString_; - - safe_ptr pChannel_; - - bool bClockLoaded_; -}; - -}}} +/* +* Copyright (c) 2011 Sveriges Television AB +* +* This file is part of CasparCG (www.casparcg.com). +* +* CasparCG is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* CasparCG is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with CasparCG. If not, see . +* +* Author: Nicklas P Andersson +*/ + + +#pragma once + +#include "../util/protocol_strategy.h" +#include "clk_command_processor.h" +#include +#include + +namespace caspar { namespace protocol { namespace CLK { + +class clk_protocol_strategy_factory : public IO::protocol_strategy_factory +{ + clk_command_processor command_processor_; +public: + clk_protocol_strategy_factory( + const std::vector>& channels, + const spl::shared_ptr& cg_registry, + const spl::shared_ptr& producer_registry); + + virtual IO::protocol_strategy::ptr create( + const IO::client_connection::ptr& client_connection); +}; + +}}}