]> git.sesse.net Git - casparcg/blobdiff - core/producer/draw/freehand_producer.cpp
* Refactored so that frame_producers are stored in a frame_producer_registry instance...
[casparcg] / core / producer / draw / freehand_producer.cpp
index f426802affc65386d7a18fbad0c8e1e7da3a1781..cdc6639bc024a53219d22ddfe8a877129f3594bf 100644 (file)
@@ -19,7 +19,7 @@
 * Author: Helge Norberg, helge.norberg@svt.se
 */
 
-#include "../../stdafx.h"
+#include "../../StdAfx.h"
 
 #include "freehand_producer.h"
 
 
 namespace caspar { namespace core {
 
-std::vector<uint8_t, tbb::cache_aligned_allocator<uint8_t>> empty_drawing(
-               int width, int height)
+cache_aligned_vector<uint8_t> empty_drawing(int width, int height)
 {
-       std::vector<uint8_t, tbb::cache_aligned_allocator<uint8_t>> result;
+       cache_aligned_vector<uint8_t> result;
 
        result.resize(width * height * 4);
        std::fill(result.begin(), result.end(), 0);
@@ -45,12 +44,13 @@ std::vector<uint8_t, tbb::cache_aligned_allocator<uint8_t>> empty_drawing(
 
 class freehand_producer : public frame_producer_base
 {
-       std::vector<uint8_t, tbb::cache_aligned_allocator<uint8_t>>     drawing_;
-       spl::shared_ptr<core::frame_factory>                                            frame_factory_;
-       constraints                                                                                                     constraints_;
-       draw_frame                                                                                                      frame_;
-       bool                                                                                                            button_pressed_;
-       bool                                                                                                            modified_;
+       monitor::subject                                                monitor_subject_;
+       cache_aligned_vector<uint8_t>                   drawing_;
+       spl::shared_ptr<core::frame_factory>    frame_factory_;
+       constraints                                                             constraints_;
+       draw_frame                                                              frame_;
+       bool                                                                    button_pressed_;
+       bool                                                                    modified_;
 public:
        explicit freehand_producer(
                        const spl::shared_ptr<core::frame_factory>& frame_factory,
@@ -68,7 +68,7 @@ public:
 
        draw_frame create_frame()
        {
-               pixel_format_desc desc(pixel_format_def::bgra);
+               pixel_format_desc desc(pixel_format::bgra);
                desc.planes.push_back(pixel_format_desc::plane(
                                static_cast<int>(constraints_.width.get()),
                                static_cast<int>(constraints_.height.get()),
@@ -161,12 +161,9 @@ public:
                return info;
        }
 
-       void subscribe(const monitor::observable::observer_ptr& o) override                                                                                                                     
-       {
-       }
-
-       void unsubscribe(const monitor::observable::observer_ptr& o) override           
+       monitor::subject& monitor_output()
        {
+               return monitor_subject_;
        }
 };