\r
#include "color_producer.h"\r
\r
-#include "../../mixer/frame/draw_frame.h"\r
+#include <mixer/frame/draw_frame.h>\r
\r
#include <sstream>\r
\r
{\r
safe_ptr<draw_frame> frame_;\r
std::wstring color_str_;\r
+ printer parent_printer_;\r
\r
public:\r
\r
- explicit color_producer(const std::wstring& color) : color_str_(color), frame_(draw_frame::empty())\r
+ explicit color_producer(const std::wstring& color) \r
+ : color_str_(color)\r
+ , frame_(draw_frame::empty())\r
{\r
if(color.length() != 9 || color[0] != '#')\r
BOOST_THROW_EXCEPTION(invalid_argument() << arg_name_info("color") << arg_value_info(narrow(color)) << msg_info("Invalid color code"));\r
str >> std::hex >> value; \r
frame_ = std::move(frame);\r
}\r
+\r
+ virtual void set_parent_printer(const printer& parent_printer){parent_printer_ = parent_printer;}\r
\r
virtual safe_ptr<draw_frame> receive() { return frame_; }\r
\r
- virtual std::wstring print() const { return + L"color[" + color_str_ + L"]"; }\r
+ virtual std::wstring print() const { return (parent_printer_ ? parent_printer_() + L"/" : L"") + L"color[" + color_str_ + L"]"; }\r
};\r
\r
safe_ptr<frame_producer> create_color_producer(const std::vector<std::wstring>& params)\r
return make_safe<color_producer>(params[0]);\r
}\r
\r
+volatile struct reg\r
+{\r
+ reg(){register_producer_factory(create_color_producer);}\r
+} my_reg;\r
+\r
}}
\ No newline at end of file