C++11 tidying.
authorCarl Hetherington <cth@carlh.net>
Thu, 29 Apr 2021 07:14:20 +0000 (09:14 +0200)
committerCarl Hetherington <cth@carlh.net>
Thu, 29 Apr 2021 18:53:49 +0000 (20:53 +0200)
99 files changed:
src/lib/cross_common.cc
src/lib/dcp_decoder.cc
src/lib/dcp_decoder.h
src/lib/dcp_subtitle_decoder.cc
src/lib/dcp_subtitle_decoder.h
src/lib/dcpomatic_time.cc
src/lib/dolby_cp750.cc
src/lib/dolby_cp750.h
src/lib/empty.cc
src/lib/empty.h
src/lib/ffmpeg_decoder.cc
src/lib/ffmpeg_decoder.h
src/lib/font.cc
src/lib/font.h
src/lib/hints.cc
src/lib/hints.h
src/lib/image_decoder.cc
src/lib/image_decoder.h
src/lib/kdm_recipient.cc
src/lib/kdm_recipient.h
src/lib/scp_uploader.cc
src/lib/scp_uploader.h
src/lib/spl.cc
src/lib/usl.cc
src/lib/usl.h
src/lib/video_mxf_decoder.cc
src/lib/video_mxf_decoder.h
src/wx/batch_job_view.cc
src/wx/batch_job_view.h
src/wx/content_properties_dialog.cc
src/wx/content_properties_dialog.h
src/wx/dkdm_dialog.cc
src/wx/dkdm_dialog.h
src/wx/dolby_doremi_certificate_panel.h
src/wx/download_certificate_panel.cc
src/wx/download_certificate_panel.h
src/wx/email_dialog.cc
src/wx/email_dialog.h
src/wx/html_dialog.cc
src/wx/html_dialog.h
src/wx/move_to_dialog.cc
src/wx/move_to_dialog.h
src/wx/name_format_editor.cc
src/wx/name_format_editor.h
src/wx/normal_job_view.cc
src/wx/normal_job_view.h
src/wx/paste_dialog.cc
src/wx/paste_dialog.h
src/wx/qube_certificate_panel.cc
src/wx/qube_certificate_panel.h
src/wx/rename_template_dialog.cc
src/wx/rename_template_dialog.h
src/wx/self_dkdm_dialog.cc
src/wx/self_dkdm_dialog.h
src/wx/standard_controls.cc
src/wx/standard_controls.h
src/wx/suspender.cc
src/wx/suspender.h
src/wx/templates_dialog.cc
src/wx/templates_dialog.h
src/wx/timeline_atmos_content_view.cc
src/wx/timeline_atmos_content_view.h
src/wx/timeline_audio_content_view.h
src/wx/timeline_content_view.h
src/wx/timeline_dialog.cc
src/wx/timeline_dialog.h
src/wx/timeline_labels_view.h
src/wx/timeline_reels_view.h
src/wx/timeline_video_content_view.h
src/wx/timeline_view.h
src/wx/try_unmount_dialog.cc
src/wx/try_unmount_dialog.h
src/wx/video_waveform_plot.cc
src/wx/video_waveform_plot.h
src/wx/wx_util.cc
src/wx/wx_util.h
test/4k_test.cc
test/audio_analysis_test.cc
test/audio_filter_test.cc
test/audio_processor_delay_test.cc
test/butler_test.cc
test/client_server_test.cc
test/config_test.cc
test/crypto_test.cc
test/disk_writer_test.cc
test/empty_test.cc
test/ffmpeg_decoder_sequential_test.cc
test/ffmpeg_pts_offset_test.cc
test/isdcf_name_test.cc
test/job_test.cc
test/markers_test.cc
test/pixel_formats_test.cc
test/rect_test.cc
test/silence_padding_test.cc
test/threed_test.cc
test/time_calculation_test.cc
test/torture_test.cc
test/video_level_test.cc
test/zipper_test.cc

index f8556b1fdc1d29d742e3193598fa9562ab1dc7b4..2e48bf3e015131fab22094fea7a46b80f028325f 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -18,6 +18,7 @@
 
 */
 
+
 #include "cross.h"
 #include "compose.hpp"
 #include "dcpomatic_log.h"
@@ -30,8 +31,10 @@ DCPOMATIC_ENABLE_WARNINGS
 
 #include "i18n.h"
 
+
 using std::string;
 
+
 Drive::Drive (string xml)
 {
        cxml::Document doc;
@@ -50,7 +53,7 @@ string
 Drive::as_xml () const
 {
        xmlpp::Document doc;
-       xmlpp::Element* root = doc.create_root_node ("Drive");
+       auto root = doc.create_root_node ("Drive");
        root->add_child("Device")->add_child_text(_device);
        for (auto i: _mount_points) {
                root->add_child("MountPoint")->add_child_text(i.string());
@@ -91,6 +94,7 @@ Drive::description () const
        return String::compose(_("%1 (%2 GB) [%3]"), name, gb, _device);
 }
 
+
 string
 Drive::log_summary () const
 {
index 566ed2935ccb10206df23acea28e49507f0f7728..f9b0d9a57461e92cb98e0578f86c7e920a259f59 100644 (file)
@@ -67,7 +67,6 @@ using namespace dcpomatic;
 DCPDecoder::DCPDecoder (shared_ptr<const Film> film, shared_ptr<const DCPContent> c, bool fast, bool tolerant, shared_ptr<DCPDecoder> old)
        : DCP (c, tolerant)
        , Decoder (film)
-       , _decode_referenced (false)
 {
        if (c->can_be_played()) {
                if (c->video) {
@@ -125,7 +124,6 @@ DCPDecoder::DCPDecoder (shared_ptr<const Film> film, shared_ptr<const DCPContent
        set_decode_referenced (false);
 
        _reel = _reels.begin ();
-       _offset = 0;
        get_readers ();
 }
 
index 887f8ad5ccaa2a4bbb0ad217bc33a53ea94d4027..a4dfbad4e5304f55d07ce2ff809b719708be162a 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014-2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 /** @file  src/dcp_decoder.h
  *  @brief A decoder of existing DCPs.
  */
 
+
 #include "atmos_metadata.h"
 #include "decoder.h"
 #include "dcp.h"
@@ -30,6 +32,7 @@
 #include <dcp/sound_asset_reader.h>
 #include <dcp/subtitle_asset.h>
 
+
 namespace dcp {
        class Reel;
 }
@@ -38,6 +41,7 @@ class DCPContent;
 class Log;
 struct dcp_subtitle_within_dcp_test;
 
+
 class DCPDecoder : public DCP, public Decoder
 {
 public:
@@ -56,16 +60,16 @@ public:
        void set_decode_referenced (bool r);
        void set_forced_reduction (boost::optional<int> reduction);
 
-       bool pass ();
-       void seek (dcpomatic::ContentTime t, bool accurate);
+       bool pass () override;
+       void seek (dcpomatic::ContentTime t, bool accurate) override;
 
-       std::vector<dcpomatic::FontData> fonts () const;
+       std::vector<dcpomatic::FontData> fonts () const override;
 
        std::string lazy_digest () const {
                return _lazy_digest;
        }
 
-       dcpomatic::ContentTime position () const;
+       dcpomatic::ContentTime position () const override;
 
 private:
        friend struct dcp_subtitle_within_dcp_test;
@@ -89,7 +93,7 @@ private:
 
        std::vector<std::shared_ptr<dcp::Reel>>::iterator _reel;
        /** Offset of _reel from the start of the content in frames */
-       int64_t _offset;
+       int64_t _offset = 0;
        /** Reader for current mono picture asset, if applicable */
        std::shared_ptr<dcp::MonoPictureAssetReader> _mono_reader;
        /** Reader for current stereo picture asset, if applicable */
@@ -99,7 +103,7 @@ private:
        std::shared_ptr<dcp::AtmosAssetReader> _atmos_reader;
        boost::optional<AtmosMetadata> _atmos_metadata;
 
-       bool _decode_referenced;
+       bool _decode_referenced = false;
        boost::optional<int> _forced_reduction;
 
        std::string _lazy_digest;
index 1b144f20456bec9e3d928851632f70b958e85314..024d62f3424f3138f2f84f190e5f99119d4a8984 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014-2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "dcp_subtitle_decoder.h"
 #include "dcp_subtitle_content.h"
 #include <dcp/interop_subtitle_asset.h>
 #include <dcp/load_font_node.h>
 #include <iostream>
 
+
 using std::cout;
 using std::list;
 using std::map;
@@ -31,13 +33,15 @@ using std::string;
 using std::vector;
 using std::shared_ptr;
 using std::dynamic_pointer_cast;
+using std::make_shared;
 using boost::bind;
 using namespace dcpomatic;
 
+
 DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr<const Film> film, shared_ptr<const DCPSubtitleContent> content)
        : Decoder (film)
 {
-       shared_ptr<dcp::SubtitleAsset> c (load (content->path (0)));
+       auto c = load (content->path(0));
        c->fix_empty_font_ids ();
        _subtitles = c->subtitles ();
        _next = _subtitles.begin ();
@@ -46,11 +50,11 @@ DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr<const Film> film, shared_ptr<
        if (_next != _subtitles.end()) {
                first = content_time_period(*_next).from;
        }
-       text.push_back (shared_ptr<TextDecoder> (new TextDecoder (this, content->only_text(), first)));
+       text.push_back (make_shared<TextDecoder>(this, content->only_text(), first));
 
-       map<string, dcp::ArrayData> fm = c->font_data();
-       for (map<string, dcp::ArrayData>::const_iterator j = fm.begin(); j != fm.end(); ++j) {
-               _fonts.push_back (FontData(j->first, j->second));
+       auto fm = c->font_data();
+       for (auto const& i: fm) {
+               _fonts.push_back (FontData(i.first, i.second));
        }
 
        /* Add a default font for any LoadFont nodes in our file which we haven't yet found fonts for */
@@ -61,6 +65,7 @@ DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr<const Film> film, shared_ptr<
        }
 }
 
+
 void
 DCPSubtitleDecoder::seek (ContentTime time, bool accurate)
 {
@@ -73,6 +78,7 @@ DCPSubtitleDecoder::seek (ContentTime time, bool accurate)
        }
 }
 
+
 bool
 DCPSubtitleDecoder::pass ()
 {
@@ -89,7 +95,7 @@ DCPSubtitleDecoder::pass ()
 
        list<dcp::SubtitleString> s;
        list<dcp::SubtitleImage> i;
-       ContentTimePeriod const p = content_time_period (*_next);
+       auto const p = content_time_period (*_next);
 
        while (_next != _subtitles.end () && content_time_period (*_next) == p) {
                auto ns = dynamic_pointer_cast<const dcp::SubtitleString>(*_next);
@@ -113,6 +119,7 @@ DCPSubtitleDecoder::pass ()
        return false;
 }
 
+
 ContentTimePeriod
 DCPSubtitleDecoder::content_time_period (shared_ptr<const dcp::Subtitle> s) const
 {
index a9540c3cf05e6896901683d1eaf5c9a20f770889..95e783d0612a9876ec5f40050240bbd1e3bb03af 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014-2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "text_decoder.h"
 #include "dcp_subtitle.h"
 #include "font_data.h"
 
+
 class DCPSubtitleContent;
 
+
 class DCPSubtitleDecoder : public DCPSubtitle, public Decoder
 {
 public:
index 8abd7755530165f2f13ba50aeefc4194bf9e0fe4..ac797f8f4205589c5ad605dc768deb83bbfed54e 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014-2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "dcpomatic_time.h"
 #include <inttypes.h>
 
+
 using std::string;
 using namespace dcpomatic;
 
+
 template <>
 Time<ContentTimeDifferentiator, DCPTimeDifferentiator>::Time (DCPTime d, FrameRateChange f)
-       : _t (llrint (d.get() * f.speed_up))
+       : _t (llrint(d.get() * f.speed_up))
 {
 
 }
 
+
 template <>
 Time<DCPTimeDifferentiator, ContentTimeDifferentiator>::Time (ContentTime d, FrameRateChange f)
-       : _t (llrint (d.get() / f.speed_up))
+       : _t (llrint(d.get() / f.speed_up))
 {
 
 }
 
+
 DCPTime
 dcpomatic::min (DCPTime a, DCPTime b)
 {
@@ -48,6 +53,7 @@ dcpomatic::min (DCPTime a, DCPTime b)
        return b;
 }
 
+
 DCPTime
 dcpomatic::max (DCPTime a, DCPTime b)
 {
@@ -58,6 +64,7 @@ dcpomatic::max (DCPTime a, DCPTime b)
        return b;
 }
 
+
 ContentTime
 dcpomatic::min (ContentTime a, ContentTime b)
 {
@@ -68,6 +75,7 @@ dcpomatic::min (ContentTime a, ContentTime b)
        return b;
 }
 
+
 ContentTime
 dcpomatic::max (ContentTime a, ContentTime b)
 {
@@ -78,6 +86,7 @@ dcpomatic::max (ContentTime a, ContentTime b)
        return b;
 }
 
+
 string
 dcpomatic::to_string (ContentTime t)
 {
@@ -90,6 +99,7 @@ dcpomatic::to_string (ContentTime t)
        return buffer;
 }
 
+
 string
 dcpomatic::to_string (DCPTime t)
 {
@@ -102,6 +112,7 @@ dcpomatic::to_string (DCPTime t)
        return buffer;
 }
 
+
 string
 dcpomatic::to_string (DCPTimePeriod p)
 {
index 380ab0564acdc61d9d18202f7ec95d43fbe575c9..6671687229c95388ec00def5169626a259311824 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "dolby_cp750.h"
 
 #include "i18n.h"
 
+
 using namespace std;
 
+
 DolbyCP750::DolbyCP750 ()
        : CinemaSoundProcessor ("dolby_cp750", _("Dolby CP650 or CP750"), 4.0f, 20, 3.33333333333333333)
 {
index 3162a962d2e765917ffcd21c7d78dc9234bb58c2..92f8ec4463dcb3799fd7ab3e98b665b64a783f17 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 /** @file  src/lib/dolby_cp750.h
  *  @brief DolbyCP750 class.
  */
 
+
 #include "cinema_sound_processor.h"
 
+
 class DolbyCP750 : public CinemaSoundProcessor
 {
 public:
index 0cf2b85dcb849c69550bfa953b613a96e170a684..f6dcad96fb730162e6824ba273d84ffa31199e5f 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2017 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2017-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -18,6 +18,7 @@
 
 */
 
+
 #include "empty.h"
 #include "film.h"
 #include "playlist.h"
 #include "piece.h"
 #include <iostream>
 
+
 using std::cout;
 using std::list;
 using std::shared_ptr;
 using std::dynamic_pointer_cast;
-using boost::function;
+using std::function;
 using namespace dcpomatic;
 
+
 Empty::Empty (shared_ptr<const Film> film, shared_ptr<const Playlist> playlist, function<bool (shared_ptr<const Content>)> part, DCPTime length)
 {
        list<DCPTimePeriod> full;
        for (auto i: playlist->content()) {
                if (part(i)) {
-                       full.push_back (DCPTimePeriod (i->position(), i->end(film)));
+                       full.push_back (DCPTimePeriod(i->position(), i->end(film)));
                }
        }
 
        _periods = subtract (DCPTimePeriod(DCPTime(), length), coalesce(full));
 
-       if (!_periods.empty ()) {
+       if (!_periods.empty()) {
                _position = _periods.front().from;
        }
 }
 
+
 void
 Empty::set_position (DCPTime position)
 {
@@ -70,6 +74,7 @@ Empty::set_position (DCPTime position)
        }
 }
 
+
 DCPTimePeriod
 Empty::period_at_position () const
 {
@@ -82,6 +87,7 @@ Empty::period_at_position () const
        DCPOMATIC_ASSERT (false);
 }
 
+
 bool
 Empty::done () const
 {
index 443d3322b8290360117c4ab98f48c62e14d0265b..145b84091a91520a026228e87d274d8aee2825e1 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2018-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #ifndef DCPOMATIC_EMPTY_H
 #define DCPOMATIC_EMPTY_H
 
+
 #include "playlist.h"
 #include "dcpomatic_time.h"
 #include "content_part.h"
 #include <list>
 
+
 struct empty_test1;
 struct empty_test2;
 struct empty_test3;
 struct empty_test_with_overlapping_content;
 struct player_subframe_test;
 
+
 class Empty
 {
 public:
        Empty () {}
-       Empty (std::shared_ptr<const Film> film, std::shared_ptr<const Playlist> playlist, boost::function<bool (std::shared_ptr<const Content>)> part, dcpomatic::DCPTime length);
+       Empty (std::shared_ptr<const Film> film, std::shared_ptr<const Playlist> playlist, std::function<bool (std::shared_ptr<const Content>)> part, dcpomatic::DCPTime length);
 
        dcpomatic::DCPTime position () const {
                return _position;
@@ -59,4 +63,5 @@ private:
        dcpomatic::DCPTime _position;
 };
 
+
 #endif
index 147bb384f3eb1bad5a811adf9d624501b69eedf4..9d7e155573e1e38e6a9d003a451fa54b26f91682 100644 (file)
@@ -81,7 +81,6 @@ using namespace dcpomatic;
 FFmpegDecoder::FFmpegDecoder (shared_ptr<const Film> film, shared_ptr<const FFmpegContent> c, bool fast)
        : FFmpeg (c)
        , Decoder (film)
-       , _have_current_subtitle (false)
 {
        if (c->video && c->video->use()) {
                video = make_shared<VideoDecoder>(this, c);
index e18d5e8eb34b650e39af633af79aa8da850227f4..d19a9f703bccba457196c5ef288665e009838335 100644 (file)
@@ -46,8 +46,8 @@ class FFmpegDecoder : public FFmpeg, public Decoder
 public:
        FFmpegDecoder (std::shared_ptr<const Film> film, std::shared_ptr<const FFmpegContent>, bool fast);
 
-       bool pass ();
-       void seek (dcpomatic::ContentTime time, bool);
+       bool pass () override;
+       void seek (dcpomatic::ContentTime time, bool) override;
 
 private:
        friend struct ::ffmpeg_pts_offset_test;
@@ -77,7 +77,7 @@ private:
        dcpomatic::ContentTime _pts_offset;
        boost::optional<dcpomatic::ContentTime> _current_subtitle_to;
        /** true if we have a subtitle which has not had emit_stop called for it yet */
-       bool _have_current_subtitle;
+       bool _have_current_subtitle = false;
 
        std::shared_ptr<Image> _black_image;
 
index aa9a8aaef7bc39d556f9377351a83cc0a2fbd401..a2dc1945f009a8facb973bd5eec19d51f256e373 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
-#include "font.h"
+
 #include "dcpomatic_assert.h"
+#include "font.h"
 #include "warnings.h"
 DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
 DCPOMATIC_ENABLE_WARNINGS
 
+
 using std::string;
 using namespace dcpomatic;
 
+
 Font::Font (cxml::NodePtr node)
-       : _id (node->string_child ("Id"))
+       : _id (node->string_child("Id"))
 {
        for (auto i: node->node_children("File")) {
-               string variant = i->optional_string_attribute("Variant").get_value_or ("Normal");
+               string variant = i->optional_string_attribute("Variant").get_value_or("Normal");
                if (variant == "Normal") {
                        _file = i->content();
                }
        }
 }
 
+
 void
 Font::as_xml (xmlpp::Node* node)
 {
-       node->add_child("Id")->add_child_text (_id);
+       node->add_child("Id")->add_child_text(_id);
        if (_file) {
                node->add_child("File")->add_child_text(_file->string());
        }
@@ -59,6 +63,7 @@ dcpomatic::operator== (Font const & a, Font const & b)
        return a.file() == b.file();
 }
 
+
 bool
 dcpomatic::operator!= (Font const & a, Font const & b)
 {
index 5876bf8a46052cbbbd75ad2adb941a581b2c7029..ed3ecc38f3075498d2051545a38df5ab4c2382fb 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #ifndef DCPOMATIC_FONT_H
 #define DCPOMATIC_FONT_H
 
+
 #include <libcxml/cxml.h>
 #include <boost/optional.hpp>
 #include <boost/signals2.hpp>
 #include <boost/filesystem.hpp>
 #include <string>
 
+
 namespace dcpomatic {
 
+
 class Font
 {
 public:
@@ -60,9 +64,11 @@ private:
        boost::optional<boost::filesystem::path> _file;
 };
 
+
 bool operator!= (Font const & a, Font const & b);
 bool operator== (Font const & a, Font const & b);
 
+
 }
 
 #endif
index 52debf3ef313c44f3d4b745810e2964fe28cb28e..4d3b2d95ee91161fddbde42a84fe3ab17c5e5322 100644 (file)
@@ -18,6 +18,7 @@
 
 */
 
+
 #include "dcp_content_type.h"
 #include "hints.h"
 #include "types.h"
@@ -45,6 +46,7 @@
 
 #include "i18n.h"
 
+
 using std::cout;
 using std::make_shared;
 using std::max;
@@ -82,12 +84,14 @@ Hints::Hints (weak_ptr<const Film> weak_film)
 
 }
 
+
 void
 Hints::start ()
 {
        _thread = boost::thread (bind(&Hints::thread, this));
 }
 
+
 Hints::~Hints ()
 {
        boost::this_thread::disable_interruption dis;
@@ -256,7 +260,7 @@ Hints::check_big_font_files ()
                for (auto i: film()->content()) {
                        for (auto j: i->text) {
                                for (auto k: j->fonts()) {
-                                       optional<boost::filesystem::path> const p = k->file ();
+                                       auto const p = k->file ();
                                        if (p && boost::filesystem::file_size(p.get()) >= (MAX_FONT_FILE_SIZE - SIZE_SLACK)) {
                                                big_font_files = true;
                                        }
@@ -276,7 +280,7 @@ Hints::check_vob ()
 {
        int vob = 0;
        for (auto i: film()->content()) {
-               if (boost::algorithm::starts_with (i->path(0).filename().string(), "VTS_")) {
+               if (boost::algorithm::starts_with(i->path(0).filename().string(), "VTS_")) {
                        ++vob;
                }
        }
@@ -330,8 +334,8 @@ Hints::check_loudness ()
 
                ch = ch.substr (0, ch.length() - 2);
 
-               if (!ch.empty ()) {
-                       hint (String::compose (
+               if (!ch.empty()) {
+                       hint(String::compose(
                                        _("Your audio level is very high (on %1).  You should reduce the gain of your audio content."),
                                        ch
                                        )
@@ -445,7 +449,7 @@ try
        bool ccap_mxf_too_big = false;
        bool subs_mxf_too_big = false;
 
-       boost::filesystem::path dcp_dir = film->dir("hints") / dcpomatic::get_process_id();
+       auto dcp_dir = film->dir("hints") / dcpomatic::get_process_id();
        boost::filesystem::remove_all (dcp_dir);
 
        _writer->finish (film->dir("hints") / dcpomatic::get_process_id());
@@ -491,6 +495,7 @@ catch (...)
        store_current ();
 }
 
+
 void
 Hints::hint (string h)
 {
index 06155f43449f687da0cc43b8d4cdf14df98130d5..81a37a3c453adb10aabfc462604b393ac3a4d2e7 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2016-2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2016-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -18,6 +18,7 @@
 
 */
 
+
 #include "audio_analyser.h"
 #include "signaller.h"
 #include "player_text.h"
index 2f7416c62630eaf740e4039532d71fb87e9d6ea4..2e0a980928ea99213e29d94255aa6a520e14de40 100644 (file)
@@ -18,6 +18,7 @@
 
 */
 
+
 #include "image_content.h"
 #include "image_decoder.h"
 #include "video_decoder.h"
 
 #include "i18n.h"
 
+
 using std::cout;
 using std::make_shared;
 using std::shared_ptr;
 using dcp::Size;
 using namespace dcpomatic;
 
+
 ImageDecoder::ImageDecoder (shared_ptr<const Film> film, shared_ptr<const ImageContent> c)
        : Decoder (film)
        , _image_content (c)
-       , _frame_video_position (0)
 {
        video = make_shared<VideoDecoder>(this, c);
 }
 
+
 bool
 ImageDecoder::pass ()
 {
@@ -80,6 +83,7 @@ ImageDecoder::pass ()
        return false;
 }
 
+
 void
 ImageDecoder::seek (ContentTime time, bool accurate)
 {
index d575f9021f3e019add9753ac05c3e1b0c703222b..067a247208f31b05f7c7cc4f1f6722b1deed09ba 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "decoder.h"
 
+
 class ImageContent;
 class Log;
 class ImageProxy;
 
+
 class ImageDecoder : public Decoder
 {
 public:
@@ -33,12 +36,12 @@ public:
                return _image_content;
        }
 
-       bool pass ();
-       void seek (dcpomatic::ContentTime, bool);
+       bool pass () override;
+       void seek (dcpomatic::ContentTime, bool) override;
 
 private:
 
        std::shared_ptr<const ImageContent> _image_content;
        std::shared_ptr<ImageProxy> _image;
-       Frame _frame_video_position;
+       Frame _frame_video_position = 0;
 };
index d05192ac675111f3a8f46ad3dbe49d6cbe7d606c..cde41e22d86162b158f6233a98a76141aa0a102a 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2020-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "kdm_recipient.h"
 
+
 KDMRecipient::KDMRecipient (cxml::ConstNodePtr node)
        : name (node->string_child("Name"))
-       , notes (node->optional_string_child("Notes").get_value_or (""))
+       , notes (node->optional_string_child("Notes").get_value_or(""))
 {
        if (node->optional_string_child("Certificate")) {
                recipient = dcp::Certificate (node->string_child("Certificate"));
index e92fc3c48d5bb8e17ded5c01052383abd5c6dbe2..85352f0ee7312bd6416c3303845efe241beccf41 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2020-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #ifndef DCPOMATIC_KDM_RECIPIENT_H
 #define DCPOMATIC_KDM_RECIPIENT_H
 
+
 #include "warnings.h"
 #include <dcp/certificate.h>
 #include <libcxml/cxml.h>
@@ -30,6 +32,7 @@ DCPOMATIC_ENABLE_WARNINGS
 #include <boost/optional.hpp>
 #include <string>
 
+
 class KDMRecipient
 {
 public:
@@ -50,4 +53,5 @@ public:
        boost::optional<dcp::Certificate> recipient;
 };
 
+
 #endif
index 0926ffa9f794bf22353cbce13f6ee998b7c239a3..9c349f233084efadcd370e91001141346c71d07b 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -18,6 +18,7 @@
 
 */
 
+
 #include "scp_uploader.h"
 #include "exceptions.h"
 #include "job.h"
 
 #include "i18n.h"
 
-using std::string;
+
+using std::function;
 using std::min;
 using std::shared_ptr;
-using boost::function;
+using std::string;
+
 
 SCPUploader::SCPUploader (function<void (string)> set_status, function<void (float)> set_progress)
        : Uploader (set_status, set_progress)
 {
        _session = ssh_new ();
        if (!_session) {
-               throw NetworkError (_("could not start SSH session"));
+               throw NetworkError (String::compose(_("SSH error [%1]"), "ssh_new"));
        }
 
-       ssh_options_set (_session, SSH_OPTIONS_HOST, Config::instance()->tms_ip().c_str ());
-       ssh_options_set (_session, SSH_OPTIONS_USER, Config::instance()->tms_user().c_str ());
+       ssh_options_set (_session, SSH_OPTIONS_HOST, Config::instance()->tms_ip().c_str());
+       ssh_options_set (_session, SSH_OPTIONS_USER, Config::instance()->tms_user().c_str());
        int const port = 22;
        ssh_options_set (_session, SSH_OPTIONS_PORT, &port);
 
        int r = ssh_connect (_session);
        if (r != SSH_OK) {
-               throw NetworkError (String::compose (_("Could not connect to server %1 (%2)"), Config::instance()->tms_ip(), ssh_get_error (_session)));
+               throw NetworkError (String::compose(_("Could not connect to server %1 (%2)"), Config::instance()->tms_ip(), ssh_get_error(_session)));
        }
 
 DCPOMATIC_DISABLE_WARNINGS
        r = ssh_is_server_known (_session);
        if (r == SSH_SERVER_ERROR) {
-               throw NetworkError (String::compose (_("SSH error (%1)"), ssh_get_error (_session)));
+               throw NetworkError (String::compose(_("SSH error [%1] (%2)"), "ssh_is_server_known", ssh_get_error(_session)));
        }
 DCPOMATIC_ENABLE_WARNINGS
 
        r = ssh_userauth_password (_session, 0, Config::instance()->tms_password().c_str ());
        if (r != SSH_AUTH_SUCCESS) {
-               throw NetworkError (String::compose (_("Failed to authenticate with server (%1)"), ssh_get_error (_session)));
+               throw NetworkError (String::compose(_("Failed to authenticate with server (%1)"), ssh_get_error(_session)));
        }
 
-       _scp = ssh_scp_new (_session, SSH_SCP_WRITE | SSH_SCP_RECURSIVE, Config::instance()->tms_path().c_str ());
+       _scp = ssh_scp_new (_session, SSH_SCP_WRITE | SSH_SCP_RECURSIVE, Config::instance()->tms_path().c_str());
        if (!_scp) {
-               throw NetworkError (String::compose (_("could not start SCP session (%1)"), ssh_get_error (_session)));
+               throw NetworkError (String::compose(_("SSH error [%1] (%2)"), "ssh_scp_new", ssh_get_error(_session)));
        }
 
        r = ssh_scp_init (_scp);
        if (r != SSH_OK) {
-               throw NetworkError (String::compose (_("Could not start SCP session (%1)"), ssh_get_error (_session)));
+               throw NetworkError (String::compose(_("SSH error [%1] (%2)"), "ssh_scp_init", ssh_get_error(_session)));
        }
 }
 
+
 SCPUploader::~SCPUploader ()
 {
        ssh_scp_free (_scp);
@@ -82,26 +86,28 @@ SCPUploader::~SCPUploader ()
        ssh_free (_session);
 }
 
+
 void
 SCPUploader::create_directory (boost::filesystem::path directory)
 {
        /* Use generic_string so that we get forward-slashes in the path, even on Windows */
        int const r = ssh_scp_push_directory (_scp, directory.generic_string().c_str(), S_IRWXU);
        if (r != SSH_OK) {
-               throw NetworkError (String::compose (_("Could not create remote directory %1 (%2)"), directory, ssh_get_error (_session)));
+               throw NetworkError (String::compose(_("Could not create remote directory %1 (%2)"), directory, ssh_get_error(_session)));
        }
 }
 
+
 void
 SCPUploader::upload_file (boost::filesystem::path from, boost::filesystem::path to, boost::uintmax_t& transferred, boost::uintmax_t total_size)
 {
-       boost::uintmax_t to_do = boost::filesystem::file_size (from);
+       auto to_do = boost::filesystem::file_size (from);
        /* Use generic_string so that we get forward-slashes in the path, even on Windows */
        ssh_scp_push_file (_scp, to.generic_string().c_str(), to_do, S_IRUSR | S_IWUSR);
 
-       FILE* f = fopen_boost (from, "rb");
-       if (f == 0) {
-               throw NetworkError (String::compose (_("Could not open %1 to send"), from));
+       auto f = fopen_boost (from, "rb");
+       if (f == nullptr) {
+               throw NetworkError (String::compose(_("Could not open %1 to send"), from));
        }
 
        boost::uintmax_t buffer_size = 64 * 1024;
@@ -118,7 +124,7 @@ SCPUploader::upload_file (boost::filesystem::path from, boost::filesystem::path
                int const r = ssh_scp_write (_scp, buffer, t);
                if (r != SSH_OK) {
                        fclose (f);
-                       throw NetworkError (String::compose (_("Could not write to remote file (%1)"), ssh_get_error (_session)));
+                       throw NetworkError (String::compose(_("Could not write to remote file (%1)"), ssh_get_error(_session)));
                }
                to_do -= t;
                transferred += t;
index 5c90db927253eda6e3b32414d1d956a779c56b26..e6bf7da2bdac0af70f740fc6a264ca19b493e2e4 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "uploader.h"
 #include <libssh/libssh.h>
 
+
 class SCPUploader : public Uploader
 {
 public:
-       SCPUploader (boost::function<void (std::string)> set_status, boost::function<void (float)> set_progress);
+       SCPUploader (std::function<void (std::string)> set_status, std::function<void (float)> set_progress);
        ~SCPUploader ();
 
 protected:
-       virtual void create_directory (boost::filesystem::path directory);
-       virtual void upload_file (boost::filesystem::path from, boost::filesystem::path to, boost::uintmax_t& transferred, boost::uintmax_t total_size);
+       virtual void create_directory (boost::filesystem::path directory) override;
+       virtual void upload_file (boost::filesystem::path from, boost::filesystem::path to, boost::uintmax_t& transferred, boost::uintmax_t total_size) override;
 
 private:
        ssh_session _session;
index 1677e626ff07ddf5cd25fb478aecdcd8da9075ed..8d0dcc6fc76df26b74e702adb1a8c14e8cf7f9d9 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2018-2019 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2018-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -18,6 +18,7 @@
 
 */
 
+
 #include "content_store.h"
 #include "spl.h"
 #include "warnings.h"
@@ -28,11 +29,13 @@ DCPOMATIC_DISABLE_WARNINGS
 DCPOMATIC_ENABLE_WARNINGS
 #include <iostream>
 
+
 using std::cout;
 using std::string;
 using std::shared_ptr;
 using dcp::raw_convert;
 
+
 void
 SPL::read (boost::filesystem::path path, ContentStore* store)
 {
@@ -43,7 +46,7 @@ SPL::read (boost::filesystem::path path, ContentStore* store)
        _id = doc.string_child("Id");
        _name = doc.string_child("Name");
        for (auto i: doc.node_children("Entry")) {
-               shared_ptr<Content> c = store->get(i->string_child("Digest"));
+               auto c = store->get(i->string_child("Digest"));
                if (c) {
                        add (SPLEntry(c));
                } else {
@@ -52,11 +55,12 @@ SPL::read (boost::filesystem::path path, ContentStore* store)
        }
 }
 
+
 void
 SPL::write (boost::filesystem::path path) const
 {
        xmlpp::Document doc;
-       xmlpp::Element* root = doc.create_root_node ("SPL");
+       auto root = doc.create_root_node ("SPL");
        root->add_child("Id")->add_child_text (_id);
        root->add_child("Name")->add_child_text (_name);
        for (auto i: _spl) {
index b8a9a71f0e8708ac130c2eac743de3048e1dd4c6..063cc8d6182f25033eb4d92c2b3c9d94c2bff948 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2019 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2019-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "usl.h"
 
 #include "i18n.h"
 
+
 USL::USL ()
        : CinemaSoundProcessor ("usl", _("USL"), 5.5f, 10, 3.33333333333333333)
 {
index 260eb3c8059c873154dfc5d84597ce26c37fe272..896fcf971335b3e4b72a41b1fe853c771c4fbff6 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2019 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2019-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 /** @file  src/lib/usl.h
  *  @brief USL class.
  */
 
+
 #include "cinema_sound_processor.h"
 
+
 class USL : public CinemaSoundProcessor
 {
 public:
index 6e194a6dfe5488c00f134b4b388479ff9518356e..d3fe2b897355ce8e71af8d680848024ed6e1854b 100644 (file)
@@ -18,6 +18,7 @@
 
 */
 
+
 #include "video_mxf_decoder.h"
 #include "video_decoder.h"
 #include "video_mxf_content.h"
 #include <dcp/stereo_picture_asset_reader.h>
 #include <dcp/exceptions.h>
 
+
+using std::make_shared;
 using std::shared_ptr;
 using boost::optional;
 using namespace dcpomatic;
 
+
 VideoMXFDecoder::VideoMXFDecoder (shared_ptr<const Film> film, shared_ptr<const VideoMXFContent> content)
        : Decoder (film)
        , _content (content)
 {
-       video.reset (new VideoDecoder (this, content));
+       video = make_shared<VideoDecoder>(this, content);
 
        shared_ptr<dcp::MonoPictureAsset> mono;
        try {
-               mono.reset (new dcp::MonoPictureAsset (_content->path(0)));
+               mono = make_shared<dcp::MonoPictureAsset>(_content->path(0));
        } catch (dcp::MXFFileError& e) {
                /* maybe it's stereo */
        } catch (dcp::ReadError& e) {
@@ -50,7 +54,7 @@ VideoMXFDecoder::VideoMXFDecoder (shared_ptr<const Film> film, shared_ptr<const
 
        shared_ptr<dcp::StereoPictureAsset> stereo;
        try {
-               stereo.reset (new dcp::StereoPictureAsset (_content->path(0)));
+               stereo = make_shared<dcp::StereoPictureAsset>(_content->path(0));
        } catch (dcp::MXFFileError& e) {
                if (!mono) {
                        throw;
@@ -70,11 +74,12 @@ VideoMXFDecoder::VideoMXFDecoder (shared_ptr<const Film> film, shared_ptr<const
        }
 }
 
+
 bool
 VideoMXFDecoder::pass ()
 {
-       double const vfr = _content->active_video_frame_rate (film());
-       int64_t const frame = _next.frames_round (vfr);
+       auto const vfr = _content->active_video_frame_rate (film());
+       auto const frame = _next.frames_round (vfr);
 
        if (frame >= _content->video->length()) {
                return true;
@@ -83,24 +88,18 @@ VideoMXFDecoder::pass ()
        if (_mono_reader) {
                video->emit (
                        film(),
-                       shared_ptr<ImageProxy> (
-                               new J2KImageProxy (_mono_reader->get_frame(frame), _size, AV_PIX_FMT_XYZ12LE, optional<int>())
-                               ),
+                       std::make_shared<J2KImageProxy>(_mono_reader->get_frame(frame), _size, AV_PIX_FMT_XYZ12LE, optional<int>()),
                        frame
                        );
        } else {
                video->emit (
                        film(),
-                       shared_ptr<ImageProxy> (
-                               new J2KImageProxy (_stereo_reader->get_frame(frame), _size, dcp::Eye::LEFT, AV_PIX_FMT_XYZ12LE, optional<int>())
-                               ),
+                       std::make_shared<J2KImageProxy>(_stereo_reader->get_frame(frame), _size, dcp::Eye::LEFT, AV_PIX_FMT_XYZ12LE, optional<int>()),
                        frame
                        );
                video->emit (
                        film(),
-                       shared_ptr<ImageProxy> (
-                               new J2KImageProxy (_stereo_reader->get_frame(frame), _size, dcp::Eye::RIGHT, AV_PIX_FMT_XYZ12LE, optional<int>())
-                               ),
+                       std::make_shared<J2KImageProxy>(_stereo_reader->get_frame(frame), _size, dcp::Eye::RIGHT, AV_PIX_FMT_XYZ12LE, optional<int>()),
                        frame
                        );
        }
@@ -109,6 +108,7 @@ VideoMXFDecoder::pass ()
        return false;
 }
 
+
 void
 VideoMXFDecoder::seek (ContentTime t, bool accurate)
 {
index ae5d2fb78fbdb2d6d6fdb332c41698c9ef98b0b8..774e269c6d5da15275e1ccf61259f4ad1f510fa3 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2016-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "decoder.h"
 #include <dcp/mono_picture_asset_reader.h>
 #include <dcp/stereo_picture_asset_reader.h>
 
+
 class VideoMXFContent;
 class Log;
 
+
 class VideoMXFDecoder : public Decoder
 {
 public:
        VideoMXFDecoder (std::shared_ptr<const Film> film, std::shared_ptr<const VideoMXFContent>);
 
-       bool pass ();
-       void seek (dcpomatic::ContentTime t, bool accurate);
+       bool pass () override;
+       void seek (dcpomatic::ContentTime t, bool accurate) override;
 
 private:
 
index 07e330c4ca34be4d98f5aff842529c3382165438..06f6988746707900e58d09a82b766a90da2fbe23 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "batch_job_view.h"
 #include "dcpomatic_button.h"
 #include "lib/job_manager.h"
 #include <wx/sizer.h>
 #include <wx/button.h>
 
+
 using std::list;
 using std::shared_ptr;
 
+
 BatchJobView::BatchJobView (shared_ptr<Job> job, wxWindow* parent, wxWindow* container, wxFlexGridSizer* table)
        : JobView (job, parent, container, table)
 {
 
 }
 
+
 int
 BatchJobView::insert_position () const
 {
        return _table->GetEffectiveRowsCount() * _table->GetEffectiveColsCount();
 }
 
+
 void
 BatchJobView::finish_setup (wxWindow* parent, wxSizer* sizer)
 {
        _higher_priority = new Button (parent, _("Higher priority"));
-       _higher_priority->Bind (wxEVT_BUTTON, boost::bind (&BatchJobView::higher_priority_clicked, this));
+       _higher_priority->Bind (wxEVT_BUTTON, boost::bind(&BatchJobView::higher_priority_clicked, this));
        sizer->Add (_higher_priority, 1, wxALIGN_CENTER_VERTICAL);
        _lower_priority = new Button (parent, _("Lower priority"));
-       _lower_priority->Bind (wxEVT_BUTTON, boost::bind (&BatchJobView::lower_priority_clicked, this));
+       _lower_priority->Bind (wxEVT_BUTTON, boost::bind(&BatchJobView::lower_priority_clicked, this));
        sizer->Add (_lower_priority, 1, wxALIGN_CENTER_VERTICAL);
 }
+
+
 void
 BatchJobView::higher_priority_clicked ()
 {
        JobManager::instance()->increase_priority (_job);
 }
 
+
 void
 BatchJobView::lower_priority_clicked ()
 {
        JobManager::instance()->decrease_priority (_job);
 }
 
+
 void
 BatchJobView::job_list_changed ()
 {
        bool high = false;
        bool low = false;
-       list<shared_ptr<Job> > jobs = JobManager::instance()->get();
-       if (!jobs.empty ()) {
+       auto jobs = JobManager::instance()->get();
+       if (!jobs.empty()) {
                if (_job != jobs.front()) {
                        high = true;
                }
index 688e6c374783cfb0bee77f7020679fa5654eb70a..6d9ccba31cc3bbfb96cb3f8d5624945bb03c9bcb 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "job_view.h"
 
+
 class BatchJobView : public JobView
 {
 public:
index 2e0e360d98cbbc8016a2487067a1fe3a29d671b2..bc835edafc305358d15d3eda63e9cb4c23e4115b 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2015-2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2015-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -18,6 +18,7 @@
 
 */
 
+
 #include "content_properties_dialog.h"
 #include "wx_util.h"
 #include "static_text.h"
@@ -26,6 +27,7 @@
 #include "lib/audio_content.h"
 #include <boost/algorithm/string.hpp>
 
+
 using std::string;
 using std::list;
 using std::pair;
@@ -33,10 +35,11 @@ using std::map;
 using std::shared_ptr;
 using std::dynamic_pointer_cast;
 
+
 ContentPropertiesDialog::ContentPropertiesDialog (wxWindow* parent, shared_ptr<const Film> film, shared_ptr<Content> content)
        : TableDialog (parent, _("Content Properties"), 2, 1, false)
 {
-       map<UserProperty::Category, list<UserProperty> > grouped;
+       map<UserProperty::Category, list<UserProperty>> grouped;
        for (auto i: content->user_properties(film)) {
                if (grouped.find(i.category) == grouped.end()) {
                        grouped[i.category] = list<UserProperty> ();
@@ -50,16 +53,17 @@ ContentPropertiesDialog::ContentPropertiesDialog (wxWindow* parent, shared_ptr<c
        maybe_add_group (grouped, UserProperty::LENGTH);
 
        /* Nasty hack to stop the bottom property being cut off on Windows / OS X */
-       add (wxString (), false);
-       add (wxString (), false);
+       add (wxString(), false);
+       add (wxString(), false);
 
        layout ();
 }
 
+
 void
-ContentPropertiesDialog::maybe_add_group (map<UserProperty::Category, list<UserProperty> > const & groups, UserProperty::Category category)
+ContentPropertiesDialog::maybe_add_group (map<UserProperty::Category, list<UserProperty>> const & groups, UserProperty::Category category)
 {
-       map<UserProperty::Category, list<UserProperty> >::const_iterator i = groups.find (category);
+       auto i = groups.find (category);
        if (i == groups.end()) {
                return;
        }
@@ -80,7 +84,7 @@ ContentPropertiesDialog::maybe_add_group (map<UserProperty::Category, list<UserP
                break;
        }
 
-       wxStaticText* m = new StaticText (this, category_name);
+       auto m = new StaticText (this, category_name);
        wxFont font (*wxNORMAL_FONT);
        font.SetWeight (wxFONTWEIGHT_BOLD);
        m->SetFont (font);
index 9faccb4b74ab3ce9fc93a0b53855e4d6b13e0dbe..c7efa4497c91cbdfd0f5af133a56f9fb224be355 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2015-2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2015-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "table_dialog.h"
 #include "lib/user_property.h"
 #include <list>
 #include <map>
 
+
 class Content;
 class Film;
 class UserProperty;
 
+
 class ContentPropertiesDialog : public TableDialog
 {
 public:
index c46fed7600243a235665530c481758d86f9436be..68fe4bae1ae53ebfc594702c6d68aa9605993b5f 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -18,6 +18,7 @@
 
 */
 
+
 #include "dkdm_dialog.h"
 #include "wx_util.h"
 #include "recipients_panel.h"
@@ -37,6 +38,7 @@
 #include <wx/listctrl.h>
 #include <iostream>
 
+
 using std::string;
 using std::exception;
 using std::map;
@@ -59,9 +61,9 @@ DKDMDialog::DKDMDialog (wxWindow* parent, shared_ptr<const Film> film)
        , _film (film)
 {
        /* Main sizers */
-       wxBoxSizer* horizontal = new wxBoxSizer (wxHORIZONTAL);
-       wxBoxSizer* left = new wxBoxSizer (wxVERTICAL);
-       wxBoxSizer* right = new wxBoxSizer (wxVERTICAL);
+       auto horizontal = new wxBoxSizer (wxHORIZONTAL);
+       auto left = new wxBoxSizer (wxVERTICAL);
+       auto right = new wxBoxSizer (wxVERTICAL);
 
        horizontal->Add (left, 1, wxEXPAND | wxRIGHT, DCPOMATIC_SIZER_X_GAP * 4);
        horizontal->Add (right, 1, wxEXPAND);
@@ -71,7 +73,7 @@ DKDMDialog::DKDMDialog (wxWindow* parent, shared_ptr<const Film> film)
        subheading_font.SetWeight (wxFONTWEIGHT_BOLD);
 
        /* Sub-heading: Screens */
-       wxStaticText* h = new StaticText (this, _("Recipients"));
+       auto h = new StaticText (this, _("Recipients"));
        h->SetFont (subheading_font);
        left->Add (h, 0, wxBOTTOM, DCPOMATIC_SIZER_Y_GAP);
        _recipients = new RecipientsPanel (this);
@@ -112,7 +114,7 @@ DKDMDialog::DKDMDialog (wxWindow* parent, shared_ptr<const Film> film)
 
        /* Make an overall sizer to get a nice border */
 
-       wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
+       auto overall_sizer = new wxBoxSizer (wxVERTICAL);
        overall_sizer->Add (horizontal, 0, wxEXPAND | wxTOP | wxLEFT | wxRIGHT, DCPOMATIC_DIALOG_BORDER);
 
        /* Bind */
@@ -128,6 +130,7 @@ DKDMDialog::DKDMDialog (wxWindow* parent, shared_ptr<const Film> film)
        overall_sizer->SetSizeHints (this);
 }
 
+
 void
 DKDMDialog::setup_sensitivity ()
 {
@@ -136,25 +139,27 @@ DKDMDialog::setup_sensitivity ()
        _make->Enable (!_recipients->recipients().empty() && _timing->valid() && _cpl->has_selected());
 }
 
+
 bool
 DKDMDialog::confirm_overwrite (boost::filesystem::path path)
 {
        return confirm_dialog (
                this,
-               wxString::Format (_("File %s already exists.  Do you want to overwrite it?"), std_to_wx(path.string()).data())
+               wxString::Format(_("File %s already exists.  Do you want to overwrite it?"), std_to_wx(path.string()).data())
                );
 }
 
+
 void
 DKDMDialog::make_clicked ()
 {
-       shared_ptr<const Film> film = _film.lock ();
+       auto film = _film.lock ();
        DCPOMATIC_ASSERT (film);
 
        list<KDMWithMetadataPtr> kdms;
        try {
                for (auto i: _recipients->recipients()) {
-                       KDMWithMetadataPtr p = kdm_for_dkdm_recipient (film, _cpl->cpl(), i, _timing->from(), _timing->until());
+                       auto p = kdm_for_dkdm_recipient (film, _cpl->cpl(), i, _timing->from(), _timing->until());
                        if (p) {
                                kdms.push_back (p);
                        }
@@ -171,17 +176,17 @@ DKDMDialog::make_clicked ()
                return;
        }
 
-       pair<shared_ptr<Job>, int> result = _output->make (kdms, film->name(), bind(&DKDMDialog::confirm_overwrite, this, _1));
+       auto result = _output->make (kdms, film->name(), bind(&DKDMDialog::confirm_overwrite, this, _1));
        if (result.first) {
                JobManager::instance()->add (result.first);
        }
 
        if (result.second > 0) {
                /* XXX: proper plural form support in wxWidgets? */
-               wxString s = result.second == 1 ? _("%d DKDM written to %s") : _("%d DKDMs written to %s");
+               auto s = result.second == 1 ? _("%d DKDM written to %s") : _("%d DKDMs written to %s");
                message_dialog (
                        this,
-                       wxString::Format (s, result.second, std_to_wx(_output->directory().string()).data())
+                       wxString::Format(s, result.second, std_to_wx(_output->directory().string()).data())
                        );
        }
 }
index 4235de511b5e5cb20665aca8866a220ca38c6451..7b20e88ec000f2bd523debc6d4e2feb37f9dd3c9 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "wx_util.h"
 #include <wx/wx.h>
 #include <map>
 
+
 class Film;
 class ScreensPanel;
 class RecipientsPanel;
@@ -30,6 +32,7 @@ class DKDMOutputPanel;
 class KDMCPLPanel;
 struct CPLSummary;
 
+
 class DKDMDialog : public wxDialog
 {
 public:
index 6652810732cf81855aa37873bf16f80310c052d2..2ff05ddecfa41c26ee1e9453a37a550d2c3928ad 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "download_certificate_panel.h"
 
+
 class DolbyDoremiCertificatePanel : public DownloadCertificatePanel
 {
 public:
        DolbyDoremiCertificatePanel (DownloadCertificateDialog* dialog);
 
-       void do_download ();
-       wxString name () const;
+       void do_download () override;
+       wxString name () const override;
 };
index ae62f1a0a62709f5d6fc96f81c3314a24131ddc9..b9680e2983f9325a0c9679b10c1da8f8930c5bce 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014-2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -18,6 +18,7 @@
 
 */
 
+
 #include "wx_util.h"
 #include "download_certificate_panel.h"
 #include "download_certificate_dialog.h"
 #include <dcp/exceptions.h>
 #include <boost/bind/bind.hpp>
 
+
 using std::string;
 using boost::function;
 using boost::optional;
 
+
 DownloadCertificatePanel::DownloadCertificatePanel (DownloadCertificateDialog* dialog)
        : wxPanel (dialog->notebook(), wxID_ANY)
        , _dialog (dialog)
@@ -59,11 +62,11 @@ optional<string>
 DownloadCertificatePanel::load_certificate (boost::filesystem::path file)
 {
        try {
-               _certificate = dcp::Certificate (dcp::file_to_string (file));
+               _certificate = dcp::Certificate (dcp::file_to_string(file));
        } catch (dcp::MiscError& e) {
                return String::compose(wx_to_std(_("Could not read certificate file (%1)")), e.what());
        }
-       return optional<string>();
+       return {};
 }
 
 
@@ -75,7 +78,7 @@ DownloadCertificatePanel::load_certificate_from_chain (boost::filesystem::path f
        } catch (dcp::MiscError& e) {
                return String::compose(wx_to_std(_("Could not read certificate file (%1)")), e.what());
        }
-       return optional<string>();
+       return {};
 }
 
 
@@ -83,6 +86,7 @@ optional<dcp::Certificate>
 DownloadCertificatePanel::certificate () const
 {
        return _certificate;
+
 }
 
 void
@@ -93,11 +97,12 @@ DownloadCertificatePanel::download ()
        /* Hack: without this the SetLabel() above has no visible effect */
        wxMilliSleep (200);
 
-       signal_manager->when_idle (boost::bind (&DownloadCertificatePanel::do_download, this));
+       signal_manager->when_idle (boost::bind(&DownloadCertificatePanel::do_download, this));
 }
 
+
 bool
 DownloadCertificatePanel::ready_to_download () const
 {
-       return !_serial->IsEmpty ();
+       return !_serial->IsEmpty();
 }
index ba355f8138c30c3c4aa46ecace7f75a7dc3fbf3d..25271c7701dbb21ab26be7087f9c8bc23520e89f 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #ifndef DCPOMATIC_DOWNLOAD_CERTIFICATE_PANEL_H
 #define DCPOMATIC_DOWNLOAD_CERTIFICATE_PANEL_H
 
+
 #include "lib/warnings.h"
 #include <dcp/certificate.h>
 DCPOMATIC_DISABLE_WARNINGS
@@ -28,8 +30,10 @@ DCPOMATIC_DISABLE_WARNINGS
 DCPOMATIC_ENABLE_WARNINGS
 #include <boost/optional.hpp>
 
+
 class DownloadCertificateDialog;
 
+
 class DownloadCertificatePanel : public wxPanel
 {
 public:
@@ -54,4 +58,5 @@ private:
        boost::optional<dcp::Certificate> _certificate;
 };
 
+
 #endif
index 4d3ae4fe135a54a26dd3f572d230962a82a57a0e..65fb47473f1cccd40d0bd1f584722168234dcef1 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2015-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "email_dialog.h"
 #include "wx_util.h"
 
+
 using std::string;
 using std::shared_ptr;
 using boost::optional;
 
+
 EmailDialog::EmailDialog (wxWindow* parent)
        : TableDialog (parent, _("Email address"), 2, 1, true)
 {
        add (_("Email address"), true);
-       _email = add (new wxTextCtrl (this, wxID_ANY, wxT (""), wxDefaultPosition, wxSize (400, -1)));
+       _email = add (new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(400, -1)));
 
        layout ();
 
        _email->SetFocus ();
 }
 
+
 void
 EmailDialog::set (string address)
 {
-       _email->SetValue (std_to_wx (address));
+       _email->SetValue (std_to_wx(address));
 }
 
+
 optional<string>
 EmailDialog::get () const
 {
-       string s = wx_to_std (_email->GetValue ());
-       if (s.empty ()) {
+       auto s = wx_to_std (_email->GetValue ());
+       if (s.empty()) {
                /* Invalid email address */
-               return optional<string> ();
+               return {};
        }
 
        return s;
index 932dd8714be3028e6e87912853898b34f6fdb072..3f622f87d61cab0dd3d6be71fc69b860d10c9640 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2015-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "table_dialog.h"
 #include <boost/optional.hpp>
 
+
 class EmailDialog : public TableDialog
 {
 public:
@@ -32,3 +34,4 @@ public:
 private:
        wxTextCtrl* _email;
 };
+
index 978330187f13fe4c40c6d64a5aaf938a2149167d..dcae84cd9d3b4b834e58a54bbf0c7138d34a84c9 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2018-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -18,6 +18,7 @@
 
 */
 
+
 #include "html_dialog.h"
 #include "wx_util.h"
 #include "lib/cross.h"
@@ -29,14 +30,16 @@ DCPOMATIC_DISABLE_WARNINGS
 DCPOMATIC_ENABLE_WARNINGS
 #include <iostream>
 
+
 #if BOOST_VERSION >= 106100
 using namespace boost::placeholders;
 #endif
 
+
 HTMLDialog::HTMLDialog (wxWindow* parent, wxString title, wxString html)
        : wxDialog (parent, wxID_ANY, title)
 {
-       wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
+       auto sizer = new wxBoxSizer (wxVERTICAL);
 
        wxFileSystem::AddHandler(new wxMemoryFSHandler);
 
@@ -46,7 +49,7 @@ HTMLDialog::HTMLDialog (wxWindow* parent, wxString title, wxString html)
                wxBitmap(std_to_wx(boost::filesystem::path(resources_path() / "me.jpg").string()), wxBITMAP_TYPE_JPEG), wxBITMAP_TYPE_JPEG
                );
 
-       wxHtmlWindow* h = new wxHtmlWindow (this);
+       auto h = new wxHtmlWindow (this);
        h->SetPage (html);
        sizer->Add (h, 1, wxEXPAND | wxALL, 6);
 
@@ -62,6 +65,7 @@ HTMLDialog::HTMLDialog (wxWindow* parent, wxString title, wxString html)
        SetSize (h->GetInternalRepresentation()->GetWidth(), h->GetInternalRepresentation()->GetHeight() + 64);
 }
 
+
 void
 HTMLDialog::link_clicked (wxHtmlLinkEvent& ev)
 {
index 9da4c82151d06b7ce4bf53dc893b5d5c5c0e77c3..2b6924179b8c8252cad5d63cfa3f35477e287e89 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2018-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "lib/warnings.h"
 DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
 DCPOMATIC_ENABLE_WARNINGS
 
+
 class wxHtmlLinkEvent;
 
+
 class HTMLDialog : public wxDialog
 {
 public:
index 542655477381eed773be38cd6440a3f08ee8df1b..fdd118520999b50a67367d9f637ec6180aefe24f 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2016-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "move_to_dialog.h"
 #include "lib/film.h"
 #include <wx/spinctrl.h>
 
+
 using std::list;
 using std::shared_ptr;
 using boost::optional;
 using namespace dcpomatic;
 
+
 MoveToDialog::MoveToDialog (wxWindow* parent, optional<DCPTime> position, shared_ptr<const Film> film)
        : TableDialog (parent, _("Move content"), 2, 0, true)
        , _film (film)
@@ -49,13 +52,14 @@ MoveToDialog::MoveToDialog (wxWindow* parent, optional<DCPTime> position, shared
        }
 }
 
+
 DCPTime
 MoveToDialog::position () const
 {
-       shared_ptr<const Film> film = _film.lock ();
+       auto film = _film.lock ();
        DCPOMATIC_ASSERT (film);
-       list<DCPTimePeriod> reels = film->reels ();
-       list<DCPTimePeriod>::const_iterator i = reels.begin ();
+       auto reels = film->reels ();
+       auto i = reels.begin ();
        for (int j = 0; j < _reel->GetValue() - 1; ++j) {
                DCPOMATIC_ASSERT (i != reels.end());
                ++i;
index 61520a71fabfb3c845032910c22b43ebf8a33e54..16267bc9babb3cbaf4831e195f88a849791f5cac 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2016-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "table_dialog.h"
 #include "lib/dcpomatic_time.h"
 #include <boost/optional.hpp>
 
+
 class Film;
 class wxSpinCtrl;
 
+
 class MoveToDialog : public TableDialog
 {
 public:
index 5755d75f4b0ed6253befb575429feb92e9a699ab..b2c11b50c8ad385a12fd1b2efd364e3b2a1728f2 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2016-2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2016-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "name_format_editor.h"
 #include "wx_util.h"
 #include "static_text.h"
 #include "lib/util.h"
 
+
 using std::string;
 
+
 NameFormatEditor::NameFormatEditor (wxWindow* parent, dcp::NameFormat name, dcp::NameFormat::Map titles, dcp::NameFormat::Map examples, string suffix)
-       : _panel (new wxPanel (parent))
-       , _example (new StaticText (_panel, ""))
-       , _sizer (new wxBoxSizer (wxVERTICAL))
-       , _specification (new wxTextCtrl (_panel, wxID_ANY, ""))
+       : _panel (new wxPanel(parent))
+       , _example (new StaticText(_panel, ""))
+       , _sizer (new wxBoxSizer(wxVERTICAL))
+       , _specification (new wxTextCtrl(_panel, wxID_ANY, ""))
        , _name (name)
        , _examples (examples)
        , _suffix (suffix)
@@ -40,22 +43,23 @@ NameFormatEditor::NameFormatEditor (wxWindow* parent, dcp::NameFormat name, dcp:
        }
        _panel->SetSizer (_sizer);
 
-       for (dcp::NameFormat::Map::const_iterator i = titles.begin(); i != titles.end(); ++i) {
-               wxStaticText* t = new StaticText (_panel, std_to_wx (String::compose ("%%%1 %2", i->first, i->second)));
+       for (auto const& i: titles) {
+               auto t = new StaticText (_panel, std_to_wx (String::compose ("%%%1 %2", i.first, i.second)));
                _sizer->Add (t);
-               wxFont font = t->GetFont();
+               auto font = t->GetFont();
                font.SetStyle (wxFONTSTYLE_ITALIC);
                font.SetPointSize (font.GetPointSize() - 1);
                t->SetFont (font);
                t->SetForegroundColour (wxColour (0, 0, 204));
        }
 
-       _specification->SetValue (std_to_wx (_name.specification ()));
-       _specification->Bind (wxEVT_TEXT, boost::bind (&NameFormatEditor::changed, this));
+       _specification->SetValue (std_to_wx (_name.specification()));
+       _specification->Bind (wxEVT_TEXT, boost::bind(&NameFormatEditor::changed, this));
 
        update_example ();
 }
 
+
 void
 NameFormatEditor::changed ()
 {
@@ -63,6 +67,7 @@ NameFormatEditor::changed ()
        Changed ();
 }
 
+
 void
 NameFormatEditor::update_example ()
 {
@@ -70,9 +75,9 @@ NameFormatEditor::update_example ()
                return;
        }
 
-       _name.set_specification (careful_string_filter (wx_to_std (_specification->GetValue ())));
+       _name.set_specification (careful_string_filter(wx_to_std(_specification->GetValue())));
 
-       wxString example = wxString::Format (_("e.g. %s"), std_to_wx (_name.get (_examples, _suffix)));
+       auto example = wxString::Format (_("e.g. %s"), std_to_wx (_name.get (_examples, _suffix)));
        wxString wrapped;
        for (size_t i = 0; i < example.Length(); ++i) {
                if (i > 0 && (i % 40) == 0) {
index e3728615fcf818e14bce5c92336c99a1addaca63..596b427409c2447ec621a80d66abe3b8906d62d3 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2016-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #ifndef DCPOMATIC_NAME_FORMAT_EDITOR_H
 #define DCPOMATIC_NAME_FORMAT_EDITOR_H
 
+
 #include "lib/compose.hpp"
 #include "lib/warnings.h"
 #include <dcp/name_format.h>
@@ -29,6 +31,7 @@ DCPOMATIC_DISABLE_WARNINGS
 DCPOMATIC_ENABLE_WARNINGS
 #include <boost/signals2.hpp>
 
+
 class NameFormatEditor
 {
 public:
@@ -59,4 +62,5 @@ private:
        std::string _suffix;
 };
 
+
 #endif
index 6c9c08fa720ccb64f21c90c8e25ab1d64fec3d08..6d2b7e9f207b3386e3a2633be4aa4b3bc6d1b609 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "normal_job_view.h"
 #include "dcpomatic_button.h"
 #include "lib/job.h"
 #include <wx/wx.h>
 
+
 using std::shared_ptr;
 
+
 NormalJobView::NormalJobView (shared_ptr<Job> job, wxWindow* parent, wxWindow* container, wxFlexGridSizer* table)
        : JobView (job, parent, container, table)
-       , _pause (0)
 {
 
 }
 
+
 void
 NormalJobView::finish_setup (wxWindow* parent, wxSizer* sizer)
 {
@@ -41,11 +44,13 @@ NormalJobView::finish_setup (wxWindow* parent, wxSizer* sizer)
 }
 
 int
+
 NormalJobView::insert_position () const
 {
        return 0;
 }
 
+
 void
 NormalJobView::pause_clicked ()
 {
@@ -58,6 +63,7 @@ NormalJobView::pause_clicked ()
        }
 }
 
+
 void
 NormalJobView::finished ()
 {
index ea1a014f4fececef6a485d695fe2dcbbfe8fe534..acd8111b6e6c95b48ee5f4de358bc0662b9de0ee 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "job_view.h"
 
+
 class wxSizer;
 
+
 class NormalJobView : public JobView
 {
 public:
@@ -35,5 +38,5 @@ private:
        void pause_clicked ();
        void finished ();
 
-       wxButton* _pause;
+       wxButton* _pause = nullptr;
 };
index cd4518881131378a2232865b0a93f2fe6534324a..429e8fe6e473a0e145cf99cac80b4dbd8d50bfe2 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2018-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "paste_dialog.h"
 #include "check_box.h"
 
+
 PasteDialog::PasteDialog (wxWindow* parent, bool video, bool audio, bool text)
        : TableDialog (parent, _("Paste"), 1, 0, true)
 {
@@ -37,18 +39,21 @@ PasteDialog::PasteDialog (wxWindow* parent, bool video, bool audio, bool text)
        layout ();
 }
 
+
 bool
 PasteDialog::video () const
 {
        return _video->GetValue ();
 }
 
+
 bool
 PasteDialog::audio () const
 {
        return _audio->GetValue ();
 }
 
+
 bool
 PasteDialog::text () const
 {
index 792195947274288c48881daab79398dd4a91a0c4..1f447d3f87a92665f5c594701bcae40ef50b14bc 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2018-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "table_dialog.h"
 
+
 class PasteDialog : public TableDialog
 {
 public:
index c67cc46f28803ed66c14529b68189b38ec0455ba..e1c6bfb41ae2c4dca09c902efadc38d7544fc9aa 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2019 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2019-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -18,6 +18,7 @@
 
 */
 
+
 #include "qube_certificate_panel.h"
 #include "download_certificate_dialog.h"
 #include "wx_util.h"
@@ -26,6 +27,7 @@
 #include "lib/config.h"
 #include <boost/algorithm/string/predicate.hpp>
 
+
 using std::string;
 using std::list;
 using boost::optional;
@@ -33,8 +35,10 @@ using boost::optional;
 using namespace boost::placeholders;
 #endif
 
+
 static string const base = "ftp://certificates.qubecinema.com/";
 
+
 QubeCertificatePanel::QubeCertificatePanel (DownloadCertificateDialog* dialog, string type)
        : DownloadCertificatePanel (dialog)
        , _type (type)
@@ -42,16 +46,17 @@ QubeCertificatePanel::QubeCertificatePanel (DownloadCertificateDialog* dialog, s
 
 }
 
+
 void
 QubeCertificatePanel::do_download ()
 {
-       list<string> files = ls_url(String::compose("%1SMPTE-%2/", base, _type));
+       auto files = ls_url(String::compose("%1SMPTE-%2/", base, _type));
        if (files.empty()) {
                error_dialog (this, _("Could not read certificates from Qube server."));
                return;
        }
 
-       string const serial = wx_to_std(_serial->GetValue());
+       auto const serial = wx_to_std(_serial->GetValue());
        optional<string> name;
        for (auto i: files) {
                if (boost::algorithm::starts_with(i, String::compose("%1-%2-", _type, serial))) {
@@ -66,7 +71,7 @@ QubeCertificatePanel::do_download ()
                return;
        }
 
-       optional<string> error = get_from_url (String::compose("%1SMPTE-%2/%3", base, _type, *name), true, false, boost::bind(&DownloadCertificatePanel::load_certificate, this, _1));
+       auto error = get_from_url (String::compose("%1SMPTE-%2/%3", base, _type, *name), true, false, boost::bind(&DownloadCertificatePanel::load_certificate, this, _1));
 
        if (error) {
                _dialog->message()->SetLabel(wxT(""));
@@ -77,6 +82,7 @@ QubeCertificatePanel::do_download ()
        }
 }
 
+
 wxString
 QubeCertificatePanel::name () const
 {
index 89c67f60e12a4bf1a1379d73bb1daf63751d7c72..a9053dd1b7a56e41a2648248c56b2fdc4ba33f8f 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2019 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2019-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "download_certificate_panel.h"
 
+
 class QubeCertificatePanel : public DownloadCertificatePanel
 {
 public:
        QubeCertificatePanel (DownloadCertificateDialog* dialog, std::string type);
 
-       void do_download ();
-       wxString name () const;
+       void do_download () override;
+       wxString name () const override;
 
 private:
        std::string _type;
index 970c85a8b0e8d0b243374e0033e0b0dfb6a90228..714e080579893a57c4e2d587c647eea51b6cd9e1 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2016-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "rename_template_dialog.h"
 
+
 RenameTemplateDialog::RenameTemplateDialog (wxWindow* parent)
        : TableDialog (parent, _("Rename template"), 2, 1, true)
 {
        add (_("New name"), true);
-       _name = add (new wxTextCtrl (this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize (300, -1)));
+       _name = add (new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(300, -1)));
        layout ();
 
        _name->SetFocus ();
 }
 
+
 wxString
 RenameTemplateDialog::get () const
 {
        return _name->GetValue ();
 }
 
+
 void
 RenameTemplateDialog::set (wxString s)
 {
index 4ad4ee4c4dcb8a37a8980d1c54bd461a0436b8d2..d4304ff45798be799388ec71656308b7839ba30b 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2016-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "table_dialog.h"
 
+
 class RenameTemplateDialog : public TableDialog
 {
 public:
index 71ea089dd4e30574aeff1eff05912ba29a6348ce..157912d37af21f0525b53165966f6b4993af12fb 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -18,6 +18,7 @@
 
 */
 
+
 #include "self_dkdm_dialog.h"
 #include "wx_util.h"
 #include "kdm_output_panel.h"
@@ -42,6 +43,7 @@ DCPOMATIC_DISABLE_WARNINGS
 DCPOMATIC_ENABLE_WARNINGS
 #include <iostream>
 
+
 using std::string;
 using std::map;
 using std::list;
@@ -52,18 +54,19 @@ using std::make_pair;
 using std::shared_ptr;
 using boost::bind;
 
+
 SelfDKDMDialog::SelfDKDMDialog (wxWindow* parent, std::shared_ptr<const Film> film)
        : wxDialog (parent, wxID_ANY, _("Make DKDM for DCP-o-matic"))
 {
        /* Main sizer */
-       wxBoxSizer* vertical = new wxBoxSizer (wxVERTICAL);
+       auto vertical = new wxBoxSizer (wxVERTICAL);
 
        /* Font for sub-headings */
        wxFont subheading_font (*wxNORMAL_FONT);
        subheading_font.SetWeight (wxFONTWEIGHT_BOLD);
 
        /* Sub-heading: CPL */
-       wxStaticText* h = new StaticText (this, _("CPL"));
+       auto h = new StaticText (this, _("CPL"));
        h->SetFont (subheading_font);
        vertical->Add (h);
        _cpl = new KDMCPLPanel (this, film->cpls ());
@@ -77,7 +80,7 @@ SelfDKDMDialog::SelfDKDMDialog (wxWindow* parent, std::shared_ptr<const Film> fi
        _internal = new wxRadioButton (this, wxID_ANY, _("Save to KDM Creator tool's list"));
        vertical->Add (_internal, 0, wxTOP, DCPOMATIC_SIZER_Y_GAP);
 
-       wxBoxSizer* w = new wxBoxSizer (wxHORIZONTAL);
+       auto w = new wxBoxSizer (wxHORIZONTAL);
 
        _write_to = new wxRadioButton (this, wxID_ANY, _("Write to"));
        w->Add (_write_to, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, DCPOMATIC_SIZER_GAP);
@@ -96,10 +99,10 @@ SelfDKDMDialog::SelfDKDMDialog (wxWindow* parent, std::shared_ptr<const Film> fi
 
        /* Make an overall sizer to get a nice border, and put some buttons in */
 
-       wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
+       auto overall_sizer = new wxBoxSizer (wxVERTICAL);
        overall_sizer->Add (vertical, 0, wxEXPAND | wxTOP | wxLEFT | wxRIGHT, DCPOMATIC_DIALOG_BORDER);
 
-       wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
+       auto buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
        if (buttons) {
                overall_sizer->Add (buttons, 0, wxEXPAND | wxALL, DCPOMATIC_SIZER_Y_GAP);
        }
@@ -122,43 +125,48 @@ SelfDKDMDialog::SelfDKDMDialog (wxWindow* parent, std::shared_ptr<const Film> fi
        _write_to->Bind (wxEVT_RADIOBUTTON, bind (&SelfDKDMDialog::dkdm_write_type_changed, this));
 }
 
+
 void
 SelfDKDMDialog::dkdm_write_type_changed ()
 {
        setup_sensitivity ();
 
-       if (_internal->GetValue ()) {
-               Config::instance()->set_last_dkdm_write_type (Config::DKDM_WRITE_INTERNAL);
-       } else if (_write_to->GetValue ()) {
-               Config::instance()->set_last_dkdm_write_type (Config::DKDM_WRITE_FILE);
+       if (_internal->GetValue()) {
+               Config::instance()->set_last_dkdm_write_type(Config::DKDM_WRITE_INTERNAL);
+       } else if (_write_to->GetValue()) {
+               Config::instance()->set_last_dkdm_write_type(Config::DKDM_WRITE_FILE);
        }
 }
 
+
 void
 SelfDKDMDialog::setup_sensitivity ()
 {
        _folder->Enable (_write_to->GetValue ());
 
-       wxButton* ok = dynamic_cast<wxButton *> (FindWindowById (wxID_OK, this));
+       auto ok = dynamic_cast<wxButton *>(FindWindowById(wxID_OK, this));
        if (ok) {
                ok->Enable (_cpl->has_selected ());
        }
 }
 
+
 boost::filesystem::path
 SelfDKDMDialog::cpl () const
 {
        return _cpl->cpl ();
 }
 
+
 bool
 SelfDKDMDialog::internal () const
 {
        return _internal->GetValue ();
 }
 
+
 boost::filesystem::path
 SelfDKDMDialog::directory () const
 {
-       return wx_to_std (_folder->GetPath ());
+       return wx_to_std (_folder->GetPath());
 }
index 20c138c41c4ac058f99a18a81ad391d03b5a4556..151231a002bad0a1d7e2c2ec18eaafe5767991fe 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -18,6 +18,7 @@
 
 */
 
+
 #include "wx_util.h"
 #include "lib/warnings.h"
 #include <dcp/types.h>
@@ -27,11 +28,13 @@ DCPOMATIC_ENABLE_WARNINGS
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include <map>
 
+
 class Film;
 class KDMCPLPanel;
 class wxDirPickerCtrl;
 class DirPickerCtrl;
 
+
 class SelfDKDMDialog : public wxDialog
 {
 public:
index c78844ca1bc3ddd14e1d463519b88d440ece9d42..1e4ecc8d7fc74e5469c76759272110d209f42f1d 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2018-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
-#include "standard_controls.h"
+
 #include "film_viewer.h"
-#include <wx/wx.h>
+#include "standard_controls.h"
 #include <wx/tglbtn.h>
+#include <wx/wx.h>
+
 
 using std::shared_ptr;
 
+
 StandardControls::StandardControls (wxWindow* parent, shared_ptr<FilmViewer> viewer, bool editor_controls)
        : Controls (parent, viewer, editor_controls)
        , _play_button (new wxToggleButton(this, wxID_ANY, _("Play")))
@@ -33,6 +36,7 @@ StandardControls::StandardControls (wxWindow* parent, shared_ptr<FilmViewer> vie
        _play_button->Bind (wxEVT_TOGGLEBUTTON, boost::bind(&StandardControls::play_clicked, this));
 }
 
+
 void
 StandardControls::started ()
 {
@@ -40,6 +44,7 @@ StandardControls::started ()
        _play_button->SetValue (true);
 }
 
+
 void
 StandardControls::stopped ()
 {
@@ -47,12 +52,14 @@ StandardControls::stopped ()
        _play_button->SetValue (false);
 }
 
+
 void
 StandardControls::play_clicked ()
 {
        check_play_state ();
 }
 
+
 void
 StandardControls::check_play_state ()
 {
@@ -67,6 +74,7 @@ StandardControls::check_play_state ()
        }
 }
 
+
 void
 StandardControls::setup_sensitivity ()
 {
@@ -75,6 +83,7 @@ StandardControls::setup_sensitivity ()
        _play_button->Enable (_film && !_film->content().empty() && !active_job);
 }
 
+
 void
 StandardControls::play ()
 {
@@ -82,6 +91,7 @@ StandardControls::play ()
        play_clicked ();
 }
 
+
 void
 StandardControls::stop ()
 {
index eac47726b2660436eeb660c9d27b6a30e9b7ec3f..191924509b1a09aac1d45e23ebcd4403deb30a7d 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2018-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "controls.h"
 
+
 class StandardControls : public Controls
 {
 public:
index 6cd78326a3f8ed5c3ab9cf4d38764276262b2b2b..88128874cf2f4d0fedc8b4f6a39a3402b129a1e6 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2020-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "suspender.h"
 
+
 Suspender::Suspender(boost::function<void (int)> handler)
        : _handler (handler)
        , _count (0)
@@ -27,29 +29,34 @@ Suspender::Suspender(boost::function<void (int)> handler)
 
 }
 
+
 Suspender::Block::Block (Suspender* s)
        : _suspender (s)
 {
        _suspender->increment ();
 }
 
+
 Suspender::Block::~Block ()
 {
        _suspender->decrement ();
 }
 
+
 Suspender::Block
 Suspender::block ()
 {
        return Block (this);
 }
 
+
 void
 Suspender::increment ()
 {
        ++_count;
 }
 
+
 void
 Suspender::decrement ()
 {
@@ -62,6 +69,7 @@ Suspender::decrement ()
        }
 }
 
+
 bool
 Suspender::check (int property)
 {
index 3538951a8551fe3a5c939dbea1e885fe43cf3e86..947d7a367fd6d13732702b5db09c8a5249368156 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2020-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include <boost/function.hpp>
 #include <set>
 
+
 class Suspender
 {
 public:
index e8f9b8a2b22516160f3400222b762fe601f6d62f..259989d4761e945d74106f550f0ae04c47b62b4e 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2016-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -18,6 +18,7 @@
 
 */
 
+
 #include "templates_dialog.h"
 #include "wx_util.h"
 #include "rename_template_dialog.h"
 #include "lib/config.h"
 #include <wx/wx.h>
 
+
 using std::string;
 using boost::bind;
 #if BOOST_VERSION >= 106100
 using namespace boost::placeholders;
 #endif
 
+
 TemplatesDialog::TemplatesDialog (wxWindow* parent)
        : wxDialog (parent, wxID_ANY, _("Templates"))
 {
        _sizer = new wxBoxSizer (wxVERTICAL);
        SetSizer (_sizer);
 
-       wxSizer* hs = new wxBoxSizer (wxHORIZONTAL);
+       auto hs = new wxBoxSizer (wxHORIZONTAL);
        _list = new wxListCtrl (this, wxID_ANY, wxDefaultPosition, wxSize (200, 100), wxLC_REPORT | wxLC_SINGLE_SEL);
 
        wxListItem ip;
@@ -49,7 +52,7 @@ TemplatesDialog::TemplatesDialog (wxWindow* parent)
        hs->Add (_list, 1, wxEXPAND, DCPOMATIC_SIZER_GAP);
 
        {
-               wxSizer* s = new wxBoxSizer (wxVERTICAL);
+               auto s = new wxBoxSizer (wxVERTICAL);
                _rename = new Button (this, _("Rename..."));
                s->Add (_rename, 0, wxTOP | wxBOTTOM, 2);
                _remove = new Button (this, _("Remove"));
@@ -59,23 +62,24 @@ TemplatesDialog::TemplatesDialog (wxWindow* parent)
 
        _sizer->Add (hs, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
 
-       wxSizer* buttons = CreateSeparatedButtonSizer (wxCLOSE);
+       auto buttons = CreateSeparatedButtonSizer (wxCLOSE);
        if (buttons) {
                _sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
        }
 
-       _rename->Bind (wxEVT_BUTTON, bind (&TemplatesDialog::rename_clicked, this));
-       _remove->Bind (wxEVT_BUTTON, bind (&TemplatesDialog::remove_clicked, this));
+       _rename->Bind (wxEVT_BUTTON, bind(&TemplatesDialog::rename_clicked, this));
+       _remove->Bind (wxEVT_BUTTON, bind(&TemplatesDialog::remove_clicked, this));
 
-       _list->Bind (wxEVT_LIST_ITEM_SELECTED, bind (&TemplatesDialog::selection_changed, this));
-       _list->Bind (wxEVT_LIST_ITEM_DESELECTED, bind (&TemplatesDialog::selection_changed, this));
-       _list->Bind (wxEVT_SIZE, bind (&TemplatesDialog::resized, this, _1));
-       _config_connection = Config::instance()->Changed.connect (bind (&TemplatesDialog::refresh, this));
+       _list->Bind (wxEVT_LIST_ITEM_SELECTED, bind(&TemplatesDialog::selection_changed, this));
+       _list->Bind (wxEVT_LIST_ITEM_DESELECTED, bind(&TemplatesDialog::selection_changed, this));
+       _list->Bind (wxEVT_SIZE, bind(&TemplatesDialog::resized, this, _1));
+       _config_connection = Config::instance()->Changed.connect (bind(&TemplatesDialog::refresh, this));
 
        refresh ();
        selection_changed ();
 }
 
+
 void
 TemplatesDialog::refresh ()
 {
@@ -90,12 +94,14 @@ TemplatesDialog::refresh ()
        }
 }
 
+
 void
 TemplatesDialog::layout ()
 {
        _sizer->Layout ();
 }
 
+
 void
 TemplatesDialog::selection_changed ()
 {
@@ -104,6 +110,7 @@ TemplatesDialog::selection_changed ()
        _remove->Enable (i >= 0);
 }
 
+
 void
 TemplatesDialog::rename_clicked ()
 {
@@ -118,7 +125,7 @@ TemplatesDialog::rename_clicked ()
        li.m_mask = wxLIST_MASK_TEXT;
        _list->GetItem (li);
 
-       RenameTemplateDialog* d = new RenameTemplateDialog (this);
+       auto d = new RenameTemplateDialog (this);
        d->set (li.m_text);
        if (d->ShowModal() == wxID_OK) {
                if (!d->get().IsEmpty()) {
@@ -131,6 +138,7 @@ TemplatesDialog::rename_clicked ()
        d->Destroy ();
 }
 
+
 void
 TemplatesDialog::remove_clicked ()
 {
@@ -145,12 +153,13 @@ TemplatesDialog::remove_clicked ()
        li.m_mask = wxLIST_MASK_TEXT;
        _list->GetItem (li);
 
-       Config::instance()->delete_template (wx_to_std (li.m_text));
+       Config::instance()->delete_template (wx_to_std(li.m_text));
        _list->DeleteItem (i);
 
        selection_changed ();
 }
 
+
 void
 TemplatesDialog::resized (wxSizeEvent& ev)
 {
index 4a55e0beb5dbb4c1512efb12486bc752997efcb3..119eb42cf0d38fd400f534d3f78f8de26d68adc6 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2016-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -18,6 +18,7 @@
 
 */
 
+
 #include "lib/warnings.h"
 DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
@@ -25,6 +26,7 @@ DCPOMATIC_DISABLE_WARNINGS
 DCPOMATIC_ENABLE_WARNINGS
 #include <boost/signals2.hpp>
 
+
 class TemplatesDialog : public wxDialog
 {
 public:
index f982921edf0d0b5c8bfc9a071cd183e17ac22d8c..ec0f06ec170cd2d374aa5b72f282388633bdd4b4 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2016-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "timeline_atmos_content_view.h"
 
+
 using std::shared_ptr;
 
+
 /** @class TimelineAtmosContentView
  *  @brief Timeline view for AtmosContent.
  */
@@ -32,12 +35,14 @@ TimelineAtmosContentView::TimelineAtmosContentView (Timeline& tl, shared_ptr<Con
 
 }
 
+
 wxColour
 TimelineAtmosContentView::background_colour () const
 {
        return wxColour (149, 121, 232, 255);
 }
 
+
 wxColour
 TimelineAtmosContentView::foreground_colour () const
 {
index 05f4352ebf1b52fe63ada6094f3115ae6cc9bff1..15da14edc8be424aee2e436764d3634cc4342fcf 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2016-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "timeline_content_view.h"
 
+
 /** @class TimelineAtmosContentView
  *  @brief Timeline view for AtmosContent.
  */
@@ -29,9 +31,10 @@ public:
        TimelineAtmosContentView (Timeline& tl, std::shared_ptr<Content> c);
 
 private:
-       bool active () const {
+       bool active () const override {
                return true;
        }
-       wxColour background_colour () const;
-       wxColour foreground_colour () const;
+
+       wxColour background_colour () const override;
+       wxColour foreground_colour () const override;
 };
index d5a966ad5633ca442f166f1cff0aff89ca9c2033..5b8d6cdc22e46b8202c997945f3eb08287bd7c1e 100644 (file)
 
 */
 
+
 #include "timeline_content_view.h"
 
+
 /** @class TimelineAudioContentView
  *  @brief Timeline view for AudioContent.
  */
@@ -29,10 +31,10 @@ public:
        TimelineAudioContentView (Timeline& tl, std::shared_ptr<Content> c);
 
 private:
-       bool active () const {
+       bool active () const override {
                return true;
        }
-       wxColour background_colour () const;
-       wxColour foreground_colour () const;
-       wxString label () const;
+       wxColour background_colour () const override;
+       wxColour foreground_colour () const override;
+       wxString label () const override;
 };
index e9b29485473b7eb64349c4548e4f0b5fa423e1cc..7087e9641b62cd7073792cfa97441ff89b0fabd8 100644 (file)
 
 */
 
+
 #ifndef DCPOMATIC_TIMELINE_CONTENT_VIEW_H
 #define DCPOMATIC_TIMELINE_CONTENT_VIEW_H
 
+
 #include "lib/change_signaller.h"
 #include "lib/types.h"
 #include "lib/warnings.h"
@@ -32,6 +34,7 @@ DCPOMATIC_ENABLE_WARNINGS
 
 class Content;
 
+
 /** @class TimelineContentView
  *  @brief Parent class for views of pieces of content.
  */
@@ -40,7 +43,7 @@ class TimelineContentView : public TimelineView
 public:
        TimelineContentView (Timeline& tl, std::shared_ptr<Content> c);
 
-       dcpomatic::Rect<int> bbox () const;
+       dcpomatic::Rect<int> bbox () const override;
 
        void set_selected (bool s);
        bool selected () const;
@@ -60,7 +63,7 @@ protected:
 
 private:
 
-       void do_paint (wxGraphicsContext* gc, std::list<dcpomatic::Rect<int> > overlaps);
+       void do_paint (wxGraphicsContext* gc, std::list<dcpomatic::Rect<int>> overlaps) override;
        int y_pos (int t) const;
        void content_change (ChangeType type, int p);
 
@@ -70,6 +73,8 @@ private:
        boost::signals2::scoped_connection _content_connection;
 };
 
-typedef std::vector<std::shared_ptr<TimelineContentView> > TimelineContentViewList;
+
+typedef std::vector<std::shared_ptr<TimelineContentView>> TimelineContentViewList;
+
 
 #endif
index 5be006b60a6ee6039e97e4ae835832391c6a4e9d..975f7cd9d6c375802c1b684296e2ff8138fcd21e 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2019 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
+#include "content_panel.h"
 #include "film_editor.h"
 #include "timeline_dialog.h"
 #include "wx_util.h"
-#include "content_panel.h"
-#include "lib/playlist.h"
-#include "lib/cross.h"
 #include "lib/compose.hpp"
+#include "lib/cross.h"
+#include "lib/playlist.h"
 #include <wx/graphics.h>
 #include <iostream>
 #include <list>
 
+
 using std::list;
 using std::cout;
 using std::string;
@@ -38,6 +40,7 @@ using std::weak_ptr;
 using namespace boost::placeholders;
 #endif
 
+
 TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr<Film> film, weak_ptr<FilmViewer> viewer)
        : wxDialog (
                cp->window(),
@@ -81,7 +84,7 @@ TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr<Film> film, weak_pt
        sizer->Add (&_timeline, 1, wxEXPAND | wxALL, 12);
 
 #ifdef DCPOMATIC_LINUX
-       wxSizer* buttons = CreateSeparatedButtonSizer (wxCLOSE);
+       auto buttons = CreateSeparatedButtonSizer (wxCLOSE);
        if (buttons) {
                sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
        }
@@ -97,6 +100,7 @@ TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr<Film> film, weak_pt
        _film_changed_connection = film->Change.connect (bind (&TimelineDialog::film_change, this, _1, _2));
 }
 
+
 void
 TimelineDialog::film_change (ChangeType type, Film::Property p)
 {
@@ -114,23 +118,25 @@ TimelineDialog::film_change (ChangeType type, Film::Property p)
        }
 }
 
+
 void
 TimelineDialog::set_selection (ContentList selection)
 {
        _timeline.set_selection (selection);
 }
 
+
 void
 TimelineDialog::tool_clicked (wxCommandEvent& ev)
 {
-       Timeline::Tool t = (Timeline::Tool) ev.GetId();
+       Timeline::Tool t = static_cast<Timeline::Tool>(ev.GetId());
        _timeline.tool_clicked (t);
        if (t == Timeline::SNAP) {
-               _timeline.set_snap (_toolbar->GetToolState ((int) t));
+               _timeline.set_snap (_toolbar->GetToolState(static_cast<int>(t)));
        } else if (t == Timeline::SEQUENCE) {
                auto film = _film.lock ();
                if (film) {
-                       film->set_sequence (_toolbar->GetToolState ((int) t));
+                       film->set_sequence (_toolbar->GetToolState(static_cast<int>(t)));
                }
        }
 }
index 97ddca964aff23df74efaf65c50635ed1bc739a4..17128e108b1d2640112b06ae26a8f557d49677ba 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2019 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include <wx/wx.h>
 #include "timeline.h"
 
+
 class Playlist;
 
+
 class TimelineDialog : public wxDialog
 {
 public:
index 2ff1fa6a8daf6c2e7a1638a4da1f648868e37e59..fb80b1bf3311ec9533fdd6e280620750516c188d 100644 (file)
@@ -30,7 +30,7 @@ class TimelineLabelsView : public TimelineView
 public:
        explicit TimelineLabelsView (Timeline& tl);
 
-       dcpomatic::Rect<int> bbox () const;
+       dcpomatic::Rect<int> bbox () const override;
 
        void set_video_tracks (int n);
        void set_audio_tracks (int n);
@@ -38,7 +38,7 @@ public:
        void set_atmos (bool s);
 
 private:
-       void do_paint (wxGraphicsContext* gc, std::list<dcpomatic::Rect<int>> overlaps);
+       void do_paint (wxGraphicsContext* gc, std::list<dcpomatic::Rect<int>> overlaps) override;
 
        int _width = 0;
        int _video_tracks = 0;
index a6c73100f40c1b52f2936d61ce77c219479834b1..357fe2ce47f80daa69ad3c6892f15f5796f8a9f0 100644 (file)
@@ -27,11 +27,11 @@ class TimelineReelsView : public TimelineView
 public:
        TimelineReelsView (Timeline& tl, int y);
 
-       dcpomatic::Rect<int> bbox () const;
+       dcpomatic::Rect<int> bbox () const override;
        void set_y (int y);
 
 private:
-       void do_paint (wxGraphicsContext* gc, std::list<dcpomatic::Rect<int>> overlaps);
+       void do_paint (wxGraphicsContext* gc, std::list<dcpomatic::Rect<int>> overlaps) override;
 
        int _y;
 };
index 2269a29301ffb1c8c1cbca37070674f7272ebe4c..fa8ddf54c736ceebeb099eddefdb68079850fa7b 100644 (file)
 
 */
 
+
 #include "timeline_content_view.h"
 
+
 /** @class TimelineVideoContentView
  *  @brief Timeline view for VideoContent.
  */
@@ -29,7 +31,7 @@ public:
        TimelineVideoContentView (Timeline& tl, std::shared_ptr<Content> c);
 
 private:
-       bool active () const;
-       wxColour background_colour () const;
-       wxColour foreground_colour () const;
+       bool active () const override;
+       wxColour background_colour () const override;
+       wxColour foreground_colour () const override;
 };
index c40cf78ff2b1469743d22b8756ad10bee9cab079..f3aa4d5e65ad9983e2490398318eff4762c085d4 100644 (file)
@@ -43,13 +43,13 @@ public:
        TimelineView (TimelineView const&) = delete;
        TimelineView& operator= (TimelineView const&) = delete;
 
-       void paint (wxGraphicsContext* g, std::list<dcpomatic::Rect<int> > overlaps);
+       void paint (wxGraphicsContext* g, std::list<dcpomatic::Rect<int>> overlaps);
        void force_redraw ();
 
        virtual dcpomatic::Rect<int> bbox () const = 0;
 
 protected:
-       virtual void do_paint (wxGraphicsContext *, std::list<dcpomatic::Rect<int> > overlaps) = 0;
+       virtual void do_paint (wxGraphicsContext *, std::list<dcpomatic::Rect<int>> overlaps) = 0;
 
        int time_x (dcpomatic::DCPTime t) const;
 
index 44d9709191e87007ae7895fc838a852f67ba49b6..ffa4af535b7271966db5d38c5616052e48b33196 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2020-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "try_unmount_dialog.h"
 #include "wx_util.h"
 #include "static_text.h"
 #include <wx/wx.h>
 
+
 TryUnmountDialog::TryUnmountDialog (wxWindow* parent, wxString description)
        : wxDialog (parent, wxID_ANY, _("DCP-o-matic Disk Writer"))
 {
-       wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
-       wxStaticText* text = new StaticText (this, wxEmptyString);
+       auto sizer = new wxBoxSizer (wxVERTICAL);
+       auto text = new StaticText (this, wxEmptyString);
        sizer->Add (text, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
 
        text->SetLabelMarkup (
                wxString::Format(_("The drive <b>%s</b> is mounted.\n\nIt must be unmounted before DCP-o-matic can write to it.\n\nShould DCP-o-matic try to unmount it now?"), description)
                );
 
-       wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
+       auto buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
        if (buttons) {
                sizer->Add(buttons, wxSizerFlags().Expand().DoubleBorder());
        }
index de686f14ca68317697eca4ff72c13e88d7b2de40..cb01a2afbb8eb307f69bce875065c4faf0efbd52 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2020-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "lib/warnings.h"
 DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
 DCPOMATIC_ENABLE_WARNINGS
 
+
 class TryUnmountDialog : public wxDialog
 {
 public:
index 7293af69071abfc2761793ee7cf71b52eb96c674..2e45f3493b69e1e0af0f29f95dfb2c9dbe538c40 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2015-2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2015-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
-#include "video_waveform_plot.h"
+
 #include "film_viewer.h"
+#include "video_waveform_plot.h"
 #include "wx_util.h"
-#include "lib/image.h"
-#include "lib/film.h"
 #include "lib/dcp_video.h"
+#include "lib/film.h"
+#include "lib/image.h"
 #include "lib/player_video.h"
 #include <dcp/locale_convert.h>
 #include <dcp/openjpeg_image.h>
 #include <boost/bind/bind.hpp>
 #include <iostream>
 
+
 using std::cout;
-using std::min;
+using std::make_shared;
 using std::max;
+using std::min;
+using std::shared_ptr;
 using std::string;
 using std::weak_ptr;
-using std::shared_ptr;
 #if BOOST_VERSION >= 106100
 using namespace boost::placeholders;
 #endif
@@ -52,28 +55,25 @@ int const VideoWaveformPlot::_x_axis_width = 52;
 VideoWaveformPlot::VideoWaveformPlot (wxWindow* parent, weak_ptr<const Film> film, weak_ptr<FilmViewer> viewer)
        : wxPanel (parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE)
        , _film (film)
-       , _dirty (true)
-       , _enabled (false)
-       , _component (0)
-       , _contrast (0)
 {
 #ifndef __WXOSX__
        SetDoubleBuffered (true);
 #endif
 
-       shared_ptr<FilmViewer> fv = viewer.lock ();
+       auto fv = viewer.lock ();
        DCPOMATIC_ASSERT (fv);
 
-       _viewer_connection = fv->ImageChanged.connect (boost::bind (&VideoWaveformPlot::set_image, this, _1));
+       _viewer_connection = fv->ImageChanged.connect (boost::bind(&VideoWaveformPlot::set_image, this, _1));
 
-       Bind (wxEVT_PAINT, boost::bind (&VideoWaveformPlot::paint, this));
-       Bind (wxEVT_SIZE,  boost::bind (&VideoWaveformPlot::sized, this, _1));
-       Bind (wxEVT_MOTION, boost::bind (&VideoWaveformPlot::mouse_moved, this, _1));
+       Bind (wxEVT_PAINT, boost::bind(&VideoWaveformPlot::paint, this));
+       Bind (wxEVT_SIZE,  boost::bind(&VideoWaveformPlot::sized, this, _1));
+       Bind (wxEVT_MOTION, boost::bind(&VideoWaveformPlot::mouse_moved, this, _1));
 
        SetMinSize (wxSize (640, 512));
        SetBackgroundColour (wxColour (0, 0, 0));
 }
 
+
 void
 VideoWaveformPlot::paint ()
 {
@@ -88,7 +88,7 @@ VideoWaveformPlot::paint ()
                return;
        }
 
-       wxGraphicsContext* gc = wxGraphicsContext::Create (dc);
+       auto gc = wxGraphicsContext::Create (dc);
        if (!gc) {
                return;
        }
@@ -119,7 +119,7 @@ VideoWaveformPlot::paint ()
        }
 
        for (int i = 0; i < label_gaps + 1; ++i) {
-               wxGraphicsPath p = gc->CreatePath ();
+               auto p = gc->CreatePath ();
                int const y = _vertical_margin + height - (i * height / label_gaps) - 1;
                p.MoveToPoint (label_width + 8, y);
                p.AddLineToPoint (_x_axis_width - 4, y);
@@ -133,7 +133,7 @@ VideoWaveformPlot::paint ()
                } else if (n < 1000) {
                        x += extra[2];
                }
-               gc->DrawText (std_to_wx (locale_convert<string> (n)), x, y - (label_height / 2));
+               gc->DrawText (std_to_wx(locale_convert<string>(n)), x, y - (label_height / 2));
        }
 
        wxImage waveform (_waveform->size().width, height, _waveform->data()[0], true);
@@ -143,6 +143,7 @@ VideoWaveformPlot::paint ()
        delete gc;
 }
 
+
 void
 VideoWaveformPlot::create_waveform ()
 {
@@ -152,9 +153,9 @@ VideoWaveformPlot::create_waveform ()
                return;
        }
 
-       dcp::Size const image_size = _image->size();
+       auto const image_size = _image->size();
        int const waveform_height = GetSize().GetHeight() - _vertical_margin * 2;
-       _waveform.reset (new Image (AV_PIX_FMT_RGB24, dcp::Size (image_size.width, waveform_height), true));
+       _waveform = make_shared<Image>(AV_PIX_FMT_RGB24, dcp::Size (image_size.width, waveform_height), true);
 
        for (int x = 0; x < image_size.width; ++x) {
 
@@ -185,11 +186,6 @@ VideoWaveformPlot::create_waveform ()
                );
 }
 
-static void
-note ()
-{
-
-}
 
 void
 VideoWaveformPlot::set_image (shared_ptr<PlayerVideo> image)
@@ -201,23 +197,26 @@ VideoWaveformPlot::set_image (shared_ptr<PlayerVideo> image)
        /* We must copy the PlayerVideo here as we will call ::image() on it, potentially
           with a different pixel_format than was used when ::prepare() was called.
        */
-       _image = DCPVideo::convert_to_xyz (image->shallow_copy(), boost::bind(&note));
+       _image = DCPVideo::convert_to_xyz (image->shallow_copy(), [](dcp::NoteType, string) {});
        _dirty = true;
        Refresh ();
 }
 
+
 void
 VideoWaveformPlot::sized (wxSizeEvent &)
 {
        _dirty = true;
 }
 
+
 void
 VideoWaveformPlot::set_enabled (bool e)
 {
        _enabled = e;
 }
 
+
 void
 VideoWaveformPlot::set_component (int c)
 {
@@ -226,6 +225,7 @@ VideoWaveformPlot::set_component (int c)
        Refresh ();
 }
 
+
 /** Set `contrast', i.e. a fudge multiplication factor to make low-level signals easier to see,
  *  between 0 and 256.
  */
@@ -237,6 +237,7 @@ VideoWaveformPlot::set_contrast (int b)
        Refresh ();
 }
 
+
 void
 VideoWaveformPlot::mouse_moved (wxMouseEvent& ev)
 {
@@ -249,18 +250,18 @@ VideoWaveformPlot::mouse_moved (wxMouseEvent& ev)
                _dirty = false;
        }
 
-       shared_ptr<const Film> film = _film.lock ();
+       auto film = _film.lock ();
        if (!film) {
                return;
        }
 
-       dcp::Size const full = film->frame_size ();
+       auto const full = film->frame_size ();
 
-       double const xs = static_cast<double> (full.width) / _waveform->size().width;
+       auto const xs = static_cast<double> (full.width) / _waveform->size().width;
        int const x1 = max (0, min (full.width - 1, int (floor (ev.GetPosition().x - _x_axis_width - 0.5) * xs)));
        int const x2 = max (0, min (full.width - 1, int (floor (ev.GetPosition().x - _x_axis_width + 0.5) * xs)));
 
-       double const ys = static_cast<double> (_pixel_values) / _waveform->size().height;
+       auto const ys = static_cast<double> (_pixel_values) / _waveform->size().height;
        int const fy = _waveform->size().height - (ev.GetPosition().y - _vertical_margin);
        int const y1 = max (0, min (_pixel_values - 1, int (floor (fy - 0.5) * ys)));
        int const y2 = max (0, min (_pixel_values - 1, int (floor (fy + 0.5) * ys)));
index 037ff0cbf42e77069df101402743826e354b3465..36ec63d8a55bbe6b9d10052e7ec3630dd84c267e 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2015-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "lib/warnings.h"
 DCPOMATIC_DISABLE_WARNINGS
 #include <wx/wx.h>
 DCPOMATIC_ENABLE_WARNINGS
 #include <boost/signals2.hpp>
 
+
 namespace dcp {
        class OpenJPEGImage;
 }
@@ -33,6 +35,7 @@ class Image;
 class Film;
 class FilmViewer;
 
+
 class VideoWaveformPlot : public wxPanel
 {
 public:
@@ -59,10 +62,10 @@ private:
        std::weak_ptr<const Film> _film;
        std::shared_ptr<dcp::OpenJPEGImage> _image;
        std::shared_ptr<const Image> _waveform;
-       bool _dirty;
-       bool _enabled;
-       int _component;
-       int _contrast;
+       bool _dirty = true;
+       bool _enabled = false;
+       int _component = 0;
+       int _contrast = 0;
 
        static int const _vertical_margin;
        static int const _pixel_values;
index 8ef32fca37858e6c3265c37cdb8634e1f28d04c7..1a34e5fa808bc992d1bd14bb55368848f0080862 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -105,6 +105,7 @@ add_label_to_sizer (wxSizer* s, wxWindow* p, wxString t, bool left, int prop, in
        return m;
 }
 
+
 wxStaticText *
 #ifdef __WXOSX__
 add_label_to_sizer (wxSizer* s, wxStaticText* t, bool left, int prop, int flags)
@@ -119,6 +120,7 @@ add_label_to_sizer (wxSizer* s, wxStaticText* t, bool, int prop, int flags)
        return t;
 }
 
+
 wxStaticText *
 add_label_to_sizer (wxGridBagSizer* s, wxWindow* p, wxString t, bool left, wxGBPosition pos, wxGBSpan span)
 {
@@ -131,6 +133,7 @@ add_label_to_sizer (wxGridBagSizer* s, wxWindow* p, wxString t, bool left, wxGBP
        return m;
 }
 
+
 wxStaticText *
 #ifdef __WXOSX__
 add_label_to_sizer (wxGridBagSizer* s, wxStaticText* t, bool left, wxGBPosition pos, wxGBSpan span)
@@ -146,6 +149,7 @@ add_label_to_sizer (wxGridBagSizer* s, wxStaticText* t, bool, wxGBPosition pos,
        return t;
 }
 
+
 /** Pop up an error dialogue box.
  *  @param parent Parent.
  *  @param m Message.
@@ -164,6 +168,7 @@ error_dialog (wxWindow* parent, wxString m, optional<wxString> e)
        d->Destroy ();
 }
 
+
 /** Pop up an error dialogue box.
  *  @param parent Parent.
  *  @param m Message.
@@ -176,11 +181,12 @@ message_dialog (wxWindow* parent, wxString m)
        d->Destroy ();
 }
 
+
 /** @return true if the user answered "yes" */
 bool
 confirm_dialog (wxWindow* parent, wxString m)
 {
-       wxMessageDialog* d = new wxMessageDialog (parent, m, _("DCP-o-matic"), wxYES_NO | wxICON_QUESTION);
+       auto d = new wxMessageDialog (parent, m, _("DCP-o-matic"), wxYES_NO | wxICON_QUESTION);
        int const r = d->ShowModal ();
        d->Destroy ();
        return r == wxID_YES;
@@ -193,9 +199,10 @@ confirm_dialog (wxWindow* parent, wxString m)
 string
 wx_to_std (wxString s)
 {
-       return string (s.ToUTF8 ());
+       return string (s.ToUTF8());
 }
 
+
 /** @param s STL string.
  *  @return Corresponding wxWidgets string.
  */
@@ -205,12 +212,14 @@ std_to_wx (string s)
        return wxString (s.c_str(), wxConvUTF8);
 }
 
+
 string
 string_client_data (wxClientData* o)
 {
        return wx_to_std (dynamic_cast<wxStringClientData*>(o)->GetData());
 }
 
+
 void
 checked_set (FilePickerCtrl* widget, boost::filesystem::path value)
 {
@@ -225,6 +234,7 @@ checked_set (FilePickerCtrl* widget, boost::filesystem::path value)
        }
 }
 
+
 void
 checked_set (wxDirPickerCtrl* widget, boost::filesystem::path value)
 {
@@ -239,6 +249,7 @@ checked_set (wxDirPickerCtrl* widget, boost::filesystem::path value)
        }
 }
 
+
 void
 checked_set (wxSpinCtrl* widget, int value)
 {
@@ -247,6 +258,7 @@ checked_set (wxSpinCtrl* widget, int value)
        }
 }
 
+
 void
 checked_set (wxSpinCtrlDouble* widget, double value)
 {
@@ -256,6 +268,7 @@ checked_set (wxSpinCtrlDouble* widget, double value)
        }
 }
 
+
 void
 checked_set (wxChoice* widget, int value)
 {
@@ -264,6 +277,7 @@ checked_set (wxChoice* widget, int value)
        }
 }
 
+
 void
 checked_set (wxChoice* widget, string value)
 {
@@ -281,15 +295,16 @@ checked_set (wxChoice* widget, string value)
        }
 }
 
+
 void
 checked_set (wxChoice* widget, vector<pair<string, string> > items)
 {
-       vector<pair<string, string> > current;
+       vector<pair<string, string>> current;
        for (unsigned int i = 0; i < widget->GetCount(); ++i) {
                current.push_back (
-                       make_pair (
-                               wx_to_std (widget->GetString (i)),
-                               string_client_data (widget->GetClientObject (i))
+                       make_pair(
+                               wx_to_std(widget->GetString(i)),
+                               string_client_data(widget->GetClientObject(i))
                                )
                        );
        }
@@ -304,6 +319,7 @@ checked_set (wxChoice* widget, vector<pair<string, string> > items)
        }
 }
 
+
 void
 checked_set (wxTextCtrl* widget, string value)
 {
@@ -312,6 +328,7 @@ checked_set (wxTextCtrl* widget, string value)
        }
 }
 
+
 void
 checked_set (PasswordEntry* entry, string value)
 {
@@ -320,6 +337,7 @@ checked_set (PasswordEntry* entry, string value)
        }
 }
 
+
 void
 checked_set (wxTextCtrl* widget, wxString value)
 {
@@ -328,6 +346,7 @@ checked_set (wxTextCtrl* widget, wxString value)
        }
 }
 
+
 void
 checked_set (wxStaticText* widget, string value)
 {
@@ -336,6 +355,7 @@ checked_set (wxStaticText* widget, string value)
        }
 }
 
+
 void
 checked_set (wxStaticText* widget, wxString value)
 {
@@ -344,6 +364,7 @@ checked_set (wxStaticText* widget, wxString value)
        }
 }
 
+
 void
 checked_set (wxCheckBox* widget, bool value)
 {
@@ -352,6 +373,7 @@ checked_set (wxCheckBox* widget, bool value)
        }
 }
 
+
 void
 checked_set (wxRadioButton* widget, bool value)
 {
@@ -360,6 +382,7 @@ checked_set (wxRadioButton* widget, bool value)
        }
 }
 
+
 void
 dcpomatic_setup_i18n ()
 {
@@ -408,24 +431,28 @@ dcpomatic_setup_i18n ()
        }
 }
 
+
 int
 wx_get (wxSpinCtrl* w)
 {
        return w->GetValue ();
 }
 
+
 int
 wx_get (wxChoice* w)
 {
        return w->GetSelection ();
 }
 
+
 double
 wx_get (wxSpinCtrlDouble* w)
 {
        return w->GetValue ();
 }
 
+
 /** @param s String of the form Context|String
  *  @return translation, or String if no translation is available.
  */
@@ -444,6 +471,7 @@ context_translation (wxString s)
        return t;
 }
 
+
 wxString
 time_to_timecode (DCPTime t, double fps)
 {
@@ -458,23 +486,24 @@ time_to_timecode (DCPTime t, double fps)
        return wxString::Format (wxT("%02d:%02d:%02d.%02d"), h, m, s, f);
 }
 
+
 void
 setup_audio_channels_choice (wxChoice* choice, int minimum)
 {
-       vector<pair<string, string> > items;
+       vector<pair<string, string>> items;
        for (int i = minimum; i <= 16; i += 2) {
                if (i == 2) {
-                       items.push_back (make_pair (wx_to_std (_("2 - stereo")), locale_convert<string> (i)));
+                       items.push_back (make_pair(wx_to_std(_("2 - stereo")), locale_convert<string>(i)));
                } else if (i == 4) {
-                       items.push_back (make_pair (wx_to_std (_("4 - L/C/R/Lfe")), locale_convert<string> (i)));
+                       items.push_back (make_pair(wx_to_std(_("4 - L/C/R/Lfe")), locale_convert<string>(i)));
                } else if (i == 6) {
-                       items.push_back (make_pair (wx_to_std (_("6 - 5.1")), locale_convert<string> (i)));
+                       items.push_back (make_pair(wx_to_std(_("6 - 5.1")), locale_convert<string>(i)));
                } else if (i == 8) {
-                       items.push_back (make_pair (wx_to_std (_("8 - 5.1/HI/VI")), locale_convert<string> (i)));
+                       items.push_back (make_pair(wx_to_std(_("8 - 5.1/HI/VI")), locale_convert<string>(i)));
                } else if (i == 12) {
-                       items.push_back (make_pair (wx_to_std (_("12 - 7.1/HI/VI")), locale_convert<string> (i)));
+                       items.push_back (make_pair(wx_to_std(_("12 - 7.1/HI/VI")), locale_convert<string>(i)));
                } else {
-                       items.push_back (make_pair (locale_convert<string> (i), locale_convert<string> (i)));
+                       items.push_back (make_pair(locale_convert<string> (i), locale_convert<string>(i)));
                }
        }
 
@@ -512,6 +541,7 @@ maybe_show_splash ()
        return splash;
 }
 
+
 double
 calculate_mark_interval (double mark_interval)
 {
@@ -616,7 +646,7 @@ bitmap_path (string name)
        base = resources_path();
 #endif
 
-       boost::filesystem::path p = base / String::compose("%1.png", name);
+       auto p = base / String::compose("%1.png", name);
        return std_to_wx (p.string());
 }
 
index 4131ec0f795034e633e41ec44d12bd936c196a60..97ddd51516420012ebfde3c82852ab8a25c0c0a9 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 /** @file src/wx/wx_util.h
  *  @brief Some utility functions and classes.
  */
 
+
 #ifndef DCPOMATIC_WX_UTIL_H
 #define DCPOMATIC_WX_UTIL_H
 
+
 #include "lib/dcpomatic_time.h"
 #include "lib/warnings.h"
 DCPOMATIC_DISABLE_WARNINGS
@@ -35,6 +38,7 @@ DCPOMATIC_ENABLE_WARNINGS
 #include <boost/thread.hpp>
 #include <boost/signals2.hpp>
 
+
 class FilePickerCtrl;
 class wxDirPickerCtrl;
 class wxSpinCtrl;
@@ -43,6 +47,7 @@ class wxGridBagSizer;
 class wxSplashScreen;
 class PasswordEntry;
 
+
 #define DCPOMATIC_SIZER_X_GAP 8
 #define DCPOMATIC_SIZER_Y_GAP 8
 #define DCPOMATIC_SIZER_GAP 8
@@ -65,12 +70,14 @@ class PasswordEntry;
 #define DCPOMATIC_RTAUDIO_API RtAudio::MACOSX_CORE
 #endif
 
+
 /** i18n macro to support strings like Context|String
  *  so that `String' can be translated to different things
  *  in different contexts.
  */
 #define S_(x) context_translation(x)
 
+
 extern void error_dialog (wxWindow *, wxString, boost::optional<wxString> e = boost::optional<wxString>());
 extern void message_dialog (wxWindow *, wxString);
 extern bool confirm_dialog (wxWindow *, wxString);
@@ -93,6 +100,7 @@ extern bool report_errors_from_last_job (wxWindow* parent);
 extern wxString bitmap_path (std::string name);
 extern wxSize small_button_size (wxWindow* parent, wxString text);
 
+
 struct Offset
 {
        Offset (wxString n, int h, int m)
@@ -132,4 +140,5 @@ extern double wx_get (wxSpinCtrlDouble* widget);
 #define DCPOMATIC_USE_OWN_PICKER
 #endif
 
+
 #endif
index f3ce0bfcc2b2e8ab03cdb3140bea39f55487d63c..4db576cfc0d1db1f4c2aa464b2144b492242ab5c 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -18,6 +18,7 @@
 
 */
 
+
 /** @defgroup completedcp Complete builds of DCPs */
 
 /** @file  test/4k_test.cc
@@ -27,6 +28,7 @@
  *  The output is checked against test/data/4k_test.
  */
 
+
 #include <boost/test/unit_test.hpp>
 #include "lib/film.h"
 #include "lib/ffmpeg_content.h"
 #include "lib/dcpomatic_log.h"
 #include "test.h"
 
+
 using std::shared_ptr;
 using std::make_shared;
 
+
 BOOST_AUTO_TEST_CASE (fourk_test)
 {
        auto film = new_test_film ("4k_test");
@@ -58,8 +62,8 @@ BOOST_AUTO_TEST_CASE (fourk_test)
                        dcp::VerificationNote::Code::MISSING_FFEC_IN_FEATURE
                });
 
-       boost::filesystem::path p (test_film_dir ("4k_test"));
+       boost::filesystem::path p (test_film_dir("4k_test"));
        p /= film->dcp_name ();
 
-       check_dcp ("test/data/4k_test", p.string ());
+       check_dcp ("test/data/4k_test", p.string());
 }
index 9da2867462c81cd66da4c424265a94cfa81466a5..e131ce57c9cf331650302488f95d0dcce0adc183 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -18,6 +18,7 @@
 
 */
 
+
 /** @defgroup selfcontained Self-contained tests of single classes / method sets */
 
 /** @file  test/audio_analysis_test.cc
  *  @ingroup selfcontained
  */
 
-#include <boost/test/unit_test.hpp>
-#include "lib/audio_analysis.h"
+
+#include "test.h"
 #include "lib/analyse_audio_job.h"
-#include "lib/film.h"
-#include "lib/ffmpeg_content.h"
+#include "lib/audio_analysis.h"
+#include "lib/audio_content.h"
+#include "lib/content_factory.h"
 #include "lib/dcp_content_type.h"
 #include "lib/ffmpeg_content.h"
-#include "lib/ratio.h"
+#include "lib/ffmpeg_content.h"
+#include "lib/film.h"
 #include "lib/job_manager.h"
-#include "lib/audio_content.h"
-#include "lib/content_factory.h"
 #include "lib/playlist.h"
-#include "test.h"
+#include "lib/ratio.h"
+#include <boost/test/unit_test.hpp>
 #include <iostream>
 
-using std::vector;
+
+using std::make_shared;
 using std::shared_ptr;
+using std::vector;
 using namespace dcpomatic;
 
-static float
-random_float ()
-{
-       return (float (rand ()) / RAND_MAX) * 2 - 1;
-}
 
 BOOST_AUTO_TEST_CASE (audio_analysis_serialisation_test)
 {
        int const channels = 3;
        int const points = 4096;
 
+       auto random_float = []() {
+               return (float (rand ()) / RAND_MAX) * 2 - 1;
+       };
+
        AudioAnalysis a (3);
        for (int i = 0; i < channels; ++i) {
                for (int j = 0; j < points; ++j) {
@@ -67,7 +70,7 @@ BOOST_AUTO_TEST_CASE (audio_analysis_serialisation_test)
 
        vector<AudioAnalysis::PeakTime> peak;
        for (int i = 0; i < channels; ++i) {
-               peak.push_back (AudioAnalysis::PeakTime (random_float(), DCPTime (rand())));
+               peak.push_back (AudioAnalysis::PeakTime(random_float(), DCPTime(rand())));
        }
        a.set_sample_peak (peak);
 
@@ -96,58 +99,52 @@ BOOST_AUTO_TEST_CASE (audio_analysis_serialisation_test)
        BOOST_CHECK_EQUAL (a.sample_rate(), 48000);
 }
 
-static void
-finished ()
-{
-
-}
 
 BOOST_AUTO_TEST_CASE (audio_analysis_test)
 {
-       shared_ptr<Film> film = new_test_film ("audio_analysis_test");
-       film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
-       film->set_container (Ratio::from_id ("185"));
+       auto film = new_test_film ("audio_analysis_test");
+       film->set_dcp_content_type (DCPContentType::from_isdcf_name("FTR"));
+       film->set_container (Ratio::from_id("185"));
        film->set_name ("audio_analysis_test");
        boost::filesystem::path p = TestPaths::private_data() / "betty_L.wav";
 
-       shared_ptr<FFmpegContent> c (new FFmpegContent(p));
+       auto c = make_shared<FFmpegContent>(p);
        film->examine_and_add_content (c);
        BOOST_REQUIRE (!wait_for_jobs());
 
-       shared_ptr<AnalyseAudioJob> job (new AnalyseAudioJob (film, film->playlist(), false));
-       job->Finished.connect (boost::bind (&finished));
+       auto job = make_shared<AnalyseAudioJob>(film, film->playlist(), false);
        JobManager::instance()->add (job);
        BOOST_REQUIRE (!wait_for_jobs());
 }
 
+
 /** Check that audio analysis works (i.e. runs without error) with a -ve delay */
 BOOST_AUTO_TEST_CASE (audio_analysis_negative_delay_test)
 {
-       shared_ptr<Film> film = new_test_film ("audio_analysis_negative_delay_test");
+       auto film = new_test_film ("audio_analysis_negative_delay_test");
        film->set_name ("audio_analysis_negative_delay_test");
-       shared_ptr<FFmpegContent> c (new FFmpegContent(TestPaths::private_data() / "boon_telly.mkv"));
+       auto c = make_shared<FFmpegContent>(TestPaths::private_data() / "boon_telly.mkv");
        film->examine_and_add_content (c);
        BOOST_REQUIRE (!wait_for_jobs());
 
        c->audio->set_delay (-250);
 
-       shared_ptr<AnalyseAudioJob> job (new AnalyseAudioJob (film, film->playlist(), false));
-       job->Finished.connect (boost::bind (&finished));
+       auto job = make_shared<AnalyseAudioJob>(film, film->playlist(), false);
        JobManager::instance()->add (job);
        BOOST_REQUIRE (!wait_for_jobs());
 }
 
+
 /** Check audio analysis that is incorrect in 2e98263 */
 BOOST_AUTO_TEST_CASE (audio_analysis_test2)
 {
-       shared_ptr<Film> film = new_test_film ("audio_analysis_test2");
+       auto film = new_test_film ("audio_analysis_test2");
        film->set_name ("audio_analysis_test2");
-       shared_ptr<FFmpegContent> c (new FFmpegContent(TestPaths::private_data() / "3d_thx_broadway_2010_lossless.m2ts"));
+       auto c = make_shared<FFmpegContent>(TestPaths::private_data() / "3d_thx_broadway_2010_lossless.m2ts");
        film->examine_and_add_content (c);
        BOOST_REQUIRE (!wait_for_jobs());
 
-       shared_ptr<AnalyseAudioJob> job (new AnalyseAudioJob (film, film->playlist(), false));
-       job->Finished.connect (boost::bind (&finished));
+       auto job = make_shared<AnalyseAudioJob>(film, film->playlist(), false);
        JobManager::instance()->add (job);
        BOOST_REQUIRE (!wait_for_jobs());
 }
@@ -161,57 +158,60 @@ analysis_finished ()
        done = true;
 }
 
+
 /* Test a case which was reported to throw an exception; analysing
  * a 12-channel DCP's audio.
  */
 BOOST_AUTO_TEST_CASE (audio_analysis_test3)
 {
-       shared_ptr<Film> film = new_test_film ("analyse_audio_test");
+       auto film = new_test_film ("analyse_audio_test");
        film->set_container (Ratio::from_id ("185"));
-       film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
+       film->set_dcp_content_type (DCPContentType::from_isdcf_name("TLR"));
        film->set_name ("frobozz");
 
-       shared_ptr<FFmpegContent> content (new FFmpegContent("test/data/white.wav"));
+       auto content = make_shared<FFmpegContent>("test/data/white.wav");
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
 
        film->set_audio_channels (12);
        boost::signals2::connection connection;
-       JobManager::instance()->analyse_audio (film, film->playlist(), false, connection, boost::bind (&analysis_finished));
+       JobManager::instance()->analyse_audio(film, film->playlist(), false, connection, boost::bind(&analysis_finished));
        BOOST_REQUIRE (!wait_for_jobs());
        BOOST_CHECK (done);
 }
 
+
 /** Run an audio analysis that triggered an exception in the audio decoder at one point */
 BOOST_AUTO_TEST_CASE (analyse_audio_test4)
 {
-       shared_ptr<Film> film = new_test_film ("analyse_audio_test");
+       auto film = new_test_film ("analyse_audio_test");
        film->set_container (Ratio::from_id ("185"));
-       film->set_dcp_content_type (DCPContentType::from_isdcf_name ("TLR"));
+       film->set_dcp_content_type (DCPContentType::from_isdcf_name("TLR"));
        film->set_name ("frobozz");
-       shared_ptr<Content> content = content_factory(TestPaths::private_data() / "20 The Wedding Convoy Song.m4a").front();
+       auto content = content_factory(TestPaths::private_data() / "20 The Wedding Convoy Song.m4a").front();
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
 
-       shared_ptr<Playlist> playlist (new Playlist);
+       auto playlist = make_shared<Playlist>();
        playlist->add (film, content);
        boost::signals2::connection c;
-       JobManager::instance()->analyse_audio (film, playlist, false, c, boost::bind (&finished));
+       JobManager::instance()->analyse_audio(film, playlist, false, c, []() {});
        BOOST_CHECK (!wait_for_jobs ());
 }
 
+
 BOOST_AUTO_TEST_CASE (analyse_audio_leqm_test)
 {
-       shared_ptr<Film> film = new_test_film2 ("analyse_audio_leqm_test");
+       auto film = new_test_film2 ("analyse_audio_leqm_test");
        film->set_audio_channels (2);
-       shared_ptr<Content> content = content_factory(TestPaths::private_data() / "betty_stereo_48k.wav").front();
+       auto content = content_factory(TestPaths::private_data() / "betty_stereo_48k.wav").front();
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
 
-       shared_ptr<Playlist> playlist (new Playlist);
+       auto playlist = make_shared<Playlist>();
        playlist->add (film, content);
        boost::signals2::connection c;
-       JobManager::instance()->analyse_audio (film, playlist, false, c, boost::bind (&finished));
+       JobManager::instance()->analyse_audio(film, playlist, false, c, []() {});
        BOOST_CHECK (!wait_for_jobs());
 
        AudioAnalysis analysis(film->audio_analysis_path(playlist));
index 13b0989108424e7735c61fb96ea6443f89794c76..d4fc550f16e7e5ae9aef244fb5b48bf03dd0dfc6 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 /** @file  test/audio_filter_test.cc
  *  @brief Test AudioFilter, LowPassAudioFilter, HighPassAudioFilter classes.
  *  @ingroup selfcontained
  */
 
+
 #include <boost/test/unit_test.hpp>
 #include "lib/audio_filter.h"
 #include "lib/audio_buffers.h"
 
+
+using std::make_shared;
 using std::shared_ptr;
 
+
 static void
 audio_filter_impulse_test_one (AudioFilter& f, int block_size, int num_blocks)
 {
@@ -36,12 +41,12 @@ audio_filter_impulse_test_one (AudioFilter& f, int block_size, int num_blocks)
 
        for (int i = 0; i < num_blocks; ++i) {
 
-               shared_ptr<AudioBuffers> in (new AudioBuffers (1, block_size));
+               auto in = make_shared<AudioBuffers>(1, block_size);
                for (int j = 0; j < block_size; ++j) {
                        in->data()[0][j] = c + j;
                }
 
-               shared_ptr<AudioBuffers> out = f.run (in);
+               auto out = f.run (in);
 
                for (int j = 0; j < out->frames(); ++j) {
                        BOOST_CHECK_EQUAL (out->data()[0][j], c + j);
@@ -51,6 +56,7 @@ audio_filter_impulse_test_one (AudioFilter& f, int block_size, int num_blocks)
        }
 }
 
+
 /** Create a filter with an impulse as a kernel and check that it
  *  passes data through unaltered.
  */
@@ -70,6 +76,7 @@ BOOST_AUTO_TEST_CASE (audio_filter_impulse_kernel_test)
        audio_filter_impulse_test_one (f, 2048, 1);
 }
 
+
 /** Create filters and pass them impulses as input and check that
  *  the filter kernels comes back.
  */
@@ -77,11 +84,11 @@ BOOST_AUTO_TEST_CASE (audio_filter_impulse_input_test)
 {
        LowPassAudioFilter lpf (0.02, 0.3);
 
-       shared_ptr<AudioBuffers> in (new AudioBuffers (1, 1751));
+       auto in = make_shared<AudioBuffers>(1, 1751);
        in->make_silent ();
        in->data(0)[0] = 1;
 
-       shared_ptr<AudioBuffers> out = lpf.run (in);
+       auto out = lpf.run (in);
        for (int j = 0; j < out->frames(); ++j) {
                if (j <= lpf._M) {
                        BOOST_CHECK_EQUAL (out->data(0)[j], lpf._ir[j]);
@@ -92,7 +99,7 @@ BOOST_AUTO_TEST_CASE (audio_filter_impulse_input_test)
 
        HighPassAudioFilter hpf (0.02, 0.3);
 
-       in.reset (new AudioBuffers (1, 9133));
+       in = make_shared<AudioBuffers>(1, 9133);
        in->make_silent ();
        in->data(0)[0] = 1;
 
index 6fd644a7ea8dc18aefd0153f4e3dc36e935777da..47a1cc8adfb344112ca01c8c22456ebbc2034599 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2015-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 /** @file  test/audio_processor_delay_test.cc
  *  @brief Test the AudioDelay class.
  *  @ingroup selfcontained
  */
 
-#include "lib/audio_delay.h"
+
 #include "lib/audio_buffers.h"
+#include "lib/audio_delay.h"
 #include <boost/test/unit_test.hpp>
 #include <cmath>
 #include <iostream>
 
+
 using std::cerr;
 using std::cout;
+using std::make_shared;
 using std::shared_ptr;
 
+
 #define CHECK_SAMPLE(c,f,r) \
        if (fabs(out->data(c)[f] - (r)) > 0.1) {                        \
                cerr << "Sample " << f << " at line " << __LINE__ << " is " << out->data(c)[f] << " not " << r << "; difference is " << fabs(out->data(c)[f] - (r)) << "\n"; \
                BOOST_REQUIRE (fabs(out->data(c)[f] - (r)) <= 0.1);     \
        }
 
+
 /** Block size greater than delay */
 BOOST_AUTO_TEST_CASE (audio_processor_delay_test1)
 {
@@ -46,14 +52,14 @@ BOOST_AUTO_TEST_CASE (audio_processor_delay_test1)
 
        int const C = 2;
 
-       shared_ptr<AudioBuffers> in (new AudioBuffers (C, 256));
+       auto in = make_shared<AudioBuffers>(C, 256);
        for (int i = 0; i < C; ++i) {
                for (int j = 0; j < 256; ++j) {
                        in->data(i)[j] = j;
                }
        }
 
-       shared_ptr<AudioBuffers> out = delay.run (in);
+       auto out = delay.run (in);
        BOOST_REQUIRE_EQUAL (out->frames(), in->frames());
 
        /* Silence at the start */
@@ -86,6 +92,7 @@ BOOST_AUTO_TEST_CASE (audio_processor_delay_test1)
        }
 }
 
+
 /** Block size less than delay */
 BOOST_AUTO_TEST_CASE (audio_processor_delay_test2)
 {
@@ -96,14 +103,14 @@ BOOST_AUTO_TEST_CASE (audio_processor_delay_test2)
        /* Feeding 4 blocks of 64 should give silence each time */
 
        for (int i = 0; i < 4; ++i) {
-               shared_ptr<AudioBuffers> in (new AudioBuffers (C, 64));
+               auto in = make_shared<AudioBuffers>(C, 64);
                for (int j = 0; j < C; ++j) {
                        for (int k = 0; k < 64; ++k) {
                                in->data(j)[k] = k + i * 64;
                        }
                }
 
-               shared_ptr<AudioBuffers> out = delay.run (in);
+               auto out = delay.run (in);
                BOOST_REQUIRE_EQUAL (out->frames(), in->frames());
 
                /* Check for silence */
@@ -117,9 +124,9 @@ BOOST_AUTO_TEST_CASE (audio_processor_delay_test2)
        /* Now feed 4 blocks of silence and we should see the data */
        for (int i = 0; i < 4; ++i) {
                /* Feed some silence */
-               shared_ptr<AudioBuffers> in (new AudioBuffers (C, 64));
+               auto in = make_shared<AudioBuffers>(C, 64);
                in->make_silent ();
-               shared_ptr<AudioBuffers> out = delay.run (in);
+               auto out = delay.run (in);
 
                /* Should now see the delayed data */
                for (int j = 0; j < C; ++j) {
index 016767e1c321099bf729ea7ac33733567947b13c..dbd7a287edd1308e9047b66d9b3047bba562a81c 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2017 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2017-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -18,6 +18,7 @@
 
 */
 
+
 #include "lib/butler.h"
 #include "lib/film.h"
 #include "lib/dcp_content_type.h"
 #include "test.h"
 #include <boost/test/unit_test.hpp>
 
+
+using std::make_shared;
 using std::shared_ptr;
 #if BOOST_VERSION >= 106100
 using namespace boost::placeholders;
 #endif
 using namespace dcpomatic;
 
+
 BOOST_AUTO_TEST_CASE (butler_test1)
 {
-       shared_ptr<Film> film = new_test_film ("butler_test1");
-       film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
+       auto film = new_test_film ("butler_test1");
+       film->set_dcp_content_type (DCPContentType::from_isdcf_name("FTR"));
        film->set_name ("butler_test1");
        film->set_container (Ratio::from_id ("185"));
 
-       shared_ptr<Content> video = content_factory("test/data/flat_red.png").front ();
+       auto video = content_factory("test/data/flat_red.png").front();
        film->examine_and_add_content (video);
-       shared_ptr<Content> audio = content_factory("test/data/staircase.wav").front ();
+       auto audio = content_factory("test/data/staircase.wav").front();
        film->examine_and_add_content (audio);
        BOOST_REQUIRE (!wait_for_jobs ());
 
        film->set_audio_channels (6);
 
        /* This is the map of the player output (5.1) to the butler output (also 5.1) */
-       AudioMapping map = AudioMapping (6, 6);
+       auto map = AudioMapping (6, 6);
        for (int i = 0; i < 6; ++i) {
                map.set (i, i, 1);
        }
 
-       Butler butler (film, shared_ptr<Player>(new Player(film)), map, 6, bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, false, false);
+       Butler butler (film, make_shared<Player>(film), map, 6, bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, false, false);
 
        BOOST_CHECK (butler.get_video(true, 0).second == DCPTime());
        BOOST_CHECK (butler.get_video(true, 0).second == DCPTime::from_frames(1, 24));
@@ -63,7 +67,7 @@ BOOST_AUTO_TEST_CASE (butler_test1)
        /* XXX: check the frame contents */
 
        float buffer[256 * 6];
-       BOOST_REQUIRE (butler.get_audio (buffer, 256) == DCPTime());
+       BOOST_REQUIRE (butler.get_audio(buffer, 256) == DCPTime());
        for (int i = 0; i < 256; ++i) {
                BOOST_REQUIRE_EQUAL (buffer[i * 6 + 0], 0);
                BOOST_REQUIRE_EQUAL (buffer[i * 6 + 1], 0);
index 3dceb31b0623a400c0cccde9b82c690d055e619c..f518f938358ebd39881f77c9e8263eac5d9834a5 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -18,6 +18,7 @@
 
 */
 
+
 /** @file  test/client_server_test.cc
  *  @brief Test the server class.
  *  @ingroup feature
  *  encoded data to check that they are the same.
  */
 
-#include "lib/encode_server.h"
-#include "lib/image.h"
+
 #include "lib/cross.h"
 #include "lib/dcp_video.h"
-#include "lib/player_video.h"
-#include "lib/raw_image_proxy.h"
-#include "lib/j2k_image_proxy.h"
+#include "lib/dcpomatic_log.h"
+#include "lib/encode_server.h"
 #include "lib/encode_server_description.h"
 #include "lib/file_log.h"
-#include "lib/dcpomatic_log.h"
+#include "lib/image.h"
+#include "lib/j2k_image_proxy.h"
+#include "lib/player_video.h"
+#include "lib/raw_image_proxy.h"
 #include "test.h"
 #include <boost/test/unit_test.hpp>
 #include <boost/thread.hpp>
 
+
 using std::list;
+using std::make_shared;
 using std::shared_ptr;
 using std::weak_ptr;
-using std::make_shared;
 using boost::thread;
 using boost::optional;
 using dcp::ArrayData;
 
+
 void
 do_remote_encode (shared_ptr<DCPVideo> frame, EncodeServerDescription description, ArrayData locally_encoded)
 {
@@ -59,6 +63,7 @@ do_remote_encode (shared_ptr<DCPVideo> frame, EncodeServerDescription descriptio
        BOOST_CHECK_EQUAL (memcmp (locally_encoded.data(), remotely_encoded.data(), locally_encoded.size()), 0);
 }
 
+
 BOOST_AUTO_TEST_CASE (client_server_test_rgb)
 {
        auto image = make_shared<Image>(AV_PIX_FMT_RGB24, dcp::Size (1998, 1080), true);
@@ -145,6 +150,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_rgb)
        delete server;
 }
 
+
 BOOST_AUTO_TEST_CASE (client_server_test_yuv)
 {
        auto image = make_shared<Image>(AV_PIX_FMT_YUV420P, dcp::Size (1998, 1080), true);
@@ -227,6 +233,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_yuv)
        delete server;
 }
 
+
 BOOST_AUTO_TEST_CASE (client_server_test_j2k)
 {
        auto image = make_shared<Image>(AV_PIX_FMT_YUV420P, dcp::Size (1998, 1080), true);
index 67c00cf41c80bb786082c4f8997d7dc5f9c2f9a6..d78b9357b86dc8943fcb5021255392c813fa09ed 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2018-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "lib/config.h"
 #include "test.h"
 #include <boost/test/unit_test.hpp>
 #include <fstream>
 
+
 using std::ofstream;
 
+
 static void
 rewrite_bad_config ()
 {
index 26c6748b8bd453bc8a2f472d267469c58d3be03b..53451b352360b2d3ec386b97822d9bf214ccbe16 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2018-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 #include "lib/crypto.h"
 #include "lib/exceptions.h"
 #include "test.h"
 #include <openssl/rand.h>
 #include <boost/test/unit_test.hpp>
 
+
 using std::string;
 using std::list;
 
+
 BOOST_AUTO_TEST_CASE (crypto_test)
 {
        dcp::ArrayData key (dcpomatic::crypto_key_length());
@@ -34,7 +37,7 @@ BOOST_AUTO_TEST_CASE (crypto_test)
 
        RAND_bytes (key.data(), dcpomatic::crypto_key_length());
 
-       dcp::ArrayData ciphertext = dcpomatic::encrypt ("Can you see any fish?", key, iv);
+       auto ciphertext = dcpomatic::encrypt ("Can you see any fish?", key, iv);
        BOOST_REQUIRE_EQUAL (dcpomatic::decrypt (ciphertext, key, iv), "Can you see any fish?");
 
        key.data()[5]++;
index 37c8f42d56cec9d3474f4965d9372c65ec8b0c19..1146c2e1b9e096345afa2802e78e08ae1cb18901 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2020-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
index 8a42bd6b8d3e840f73be13dd809d0af59edebd85..b186954b3790916098cc0b5a2d88bf6fc444ce67 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2017-2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2017-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 /** @file  test/empty_test.cc
  *  @brief Test the creation of Empty objects.
  *  @ingroup feature
  */
 
-#include "lib/film.h"
+
 #include "lib/dcp_content_type.h"
-#include "lib/ratio.h"
-#include "lib/video_content.h"
-#include "lib/image_content.h"
+#include "lib/decoder.h"
 #include "lib/empty.h"
+#include "lib/film.h"
+#include "lib/image_content.h"
 #include "lib/player.h"
-#include "lib/decoder.h"
+#include "lib/ratio.h"
+#include "lib/video_content.h"
 #include "test.h"
 #include <boost/test/unit_test.hpp>
 
+
 using std::list;
 using std::make_shared;
 using std::shared_ptr;
@@ -42,18 +45,20 @@ using namespace boost::placeholders;
 #endif
 using namespace dcpomatic;
 
+
 bool
 has_video (shared_ptr<const Content> content)
 {
         return static_cast<bool>(content->video);
 }
 
+
 BOOST_AUTO_TEST_CASE (empty_test1)
 {
-       shared_ptr<Film> film = new_test_film2 ("empty_test1");
+       auto film = new_test_film2 ("empty_test1");
        film->set_sequence (false);
-       shared_ptr<ImageContent> contentA (new ImageContent("test/data/simple_testcard_640x480.png"));
-       shared_ptr<ImageContent> contentB (new ImageContent("test/data/simple_testcard_640x480.png"));
+       auto contentA = make_shared<ImageContent>("test/data/simple_testcard_640x480.png");
+       auto contentB = make_shared<ImageContent>("test/data/simple_testcard_640x480.png");
 
        film->examine_and_add_content (contentA);
        film->examine_and_add_content (contentB);
@@ -65,13 +70,13 @@ BOOST_AUTO_TEST_CASE (empty_test1)
         *     A A A     B
         */
        contentA->video->set_length (3);
-       contentA->set_position (film, DCPTime::from_frames (2, vfr));
+       contentA->set_position (film, DCPTime::from_frames(2, vfr));
        contentB->video->set_length (1);
-       contentB->set_position (film, DCPTime::from_frames (7, vfr));
+       contentB->set_position (film, DCPTime::from_frames(7, vfr));
 
        Empty black (film, film->playlist(), bind(&has_video, _1), film->playlist()->length(film));
        BOOST_REQUIRE_EQUAL (black._periods.size(), 2U);
-       list<dcpomatic::DCPTimePeriod>::const_iterator i = black._periods.begin();
+       auto i = black._periods.begin();
        BOOST_CHECK (i->from == DCPTime::from_frames(0, vfr));
        BOOST_CHECK (i->to ==   DCPTime::from_frames(2, vfr));
        ++i;
@@ -79,13 +84,14 @@ BOOST_AUTO_TEST_CASE (empty_test1)
        BOOST_CHECK (i->to ==   DCPTime::from_frames(7, vfr));
 }
 
+
 /** Some tests where the first empty period is not at time 0 */
 BOOST_AUTO_TEST_CASE (empty_test2)
 {
-       shared_ptr<Film> film = new_test_film2 ("empty_test2");
+       auto film = new_test_film2 ("empty_test2");
        film->set_sequence (false);
-       shared_ptr<ImageContent> contentA (new ImageContent("test/data/simple_testcard_640x480.png"));
-       shared_ptr<ImageContent> contentB (new ImageContent("test/data/simple_testcard_640x480.png"));
+       auto contentA = make_shared<ImageContent>("test/data/simple_testcard_640x480.png");
+       auto contentB = make_shared<ImageContent>("test/data/simple_testcard_640x480.png");
 
        film->examine_and_add_content (contentA);
        film->examine_and_add_content (contentB);
@@ -117,13 +123,14 @@ BOOST_AUTO_TEST_CASE (empty_test2)
        BOOST_CHECK (black.done ());
 }
 
+
 /** Test for when the film's playlist is not the same as the one passed into Empty */
 BOOST_AUTO_TEST_CASE (empty_test3)
 {
-       shared_ptr<Film> film = new_test_film2 ("empty_test3");
+       auto film = new_test_film2 ("empty_test3");
        film->set_sequence (false);
-       shared_ptr<ImageContent> contentA (new ImageContent("test/data/simple_testcard_640x480.png"));
-       shared_ptr<ImageContent> contentB (new ImageContent("test/data/simple_testcard_640x480.png"));
+       auto contentA = make_shared<ImageContent>("test/data/simple_testcard_640x480.png");
+       auto contentB = make_shared<ImageContent>("test/data/simple_testcard_640x480.png");
 
        film->examine_and_add_content (contentA);
        film->examine_and_add_content (contentB);
@@ -139,7 +146,7 @@ BOOST_AUTO_TEST_CASE (empty_test3)
        contentB->video->set_length (1);
        contentB->set_position (film, DCPTime::from_frames(7, vfr));
 
-       shared_ptr<Playlist> playlist (new Playlist);
+       auto playlist = make_shared<Playlist>();
        playlist->add (film, contentB);
        Empty black (film, playlist, bind(&has_video, _1), playlist->length(film));
        BOOST_REQUIRE_EQUAL (black._periods.size(), 1U);
@@ -150,6 +157,7 @@ BOOST_AUTO_TEST_CASE (empty_test3)
        BOOST_CHECK (black.position() == DCPTime::from_frames(0, vfr));
 }
 
+
 BOOST_AUTO_TEST_CASE (empty_test_with_overlapping_content)
 {
        auto film = new_test_film2 ("empty_test_with_overlapping_content");
index f81ebda9cfdfc9bc5991691bd5312259177d8be2..b2069a8b16b522bd5163a45ebe16d30782997b8d 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 /** @file  test/ffmpeg_decoder_sequential_test.cc
  *  @brief Check that the FFmpeg decoder and Player produce sequential frames without gaps or dropped frames;
  *  Also that the decoder picks up frame rates correctly.
  *  @ingroup feature
  */
 
+
 #include "lib/ffmpeg_content.h"
 #include "lib/ffmpeg_decoder.h"
 #include "lib/content_video.h"
 #include <boost/test/unit_test.hpp>
 #include <iostream>
 
-using std::cout;
+
 using std::cerr;
+using std::cout;
 using std::list;
+using std::make_shared;
 using std::shared_ptr;
 using boost::optional;
 using boost::bind;
@@ -47,9 +51,11 @@ using namespace boost::placeholders;
 #endif
 using namespace dcpomatic;
 
+
 static DCPTime next;
 static DCPTime frame;
 
+
 static void
 check (shared_ptr<PlayerVideo>, DCPTime time)
 {
@@ -57,18 +63,19 @@ check (shared_ptr<PlayerVideo>, DCPTime time)
        next += frame;
 }
 
+
 void
 ffmpeg_decoder_sequential_test_one (boost::filesystem::path file, float fps, int video_length)
 {
-       boost::filesystem::path path = TestPaths::private_data() / file;
+       auto path = TestPaths::private_data() / file;
        BOOST_REQUIRE (boost::filesystem::exists (path));
 
-       shared_ptr<Film> film = new_test_film ("ffmpeg_decoder_sequential_test_" + file.string());
-       shared_ptr<FFmpegContent> content (new FFmpegContent(path));
+       auto film = new_test_film ("ffmpeg_decoder_sequential_test_" + file.string());
+       auto content = make_shared<FFmpegContent>(path);
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
        film->write_metadata ();
-       shared_ptr<Player> player (new Player(film));
+       auto player = make_shared<Player>(film);
 
        BOOST_REQUIRE (content->video_frame_rate());
        BOOST_CHECK_CLOSE (content->video_frame_rate().get(), fps, 0.01);
@@ -81,6 +88,7 @@ ffmpeg_decoder_sequential_test_one (boost::filesystem::path file, float fps, int
        BOOST_REQUIRE (next == DCPTime::from_frames (video_length, film->video_frame_rate()));
 }
 
+
 BOOST_AUTO_TEST_CASE (ffmpeg_decoder_sequential_test)
 {
        ffmpeg_decoder_sequential_test_one ("boon_telly.mkv", 29.97, 6912);
index 134881c0d0238082704b9fc426baa3d039632bcb..4aa4c1d9aadf387e2874d7a4e71d86591743398f 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 /** @file  test/ffmpeg_pts_offset_test.cc
  *  @brief Check the computation of _pts_offset in FFmpegDecoder.
  *  @ingroup selfcontained
  */
 
+
 #include <boost/test/unit_test.hpp>
 #include "lib/film.h"
 #include "lib/ffmpeg_decoder.h"
 #include "lib/audio_content.h"
 #include "test.h"
 
+
+using std::make_shared;
 using std::shared_ptr;
 using namespace dcpomatic;
 
+
 BOOST_AUTO_TEST_CASE (ffmpeg_pts_offset_test)
 {
-       shared_ptr<Film> film = new_test_film ("ffmpeg_pts_offset_test");
-       shared_ptr<FFmpegContent> content (new FFmpegContent ("test/data/test.mp4"));
+       auto film = new_test_film ("ffmpeg_pts_offset_test");
+       auto content = make_shared<FFmpegContent>("test/data/test.mp4");
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
 
-       content->audio.reset (new AudioContent (content.get()));
+       content->audio = make_shared<AudioContent>(content.get());
        content->audio->add_stream (shared_ptr<FFmpegAudioStream> (new FFmpegAudioStream));
        content->_video_frame_rate = 24;
 
index cf39c112e5ceabeff448b01ffef35226b95c08e1..a41bf84b369703f47a1d70897508268253c58869 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2014-2019 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
index c834ec12e4cdbcc1755cafc66384a60c0de8b75f..7fb240843b884a9ebfa324cb464485cc5db3994d 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 /** @file  test/job_test.cc
  *  @brief Test Job and JobManager.
  *  @ingroup selfcontained
  */
 
-#include <boost/test/unit_test.hpp>
+
+#include "lib/cross.h"
 #include "lib/job.h"
 #include "lib/job_manager.h"
-#include "lib/cross.h"
+#include <boost/test/unit_test.hpp>
 
-using std::string;
+
+using std::make_shared;
 using std::shared_ptr;
+using std::string;
+
 
 class TestJob : public Job
 {
@@ -71,12 +76,13 @@ public:
        }
 };
 
+
 BOOST_AUTO_TEST_CASE (job_manager_test)
 {
        shared_ptr<Film> film;
 
        /* Single job */
-       shared_ptr<TestJob> a (new TestJob (film));
+       auto a = make_shared<TestJob>(film);
 
        JobManager::instance()->add (a);
        dcpomatic_sleep_seconds (1);
index 70f4cad82a2d7212c61c7e4a6dbf8508f38b6219..844f25660a34d82d4c7aea3330632f90fa197ec1 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2020-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
index 952cc0af91039cce392b11f130cb64ce453aee61..f59c594e9705f07ab1c405ad2bfd4b10118bcd3b 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -18,6 +18,7 @@
 
 */
 
+
 /** @file  src/pixel_formats_test.cc
  *  @brief Make sure that Image::sample_size() and Image::bytes_per_pixel() return the right
  *  things for various pixel formats.
@@ -25,6 +26,7 @@
  *  @see test/image_test.cc
  */
 
+
 #include <boost/test/unit_test.hpp>
 #include <list>
 extern "C" {
@@ -34,9 +36,11 @@ extern "C" {
 #include "lib/image.h"
 #include <iostream>
 
+
 using std::list;
 using std::cout;
 
+
 /** @struct Case
  *  @brief  A test case for pixel_formats_test.
  */
@@ -63,33 +67,34 @@ struct Case
 
 BOOST_AUTO_TEST_CASE (pixel_formats_test)
 {
-       list<Case> cases;
-       cases.push_back(Case(AV_PIX_FMT_RGB24,       1, 480, 480, 480, 3, 0,   0  ));
-       cases.push_back(Case(AV_PIX_FMT_RGBA,        1, 480, 480, 480, 4, 0,   0  ));
-       cases.push_back(Case(AV_PIX_FMT_YUV420P,     3, 480, 240, 240, 1, 0.5, 0.5));
-       cases.push_back(Case(AV_PIX_FMT_YUV422P,     3, 480, 480, 480, 1, 0.5, 0.5));
-       cases.push_back(Case(AV_PIX_FMT_YUV422P10LE, 3, 480, 480, 480, 2, 1,   1  ));
-       cases.push_back(Case(AV_PIX_FMT_YUV422P16LE, 3, 480, 480, 480, 2, 1,   1  ));
-       cases.push_back(Case(AV_PIX_FMT_UYVY422,     1, 480, 480, 480, 2, 0,   0  ));
-       cases.push_back(Case(AV_PIX_FMT_YUV444P,     3, 480, 480, 480, 1, 1,   1  ));
-       cases.push_back(Case(AV_PIX_FMT_YUV444P9BE,  3, 480, 480, 480, 2, 2,   2  ));
-       cases.push_back(Case(AV_PIX_FMT_YUV444P9LE,  3, 480, 480, 480, 2, 2,   2  ));
-       cases.push_back(Case(AV_PIX_FMT_YUV444P10BE, 3, 480, 480, 480, 2, 2,   2  ));
-       cases.push_back(Case(AV_PIX_FMT_YUV444P10LE, 3, 480, 480, 480, 2, 2,   2  ));
-
-       for (list<Case>::iterator i = cases.begin(); i != cases.end(); ++i) {
-               AVFrame* f = av_frame_alloc ();
+       list<Case> cases = {
+               { AV_PIX_FMT_RGB24,       1, 480, 480, 480, 3, 0,   0  },
+               { AV_PIX_FMT_RGBA,        1, 480, 480, 480, 4, 0,   0  },
+               { AV_PIX_FMT_YUV420P,     3, 480, 240, 240, 1, 0.5, 0.5},
+               { AV_PIX_FMT_YUV422P,     3, 480, 480, 480, 1, 0.5, 0.5},
+               { AV_PIX_FMT_YUV422P10LE, 3, 480, 480, 480, 2, 1,   1  },
+               { AV_PIX_FMT_YUV422P16LE, 3, 480, 480, 480, 2, 1,   1  },
+               { AV_PIX_FMT_UYVY422,     1, 480, 480, 480, 2, 0,   0  },
+               { AV_PIX_FMT_YUV444P,     3, 480, 480, 480, 1, 1,   1  },
+               { AV_PIX_FMT_YUV444P9BE,  3, 480, 480, 480, 2, 2,   2  },
+               { AV_PIX_FMT_YUV444P9LE,  3, 480, 480, 480, 2, 2,   2  },
+               { AV_PIX_FMT_YUV444P10BE, 3, 480, 480, 480, 2, 2,   2  },
+               { AV_PIX_FMT_YUV444P10LE, 3, 480, 480, 480, 2, 2,   2  }
+       };
+
+       for (auto const& i: cases) {
+               auto f = av_frame_alloc ();
                f->width = 640;
                f->height = 480;
-               f->format = static_cast<int> (i->format);
+               f->format = static_cast<int> (i.format);
                av_frame_get_buffer (f, true);
                Image t (f);
-               BOOST_CHECK_EQUAL(t.planes(), i->planes);
-               BOOST_CHECK_EQUAL(t.sample_size(0).height, i->lines[0]);
-               BOOST_CHECK_EQUAL(t.sample_size(1).height, i->lines[1]);
-               BOOST_CHECK_EQUAL(t.sample_size(2).height, i->lines[2]);
-               BOOST_CHECK_EQUAL(t.bytes_per_pixel(0), i->bpp[0]);
-               BOOST_CHECK_EQUAL(t.bytes_per_pixel(1), i->bpp[1]);
-               BOOST_CHECK_EQUAL(t.bytes_per_pixel(2), i->bpp[2]);
+               BOOST_CHECK_EQUAL(t.planes(), i.planes);
+               BOOST_CHECK_EQUAL(t.sample_size(0).height, i.lines[0]);
+               BOOST_CHECK_EQUAL(t.sample_size(1).height, i.lines[1]);
+               BOOST_CHECK_EQUAL(t.sample_size(2).height, i.lines[2]);
+               BOOST_CHECK_EQUAL(t.bytes_per_pixel(0), i.bpp[0]);
+               BOOST_CHECK_EQUAL(t.bytes_per_pixel(1), i.bpp[1]);
+               BOOST_CHECK_EQUAL(t.bytes_per_pixel(2), i.bpp[2]);
        }
 }
index f603b1230833232fa3a27b1b60002207b12de434..24df333166f2ee8b1378f89ba1a7ad12760ca729 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2016-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 /** @file  test/rect_test.cc
  *  @brief Test dcpomatic::Rect class.
  *  @ingroup selfcontained
  */
 
+
 #include "lib/rect.h"
 #include <boost/test/unit_test.hpp>
 #include <iostream>
 
+
 using boost::optional;
 
+
 BOOST_AUTO_TEST_CASE (rect_test1)
 {
        dcpomatic::Rect<int> a (0, 0, 100, 100);
        dcpomatic::Rect<int> b (200, 200, 100, 100);
-       optional<dcpomatic::Rect<int> > c = a.intersection (b);
+       auto c = a.intersection (b);
        BOOST_CHECK (!c);
 }
 
+
 BOOST_AUTO_TEST_CASE (rect_test2)
 {
        dcpomatic::Rect<int> a (0, 330, 100, 85);
-       a.extend (dcpomatic::Rect<int> (50, 235, 100, 85));
+       a.extend (dcpomatic::Rect<int>(50, 235, 100, 85));
        BOOST_CHECK_EQUAL (a.x, 0);
        BOOST_CHECK_EQUAL (a.y, 235);
        BOOST_CHECK_EQUAL (a.width, 150);
index 328f9bef74bc4bdce99d40428abb1ae25b1909af..e4c640792d675bda09cfe7fd1acbe1b4c91d997f 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 /** @file  test/silence_padding_test.cc
  *  @brief Test the padding (with silence) of a mono source to a 6-channel DCP.
  *  @ingroup feature
  */
 
+
 #include "lib/ffmpeg_content.h"
 #include "lib/film.h"
 #include "lib/dcp_content_type.h"
 #include <dcp/sound_asset_reader.h>
 #include <boost/test/unit_test.hpp>
 
+
 using std::make_shared;
 using std::string;
 using std::shared_ptr;
 using boost::lexical_cast;
 
+
 static void
 test_silence_padding (int channels)
 {
@@ -120,6 +124,7 @@ test_silence_padding (int channels)
 
 }
 
+
 BOOST_AUTO_TEST_CASE (silence_padding_test)
 {
        for (int i = 1; i < MAX_DCP_AUDIO_CHANNELS; ++i) {
@@ -127,6 +132,7 @@ BOOST_AUTO_TEST_CASE (silence_padding_test)
        }
 }
 
+
 /** Test a situation that used to crash because of a sub-sample rounding confusion
  *  caused by a trim.
  */
index a4889645f100064e2ae1bbc8008e6f97fd887870..f98464fb5810329d20a6a6903ed2b175bc4fb9b6 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2013-2019 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 /** @file  test/threed_test.cc
  *  @brief Create some 3D DCPs (without comparing the results to anything).
  *  @ingroup completedcp
  */
 
+
 #include "lib/config.h"
 #include "lib/content_factory.h"
 #include "lib/cross.h"
index d0cf63bb28eda8d2b2aff819d8b700e7c4e4f997..ffe77c2b786ec2aa98000a254cecf288fa5a6df2 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2015-2016 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2015-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 /** @file  test/time_calculation_test.cc
  *  @brief Test calculation of timings when frame rates change.
  *  @ingroup feature
  */
 
+
 #include "lib/film.h"
 #include "lib/ffmpeg_content.h"
 #include "lib/video_content.h"
 #include "test.h"
 #include <boost/test/unit_test.hpp>
 
-using std::string;
+
 using std::list;
+using std::make_shared;
 using std::shared_ptr;
+using std::string;
 using namespace dcpomatic;
 
+
 static string const xml = "<Content>"
        "<Type>FFmpeg</Type>"
        "<BurnSubtitles>0</BurnSubtitles>"
@@ -125,15 +130,16 @@ static string const xml = "<Content>"
        "<FirstVideo>0</FirstVideo>"
        "</Content>";
 
+
 BOOST_AUTO_TEST_CASE (ffmpeg_time_calculation_test)
 {
-       shared_ptr<Film> film = new_test_film ("ffmpeg_time_calculation_test");
+       auto film = new_test_film ("ffmpeg_time_calculation_test");
 
-       shared_ptr<cxml::Document> doc (new cxml::Document);
+       auto doc = make_shared<cxml::Document>();
        doc->read_string (xml);
 
        list<string> notes;
-       shared_ptr<FFmpegContent> content (new FFmpegContent(doc, film->state_version(), notes));
+       auto content = make_shared<FFmpegContent>(doc, film->state_version(), notes);
 
        /* 25fps content, 25fps DCP */
        film->set_video_frame_rate (25);
@@ -177,20 +183,21 @@ BOOST_AUTO_TEST_CASE (ffmpeg_time_calculation_test)
 
 }
 
+
 /** Test Player::dcp_to_content_video */
 BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
 {
-       shared_ptr<Film> film = new_test_film ("player_time_calculation_test1");
+       auto film = new_test_film ("player_time_calculation_test1");
 
-       shared_ptr<cxml::Document> doc (new cxml::Document);
+       auto doc = make_shared<cxml::Document>();
        doc->read_string (xml);
 
        list<string> notes;
-       shared_ptr<FFmpegContent> content (new FFmpegContent(doc, film->state_version(), notes));
+       auto content = make_shared<FFmpegContent>(doc, film->state_version(), notes);
        film->set_sequence (false);
        film->add_content (content);
 
-       shared_ptr<Player> player (new Player(film));
+       auto player = make_shared<Player>(film);
 
        /* Position 0, no trim, content rate = DCP rate */
        content->set_position (film, DCPTime());
@@ -386,17 +393,17 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test1)
 /** Test Player::content_video_to_dcp */
 BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
 {
-       shared_ptr<Film> film = new_test_film ("player_time_calculation_test2");
+       auto film = new_test_film ("player_time_calculation_test2");
 
-       shared_ptr<cxml::Document> doc (new cxml::Document);
+       auto doc = make_shared<cxml::Document>();
        doc->read_string (xml);
 
        list<string> notes;
-       shared_ptr<FFmpegContent> content (new FFmpegContent(doc, film->state_version(), notes));
+       auto content = make_shared<FFmpegContent>(doc, film->state_version(), notes);
        film->set_sequence (false);
        film->add_content (content);
 
-       shared_ptr<Player> player (new Player(film));
+       auto player = make_shared<Player>(film);
 
        /* Position 0, no trim, content rate = DCP rate */
        content->set_position (film, DCPTime());
@@ -562,18 +569,18 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test2)
 /** Test Player::dcp_to_content_audio */
 BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
 {
-       shared_ptr<Film> film = new_test_film ("player_time_calculation_test3");
+       auto film = new_test_film ("player_time_calculation_test3");
 
-       shared_ptr<cxml::Document> doc (new cxml::Document);
+       auto doc = make_shared<cxml::Document>();
        doc->read_string (xml);
 
        list<string> notes;
-       shared_ptr<FFmpegContent> content (new FFmpegContent(doc, film->state_version(), notes));
-       AudioStreamPtr stream = content->audio->streams().front();
+       auto content = make_shared<FFmpegContent>(doc, film->state_version(), notes);
+       auto stream = content->audio->streams().front();
        film->set_sequence (false);
        film->add_content (content);
 
-       shared_ptr<Player> player (new Player(film));
+       auto player = make_shared<Player>(film);
 
        /* Position 0, no trim, video/audio content rate = video/audio DCP rate */
        content->set_position (film, DCPTime());
@@ -583,7 +590,7 @@ BOOST_AUTO_TEST_CASE (player_time_calculation_test3)
        stream->_frame_rate = 48000;
        player->setup_pieces ();
        BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
-       shared_ptr<Piece> piece = player->_pieces.front ();
+       auto piece = player->_pieces.front ();
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime ()), 0);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (0.5)),  24000);
        BOOST_CHECK_EQUAL (player->dcp_to_resampled_audio (piece, DCPTime::from_seconds (3.0)), 144000);
index 6b8cbffbfb96e8344f1286499caf477cbc7a6826..c9bffaac7acf02aac11bc95f9ed37859253cc8b5 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2017 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2017-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 /** @file  test/torture_test.cc
  *  @brief Tricky arrangements of content whose resulting DCPs are checked programmatically.
  *  @ingroup completedcp
  */
 
+
 #include "lib/audio_content.h"
 #include "lib/film.h"
 #include "lib/dcp_content_type.h"
 #include <boost/test/unit_test.hpp>
 #include <iostream>
 
+
 using std::list;
 using std::cout;
 using std::shared_ptr;
 using std::dynamic_pointer_cast;
 using namespace dcpomatic;
 
+
 /** Test start/end trim and positioning of some audio content */
 BOOST_AUTO_TEST_CASE (torture_test1)
 {
@@ -63,7 +67,7 @@ BOOST_AUTO_TEST_CASE (torture_test1)
        staircase->audio->set_gain (20 * log10(2));
 
        /* And again at an offset of 50000 samples, trimmed both start and end, with a gain of exactly 2 (linear) */
-       staircase = content_factory("test/data/staircase.wav").front ();
+       staircase = content_factory("test/data/staircase.wav").front();
        film->examine_and_add_content (staircase);
        BOOST_REQUIRE (!wait_for_jobs());
        staircase->set_position (film, DCPTime::from_frames(50000, film->audio_frame_rate()));
index 22bec742a231ab91fc00494a4fc7b63e819b4d87..acf7fb4e2919a1084fb5c4667f4b710249a18ea7 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2020-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -199,7 +199,7 @@ static
 pair<int, int>
 pixel_range (shared_ptr<Film> film, shared_ptr<const FFmpegContent> content)
 {
-       shared_ptr<FFmpegDecoder> decoder(new FFmpegDecoder(film, content, false));
+       auto decoder = make_shared<FFmpegDecoder>(film, content, false);
        decoder->video->Data.connect (bind(&video_handler, _1));
        content_video = boost::none;
        while (!content_video) {
@@ -214,7 +214,7 @@ static
 pair<int, int>
 pixel_range (shared_ptr<Film> film, shared_ptr<const ImageContent> content)
 {
-       shared_ptr<ImageDecoder> decoder(new ImageDecoder(film, content));
+       auto decoder = make_shared<ImageDecoder>(film, content);
        decoder->video->Data.connect (bind(&video_handler, _1));
        content_video = boost::none;
        while (!content_video) {
@@ -232,9 +232,9 @@ pixel_range (boost::filesystem::path dcp_path)
        dcp::DCP dcp (dcp_path);
        dcp.read ();
 
-       shared_ptr<dcp::MonoPictureAsset> picture = dynamic_pointer_cast<dcp::MonoPictureAsset>(dcp.cpls().front()->reels().front()->main_picture()->asset());
+       auto picture = dynamic_pointer_cast<dcp::MonoPictureAsset>(dcp.cpls().front()->reels().front()->main_picture()->asset());
        BOOST_REQUIRE (picture);
-       shared_ptr<dcp::OpenJPEGImage> frame = picture->start_read()->get_frame(0)->xyz_image();
+       auto frame = picture->start_read()->get_frame(0)->xyz_image();
 
        int const width = frame->size().width;
        int const height = frame->size().height;
@@ -267,8 +267,8 @@ static
 shared_ptr<Film>
 movie_V (string name)
 {
-       shared_ptr<Film> film = new_test_film2 (name);
-       shared_ptr<FFmpegContent> content = dynamic_pointer_cast<FFmpegContent>(content_factory("test/data/rgb_grey_testcard.mp4").front());
+       auto film = new_test_film2 (name);
+       auto content = dynamic_pointer_cast<FFmpegContent>(content_factory("test/data/rgb_grey_testcard.mp4").front());
        BOOST_REQUIRE (content);
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
@@ -285,8 +285,8 @@ static
 shared_ptr<Film>
 movie_VoF (string name)
 {
-       shared_ptr<Film> film = new_test_film2 (name);
-       shared_ptr<FFmpegContent> content = dynamic_pointer_cast<FFmpegContent>(content_factory("test/data/rgb_grey_testcard.mp4").front());
+       auto film = new_test_film2 (name);
+       auto content = dynamic_pointer_cast<FFmpegContent>(content_factory("test/data/rgb_grey_testcard.mp4").front());
        BOOST_REQUIRE (content);
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
@@ -304,8 +304,8 @@ static
 shared_ptr<Film>
 movie_F (string name)
 {
-       shared_ptr<Film> film = new_test_film2 (name);
-       shared_ptr<FFmpegContent> content = dynamic_pointer_cast<FFmpegContent>(content_factory("test/data/rgb_grey_testcard.mov").front());
+       auto film = new_test_film2 (name);
+       auto content = dynamic_pointer_cast<FFmpegContent>(content_factory("test/data/rgb_grey_testcard.mov").front());
        BOOST_REQUIRE (content);
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
@@ -322,8 +322,8 @@ static
 shared_ptr<Film>
 movie_FoV (string name)
 {
-       shared_ptr<Film> film = new_test_film2 (name);
-       shared_ptr<FFmpegContent> content = dynamic_pointer_cast<FFmpegContent>(content_factory("test/data/rgb_grey_testcard.mov").front());
+       auto film = new_test_film2 (name);
+       auto content = dynamic_pointer_cast<FFmpegContent>(content_factory("test/data/rgb_grey_testcard.mov").front());
        BOOST_REQUIRE (content);
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
@@ -341,8 +341,8 @@ static
 shared_ptr<Film>
 image_F (string name)
 {
-       shared_ptr<Film> film = new_test_film2 (name);
-       shared_ptr<ImageContent> content = dynamic_pointer_cast<ImageContent>(content_factory("test/data/rgb_grey_testcard.png").front());
+       auto film = new_test_film2 (name);
+       auto content = dynamic_pointer_cast<ImageContent>(content_factory("test/data/rgb_grey_testcard.png").front());
        BOOST_REQUIRE (content);
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
@@ -359,8 +359,8 @@ static
 shared_ptr<Film>
 image_FoV (string name)
 {
-       shared_ptr<Film> film = new_test_film2 (name);
-       shared_ptr<ImageContent> content = dynamic_pointer_cast<ImageContent>(content_factory("test/data/rgb_grey_testcard.png").front());
+       auto film = new_test_film2 (name);
+       auto content = dynamic_pointer_cast<ImageContent>(content_factory("test/data/rgb_grey_testcard.png").front());
        BOOST_REQUIRE (content);
        film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
@@ -379,9 +379,9 @@ shared_ptr<Film>
 dcp_F (string name)
 {
        boost::filesystem::path const dcp = "test/data/RgbGreyTestcar_TST-1_F_MOS_2K_20201115_SMPTE_OV";
-       shared_ptr<Film> film = new_test_film2 (name);
-       shared_ptr<DCPContent> content(new DCPContent(dcp));
-       film->examine_and_add_content (shared_ptr<DCPContent>(new DCPContent(dcp)));
+       auto film = new_test_film2 (name);
+       auto content = make_shared<DCPContent>(dcp);
+       film->examine_and_add_content (content);
        BOOST_REQUIRE (!wait_for_jobs());
 
        auto range = pixel_range (dcp);
@@ -411,11 +411,9 @@ static
 pair<int, int>
 V_movie_range (shared_ptr<Film> film)
 {
-       shared_ptr<TranscodeJob> job (new TranscodeJob(film));
+       auto job = make_shared<TranscodeJob>(film);
        job->set_encoder (
-               shared_ptr<FFmpegEncoder>(
-                       new FFmpegEncoder (film, job, film->file("export.mov"), ExportFormat::PRORES, true, false, false, 23)
-                       )
+               make_shared<FFmpegEncoder>(film, job, film->file("export.mov"), ExportFormat::PRORES, true, false, false, 23)
                );
        JobManager::instance()->add (job);
        BOOST_REQUIRE (!wait_for_jobs());
index c3f6ef7281140769220ab20489d190a44869942c..1b8c386f4356e369090266be63e51a4f8abc5f1a 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2020 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2020-2021 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
 
 */
 
+
 /** @file  test/zipper_test.cc
  *  @brief Test Zipper class.
  *  @ingroup selfcontained
  */
 
-#include "lib/zipper.h"
+
 #include "lib/exceptions.h"
+#include "lib/zipper.h"
 #include "test.h"
 #include <dcp/util.h>
 #include <boost/test/unit_test.hpp>
 #include <boost/filesystem.hpp>
 
+
 /** Basic test of Zipper working normally */
 BOOST_AUTO_TEST_CASE (zipper_test1)
 {