]> git.sesse.net Git - casparcg/blobdiff - core/producer/color/color_producer.cpp
2.0.0.2: Improved logging. Added "parent logging".
[casparcg] / core / producer / color / color_producer.cpp
index b82a49eee10b46ca7567b76c527b3b1296895b37..1f8484e5517c9ce2ff7f40dfa96c69774a166fac 100644 (file)
@@ -22,7 +22,7 @@
 \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
@@ -32,6 +32,7 @@ class color_producer : public frame_producer
 {\r
        safe_ptr<draw_frame> frame_;\r
        std::wstring color_str_;\r
+       printer parent_printer_;\r
 \r
 public:\r
 \r
@@ -40,8 +41,6 @@ public:
                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
        }\r
-       \r
-       virtual safe_ptr<draw_frame> receive() { return frame_; }\r
 \r
        virtual void initialize(const safe_ptr<frame_factory>& frame_factory)\r
        {\r
@@ -51,8 +50,12 @@ public:
                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