From c2a97b6f83a32483817d02194a1e7c8d6828b0bb Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 18 Aug 2015 18:04:49 +0100 Subject: [PATCH] Include tidying. --- src/lib/audio_content.cc | 4 +-- src/lib/audio_decoder_stream.cc | 1 + src/lib/cinema.cc | 22 ++------------- src/lib/cinema.h | 27 ++----------------- src/lib/content.cc | 1 + src/lib/dcp_video.cc | 12 +-------- src/lib/encoder.cc | 8 +----- src/lib/ffmpeg.cc | 4 +-- src/lib/ffmpeg_decoder.cc | 9 +------ src/lib/ffmpeg_decoder.h | 5 ---- src/lib/film.cc | 18 +++---------- src/lib/filter_graph.cc | 14 +++++----- src/lib/filter_graph.h | 1 + src/lib/image_examiner.cc | 1 + src/lib/job.cc | 9 ++++--- src/lib/kdm.cc | 14 +++++----- src/lib/kdm.h | 3 ++- src/lib/screen.cc | 38 ++++++++++++++++++++++++++ src/lib/screen.h | 48 +++++++++++++++++++++++++++++++++ src/lib/server.cc | 8 ++---- src/lib/transcode_job.cc | 5 ++-- src/lib/util.cc | 6 +++-- src/lib/util.h | 4 --- src/lib/video_decoder.cc | 13 +++++---- src/lib/wscript | 1 + src/tools/dcpomatic.cc | 1 + src/wx/audio_plot.cc | 1 + src/wx/job_manager_view.cc | 5 ++-- src/wx/job_manager_view.h | 5 ++-- src/wx/kdm_dialog.cc | 1 + 30 files changed, 151 insertions(+), 138 deletions(-) create mode 100644 src/lib/screen.cc create mode 100644 src/lib/screen.h diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc index d2d90a1f5..4d821ad60 100644 --- a/src/lib/audio_content.cc +++ b/src/lib/audio_content.cc @@ -18,14 +18,12 @@ */ #include "audio_content.h" -#include "analyse_audio_job.h" -#include "job_manager.h" #include "film.h" #include "exceptions.h" #include "config.h" #include "frame_rate_change.h" #include "raw_convert.h" -#include "playlist.h" +#include "compose.hpp" #include #include diff --git a/src/lib/audio_decoder_stream.cc b/src/lib/audio_decoder_stream.cc index 36274b502..52a33c172 100644 --- a/src/lib/audio_decoder_stream.cc +++ b/src/lib/audio_decoder_stream.cc @@ -25,6 +25,7 @@ #include "util.h" #include "film.h" #include "log.h" +#include "compose.hpp" #include #include "i18n.h" diff --git a/src/lib/cinema.cc b/src/lib/cinema.cc index f77439238..11bc888da 100644 --- a/src/lib/cinema.cc +++ b/src/lib/cinema.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013 Carl Hetherington + Copyright (C) 2013-2015 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -18,6 +18,7 @@ */ #include "cinema.h" +#include "screen.h" #include #include @@ -66,22 +67,3 @@ Cinema::remove_screen (shared_ptr s) { _screens.remove (s); } - -Screen::Screen (cxml::ConstNodePtr node) - : name (node->string_child ("Name")) -{ - if (node->optional_string_child ("Certificate")) { - certificate = dcp::Certificate (node->string_child ("Certificate")); - } -} - -void -Screen::as_xml (xmlpp::Element* parent) const -{ - parent->add_child("Name")->add_child_text (name); - if (certificate) { - parent->add_child("Certificate")->add_child_text (certificate->certificate (true)); - } -} - - diff --git a/src/lib/cinema.h b/src/lib/cinema.h index 4639261c3..8d4473fb1 100644 --- a/src/lib/cinema.h +++ b/src/lib/cinema.h @@ -18,37 +18,14 @@ */ /** @file src/lib/cinema.h - * @brief Screen and Cinema classes. + * @brief Cinema class. */ #include #include #include -class Cinema; - -/** @class Screen - * @brief A representation of a Screen for KDM generation. - * - * This is the name of the screen and the certificate of its - * server. - */ -class Screen -{ -public: - Screen (std::string const & n, boost::optional cert) - : name (n) - , certificate (cert) - {} - - Screen (cxml::ConstNodePtr); - - void as_xml (xmlpp::Element *) const; - - boost::shared_ptr cinema; - std::string name; - boost::optional certificate; -}; +class Screen; /** @class Cinema * @brief A description of a Cinema for KDM generation. diff --git a/src/lib/content.cc b/src/lib/content.cc index f0d35186a..a8e592ba7 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -28,6 +28,7 @@ #include "film.h" #include "safe_stringstream.h" #include "job.h" +#include "compose.hpp" #include "raw_convert.h" #include #include diff --git a/src/lib/dcp_video.cc b/src/lib/dcp_video.cc index 7610e6c9f..5b5edba95 100644 --- a/src/lib/dcp_video.cc +++ b/src/lib/dcp_video.cc @@ -39,24 +39,15 @@ #include "player_video.h" #include "raw_convert.h" #include "data.h" +#include "compose.hpp" #include #include #include #include -#include #include -#include -#include #include -#include -#include -#include -#include #include #include -#include -#include -#include #define LOG_GENERAL(...) _log->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL); #define LOG_DEBUG_ENCODE(...) _log->log (String::compose (__VA_ARGS__), Log::TYPE_DEBUG_ENCODE); @@ -66,7 +57,6 @@ using std::string; using std::cout; using boost::shared_ptr; -using boost::lexical_cast; using dcp::Size; #define DCI_COEFFICENT (48.0 / 52.37) diff --git a/src/lib/encoder.cc b/src/lib/encoder.cc index 9b195bade..09788d3fa 100644 --- a/src/lib/encoder.cc +++ b/src/lib/encoder.cc @@ -34,8 +34,8 @@ #include "player.h" #include "player_video.h" #include "data.h" +#include "compose.hpp" #include -#include #include #include @@ -45,17 +45,11 @@ #define LOG_ERROR(...) _film->log()->log (String::compose (__VA_ARGS__), Log::TYPE_ERROR); #define LOG_TIMING(...) _film->log()->microsecond_log (String::compose (__VA_ARGS__), Log::TYPE_TIMING); -using std::pair; -using std::string; -using std::vector; using std::list; using std::cout; -using std::min; -using std::make_pair; using boost::shared_ptr; using boost::weak_ptr; using boost::optional; -using boost::scoped_array; int const Encoder::_history_size = 25; diff --git a/src/lib/ffmpeg.cc b/src/lib/ffmpeg.cc index 4eee08992..1620b32b4 100644 --- a/src/lib/ffmpeg.cc +++ b/src/lib/ffmpeg.cc @@ -20,12 +20,12 @@ #include "ffmpeg.h" #include "ffmpeg_content.h" #include "film.h" -#include "ffmpeg_audio_stream.h" -#include "ffmpeg_subtitle_stream.h" #include "exceptions.h" #include "util.h" #include "raw_convert.h" #include "log.h" +#include "ffmpeg_subtitle_stream.h" +#include "compose.hpp" extern "C" { #include #include diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index 0c9225a6a..a17419dc7 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -34,18 +34,16 @@ #include "ffmpeg_content.h" #include "raw_image_proxy.h" #include "film.h" -#include "timer.h" +#include "compose.hpp" extern "C" { #include #include } #include -#include #include #include #include #include -#include #include "i18n.h" @@ -55,16 +53,12 @@ extern "C" { #define LOG_WARNING(...) _video_content->film()->log()->log (String::compose (__VA_ARGS__), Log::TYPE_WARNING); using std::cout; -using std::string; using std::vector; using std::list; using std::min; using std::pair; -using std::make_pair; using std::max; using boost::shared_ptr; -using boost::optional; -using boost::dynamic_pointer_cast; using dcp::Size; FFmpegDecoder::FFmpegDecoder (shared_ptr c, shared_ptr log) @@ -535,4 +529,3 @@ FFmpegDecoder::decode_bitmap_subtitle (AVSubtitleRect const * rect, ContentTimeP image_subtitle (period, image, scaled_rect); } - diff --git a/src/lib/ffmpeg_decoder.h b/src/lib/ffmpeg_decoder.h index 60217b073..28d8e4baa 100644 --- a/src/lib/ffmpeg_decoder.h +++ b/src/lib/ffmpeg_decoder.h @@ -22,21 +22,16 @@ */ #include "util.h" -#include "decoder.h" #include "video_decoder.h" #include "audio_decoder.h" #include "subtitle_decoder.h" #include "ffmpeg.h" -#include "rect.h" extern "C" { #include } #include -#include #include #include -#include -#include class Log; class FilterGraph; diff --git a/src/lib/film.cc b/src/lib/film.cc index a20a44e77..9066b7c5a 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -33,16 +33,16 @@ #include "examine_content_job.h" #include "config.h" #include "playlist.h" -#include "player.h" #include "dcp_content_type.h" #include "ratio.h" #include "cross.h" -#include "cinema.h" #include "safe_stringstream.h" #include "environment_info.h" #include "raw_convert.h" #include "audio_processor.h" #include "md5_digester.h" +#include "compose.hpp" +#include "screen.h" #include #include #include @@ -52,13 +52,11 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include #include @@ -66,28 +64,20 @@ #include "i18n.h" using std::string; -using std::multimap; using std::pair; -using std::map; using std::vector; using std::setfill; using std::min; using std::max; using std::make_pair; -using std::endl; using std::cout; using std::list; using std::set; using boost::shared_ptr; using boost::weak_ptr; using boost::dynamic_pointer_cast; -using boost::to_upper_copy; -using boost::ends_with; -using boost::starts_with; using boost::optional; using boost::is_any_of; -using dcp::Size; -using dcp::CertificateChain; #define LOG_GENERAL(...) log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL); #define LOG_GENERAL_NC(...) log()->log (__VA_ARGS__, Log::TYPE_GENERAL); @@ -933,7 +923,7 @@ Film::examine_and_add_content (shared_ptr c) shared_ptr j (new ExamineContentJob (shared_from_this(), c)); _job_connections.push_back ( - j->Finished.connect (bind (&Film::maybe_add_content, this, boost::weak_ptr (j), boost::weak_ptr (c))) + j->Finished.connect (bind (&Film::maybe_add_content, this, weak_ptr (j), weak_ptr (c))) ); JobManager::instance()->add (j); @@ -1001,7 +991,7 @@ Film::active_frame_rate_change (DCPTime t) const } void -Film::playlist_content_changed (boost::weak_ptr c, int p, bool frequent) +Film::playlist_content_changed (weak_ptr c, int p, bool frequent) { _dirty = true; diff --git a/src/lib/filter_graph.cc b/src/lib/filter_graph.cc index da7b04133..817459bcc 100644 --- a/src/lib/filter_graph.cc +++ b/src/lib/filter_graph.cc @@ -21,6 +21,13 @@ * @brief A graph of FFmpeg filters. */ +#include "filter_graph.h" +#include "filter.h" +#include "exceptions.h" +#include "image.h" +#include "ffmpeg_content.h" +#include "safe_stringstream.h" +#include "compose.hpp" extern "C" { #include #include @@ -28,13 +35,6 @@ extern "C" { #include #include } -#include "decoder.h" -#include "filter_graph.h" -#include "filter.h" -#include "exceptions.h" -#include "image.h" -#include "ffmpeg_content.h" -#include "safe_stringstream.h" #include "i18n.h" diff --git a/src/lib/filter_graph.h b/src/lib/filter_graph.h index 5b43c5512..45caef820 100644 --- a/src/lib/filter_graph.h +++ b/src/lib/filter_graph.h @@ -26,6 +26,7 @@ #include "util.h" +struct AVFilterContext; class Image; class VideoFilter; class FFmpegContent; diff --git a/src/lib/image_examiner.cc b/src/lib/image_examiner.cc index 6ad32f511..bb0f365d6 100644 --- a/src/lib/image_examiner.cc +++ b/src/lib/image_examiner.cc @@ -24,6 +24,7 @@ #include "exceptions.h" #include "config.h" #include "cross.h" +#include "compose.hpp" #include #include #include diff --git a/src/lib/job.cc b/src/lib/job.cc index def874ba2..25a533654 100644 --- a/src/lib/job.cc +++ b/src/lib/job.cc @@ -17,19 +17,20 @@ */ -/** @file src/job.cc +/** @file src/job.cc * @brief A parent class to represent long-running tasks which are run in their own thread. */ -#include -#include -#include #include "job.h" #include "util.h" #include "cross.h" #include "exceptions.h" #include "film.h" #include "log.h" +#include "compose.hpp" +#include +#include +#include #include "i18n.h" diff --git a/src/lib/kdm.cc b/src/lib/kdm.cc index 0ded8f2c1..d62f1e660 100644 --- a/src/lib/kdm.cc +++ b/src/lib/kdm.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013 Carl Hetherington + Copyright (C) 2013-2015 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,19 +17,21 @@ */ -#include -#include -#include -#include -#include #include "kdm.h" #include "cinema.h" +#include "screen.h" #include "exceptions.h" #include "util.h" #include "film.h" #include "config.h" #include "safe_stringstream.h" #include "quickmail.h" +#include "compose.hpp" +#include +#include +#include +#include +#include using std::list; using std::string; diff --git a/src/lib/kdm.h b/src/lib/kdm.h index b80ef454f..a776b62b3 100644 --- a/src/lib/kdm.h +++ b/src/lib/kdm.h @@ -17,6 +17,8 @@ */ +#include +#include #include #include @@ -51,4 +53,3 @@ extern void email_kdms ( dcp::LocalTime to, dcp::Formulation formulation ); - diff --git a/src/lib/screen.cc b/src/lib/screen.cc new file mode 100644 index 000000000..347e1d655 --- /dev/null +++ b/src/lib/screen.cc @@ -0,0 +1,38 @@ +/* + Copyright (C) 2013-2015 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include "screen.h" +#include + +Screen::Screen (cxml::ConstNodePtr node) + : name (node->string_child ("Name")) +{ + if (node->optional_string_child ("Certificate")) { + certificate = dcp::Certificate (node->string_child ("Certificate")); + } +} + +void +Screen::as_xml (xmlpp::Element* parent) const +{ + parent->add_child("Name")->add_child_text (name); + if (certificate) { + parent->add_child("Certificate")->add_child_text (certificate->certificate (true)); + } +} diff --git a/src/lib/screen.h b/src/lib/screen.h new file mode 100644 index 000000000..6bac3ec14 --- /dev/null +++ b/src/lib/screen.h @@ -0,0 +1,48 @@ +/* + Copyright (C) 2013-2015 Carl Hetherington + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include +#include +#include +#include + +class Cinema; + +/** @class Screen + * @brief A representation of a Screen for KDM generation. + * + * This is the name of the screen and the certificate of its + * server. + */ +class Screen +{ +public: + Screen (std::string const & n, boost::optional cert) + : name (n) + , certificate (cert) + {} + + Screen (cxml::ConstNodePtr); + + void as_xml (xmlpp::Element *) const; + + boost::shared_ptr cinema; + std::string name; + boost::optional certificate; +}; diff --git a/src/lib/server.cc b/src/lib/server.cc index 79840c25b..2fc940466 100644 --- a/src/lib/server.cc +++ b/src/lib/server.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2014 Carl Hetherington + Copyright (C) 2012-2015 Carl Hetherington This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,6 +32,7 @@ #include "data.h" #include "safe_stringstream.h" #include "raw_convert.h" +#include "compose.hpp" #include #include #include @@ -47,16 +48,12 @@ #define LOG_ERROR_NC(...) _log->log (__VA_ARGS__, Log::TYPE_ERROR); using std::string; -using std::multimap; using std::vector; using std::list; using std::cout; using std::cerr; -using std::setprecision; using std::fixed; using boost::shared_ptr; -using boost::algorithm::is_any_of; -using boost::algorithm::split; using boost::thread; using boost::bind; using boost::scoped_array; @@ -304,4 +301,3 @@ Server::handle_accept (shared_ptr socket, boost::system::error_code cons start_accept (); } - diff --git a/src/lib/transcode_job.cc b/src/lib/transcode_job.cc index 122f7f799..eb1991297 100644 --- a/src/lib/transcode_job.cc +++ b/src/lib/transcode_job.cc @@ -21,13 +21,14 @@ * @brief A job which transcodes from one format to another. */ -#include -#include #include "transcode_job.h" #include "film.h" #include "transcoder.h" #include "log.h" #include "safe_stringstream.h" +#include "compose.hpp" +#include +#include #include "i18n.h" diff --git a/src/lib/util.cc b/src/lib/util.cc index 56f1b5286..76e76328d 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -35,16 +35,18 @@ #include "md5_digester.h" #include "audio_processor.h" #include "safe_stringstream.h" +#include "compose.hpp" #include #include #include #include +extern "C" { +#include +} #include #include #include #include -#include -#include #include #include #ifdef DCPOMATIC_WINDOWS diff --git a/src/lib/util.h b/src/lib/util.h index 95d272979..9e811f8ad 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -24,15 +24,11 @@ #ifndef DCPOMATIC_UTIL_H #define DCPOMATIC_UTIL_H -#include "compose.hpp" #include "types.h" -#include "exceptions.h" #include "dcpomatic_time.h" #include -#include extern "C" { #include -#include } #include #include diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc index 1b4a625d6..c1aa637ef 100644 --- a/src/lib/video_decoder.cc +++ b/src/lib/video_decoder.cc @@ -19,11 +19,10 @@ #include "video_decoder.h" #include "image.h" -#include "image_proxy.h" -#include "raw_image_proxy.h" #include "raw_image_proxy.h" #include "film.h" #include "log.h" +#include "compose.hpp" #include "i18n.h" @@ -143,7 +142,7 @@ VideoDecoder::fill_one_eye (Frame from, Frame to, Eyes eye) } /* Fill with black... */ - boost::shared_ptr filler_image (new RawImageProxy (_black_image)); + shared_ptr filler_image (new RawImageProxy (_black_image)); Part filler_part = PART_WHOLE; /* ...unless there's some video we can fill with */ @@ -174,8 +173,8 @@ VideoDecoder::fill_both_eyes (Frame from, Frame to, Eyes eye) } /* Fill with black... */ - boost::shared_ptr filler_left_image (new RawImageProxy (_black_image)); - boost::shared_ptr filler_right_image (new RawImageProxy (_black_image)); + shared_ptr filler_left_image (new RawImageProxy (_black_image)); + shared_ptr filler_right_image (new RawImageProxy (_black_image)); Part filler_left_part = PART_WHOLE; Part filler_right_part = PART_WHOLE; @@ -280,8 +279,8 @@ VideoDecoder::video (shared_ptr image, Frame frame) and the things we are about to push. */ - boost::optional from; - boost::optional to; + optional from; + optional to; if (_decoded_video.empty() && _last_seek_time && _last_seek_accurate) { from = _last_seek_time->frames_round (_video_content->video_frame_rate ()); diff --git a/src/lib/wscript b/src/lib/wscript index 3457329e6..ef40c7606 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -95,6 +95,7 @@ sources = """ safe_stringstream.cc scoped_temporary.cc scp_uploader.cc + screen.cc send_kdm_email_job.cc send_problem_report_job.cc server.cc diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 743172e9b..d2747944f 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -37,6 +37,7 @@ #include "lib/update.h" #include "lib/cross.h" #include "lib/content_factory.h" +#include "lib/compose.hpp" #include "wx/film_viewer.h" #include "wx/film_editor.h" #include "wx/job_manager_view.h" diff --git a/src/wx/audio_plot.cc b/src/wx/audio_plot.cc index 605738b4f..a622e2b86 100644 --- a/src/wx/audio_plot.cc +++ b/src/wx/audio_plot.cc @@ -20,6 +20,7 @@ #include "audio_plot.h" #include "lib/audio_decoder.h" #include "lib/audio_analysis.h" +#include "lib/compose.hpp" #include "wx/wx_util.h" #include #include diff --git a/src/wx/job_manager_view.cc b/src/wx/job_manager_view.cc index 1df64ba1c..2dfb41131 100644 --- a/src/wx/job_manager_view.cc +++ b/src/wx/job_manager_view.cc @@ -21,12 +21,13 @@ * @brief Class generating a GTK widget to show the progress of jobs. */ +#include "job_manager_view.h" +#include "wx_util.h" #include "lib/job_manager.h" #include "lib/job.h" #include "lib/util.h" #include "lib/exceptions.h" -#include "job_manager_view.h" -#include "wx_util.h" +#include "lib/compose.hpp" using std::string; using std::list; diff --git a/src/wx/job_manager_view.h b/src/wx/job_manager_view.h index a83b481dc..c6805aaa9 100644 --- a/src/wx/job_manager_view.h +++ b/src/wx/job_manager_view.h @@ -21,9 +21,10 @@ * @brief Class which is a wxPanel for showing the progress of jobs. */ -#include -#include #include +#include +#include +#include class Job; class JobRecord; diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc index 8d629b662..7046c160e 100644 --- a/src/wx/kdm_dialog.cc +++ b/src/wx/kdm_dialog.cc @@ -24,6 +24,7 @@ #include "lib/cinema.h" #include "lib/config.h" #include "lib/film.h" +#include "lib/screen.h" #include #ifdef DCPOMATIC_USE_OWN_DIR_PICKER #include "dir_picker_ctrl.h" -- 2.30.2