]> git.sesse.net Git - casparcg/blobdiff - modules/flash/producer/cg_producer.cpp
#297 Fixed support for flash templates with spaces in the file name.
[casparcg] / modules / flash / producer / cg_producer.cpp
index b0acbebc827f87594532efda0d6eb26b69aa9bfe..85cd830f23e3c3db93287232c7863267e748325d 100644 (file)
@@ -118,7 +118,7 @@ public:
 \r
        boost::unique_future<std::wstring> call(const std::wstring& str)\r
        {               \r
-               static const boost::wregex add_exp                      (L"ADD (?<LAYER>\\d+) (?<FILENAME>[^\\s]+) (?<PLAY_ON_LOAD>\\d)( (?<DATA>.*))?", boost::regex::perl|boost::regex::icase);\r
+               static const boost::wregex add_exp                      (L"ADD (?<LAYER>\\d+) \"(?<FILENAME>[^\"]*)\" (?<PLAY_ON_LOAD>\\d)( (?<DATA>.*))?", boost::regex::perl|boost::regex::icase);\r
                static const boost::wregex remove_exp           (L"REMOVE (?<LAYER>\\d+)", boost::regex::perl|boost::regex::icase);\r
                static const boost::wregex play_exp                     (L"PLAY (?<LAYER>\\d+)", boost::regex::perl|boost::regex::icase);\r
                static const boost::wregex stop_exp                     (L"STOP (?<LAYER>\\d+)", boost::regex::perl|boost::regex::icase);\r
@@ -130,20 +130,27 @@ public:
                \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(\r
+                                       boost::lexical_cast<int>(what["LAYER"].str()),\r
+                                       what["FILENAME"].str(),\r
+                                       boost::lexical_cast<bool>(what["PLAY_ON_LOAD"].str()),\r
+                                       L"",\r
+                                       what["DATA"].str());\r
                else if(boost::regex_match(str, what, remove_exp))\r
-                       return remove(boost::lexical_cast<int>(what["LAYER"].str())); \r
+                       return remove(boost::lexical_cast<int>(what["LAYER"].str()));\r
+               else if(boost::regex_match(str, what, play_exp))\r
+                       return play(boost::lexical_cast<int>(what["LAYER"].str()));\r
                else if(boost::regex_match(str, what, stop_exp))\r
-                       return stop(boost::lexical_cast<int>(what["LAYER"].str()), 0); \r
+                       return stop(boost::lexical_cast<int>(what["LAYER"].str()), 0);\r
                else if(boost::regex_match(str, what, next_exp))\r
-                       return next(boost::lexical_cast<int>(what["LAYER"].str())); \r
+                       return next(boost::lexical_cast<int>(what["LAYER"].str()));\r
                else if(boost::regex_match(str, what, update_exp))\r
-                       return update(boost::lexical_cast<int>(what["LAYER"].str()), what["DATA"].str()); \r
-               else if(boost::regex_match(str, what, next_exp))\r
-                       return invoke(boost::lexical_cast<int>(what["LAYER"].str()), what["LABEL"].str()); \r
-               else if(boost::regex_match(str, what, description_exp))\r
-                       return description(boost::lexical_cast<int>(what["LAYER"].str())); \r
+                       return update(boost::lexical_cast<int>(what["LAYER"].str()), what["DATA"].str());\r
                else if(boost::regex_match(str, what, invoke_exp))\r
+                       return invoke(boost::lexical_cast<int>(what["LAYER"].str()), what["LABEL"].str());\r
+               else if(boost::regex_match(str, what, description_exp))\r
+                       return description(boost::lexical_cast<int>(what["LAYER"].str()));\r
+               else if(boost::regex_match(str, what, info_exp))\r
                        return template_host_info(); \r
 \r
                return flash_producer_->call(str);\r