]> git.sesse.net Git - casparcg/blobdiff - protocol/amcp/AMCPProtocolStrategy.h
Merge branch '2.1.0' of https://github.com/CasparCG/Server into 2.1.0
[casparcg] / protocol / amcp / AMCPProtocolStrategy.h
index ac8ee3e7bd49716014216f7b3a9219e7b5ec70c9..559b9d44f1f09042135033c1a5dbd8b8003e6fb1 100644 (file)
 
 #pragma once
 
-#include "../util/protocolstrategy.h"
+#include "../util/ProtocolStrategy.h"
+
 #include <core/video_channel.h>
+#include <core/thumbnail_generator.h>
+#include <core/producer/media_info/media_info_repository.h>
+#include <core/producer/cg_proxy.h>
+#include <core/system_info_provider.h>
 
-#include "AMCPCommand.h"
-#include "AMCPCommandQueue.h"
+#include <common/memory.h>
 
 #include <boost/noncopyable.hpp>
 
 #include <string>
+#include <future>
 
 namespace caspar { namespace protocol { namespace amcp {
 
 class AMCPProtocolStrategy : public IO::IProtocolStrategy, boost::noncopyable
 {
-       enum MessageParserState {
-               New = 0,
-               GetSwitch,
-               GetCommand,
-               GetParameters,
-               GetChannel,
-               Done
-       };
-
-       AMCPProtocolStrategy(const AMCPProtocolStrategy&);
-       AMCPProtocolStrategy& operator=(const AMCPProtocolStrategy&);
-
 public:
-       AMCPProtocolStrategy(const std::vector<spl::shared_ptr<core::video_channel>>& channels);
-       virtual ~AMCPProtocolStrategy();
+       AMCPProtocolStrategy(const std::wstring& name, const spl::shared_ptr<class amcp_command_repository>& repo);
 
-       virtual void Parse(const TCHAR* pData, int charCount, IO::ClientInfoPtr pClientInfo);
-       virtual std::string GetCodepage() {
-               return "UTF-8";
-       }
+       virtual ~AMCPProtocolStrategy();
 
-       AMCPCommandPtr InterpretCommandString(const std::wstring& str, MessageParserState* pOutState=0);
+       virtual void Parse(const std::wstring& msg, IO::ClientInfoPtr pClientInfo);
+       virtual std::string GetCodepage() const { return "UTF-8"; }
 
 private:
-       friend class AMCPCommand;
-
-       void ProcessMessage(const std::wstring& message, IO::ClientInfoPtr& pClientInfo);
-       std::size_t TokenizeMessage(const std::wstring& message, std::vector<std::wstring>* pTokenVector);
-       AMCPCommandPtr CommandFactory(const std::wstring& str);
-
-       bool QueueCommand(AMCPCommandPtr);
-
-       std::vector<spl::shared_ptr<core::video_channel>> channels_;
-       std::vector<AMCPCommandQueuePtr> commandQueues_;
-       static const std::wstring MessageDelimiter;
+       struct impl;
+       spl::unique_ptr<impl> impl_;
 };
 
 }}}