\r
boost::wsmatch what;\r
if(boost::regex_match(str, what, add_exp))\r
- return add(boost::lexical_cast<int>(what["LAYER"].str()), flash::find_template(env::template_folder() + what["FILENAME"].str()), boost::lexical_cast<bool>(what["PLAY_ON_LOAD"].str()), L"", what["DATA"].str()); \r
+ return add(boost::lexical_cast<int>(what["LAYER"].str()), what["FILENAME"].str(), boost::lexical_cast<bool>(what["PLAY_ON_LOAD"].str()), L"", what["DATA"].str()); \r
else if(boost::regex_match(str, what, remove_exp))\r
return remove(boost::lexical_cast<int>(what["LAYER"].str())); \r
else if(boost::regex_match(str, what, stop_exp))\r
\r
if(!ax_->FlashCall(param, result))\r
CASPAR_LOG(warning) << print() << L" Flash call failed:" << param;//BOOST_THROW_EXCEPTION(invalid_operation() << msg_info("Flash function call failed.") << arg_name_info("param") << arg_value_info(narrow(param)));\r
+\r
+ if (boost::starts_with(result, L"<exception>"))\r
+ CASPAR_LOG(warning) << print() << L" Flash call failed:" << result;\r
+\r
graph_->set_tag("param");\r
\r
return result;\r
#include <modules/html/producer/html_producer.h>\r
#include <modules/flash/util/swf.h>\r
#include <modules/flash/producer/flash_producer.h>\r
+#include <modules/flash/producer/cg_producer.h>\r
#include <modules/ffmpeg/producer/util/util.h>\r
#include <modules/image/image.h>\r
#include <modules/ogl/ogl.h>\r
std::wstring fullFilename = flash::find_template(env::template_folder() + _parameters[2]);\r
std::wstring extension = boost::filesystem::wpath(fullFilename).extension();\r
std::wstring filename = _parameters[2];\r
- filename.append(extension);\r
\r
if(!fullFilename.empty())\r
{\r
- \r
+ auto call = (boost::wformat(L"ADD %1% %2% %3% %4% %5%") % layer % filename % bDoStart % label % (std::wstring() + (pDataString ? pDataString : L""))).str();\r
auto producer = GetChannel()->stage()->foreground(GetLayerIndex(9999)).get();\r
\r
if(producer->print().find(L"flash") == std::string::npos)\r
{ \r
- producer = flash::create_producer(GetChannel()->mixer(), boost::assign::list_of<std::wstring>()); \r
+ producer = flash::create_producer(GetChannel()->mixer(), boost::assign::list_of<std::wstring>());\r
+\r
+ if (producer != core::frame_producer::empty())\r
+ {\r
+ producer = make_safe<flash::cg_producer>(producer);\r
+ producer->call(call).wait();\r
+ GetChannel()->stage()->load(GetLayerIndex(9999), producer);\r
+ GetChannel()->stage()->play(GetLayerIndex(9999));\r
+ }\r
+ }\r
+ else\r
+ {\r
+ GetChannel()->stage()->call(GetLayerIndex(9999), true, call).wait();\r
}\r
- \r
- GetChannel()->stage()->call(GetLayerIndex(9999), true, (boost::wformat(L"ADD %1% %2% %3% %4% %5%") % layer % filename % bDoStart % label % (std::wstring() + L"\"" + (pDataString ? pDataString : L"") + L"\"")).str()).wait();\r
\r
SetReplyString(TEXT("202 CG OK\r\n"));\r
\r
}\r
else\r
{ \r
+ filename.append(extension);\r
std::vector<std::wstring> parameters = boost::assign::list_of<std::wstring>(filename);\r
auto producer = html::create_producer(GetChannel()->mixer(), core::parameters(parameters)); \r
\r