\r
bool is_valid_file(const std::wstring filename)\r
{ \r
- static const std::vector<std::wstring> invalid_exts = boost::assign::list_of(L".png")(L".tga")(L".bmp")(L".jpg")(L".jpeg")(L".gif")(L".tiff")(L".tif")(L".jp2")(L".jpx")(L".j2k")(L".j2c");\r
+ static const std::vector<std::wstring> invalid_exts = boost::assign::list_of(L".png")(L".tga")(L".bmp")(L".jpg")(L".jpeg")(L".gif")(L".tiff")(L".tif")(L".jp2")(L".jpx")(L".j2k")(L".j2c")(L".swf")(L".ct");\r
static std::vector<std::wstring> valid_exts = boost::assign::list_of(L".m2t")(L".mov")(L".mp4")(L".dv")(L".flv")(L".mpg")(L".wav")(L".mp3")(L".dnxhd")(L".h264")(L".prores");\r
\r
auto ext = boost::to_lower_copy(boost::filesystem::wpath(filename).extension());\r
return make_safe<cg_producer>(flash_producer);\r
}\r
\r
-safe_ptr<core::frame_producer> create_ct_producer(const safe_ptr<core::frame_factory> frame_factory, const std::vector<std::wstring>& params) \r
+safe_ptr<core::frame_producer> create_cg_producer_and_autoplay_file(\r
+ const safe_ptr<core::frame_factory>& frame_factory, \r
+ const std::vector<std::wstring>& params,\r
+ const std::wstring& filename) \r
{\r
- std::wstring filename = env::media_folder() + L"\\" + params[0] + L".ct";\r
if(!boost::filesystem::exists(filename))\r
return core::frame_producer::empty();\r
\r
boost::filesystem2::wpath path(filename);\r
path = boost::filesystem2::complete(path);\r
- filename = path.file_string();\r
+ auto filename2 = path.file_string();\r
\r
auto flash_producer = flash::create_producer(frame_factory, boost::assign::list_of<std::wstring>()); \r
auto producer = make_safe<cg_producer>(flash_producer);\r
- producer->add(0, filename, 1);\r
+ producer->add(0, filename2, 1);\r
\r
return producer;\r
}\r
\r
-safe_ptr<core::frame_producer> create_cg_producer(const safe_ptr<core::frame_factory> frame_factory, const std::vector<std::wstring>& params) \r
+safe_ptr<core::frame_producer> create_ct_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params) \r
+{\r
+ return create_cg_producer_and_autoplay_file(frame_factory, params, env::media_folder() + L"\\" + params[0] + L".ct");\r
+}\r
+\r
+safe_ptr<core::frame_producer> create_swf_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params) \r
+{\r
+ return create_cg_producer_and_autoplay_file(frame_factory, params, env::media_folder() + L"\\" + params[0] + L".swf");\r
+}\r
+\r
+safe_ptr<core::frame_producer> create_cg_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params) \r
{\r
if(params.empty() || params.at(0) != L"[CG]")\r
return core::frame_producer::empty();\r
};\r
safe_ptr<cg_producer> get_default_cg_producer(const safe_ptr<core::video_channel>& video_channel, int layer_index = cg_producer::DEFAULT_LAYER);\r
\r
-safe_ptr<core::frame_producer> create_ct_producer(const safe_ptr<core::frame_factory> frame_factory, const std::vector<std::wstring>& params);\r
-safe_ptr<core::frame_producer> create_cg_producer(const safe_ptr<core::frame_factory> frame_factory, const std::vector<std::wstring>& params);\r
+safe_ptr<core::frame_producer> create_ct_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params);\r
+safe_ptr<core::frame_producer> create_cg_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params);\r
+safe_ptr<core::frame_producer> create_swf_producer(const safe_ptr<core::frame_factory>& frame_factory, const std::vector<std::wstring>& params);\r
\r
}}
\ No newline at end of file