From f41818f14369f170475b7f2bde1a2dd856517b14 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 8 May 2019 23:56:32 +0100 Subject: [PATCH] Put Font and Screen into dcpomatic namespace. --- src/lib/cinema.cc | 1 + src/lib/cinema.h | 12 +++++++----- src/lib/film.h | 7 +++++-- src/lib/font.cc | 5 +++-- src/lib/font.h | 4 ++++ src/lib/player.h | 7 +++++-- src/lib/player_text.cc | 1 + src/lib/player_text.h | 8 +++++--- src/lib/reel_writer.h | 7 +++++-- src/lib/render_text.h | 6 ++++-- src/lib/screen.cc | 1 + src/lib/screen.h | 4 ++++ src/lib/screen_kdm.h | 10 ++++++---- src/lib/send_kdm_email_job.h | 7 +++++-- src/lib/text_content.h | 12 +++++++----- src/lib/writer.h | 11 +++++++---- src/tools/dcpomatic_kdm.cc | 1 + src/tools/dcpomatic_kdm_cli.cc | 1 + src/wx/fonts_dialog.cc | 1 + src/wx/kdm_dialog.h | 5 ++++- src/wx/screens_panel.cc | 1 + src/wx/screens_panel.h | 11 +++++++---- 22 files changed, 85 insertions(+), 38 deletions(-) diff --git a/src/lib/cinema.cc b/src/lib/cinema.cc index 61862fa6d..1902f15f9 100644 --- a/src/lib/cinema.cc +++ b/src/lib/cinema.cc @@ -31,6 +31,7 @@ using std::list; using std::string; using boost::shared_ptr; using dcp::raw_convert; +using dcpomatic::Screen; Cinema::Cinema (cxml::ConstNodePtr node) : name (node->string_child ("Name")) diff --git a/src/lib/cinema.h b/src/lib/cinema.h index 6a3d89845..86245953b 100644 --- a/src/lib/cinema.h +++ b/src/lib/cinema.h @@ -29,7 +29,9 @@ namespace xmlpp { class Element; } -class Screen; +namespace dcpomatic { + class Screen; +} /** @class Cinema * @brief A description of a Cinema for KDM generation. @@ -54,8 +56,8 @@ public: void as_xml (xmlpp::Element *) const; - void add_screen (boost::shared_ptr); - void remove_screen (boost::shared_ptr); + void add_screen (boost::shared_ptr); + void remove_screen (boost::shared_ptr); void set_utc_offset_hour (int h); void set_utc_offset_minute (int m); @@ -72,12 +74,12 @@ public: return _utc_offset_minute; } - std::list > screens () const { + std::list > screens () const { return _screens; } private: - std::list > _screens; + std::list > _screens; /** Offset such that the equivalent time in UTC can be determined by subtracting the offset from the local time. */ diff --git a/src/lib/film.h b/src/lib/film.h index 7d762f599..87ea700b7 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -45,12 +45,15 @@ namespace xmlpp { class Document; } +namespace dcpomatic { + class Screen; +} + class DCPContentType; class Log; class Content; class Playlist; class AudioContent; -class Screen; class AudioProcessor; class AudioMapping; class Ratio; @@ -140,7 +143,7 @@ public: ) const; std::list make_kdms ( - std::list > screens, + std::list > screens, boost::filesystem::path cpl_file, boost::posix_time::ptime from, boost::posix_time::ptime until, diff --git a/src/lib/font.cc b/src/lib/font.cc index 333539aa4..019c9ab07 100644 --- a/src/lib/font.cc +++ b/src/lib/font.cc @@ -24,6 +24,7 @@ #include using std::string; +using namespace dcpomatic; Font::Font (cxml::NodePtr node) : _id (node->string_child ("Id")) @@ -47,7 +48,7 @@ Font::as_xml (xmlpp::Node* node) bool -operator== (Font const & a, Font const & b) +dcpomatic::operator== (Font const & a, Font const & b) { if (a.id() != b.id()) { return false; @@ -57,7 +58,7 @@ operator== (Font const & a, Font const & b) } bool -operator!= (Font const & a, Font const & b) +dcpomatic::operator!= (Font const & a, Font const & b) { return !(a == b); } diff --git a/src/lib/font.h b/src/lib/font.h index b2ae86daf..5876bf8a4 100644 --- a/src/lib/font.h +++ b/src/lib/font.h @@ -27,6 +27,8 @@ #include #include +namespace dcpomatic { + class Font { public: @@ -61,4 +63,6 @@ private: bool operator!= (Font const & a, Font const & b); bool operator== (Font const & a, Font const & b); +} + #endif diff --git a/src/lib/player.h b/src/lib/player.h index 381aa80b7..9f3dc7e71 100644 --- a/src/lib/player.h +++ b/src/lib/player.h @@ -41,9 +41,12 @@ namespace dcp { class ReelAsset; } +namespace dcpomatic { + class Font; +} + class PlayerVideo; class Playlist; -class Font; class AudioBuffers; class ReferencedReelAsset; class Shuffler; @@ -70,7 +73,7 @@ public: bool pass (); void seek (dcpomatic::DCPTime time, bool accurate); - std::list > get_subtitle_fonts (); + std::list > get_subtitle_fonts (); std::list get_reel_assets (); dcp::Size video_container_size () const { boost::mutex::scoped_lock lm (_mutex); diff --git a/src/lib/player_text.cc b/src/lib/player_text.cc index 16e89b0f1..d31c7d024 100644 --- a/src/lib/player_text.cc +++ b/src/lib/player_text.cc @@ -24,6 +24,7 @@ using std::list; using boost::shared_ptr; +using namespace dcpomatic; void PlayerText::add_fonts (list > fonts_) diff --git a/src/lib/player_text.h b/src/lib/player_text.h index 3f5066314..fb1d846d8 100644 --- a/src/lib/player_text.h +++ b/src/lib/player_text.h @@ -25,14 +25,16 @@ #include "dcpomatic_time.h" #include "string_text.h" -class Font; +namespace dcpomatic { + class Font; +} /** A set of text (subtitle/CCAP) which span the same time period */ class PlayerText { public: - void add_fonts (std::list > fonts_); - std::list > fonts; + void add_fonts (std::list > fonts_); + std::list > fonts; /** BitmapTexts, with their rectangles transformed as specified by their content */ std::list bitmap; diff --git a/src/lib/reel_writer.h b/src/lib/reel_writer.h index 9ea576d7a..fff2e0b9e 100644 --- a/src/lib/reel_writer.h +++ b/src/lib/reel_writer.h @@ -26,9 +26,12 @@ #include #include +namespace dcpomatic { + class Font; +} + class Film; class Job; -class Font; class AudioBuffers; namespace dcp { @@ -64,7 +67,7 @@ public: void write (PlayerText text, TextType type, boost::optional track, dcpomatic::DCPTimePeriod period); void finish (); - boost::shared_ptr create_reel (std::list const & refs, std::list > const & fonts); + boost::shared_ptr create_reel (std::list const & refs, std::list > const & fonts); void calculate_digests (boost::function set_progress); Frame start () const; diff --git a/src/lib/render_text.h b/src/lib/render_text.h index f235fb459..7187ca30b 100644 --- a/src/lib/render_text.h +++ b/src/lib/render_text.h @@ -23,9 +23,11 @@ #include "string_text.h" #include -class Font; +namespace dcpomatic { + class Font; +} std::string marked_up (std::list subtitles, int target_height, float fade_factor); std::list render_text ( - std::list, std::list > fonts, dcp::Size, dcpomatic::DCPTime, int + std::list, std::list > fonts, dcp::Size, dcpomatic::DCPTime, int ); diff --git a/src/lib/screen.cc b/src/lib/screen.cc index 5ec00f9c1..fe62a5e6c 100644 --- a/src/lib/screen.cc +++ b/src/lib/screen.cc @@ -25,6 +25,7 @@ using std::string; using std::vector; +using namespace dcpomatic; Screen::Screen (cxml::ConstNodePtr node) : name (node->string_child("Name")) diff --git a/src/lib/screen.h b/src/lib/screen.h index eff2e5ffe..829df2373 100644 --- a/src/lib/screen.h +++ b/src/lib/screen.h @@ -46,6 +46,8 @@ private: boost::optional _thumbprint; }; +namespace dcpomatic { + /** @class Screen * @brief A representation of a Screen for KDM generation. * @@ -74,4 +76,6 @@ public: std::vector trusted_devices; }; +} + #endif diff --git a/src/lib/screen_kdm.h b/src/lib/screen_kdm.h index 9ab73b851..351c2f1c2 100644 --- a/src/lib/screen_kdm.h +++ b/src/lib/screen_kdm.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2016 Carl Hetherington + Copyright (C) 2013-2019 Carl Hetherington This file is part of DCP-o-matic. @@ -25,13 +25,15 @@ #include #include -class Screen; +namespace dcpomatic { + class Screen; +} /** Simple class to collect a screen and an encrypted KDM */ class ScreenKDM { public: - ScreenKDM (boost::shared_ptr s, dcp::EncryptedKDM k) + ScreenKDM (boost::shared_ptr s, dcp::EncryptedKDM k) : screen (s) , kdm (k) {} @@ -42,7 +44,7 @@ public: boost::function confirm_overwrite ); - boost::shared_ptr screen; + boost::shared_ptr screen; dcp::EncryptedKDM kdm; }; diff --git a/src/lib/send_kdm_email_job.h b/src/lib/send_kdm_email_job.h index b4e007e3b..0b64db7a8 100644 --- a/src/lib/send_kdm_email_job.h +++ b/src/lib/send_kdm_email_job.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013 Carl Hetherington + Copyright (C) 2013-2019 Carl Hetherington This file is part of DCP-o-matic. @@ -23,7 +23,10 @@ #include #include -class Screen; +namespace dcpomatic { + class Screen; +} + class CinemaKDMs; class Log; diff --git a/src/lib/text_content.h b/src/lib/text_content.h index c7d1b590d..5eda8764f 100644 --- a/src/lib/text_content.h +++ b/src/lib/text_content.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2018 Carl Hetherington + Copyright (C) 2013-2019 Carl Hetherington This file is part of DCP-o-matic. @@ -27,7 +27,9 @@ #include #include -class Font; +namespace dcpomatic { + class Font; +} class TextContentProperty { @@ -67,7 +69,7 @@ public: std::string identifier () const; void take_settings_from (boost::shared_ptr c); - void add_font (boost::shared_ptr font); + void add_font (boost::shared_ptr font); void set_use (bool); void set_burn (bool); @@ -122,7 +124,7 @@ public: return _y_scale; } - std::list > fonts () const { + std::list > fonts () const { boost::mutex::scoped_lock lm (_mutex); return _fonts; } @@ -211,7 +213,7 @@ private: double _x_scale; /** y scale factor to apply to subtitles */ double _y_scale; - std::list > _fonts; + std::list > _fonts; boost::optional _colour; boost::optional _effect; boost::optional _effect_colour; diff --git a/src/lib/writer.h b/src/lib/writer.h index ce1d04ced..5fe96a3ac 100644 --- a/src/lib/writer.h +++ b/src/lib/writer.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2018 Carl Hetherington + Copyright (C) 2012-2019 Carl Hetherington This file is part of DCP-o-matic. @@ -36,10 +36,13 @@ namespace dcp { class Data; } +namespace dcpomatic { + class Font; +} + class Film; class AudioBuffers; class Job; -class Font; class ReferencedReelAsset; class ReelWriter; @@ -106,7 +109,7 @@ public: void repeat (Frame, Eyes); void write (boost::shared_ptr, dcpomatic::DCPTime time); void write (PlayerText text, TextType type, boost::optional, dcpomatic::DCPTimePeriod period); - void write (std::list > fonts); + void write (std::list > fonts); void write (ReferencedReelAsset asset); void finish (); @@ -163,5 +166,5 @@ private: std::list _reel_assets; - std::list > _fonts; + std::list > _fonts; }; diff --git a/src/tools/dcpomatic_kdm.cc b/src/tools/dcpomatic_kdm.cc index 8ee4c72d4..60bb54f59 100644 --- a/src/tools/dcpomatic_kdm.cc +++ b/src/tools/dcpomatic_kdm.cc @@ -74,6 +74,7 @@ using boost::bind; using boost::optional; using boost::ref; using boost::dynamic_pointer_cast; +using namespace dcpomatic; enum { ID_help_report_a_problem = 1, diff --git a/src/tools/dcpomatic_kdm_cli.cc b/src/tools/dcpomatic_kdm_cli.cc index 21f9ec734..79912a36a 100644 --- a/src/tools/dcpomatic_kdm_cli.cc +++ b/src/tools/dcpomatic_kdm_cli.cc @@ -47,6 +47,7 @@ using boost::shared_ptr; using boost::optional; using boost::bind; using boost::dynamic_pointer_cast; +using namespace dcpomatic; static void help () diff --git a/src/wx/fonts_dialog.cc b/src/wx/fonts_dialog.cc index 88fcb2dce..66f8ab0e4 100644 --- a/src/wx/fonts_dialog.cc +++ b/src/wx/fonts_dialog.cc @@ -33,6 +33,7 @@ using std::list; using std::string; using std::cout; using boost::shared_ptr; +using namespace dcpomatic; FontsDialog::FontsDialog (wxWindow* parent, shared_ptr content, shared_ptr caption) : wxDialog (parent, wxID_ANY, _("Fonts")) diff --git a/src/wx/kdm_dialog.h b/src/wx/kdm_dialog.h index 099db951b..a240ec1b6 100644 --- a/src/wx/kdm_dialog.h +++ b/src/wx/kdm_dialog.h @@ -25,8 +25,11 @@ #include #include +namespace dcpomatic { + class Screen; +} + class Cinema; -class Screen; class Film; class ScreensPanel; class KDMTimingPanel; diff --git a/src/wx/screens_panel.cc b/src/wx/screens_panel.cc index e89173eb2..7e012b522 100644 --- a/src/wx/screens_panel.cc +++ b/src/wx/screens_panel.cc @@ -36,6 +36,7 @@ using std::string; using std::make_pair; using boost::shared_ptr; using boost::optional; +using namespace dcpomatic; ScreensPanel::ScreensPanel (wxWindow* parent) : wxPanel (parent, wxID_ANY) diff --git a/src/wx/screens_panel.h b/src/wx/screens_panel.h index 3e9accde5..510297efb 100644 --- a/src/wx/screens_panel.h +++ b/src/wx/screens_panel.h @@ -26,8 +26,11 @@ #include #include +namespace dcpomatic { + class Screen; +} + class Cinema; -class Screen; class ScreensPanel : public wxPanel { @@ -35,7 +38,7 @@ public: explicit ScreensPanel (wxWindow* parent); ~ScreensPanel (); - std::list > screens () const; + std::list > screens () const; void setup_sensitivity (); boost::signals2::signal ScreensChanged; @@ -43,7 +46,7 @@ public: private: void add_cinemas (); void add_cinema (boost::shared_ptr); - boost::optional add_screen (boost::shared_ptr, boost::shared_ptr); + boost::optional add_screen (boost::shared_ptr, boost::shared_ptr); void add_cinema_clicked (); void edit_cinema_clicked (); void remove_cinema_clicked (); @@ -65,7 +68,7 @@ private: wxTreeItemId _root; typedef std::map > CinemaMap; - typedef std::map > ScreenMap; + typedef std::map > ScreenMap; CinemaMap _cinemas; ScreenMap _screens; -- 2.30.2