#pragma once\r
\r
#include <common/memory/safe_ptr.h>\r
+#include <common/exception/exceptions.h>\r
\r
#include <boost/noncopyable.hpp>\r
\r
\r
virtual boost::unique_future<std::wstring> call(const std::wstring&) \r
{\r
- boost::promise<std::wstring> promise;\r
- promise.set_value(L"");\r
- return promise.get_future();\r
+ BOOST_THROW_EXCEPTION(not_supported());\r
}\r
\r
virtual safe_ptr<frame_producer> get_following_producer() const {return frame_producer::empty();} // nothrow\r
\r
info.add(L"nb_frames", nb_frames == std::numeric_limits<int64_t>::max() ? -1 : nb_frames);\r
info.add(L"frames-left", nb_frames == std::numeric_limits<int64_t>::max() ? -1 : (foreground_->nb_frames() - frame_number_ - auto_play_delta_));\r
- info.add_child(L"foreground", foreground_->info());\r
- info.add_child(L"background", background_->info());\r
+ info.add_child(L"foreground.producer", foreground_->info());\r
+ info.add_child(L"background.producer", background_->info());\r
return info;\r
}\r
};\r
\r
std::wstring do_call(const std::wstring& param)\r
{\r
- static const boost::wregex loop_exp(L"LOOP\\s*(?<VALUE>\\d?)", boost::regex::icase);\r
+ static const boost::wregex loop_exp(L"LOOP\\s*(?<VALUE>\\d?)?", boost::regex::icase);\r
static const boost::wregex seek_exp(L"SEEK\\s+(?<VALUE>\\d+)", boost::regex::icase);\r
\r
boost::wsmatch what;\r
try\r
{\r
auto what = _parameters.at(0);\r
-\r
- std::wstring param = _parameters2.at(1);\r
- for(auto it = std::begin(_parameters2)+2; it != std::end(_parameters2); ++it)\r
- param += L" " + *it;\r
- \r
+ \r
boost::unique_future<std::wstring> result;\r
- if(what == L"B")\r
- result = GetChannel()->stage()->call(GetLayerIndex(), false, param);\r
- else if(what == L"F")\r
- result = GetChannel()->stage()->call(GetLayerIndex(), true, param);\r
+ if(what == L"B" || what == L"F")\r
+ {\r
+ std::wstring param;\r
+ for(auto it = std::begin(_parameters2)+1; it != std::end(_parameters2); ++it, param += L" ")\r
+ param += *it;\r
+ result = GetChannel()->stage()->call(GetLayerIndex(), what == L"F", boost::trim_copy(param));\r
+ }\r
else\r
- result = GetChannel()->stage()->call(GetLayerIndex(), true, _parameters.at(0) + L" " + param);\r
- \r
+ {\r
+ std::wstring param;\r
+ for(auto it = std::begin(_parameters2); it != std::end(_parameters2); ++it, param += L" ")\r
+ param += *it;\r
+ result = GetChannel()->stage()->call(GetLayerIndex(), true, boost::trim_copy(param));\r
+ }\r
+\r
if(!result.timed_wait(boost::posix_time::seconds(2)))\r
BOOST_THROW_EXCEPTION(timed_out());\r
\r
bool DoExecute();\r
};\r
\r
-class CallCommand : public AMCPCommandBase<true, AddToQueue, 2>\r
+class CallCommand : public AMCPCommandBase<true, AddToQueue, 1>\r
{\r
std::wstring print() const { return L"CallCommand";}\r
bool DoExecute();\r
<?xml version="1.0" encoding="utf-8"?>\r
<configuration>\r
<paths>\r
- <media-path>D:\casparcg\_media\</media-path>\r
+ <media-path>C:\casparmedia\_media\</media-path>\r
<log-path>D:\casparcg\_log\</log-path>\r
<data-path>D:\casparcg\_data\</data-path>\r
<template-path>D:\casparcg\_templates\</template-path>\r