std::shared_ptr
[dcpomatic.git] / src / lib / text_content.h
index c7d1b590d101cbdf5e5acb4c08a822c3c6a0c231..21d09ad12b7329e146b5a1169a5ea934cd26dc16 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2020 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -27,7 +27,9 @@
 #include <dcp/types.h>
 #include <boost/signals2.hpp>
 
-class Font;
+namespace dcpomatic {
+       class Font;
+}
 
 class TextContentProperty
 {
@@ -38,7 +40,6 @@ public:
        static int const Y_SCALE;
        static int const USE;
        static int const BURN;
-       static int const LANGUAGE;
        static int const FONTS;
        static int const COLOUR;
        static int const EFFECT;
@@ -61,13 +62,13 @@ class TextContent : public ContentPart
 {
 public:
        TextContent (Content* parent, TextType type, TextType original_type);
-       TextContent (Content* parent, std::vector<boost::shared_ptr<Content> >);
+       TextContent (Content* parent, std::vector<std::shared_ptr<Content> >);
 
        void as_xml (xmlpp::Node *) const;
        std::string identifier () const;
-       void take_settings_from (boost::shared_ptr<const TextContent> c);
+       void take_settings_from (std::shared_ptr<const TextContent> c);
 
-       void add_font (boost::shared_ptr<Font> font);
+       void add_font (std::shared_ptr<dcpomatic::Font> font);
 
        void set_use (bool);
        void set_burn (bool);
@@ -75,7 +76,6 @@ public:
        void set_y_offset (double);
        void set_x_scale (double);
        void set_y_scale (double);
-       void set_language (std::string language);
        void set_colour (dcp::Colour);
        void unset_colour ();
        void set_effect (dcp::Effect);
@@ -122,16 +122,11 @@ public:
                return _y_scale;
        }
 
-       std::list<boost::shared_ptr<Font> > fonts () const {
+       std::list<std::shared_ptr<dcpomatic::Font> > fonts () const {
                boost::mutex::scoped_lock lm (_mutex);
                return _fonts;
        }
 
-       std::string language () const {
-               boost::mutex::scoped_lock lm (_mutex);
-               return _language;
-       }
-
        boost::optional<dcp::Colour> colour () const {
                boost::mutex::scoped_lock lm (_mutex);
                return _colour;
@@ -182,11 +177,7 @@ public:
                return _dcp_track;
        }
 
-       static std::list<boost::shared_ptr<TextContent> > from_xml (Content* parent, cxml::ConstNodePtr, int version);
-
-protected:
-       /** subtitle language (e.g. "German") or empty if it is not known */
-       std::string _language;
+       static std::list<std::shared_ptr<TextContent> > from_xml (Content* parent, cxml::ConstNodePtr, int version);
 
 private:
        friend struct ffmpeg_pts_offset_test;
@@ -211,7 +202,7 @@ private:
        double _x_scale;
        /** y scale factor to apply to subtitles */
        double _y_scale;
-       std::list<boost::shared_ptr<Font> > _fonts;
+       std::list<std::shared_ptr<dcpomatic::Font> > _fonts;
        boost::optional<dcp::Colour> _colour;
        boost::optional<dcp::Effect> _effect;
        boost::optional<dcp::Colour> _effect_colour;