]> git.sesse.net Git - casparcg/blobdiff - core/producer/text/text_producer.h
Merged most recent OSC changes
[casparcg] / core / producer / text / text_producer.h
index 6f7dfec459b2c3f87779f13e555d74e282212605..f666f4ba73f1ba0f0509c0ffffc2dc2d46170029 100644 (file)
 
 #include "utils/color.h"
 #include "utils/string_metrics.h"
+#include "utils/text_info.h"
 
 namespace caspar { namespace core {
        namespace text 
        {
-               struct text_info
-               {
-                       std::wstring font;
-                       float size;
-                       color<float> color;
-               };
+               void init();
        }
 
 class text_producer : public frame_producer_base
 {
 public:
-       text_producer(const spl::shared_ptr<frame_factory>& frame_factory, int x, int y, const std::wstring& str, const text::text_info& text_info, long parent_width, long parent_height);
+       text_producer(const spl::shared_ptr<frame_factory>& frame_factory, int x, int y, const std::wstring& str, text::text_info& text_info, long parent_width, long parent_height, bool standalone);
+       static spl::shared_ptr<text_producer> create(const spl::shared_ptr<class frame_factory>& frame_factory, int x, int y, const std::wstring& str, text::text_info& text_info, long parent_width, long parent_height, bool standalone = false);
+       
        draw_frame receive_impl() override;
        boost::unique_future<std::wstring> call(const std::vector<std::wstring>& param) override;
+       variable& get_variable(const std::wstring& name) override;
+       const std::vector<std::wstring>& get_variables() const override;
 
        text::string_metrics measure_string(const std::wstring& str);
 
@@ -56,15 +56,17 @@ public:
        std::wstring print() const override;
        std::wstring name() const override;
        boost::property_tree::wptree info() const override;
-       void subscribe(const monitor::observable::observer_ptr& o) override;
-       void unsubscribe(const monitor::observable::observer_ptr& o) override;
+       monitor::subject& monitor_output();
 
+       binding<std::wstring>& text();
+       binding<double>& tracking();
+       const binding<double>& current_bearing_y() const;
+       const binding<double>& current_protrude_under_y() const;
 private:
        struct impl;
        spl::unique_ptr<impl> impl_;
 };
 
-spl::shared_ptr<frame_producer> do_create_text_producer(const spl::shared_ptr<class frame_factory>& frame_factory, int x, int y, const std::wstring& str, const text::text_info& text_info, long parent_width, long parent_height);
 spl::shared_ptr<frame_producer> create_text_producer(const spl::shared_ptr<class frame_factory>& frame_factory, const video_format_desc& format_desc, const std::vector<std::wstring>& params);