summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-04-21 21:34:50 +0200
committerCarl Hetherington <cth@carlh.net>2022-04-21 23:48:16 +0200
commit313319ba2d8544bc25524e02e634804a503b54f1 (patch)
treebbaacfbd1ce80d5141680a87fe533c9a8dd16a3b /src
parente7e4af869f7144fa9a265ccf1e15c7b2f182ac2c (diff)
Tidying.
Diffstat (limited to 'src')
-rw-r--r--src/lib/reel_writer.cc41
-rw-r--r--src/tools/dcpomatic_playlist.cc12
-rw-r--r--src/wx/audio_plot.cc2
-rw-r--r--src/wx/batch_job_view.cc2
-rw-r--r--src/wx/colour_conversion_editor.cc6
-rw-r--r--src/wx/colour_conversion_editor.h2
-rw-r--r--src/wx/content_menu.cc38
-rw-r--r--src/wx/content_menu.h6
-rw-r--r--src/wx/content_panel.cc8
-rw-r--r--src/wx/content_panel.h22
-rw-r--r--src/wx/content_sub_panel.cc5
-rw-r--r--src/wx/content_view.cc6
-rw-r--r--src/wx/content_widget.h5
-rw-r--r--src/wx/controls.cc16
-rw-r--r--src/wx/dcp_panel.cc30
-rw-r--r--src/wx/dcpomatic_spin_ctrl.cc1
-rw-r--r--src/wx/dkdm_dialog.cc26
-rw-r--r--src/wx/dkdm_dialog.h8
-rw-r--r--src/wx/dkdm_output_panel.h13
-rw-r--r--src/wx/editable_list.h7
-rw-r--r--src/wx/film_editor.cc16
-rw-r--r--src/wx/film_name_location_dialog.cc3
-rw-r--r--src/wx/film_viewer.cc28
-rw-r--r--src/wx/fonts_dialog.cc10
-rw-r--r--src/wx/full_language_tag_dialog.cc7
-rw-r--r--src/wx/interop_metadata_dialog.cc2
-rw-r--r--src/wx/job_view.cc14
-rw-r--r--src/wx/kdm_advanced_dialog.cc5
-rw-r--r--src/wx/kdm_dialog.cc32
-rw-r--r--src/wx/kdm_dialog.h9
-rw-r--r--src/wx/markers_dialog.cc16
-rw-r--r--src/wx/player_config_dialog.cc46
-rw-r--r--src/wx/player_stress_tester.cc10
-rw-r--r--src/wx/playlist_controls.cc25
-rw-r--r--src/wx/recipient_dialog.h3
-rw-r--r--src/wx/send_i18n_dialog.h2
-rw-r--r--src/wx/smpte_metadata_dialog.cc6
-rw-r--r--src/wx/smpte_metadata_dialog.h6
-rw-r--r--src/wx/static_text.h2
-rw-r--r--src/wx/templates_dialog.cc4
-rw-r--r--src/wx/text_panel.cc11
-rw-r--r--src/wx/text_view.cc26
-rw-r--r--src/wx/time_picker.cc10
-rw-r--r--src/wx/timeline.cc75
-rw-r--r--src/wx/timeline.h19
-rw-r--r--src/wx/timeline_content_view.cc16
-rw-r--r--src/wx/timeline_dialog.cc4
-rw-r--r--src/wx/timeline_labels_view.cc4
-rw-r--r--src/wx/timeline_reels_view.cc4
-rw-r--r--src/wx/timeline_time_axis_view.cc11
-rw-r--r--src/wx/try_unmount_dialog.cc2
-rw-r--r--src/wx/verify_dcp_progress_dialog.cc2
-rw-r--r--src/wx/video_view.h4
-rw-r--r--src/wx/video_waveform_plot.cc2
-rw-r--r--src/wx/wx_util.h2
55 files changed, 398 insertions, 296 deletions
diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc
index d8ce8882e..b5a95d8b1 100644
--- a/src/lib/reel_writer.cc
+++ b/src/lib/reel_writer.cc
@@ -18,18 +18,19 @@
*/
-#include "reel_writer.h"
-#include "film.h"
+
+#include "audio_buffers.h"
+#include "compose.hpp"
+#include "config.h"
#include "cross.h"
-#include "job.h"
-#include "log.h"
#include "dcpomatic_log.h"
#include "digester.h"
+#include "film.h"
#include "font_data.h"
-#include "compose.hpp"
-#include "config.h"
-#include "audio_buffers.h"
#include "image.h"
+#include "job.h"
+#include "log.h"
+#include "reel_writer.h"
#include <dcp/atmos_asset.h>
#include <dcp/atmos_asset_writer.h>
#include <dcp/certificate_chain.h>
@@ -56,28 +57,30 @@
#include "i18n.h"
-using std::list;
-using std::string;
-using std::cout;
+
+using std::dynamic_pointer_cast;
using std::exception;
+using std::list;
+using std::make_shared;
using std::map;
using std::set;
-using std::vector;
using std::shared_ptr;
-using std::make_shared;
+using std::string;
+using std::vector;
+using std::weak_ptr;
using boost::optional;
-using std::dynamic_pointer_cast;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
#endif
-using std::weak_ptr;
using dcp::ArrayData;
using dcp::Data;
using dcp::raw_convert;
using namespace dcpomatic;
+
int const ReelWriter::_info_size = 48;
+
static dcp::MXFMetadata
mxf_metadata ()
{
@@ -95,6 +98,7 @@ mxf_metadata ()
return meta;
}
+
/** @param job Related job, or 0.
* @param text_only true to enable a special mode where the writer will expect only subtitles and closed captions to be written
* (no picture nor sound) and not give errors in that case. This is used by the hints system to check the potential sizes of
@@ -197,6 +201,7 @@ ReelWriter::ReelWriter (
_default_font = dcp::ArrayData(default_font_file());
}
+
/** @param frame reel-relative frame */
void
ReelWriter::write_frame_info (Frame frame, Eyes eyes, dcp::FrameInfo info) const
@@ -208,6 +213,7 @@ ReelWriter::write_frame_info (Frame frame, Eyes eyes, dcp::FrameInfo info) const
checked_fwrite (info.hash.c_str(), info.hash.size(), handle->get(), handle->file());
}
+
dcp::FrameInfo
ReelWriter::read_frame_info (shared_ptr<InfoFileHandle> info, Frame frame, Eyes eyes) const
{
@@ -224,6 +230,7 @@ ReelWriter::read_frame_info (shared_ptr<InfoFileHandle> info, Frame frame, Eyes
return frame_info;
}
+
long
ReelWriter::frame_info_position (Frame frame, Eyes eyes) const
{
@@ -241,6 +248,7 @@ ReelWriter::frame_info_position (Frame frame, Eyes eyes) const
DCPOMATIC_ASSERT (false);
}
+
Frame
ReelWriter::check_existing_picture_asset (boost::filesystem::path asset)
{
@@ -299,6 +307,7 @@ ReelWriter::check_existing_picture_asset (boost::filesystem::path asset)
return first_nonexistant_frame;
}
+
void
ReelWriter::write (shared_ptr<const Data> encoded, Frame frame, Eyes eyes)
{
@@ -340,6 +349,7 @@ ReelWriter::fake_write (int size)
_picture_asset_writer->fake_write (size);
}
+
void
ReelWriter::repeat_write (Frame frame, Eyes eyes)
{
@@ -355,6 +365,7 @@ ReelWriter::repeat_write (Frame frame, Eyes eyes)
write_frame_info (frame, eyes, fin);
}
+
void
ReelWriter::finish (boost::filesystem::path output_dcp)
{
@@ -767,6 +778,7 @@ try
*/
}
+
Frame
ReelWriter::start () const
{
@@ -906,6 +918,7 @@ ReelWriter::write (PlayerText subs, TextType type, optional<DCPTextTrack> track,
}
}
+
bool
ReelWriter::existing_picture_frame_ok (FILE* asset_file, shared_ptr<InfoFileHandle> info_file, Frame frame) const
{
diff --git a/src/tools/dcpomatic_playlist.cc b/src/tools/dcpomatic_playlist.cc
index dbc5e81dd..056bc7512 100644
--- a/src/tools/dcpomatic_playlist.cc
+++ b/src/tools/dcpomatic_playlist.cc
@@ -19,12 +19,12 @@
*/
-#include "wx/wx_util.h"
-#include "wx/wx_signal_manager.h"
+#include "wx/about_dialog.h"
#include "wx/content_view.h"
#include "wx/dcpomatic_button.h"
-#include "wx/about_dialog.h"
#include "wx/playlist_editor_config_dialog.h"
+#include "wx/wx_signal_manager.h"
+#include "wx/wx_util.h"
#include "lib/config.h"
#include "lib/cross.h"
#include "lib/dcp_content.h"
@@ -32,11 +32,11 @@
#include "lib/spl.h"
#include "lib/spl_entry.h"
#include "lib/util.h"
-#include <wx/wx.h>
-#include <wx/listctrl.h>
#include <wx/imaglist.h>
-#include <wx/spinctrl.h>
+#include <wx/listctrl.h>
#include <wx/preferences.h>
+#include <wx/spinctrl.h>
+#include <wx/wx.h>
using std::cout;
diff --git a/src/wx/audio_plot.cc b/src/wx/audio_plot.cc
index e08e07e05..a4518d5dd 100644
--- a/src/wx/audio_plot.cc
+++ b/src/wx/audio_plot.cc
@@ -29,10 +29,8 @@
#include <wx/graphics.h>
#include <boost/bind/bind.hpp>
#include <cfloat>
-#include <iostream>
-using std::cout;
using std::list;
using std::map;
using std::max;
diff --git a/src/wx/batch_job_view.cc b/src/wx/batch_job_view.cc
index 06f698874..c93bf1eba 100644
--- a/src/wx/batch_job_view.cc
+++ b/src/wx/batch_job_view.cc
@@ -22,8 +22,8 @@
#include "batch_job_view.h"
#include "dcpomatic_button.h"
#include "lib/job_manager.h"
-#include <wx/sizer.h>
#include <wx/button.h>
+#include <wx/sizer.h>
using std::list;
diff --git a/src/wx/colour_conversion_editor.cc b/src/wx/colour_conversion_editor.cc
index 8f52c1ff5..908968712 100644
--- a/src/wx/colour_conversion_editor.cc
+++ b/src/wx/colour_conversion_editor.cc
@@ -24,18 +24,16 @@
#include "static_text.h"
#include "wx_util.h"
#include "lib/colour_conversion.h"
-#include <dcp/locale_convert.h>
#include <dcp/gamma_transfer_function.h>
#include <dcp/identity_transfer_function.h>
-#include <dcp/s_gamut3_transfer_function.h>
+#include <dcp/locale_convert.h>
#include <dcp/modified_gamma_transfer_function.h>
+#include <dcp/s_gamut3_transfer_function.h>
#include <wx/gbsizer.h>
#include <wx/numformatter.h>
#include <wx/spinctrl.h>
-#include <iostream>
-using std::cout;
using std::dynamic_pointer_cast;
using std::make_shared;
using std::string;
diff --git a/src/wx/colour_conversion_editor.h b/src/wx/colour_conversion_editor.h
index f609daae4..bdf185227 100644
--- a/src/wx/colour_conversion_editor.h
+++ b/src/wx/colour_conversion_editor.h
@@ -27,9 +27,9 @@
#include <wx/wx.h>
+class ColourConversion;
class wxGridBagSizer;
class wxSpinCtrlDouble;
-class ColourConversion;
class ColourConversionEditor : public wxPanel
diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc
index 137ef97dc..fe117aac0 100644
--- a/src/wx/content_menu.cc
+++ b/src/wx/content_menu.cc
@@ -19,43 +19,41 @@
*/
+#include "content_advanced_dialog.h"
#include "content_menu.h"
+#include "content_properties_dialog.h"
#include "repeat_dialog.h"
-#include "wx_util.h"
-#include "timeline_video_content_view.h"
#include "timeline_audio_content_view.h"
-#include "content_properties_dialog.h"
-#include "content_advanced_dialog.h"
-#include "lib/playlist.h"
-#include "lib/film.h"
-#include "lib/image_content.h"
+#include "timeline_video_content_view.h"
+#include "wx_util.h"
+#include "lib/audio_content.h"
+#include "lib/config.h"
#include "lib/content_factory.h"
-#include "lib/examine_content_job.h"
-#include "lib/job_manager.h"
-#include "lib/exceptions.h"
+#include "lib/copy_dcp_details_to_film.h"
#include "lib/dcp_content.h"
#include "lib/dcp_examiner.h"
+#include "lib/examine_content_job.h"
+#include "lib/exceptions.h"
#include "lib/ffmpeg_content.h"
-#include "lib/audio_content.h"
-#include "lib/config.h"
-#include "lib/copy_dcp_details_to_film.h"
+#include "lib/film.h"
+#include "lib/image_content.h"
+#include "lib/job_manager.h"
+#include "lib/playlist.h"
#include <dcp/cpl.h>
-#include <dcp/exceptions.h>
#include <dcp/decrypted_kdm.h>
+#include <dcp/exceptions.h>
#include <dcp/search.h>
-#include <wx/wx.h>
#include <wx/dirdlg.h>
-#include <iostream>
+#include <wx/wx.h>
-using std::cout;
-using std::vector;
+using std::dynamic_pointer_cast;
using std::exception;
using std::list;
+using std::make_shared;
using std::shared_ptr;
+using std::vector;
using std::weak_ptr;
-using std::dynamic_pointer_cast;
-using std::make_shared;
using boost::optional;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
diff --git a/src/wx/content_menu.h b/src/wx/content_menu.h
index 8a3548419..240a9e64f 100644
--- a/src/wx/content_menu.h
+++ b/src/wx/content_menu.h
@@ -18,17 +18,21 @@
*/
+
#ifndef DCPOMATIC_CONTENT_MENU_H
#define DCPOMATIC_CONTENT_MENU_H
+
#include "timeline_content_view.h"
#include "lib/types.h"
#include <wx/wx.h>
#include <memory>
+
+class DCPContent;
class Film;
class Job;
-class DCPContent;
+
class ContentMenu
{
diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc
index 56a342bfe..db29ed74a 100644
--- a/src/wx/content_panel.cc
+++ b/src/wx/content_panel.cc
@@ -45,15 +45,13 @@
#include "lib/string_text_file_content.h"
#include "lib/text_content.h"
#include "lib/video_content.h"
-#include <wx/wx.h>
-#include <wx/notebook.h>
-#include <wx/listctrl.h>
#include <wx/display.h>
+#include <wx/listctrl.h>
+#include <wx/notebook.h>
+#include <wx/wx.h>
#include <boost/filesystem.hpp>
-#include <iostream>
-using std::cout;
using std::dynamic_pointer_cast;
using std::exception;
using std::list;
diff --git a/src/wx/content_panel.h b/src/wx/content_panel.h
index 650b79668..21acd28b2 100644
--- a/src/wx/content_panel.h
+++ b/src/wx/content_panel.h
@@ -26,21 +26,21 @@
#include <list>
+class AudioPanel;
+class ContentSubPanel;
+class Film;
+class FilmEditor;
+class FilmViewer;
+class TextPanel;
+class TimelineDialog;
+class TimingPanel;
+class VideoPanel;
+class wxListCtrl;
+class wxListEvent;
class wxNotebook;
class wxPanel;
class wxSizer;
-class wxListCtrl;
-class wxListEvent;
class wxSplitterWindow;
-class TimelineDialog;
-class FilmEditor;
-class ContentSubPanel;
-class TextPanel;
-class VideoPanel;
-class AudioPanel;
-class TimingPanel;
-class Film;
-class FilmViewer;
class LimitedSplitter : public wxSplitterWindow
diff --git a/src/wx/content_sub_panel.cc b/src/wx/content_sub_panel.cc
index 9c236abeb..d170d6edd 100644
--- a/src/wx/content_sub_panel.cc
+++ b/src/wx/content_sub_panel.cc
@@ -18,6 +18,7 @@
*/
+
#include "content_sub_panel.h"
#include "content_panel.h"
#include "wx_util.h"
@@ -26,13 +27,15 @@
#include "lib/log.h"
#include <wx/notebook.h>
+
using std::list;
-using std::string;
using std::shared_ptr;
+using std::string;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
#endif
+
ContentSubPanel::ContentSubPanel (ContentPanel* p, wxString name)
: wxScrolledWindow (p->notebook(), wxID_ANY)
, _parent (p)
diff --git a/src/wx/content_view.cc b/src/wx/content_view.cc
index 8055e2f2d..7a20cc344 100644
--- a/src/wx/content_view.cc
+++ b/src/wx/content_view.cc
@@ -21,13 +21,13 @@
#include "content_view.h"
#include "wx_util.h"
-#include "lib/dcpomatic_assert.h"
#include "lib/config.h"
-#include "lib/dcp_content.h"
#include "lib/content_factory.h"
+#include "lib/cross.h"
+#include "lib/dcp_content.h"
+#include "lib/dcpomatic_assert.h"
#include "lib/examine_content_job.h"
#include "lib/job_manager.h"
-#include "lib/cross.h"
#include <dcp/exceptions.h>
#include <boost/filesystem.hpp>
#include <boost/optional.hpp>
diff --git a/src/wx/content_widget.h b/src/wx/content_widget.h
index 34755e4b5..62561192d 100644
--- a/src/wx/content_widget.h
+++ b/src/wx/content_widget.h
@@ -22,16 +22,19 @@
* @brief ContentWidget class.
*/
+
#ifndef DCPOMATIC_CONTENT_WIDGET_H
#define DCPOMATIC_CONTENT_WIDGET_H
+
#include "wx_util.h"
#include "lib/content.h"
-#include <wx/wx.h>
#include <wx/gbsizer.h>
#include <wx/spinctrl.h>
+#include <wx/wx.h>
#include <vector>
+
/** @class ContentWidget
* @brief A widget which represents some Content state and which can be used
* when multiple pieces of content are selected.
diff --git a/src/wx/controls.cc b/src/wx/controls.cc
index a90ac79b4..5b1e62c2e 100644
--- a/src/wx/controls.cc
+++ b/src/wx/controls.cc
@@ -35,25 +35,25 @@
#include "lib/job.h"
#include "lib/job_manager.h"
#include "lib/player_video.h"
-#include <dcp/dcp.h>
#include <dcp/cpl.h>
+#include <dcp/dcp.h>
#include <dcp/reel.h>
#include <dcp/reel_picture_asset.h>
-#include <wx/wx.h>
-#include <wx/tglbtn.h>
#include <wx/listctrl.h>
#include <wx/progdlg.h>
+#include <wx/tglbtn.h>
+#include <wx/wx.h>
-using std::string;
-using std::list;
using std::cout;
-using std::make_pair;
+using std::dynamic_pointer_cast;
using std::exception;
-using boost::optional;
+using std::list;
+using std::make_pair;
using std::shared_ptr;
+using std::string;
using std::weak_ptr;
-using std::dynamic_pointer_cast;
+using boost::optional;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
#endif
diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc
index 61dfd7507..1e626bf18 100644
--- a/src/wx/dcp_panel.cc
+++ b/src/wx/dcp_panel.cc
@@ -32,36 +32,34 @@
#include "smpte_metadata_dialog.h"
#include "static_text.h"
#include "wx_util.h"
-#include "lib/ratio.h"
+#include "lib/audio_content.h"
+#include "lib/audio_processor.h"
#include "lib/config.h"
+#include "lib/dcp_content.h"
#include "lib/dcp_content_type.h"
-#include "lib/util.h"
-#include "lib/film.h"
#include "lib/ffmpeg_content.h"
-#include "lib/audio_processor.h"
-#include "lib/video_content.h"
+#include "lib/film.h"
+#include "lib/ratio.h"
#include "lib/text_content.h"
-#include "lib/dcp_content.h"
-#include "lib/audio_content.h"
+#include "lib/util.h"
+#include "lib/video_content.h"
#include <dcp/locale_convert.h>
-#include <wx/wx.h>
-#include <wx/notebook.h>
#include <wx/gbsizer.h>
+#include <wx/notebook.h>
#include <wx/spinctrl.h>
+#include <wx/wx.h>
#include <boost/lexical_cast.hpp>
-#include <iostream>
-using std::cout;
using std::list;
-using std::string;
-using std::vector;
-using std::pair;
-using std::max;
using std::make_pair;
-using boost::lexical_cast;
+using std::max;
+using std::pair;
using std::shared_ptr;
+using std::string;
+using std::vector;
using std::weak_ptr;
+using boost::lexical_cast;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
#endif
diff --git a/src/wx/dcpomatic_spin_ctrl.cc b/src/wx/dcpomatic_spin_ctrl.cc
index a05070410..9d255f77a 100644
--- a/src/wx/dcpomatic_spin_ctrl.cc
+++ b/src/wx/dcpomatic_spin_ctrl.cc
@@ -24,6 +24,7 @@
#include <boost/version.hpp>
#include <wx/wx.h>
+
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
#endif
diff --git a/src/wx/dkdm_dialog.cc b/src/wx/dkdm_dialog.cc
index 68fe4bae1..e9fd89304 100644
--- a/src/wx/dkdm_dialog.cc
+++ b/src/wx/dkdm_dialog.cc
@@ -19,36 +19,36 @@
*/
+#include "confirm_kdm_email_dialog.h"
+#include "dcpomatic_button.h"
#include "dkdm_dialog.h"
-#include "wx_util.h"
-#include "recipients_panel.h"
-#include "kdm_timing_panel.h"
#include "dkdm_output_panel.h"
#include "kdm_cpl_panel.h"
-#include "confirm_kdm_email_dialog.h"
+#include "kdm_timing_panel.h"
+#include "recipients_panel.h"
#include "static_text.h"
-#include "dcpomatic_button.h"
+#include "wx_util.h"
+#include "lib/config.h"
#include "lib/film.h"
-#include "lib/kdm_with_metadata.h"
#include "lib/job_manager.h"
-#include "lib/config.h"
+#include "lib/kdm_with_metadata.h"
#include <libcxml/cxml.h>
#include <dcp/exceptions.h>
-#include <wx/treectrl.h>
#include <wx/listctrl.h>
+#include <wx/treectrl.h>
#include <iostream>
-using std::string;
+using std::cout;
using std::exception;
-using std::map;
using std::list;
-using std::pair;
-using std::cout;
-using std::vector;
using std::make_pair;
+using std::map;
+using std::pair;
using std::runtime_error;
using std::shared_ptr;
+using std::string;
+using std::vector;
using boost::bind;
using boost::optional;
#if BOOST_VERSION >= 106100
diff --git a/src/wx/dkdm_dialog.h b/src/wx/dkdm_dialog.h
index 7b20e88ec..132b30aef 100644
--- a/src/wx/dkdm_dialog.h
+++ b/src/wx/dkdm_dialog.h
@@ -24,12 +24,12 @@
#include <map>
-class Film;
-class ScreensPanel;
-class RecipientsPanel;
-class KDMTimingPanel;
class DKDMOutputPanel;
+class Film;
class KDMCPLPanel;
+class KDMTimingPanel;
+class RecipientsPanel;
+class ScreensPanel;
struct CPLSummary;
diff --git a/src/wx/dkdm_output_panel.h b/src/wx/dkdm_output_panel.h
index 43e66a172..821a41deb 100644
--- a/src/wx/dkdm_output_panel.h
+++ b/src/wx/dkdm_output_panel.h
@@ -18,19 +18,22 @@
*/
-#include "lib/kdm_with_metadata.h"
-#include "wx_util.h"
+
#include "name_format_editor.h"
+#include "wx_util.h"
+#include "lib/kdm_with_metadata.h"
#include <dcp/types.h>
#include <wx/wx.h>
#include <boost/filesystem.hpp>
-class wxRadioButton;
-class wxDirPickerCtrl;
+
class DirPickerCtrl;
-class KDMTimingPanel;
class Job;
+class KDMTimingPanel;
class Log;
+class wxDirPickerCtrl;
+class wxRadioButton;
+
class DKDMOutputPanel : public wxPanel
{
diff --git a/src/wx/editable_list.h b/src/wx/editable_list.h
index 3f2ea0ca2..ac201580b 100644
--- a/src/wx/editable_list.h
+++ b/src/wx/editable_list.h
@@ -18,15 +18,18 @@
*/
+
#ifndef DCPOMATIC_EDITABLE_LIST_H
#define DCPOMATIC_EDITABLE_LIST_H
-#include "wx_util.h"
+
#include "dcpomatic_button.h"
-#include <wx/wx.h>
+#include "wx_util.h"
#include <wx/listctrl.h>
+#include <wx/wx.h>
#include <vector>
+
class EditableListColumn
{
public:
diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc
index d604f678d..28baf566e 100644
--- a/src/wx/film_editor.cc
+++ b/src/wx/film_editor.cc
@@ -24,23 +24,21 @@
*/
-#include "wx_util.h"
-#include "film_editor.h"
-#include "dcp_panel.h"
#include "content_panel.h"
-#include "lib/film.h"
-#include "lib/job_manager.h"
+#include "dcp_panel.h"
+#include "film_editor.h"
+#include "wx_util.h"
#include "lib/content.h"
#include "lib/dcp_content.h"
-#include <wx/wx.h>
+#include "lib/film.h"
+#include "lib/job_manager.h"
#include <wx/notebook.h>
-#include <iostream>
+#include <wx/wx.h>
-using std::cout;
-using std::string;
using std::list;
using std::shared_ptr;
+using std::string;
using std::weak_ptr;
using boost::optional;
#if BOOST_VERSION >= 106100
diff --git a/src/wx/film_name_location_dialog.cc b/src/wx/film_name_location_dialog.cc
index 516ed86ae..098676a9e 100644
--- a/src/wx/film_name_location_dialog.cc
+++ b/src/wx/film_name_location_dialog.cc
@@ -22,11 +22,12 @@
#include "check_box.h"
#include "film_name_location_dialog.h"
#include "wx_util.h"
+/* This must come after wx_util.h as it defines DCPOMATIC_USE_OWN_PICKER */
#ifdef DCPOMATIC_USE_OWN_PICKER
#include "dir_picker_ctrl.h"
#endif
-#include "lib/config.h"
#include "lib/compose.hpp"
+#include "lib/config.h"
#include <wx/stdpaths.h>
#include <boost/filesystem.hpp>
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index cd5b6e2ea..f7c50b98a 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -32,36 +32,34 @@
#include "playhead_to_timecode_dialog.h"
#include "simple_video_view.h"
#include "wx_util.h"
-#include "lib/film.h"
-#include "lib/ratio.h"
-#include "lib/util.h"
-#include "lib/job_manager.h"
-#include "lib/image.h"
-#include "lib/exceptions.h"
+#include "lib/butler.h"
+#include "lib/compose.hpp"
+#include "lib/config.h"
+#include "lib/dcpomatic_log.h"
#include "lib/examine_content_job.h"
+#include "lib/exceptions.h"
+#include "lib/film.h"
#include "lib/filter.h"
+#include "lib/image.h"
+#include "lib/job_manager.h"
+#include "lib/log.h"
#include "lib/player.h"
#include "lib/player_video.h"
+#include "lib/ratio.h"
+#include "lib/text_content.h"
+#include "lib/timer.h"
+#include "lib/util.h"
#include "lib/video_content.h"
#include "lib/video_decoder.h"
-#include "lib/timer.h"
-#include "lib/butler.h"
-#include "lib/log.h"
-#include "lib/config.h"
-#include "lib/compose.hpp"
-#include "lib/dcpomatic_log.h"
-#include "lib/text_content.h"
extern "C" {
#include <libavutil/pixfmt.h>
}
#include <dcp/exceptions.h>
#include <wx/tglbtn.h>
-#include <iostream>
#include <iomanip>
using std::bad_alloc;
-using std::cout;
using std::dynamic_pointer_cast;
using std::make_shared;
using std::max;
diff --git a/src/wx/fonts_dialog.cc b/src/wx/fonts_dialog.cc
index d5e0aacbe..43e914cee 100644
--- a/src/wx/fonts_dialog.cc
+++ b/src/wx/fonts_dialog.cc
@@ -19,22 +19,20 @@
*/
+#include "dcpomatic_button.h"
#include "fonts_dialog.h"
-#include "wx_util.h"
#include "system_font_dialog.h"
-#include "dcpomatic_button.h"
-#include "lib/font.h"
+#include "wx_util.h"
#include "lib/content.h"
+#include "lib/font.h"
#include "lib/text_content.h"
#include <wx/wx.h>
-#include <iostream>
#include <memory>
using std::list;
-using std::string;
-using std::cout;
using std::shared_ptr;
+using std::string;
using namespace dcpomatic;
diff --git a/src/wx/full_language_tag_dialog.cc b/src/wx/full_language_tag_dialog.cc
index a6d5e49a6..df9a565b4 100644
--- a/src/wx/full_language_tag_dialog.cc
+++ b/src/wx/full_language_tag_dialog.cc
@@ -19,8 +19,8 @@
*/
-#include "lib/dcpomatic_assert.h"
#include "full_language_tag_dialog.h"
+#include "lib/dcpomatic_assert.h"
#include <dcp/language_tag.h>
#include <wx/listctrl.h>
#include <wx/srchctrl.h>
@@ -29,7 +29,6 @@
#include <boost/bind/bind.hpp>
#include <boost/optional.hpp>
#include <boost/signals2.hpp>
-#include <iostream>
#include <iterator>
#include <string>
#include <vector>
@@ -37,11 +36,11 @@
using std::min;
using std::pair;
+using std::shared_ptr;
using std::string;
using std::vector;
-using boost::optional;
-using std::shared_ptr;
using std::weak_ptr;
+using boost::optional;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
#endif
diff --git a/src/wx/interop_metadata_dialog.cc b/src/wx/interop_metadata_dialog.cc
index 61aa23498..ad932bc67 100644
--- a/src/wx/interop_metadata_dialog.cc
+++ b/src/wx/interop_metadata_dialog.cc
@@ -28,10 +28,10 @@
#include <wx/gbsizer.h>
+using std::shared_ptr;
using std::string;
using std::vector;
using std::weak_ptr;
-using std::shared_ptr;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
#endif
diff --git a/src/wx/job_view.cc b/src/wx/job_view.cc
index 06d10401f..fe42f4be3 100644
--- a/src/wx/job_view.cc
+++ b/src/wx/job_view.cc
@@ -19,26 +19,26 @@
*/
+#include "check_box.h"
+#include "dcpomatic_button.h"
#include "job_view.h"
-#include "wx_util.h"
#include "message_dialog.h"
#include "static_text.h"
-#include "check_box.h"
-#include "dcpomatic_button.h"
-#include "lib/job.h"
-#include "lib/job_manager.h"
+#include "wx_util.h"
+#include "lib/analyse_audio_job.h"
#include "lib/compose.hpp"
#include "lib/config.h"
+#include "lib/job.h"
+#include "lib/job_manager.h"
#include "lib/send_notification_email_job.h"
#include "lib/transcode_job.h"
-#include "lib/analyse_audio_job.h"
#include <wx/wx.h>
#include <boost/algorithm/string.hpp>
-using std::string;
using std::min;
using std::shared_ptr;
+using std::string;
using boost::bind;
diff --git a/src/wx/kdm_advanced_dialog.cc b/src/wx/kdm_advanced_dialog.cc
index f5ed88b41..ba1e7a4d3 100644
--- a/src/wx/kdm_advanced_dialog.cc
+++ b/src/wx/kdm_advanced_dialog.cc
@@ -18,13 +18,16 @@
*/
-#include "kdm_advanced_dialog.h"
+
#include "check_box.h"
+#include "kdm_advanced_dialog.h"
#include "wx_util.h"
#include <wx/spinctrl.h>
+
using boost::optional;
+
KDMAdvancedDialog::KDMAdvancedDialog (wxWindow* parent, bool forensic_mark_video, bool forensic_mark_audio, optional<int> forensic_mark_audio_up_to)
: TableDialog (parent, _("Advanced KDM options"), 2, 1, false)
{
diff --git a/src/wx/kdm_dialog.cc b/src/wx/kdm_dialog.cc
index 9b6b0927c..715568122 100644
--- a/src/wx/kdm_dialog.cc
+++ b/src/wx/kdm_dialog.cc
@@ -19,38 +19,36 @@
*/
+#include "confirm_kdm_email_dialog.h"
+#include "dcpomatic_button.h"
+#include "kdm_cpl_panel.h"
#include "kdm_dialog.h"
-#include "wx_util.h"
-#include "screens_panel.h"
-#include "kdm_timing_panel.h"
#include "kdm_output_panel.h"
-#include "kdm_cpl_panel.h"
-#include "confirm_kdm_email_dialog.h"
+#include "kdm_timing_panel.h"
+#include "screens_panel.h"
#include "static_text.h"
-#include "dcpomatic_button.h"
+#include "wx_util.h"
+#include "lib/cinema.h"
+#include "lib/config.h"
#include "lib/film.h"
-#include "lib/screen.h"
-#include "lib/kdm_with_metadata.h"
#include "lib/job_manager.h"
-#include "lib/config.h"
-#include "lib/cinema.h"
+#include "lib/kdm_with_metadata.h"
+#include "lib/screen.h"
#include <libcxml/cxml.h>
#include <dcp/exceptions.h>
-#include <wx/treectrl.h>
#include <wx/listctrl.h>
-#include <iostream>
+#include <wx/treectrl.h>
-using std::string;
using std::exception;
-using std::map;
using std::list;
-using std::pair;
-using std::cout;
-using std::vector;
using std::make_pair;
+using std::map;
+using std::pair;
using std::runtime_error;
using std::shared_ptr;
+using std::string;
+using std::vector;
using boost::bind;
using boost::optional;
#if BOOST_VERSION >= 106100
diff --git a/src/wx/kdm_dialog.h b/src/wx/kdm_dialog.h
index ea504f842..0c6076fb4 100644
--- a/src/wx/kdm_dialog.h
+++ b/src/wx/kdm_dialog.h
@@ -18,24 +18,27 @@
*/
+
#include "wx_util.h"
#include <dcp/types.h>
#include <wx/wx.h>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <map>
+
namespace dcpomatic {
class Screen;
}
class Cinema;
class Film;
-class ScreensPanel;
-class KDMTimingPanel;
-class KDMOutputPanel;
class KDMCPLPanel;
+class KDMOutputPanel;
+class KDMTimingPanel;
+class ScreensPanel;
struct CPLSummary;
+
class KDMDialog : public wxDialog
{
public:
diff --git a/src/wx/markers_dialog.cc b/src/wx/markers_dialog.cc
index 205d44195..302717f59 100644
--- a/src/wx/markers_dialog.cc
+++ b/src/wx/markers_dialog.cc
@@ -19,26 +19,24 @@
*/
-#include "markers_dialog.h"
-#include "wx_util.h"
-#include "timecode.h"
-#include "static_text.h"
-#include "dcpomatic_button.h"
#include "check_box.h"
+#include "dcpomatic_button.h"
#include "film_viewer.h"
+#include "markers_dialog.h"
+#include "static_text.h"
+#include "timecode.h"
+#include "wx_util.h"
#include "lib/film.h"
#include <dcp/types.h>
#include <wx/gbsizer.h>
#include <boost/bind/bind.hpp>
-#include <iostream>
-using std::cout;
+using std::make_shared;
using std::shared_ptr;
using std::weak_ptr;
-using std::make_shared;
-using boost::optional;
using boost::bind;
+using boost::optional;
using dcpomatic::DCPTime;
diff --git a/src/wx/player_config_dialog.cc b/src/wx/player_config_dialog.cc
index af0f8641e..947afa500 100644
--- a/src/wx/player_config_dialog.cc
+++ b/src/wx/player_config_dialog.cc
@@ -18,58 +18,60 @@
*/
+
/** @file src/player_config_dialog.cc
* @brief A dialogue to edit DCP-o-matic Player configuration.
*/
+
+#include "check_box.h"
#include "config_dialog.h"
-#include "wx_util.h"
+#include "dir_picker_ctrl.h"
#include "editable_list.h"
-#include "filter_dialog.h"
+#include "email_dialog.h"
#include "file_picker_ctrl.h"
-#include "dir_picker_ctrl.h"
-#include "server_dialog.h"
+#include "filter_dialog.h"
#include "make_chain_dialog.h"
-#include "email_dialog.h"
-#include "name_format_editor.h"
#include "nag_dialog.h"
-#include "check_box.h"
+#include "name_format_editor.h"
+#include "server_dialog.h"
#include "static_text.h"
+#include "wx_util.h"
#include "lib/config.h"
-#include "lib/ratio.h"
-#include "lib/filter.h"
+#include "lib/cross.h"
#include "lib/dcp_content_type.h"
+#include "lib/exceptions.h"
+#include "lib/filter.h"
#include "lib/log.h"
+#include "lib/ratio.h"
#include "lib/util.h"
-#include "lib/cross.h"
-#include "lib/exceptions.h"
-#include <dcp/locale_convert.h>
-#include <dcp/exceptions.h>
#include <dcp/certificate_chain.h>
-#include <wx/stdpaths.h>
+#include <dcp/exceptions.h>
+#include <dcp/locale_convert.h>
+#include <wx/filepicker.h>
#include <wx/preferences.h>
#include <wx/spinctrl.h>
-#include <wx/filepicker.h>
+#include <wx/stdpaths.h>
#include <RtAudio.h>
#include <boost/filesystem.hpp>
-#include <iostream>
-using std::vector;
-using std::string;
+
+using std::function;
using std::list;
-using std::cout;
-using std::pair;
using std::make_pair;
using std::map;
-using boost::bind;
+using std::pair;
using std::shared_ptr;
-using std::function;
+using std::string;
+using std::vector;
+using boost::bind;
using boost::optional;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
#endif
using dcp::locale_convert;
+
class PlayerGeneralPage : public GeneralPage
{
public:
diff --git a/src/wx/player_stress_tester.cc b/src/wx/player_stress_tester.cc
index 6dd2dd674..b299ccbf8 100644
--- a/src/wx/player_stress_tester.cc
+++ b/src/wx/player_stress_tester.cc
@@ -18,26 +18,30 @@
*/
-#include "player_stress_tester.h"
+
#include "controls.h"
+#include "player_stress_tester.h"
#include <dcp/raw_convert.h>
#include <dcp/util.h>
#include <wx/wx.h>
#include <boost/algorithm/string.hpp>
#include <boost/bind/bind.hpp>
+#include <iostream>
#include <string>
#include <vector>
-#include <iostream>
+
+using std::cout;
using std::string;
using std::vector;
-using std::cout;
using dcp::raw_convert;
using boost::optional;
+
/* Interval to check for things to do with the stress script (in milliseconds) */
#define CHECK_INTERVAL 20
+
Command::Command (string line)
: type (NONE)
, int_param (0)
diff --git a/src/wx/playlist_controls.cc b/src/wx/playlist_controls.cc
index 3be47ad97..da7976b8d 100644
--- a/src/wx/playlist_controls.cc
+++ b/src/wx/playlist_controls.cc
@@ -18,33 +18,36 @@
*/
-#include "playlist_controls.h"
-#include "film_viewer.h"
-#include "wx_util.h"
+
#include "content_view.h"
#include "dcpomatic_button.h"
+#include "film_viewer.h"
+#include "playlist_controls.h"
#include "static_text.h"
-#include "lib/player_video.h"
-#include "lib/dcp_content.h"
+#include "wx_util.h"
+#include "lib/compose.hpp"
#include "lib/cross.h"
-#include "lib/scoped_temporary.h"
-#include "lib/internet.h"
+#include "lib/dcp_content.h"
#include "lib/ffmpeg_content.h"
-#include "lib/compose.hpp"
+#include "lib/internet.h"
+#include "lib/player_video.h"
+#include "lib/scoped_temporary.h"
#include <dcp/raw_convert.h>
#include <dcp/exceptions.h>
#include <wx/listctrl.h>
#include <wx/progdlg.h>
-using std::string;
+
using std::cout;
+using std::dynamic_pointer_cast;
using std::exception;
-using std::sort;
using std::shared_ptr;
-using std::dynamic_pointer_cast;
+using std::sort;
+using std::string;
using boost::optional;
using namespace dcpomatic;
+
PlaylistControls::PlaylistControls (wxWindow* parent, shared_ptr<FilmViewer> viewer)
: Controls (parent, viewer, false)
, _play_button (new Button(this, _("Play")))
diff --git a/src/wx/recipient_dialog.h b/src/wx/recipient_dialog.h
index 39ba5915e..3ad9789e9 100644
--- a/src/wx/recipient_dialog.h
+++ b/src/wx/recipient_dialog.h
@@ -18,6 +18,7 @@
*/
+
#include "editable_list.h"
#include "email_dialog.h"
#include "wx_util.h"
@@ -26,9 +27,11 @@
#include <wx/wx.h>
#include <boost/optional.hpp>
+
class Progress;
class TrustedDeviceDialog;
+
class RecipientDialog : public wxDialog
{
public:
diff --git a/src/wx/send_i18n_dialog.h b/src/wx/send_i18n_dialog.h
index f8d2b5354..68eec51b2 100644
--- a/src/wx/send_i18n_dialog.h
+++ b/src/wx/send_i18n_dialog.h
@@ -18,9 +18,11 @@
*/
+
#include "wx_util.h"
#include <wx/wx.h>
+
class SendI18NDialog : public wxDialog
{
public:
diff --git a/src/wx/smpte_metadata_dialog.cc b/src/wx/smpte_metadata_dialog.cc
index e4d2d9622..979afde8d 100644
--- a/src/wx/smpte_metadata_dialog.cc
+++ b/src/wx/smpte_metadata_dialog.cc
@@ -23,19 +23,19 @@
#include "editable_list.h"
#include "language_tag_dialog.h"
#include "language_tag_widget.h"
-#include "smpte_metadata_dialog.h"
#include "rating_dialog.h"
+#include "smpte_metadata_dialog.h"
#include "lib/film.h"
#include <dcp/types.h>
#include <wx/gbsizer.h>
#include <wx/spinctrl.h>
+using std::shared_ptr;
using std::string;
using std::vector;
-using boost::optional;
-using std::shared_ptr;
using std::weak_ptr;
+using boost::optional;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
#endif
diff --git a/src/wx/smpte_metadata_dialog.h b/src/wx/smpte_metadata_dialog.h
index d1a792a36..2d1b30757 100644
--- a/src/wx/smpte_metadata_dialog.h
+++ b/src/wx/smpte_metadata_dialog.h
@@ -30,11 +30,11 @@
#include <vector>
-class Film;
-class RatingDialog;
class ContentVersionDialog;
-class LanguageTagWidget;
+class Film;
class LanguageTagDialog;
+class LanguageTagWidget;
+class RatingDialog;
class SMPTEMetadataDialog : public MetadataDialog
diff --git a/src/wx/static_text.h b/src/wx/static_text.h
index 325e1f6d8..f690815eb 100644
--- a/src/wx/static_text.h
+++ b/src/wx/static_text.h
@@ -18,9 +18,11 @@
*/
+
#include "i18n_hook.h"
#include <wx/wx.h>
+
class StaticText : public wxStaticText, public I18NHook
{
public:
diff --git a/src/wx/templates_dialog.cc b/src/wx/templates_dialog.cc
index 259989d47..30c692e5e 100644
--- a/src/wx/templates_dialog.cc
+++ b/src/wx/templates_dialog.cc
@@ -19,10 +19,10 @@
*/
+#include "dcpomatic_button.h"
+#include "rename_template_dialog.h"
#include "templates_dialog.h"
#include "wx_util.h"
-#include "rename_template_dialog.h"
-#include "dcpomatic_button.h"
#include "lib/config.h"
#include <wx/wx.h>
diff --git a/src/wx/text_panel.cc b/src/wx/text_panel.cc
index 7bbead30c..24646b78a 100644
--- a/src/wx/text_panel.cc
+++ b/src/wx/text_panel.cc
@@ -18,6 +18,7 @@
*/
+
#include "check_box.h"
#include "content_panel.h"
#include "dcp_text_track_dialog.h"
@@ -47,14 +48,14 @@
#include <wx/spinctrl.h>
-using std::vector;
-using std::string;
-using std::list;
using std::cout;
-using std::shared_ptr;
-using boost::optional;
using std::dynamic_pointer_cast;
+using std::list;
+using std::shared_ptr;
+using std::string;
+using std::vector;
using boost::bind;
+using boost::optional;
/** @param t Original text type of the content, if known */
diff --git a/src/wx/text_view.cc b/src/wx/text_view.cc
index 3b674b5c1..4a39b9139 100644
--- a/src/wx/text_view.cc
+++ b/src/wx/text_view.cc
@@ -18,28 +18,31 @@
*/
-#include "text_view.h"
+
#include "film_viewer.h"
+#include "text_view.h"
#include "wx_util.h"
-#include "lib/string_text_file_decoder.h"
-#include "lib/content_text.h"
-#include "lib/video_decoder.h"
#include "lib/audio_decoder.h"
-#include "lib/film.h"
#include "lib/config.h"
+#include "lib/content_text.h"
+#include "lib/film.h"
#include "lib/string_text_file_content.h"
+#include "lib/string_text_file_decoder.h"
#include "lib/text_decoder.h"
+#include "lib/video_decoder.h"
+
+using std::dynamic_pointer_cast;
using std::list;
using std::shared_ptr;
using std::weak_ptr;
using boost::bind;
-using std::dynamic_pointer_cast;
using namespace dcpomatic;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
#endif
+
TextView::TextView (
wxWindow* parent, shared_ptr<Film> film, shared_ptr<Content> content, shared_ptr<TextContent> text, shared_ptr<Decoder> decoder, weak_ptr<FilmViewer> viewer
)
@@ -73,12 +76,12 @@ TextView::TextView (
_list->InsertColumn (2, ip);
}
- wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
+ auto sizer = new wxBoxSizer (wxVERTICAL);
sizer->Add (_list, 1, wxEXPAND | wxALL, DCPOMATIC_SIZER_X_GAP);
_list->Bind (wxEVT_LIST_ITEM_SELECTED, boost::bind (&TextView::subtitle_selected, this, _1));
- wxSizer* buttons = CreateSeparatedButtonSizer (wxOK);
+ auto buttons = CreateSeparatedButtonSizer (wxOK);
if (buttons) {
sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
}
@@ -104,6 +107,7 @@ TextView::TextView (
SetSizerAndFit (sizer);
}
+
void
TextView::data_start (ContentStringText cts)
{
@@ -120,6 +124,7 @@ TextView::data_start (ContentStringText cts)
_last_count = cts.subs.size ();
}
+
void
TextView::data_stop (ContentTime time)
{
@@ -132,6 +137,7 @@ TextView::data_stop (ContentTime time)
}
}
+
void
TextView::subtitle_selected (wxListEvent& ev)
{
@@ -140,9 +146,9 @@ TextView::subtitle_selected (wxListEvent& ev)
}
DCPOMATIC_ASSERT (ev.GetIndex() < int(_start_times.size()));
- shared_ptr<Content> lc = _content.lock ();
+ auto lc = _content.lock ();
DCPOMATIC_ASSERT (lc);
- shared_ptr<FilmViewer> fv = _film_viewer.lock ();
+ auto fv = _film_viewer.lock ();
DCPOMATIC_ASSERT (fv);
/* Add on a frame here to work around any rounding errors and make sure land in the subtitle */
fv->seek (lc, _start_times[ev.GetIndex()] + ContentTime::from_frames(1, _frc->source), true);
diff --git a/src/wx/time_picker.cc b/src/wx/time_picker.cc
index 966671be9..6b37d864b 100644
--- a/src/wx/time_picker.cc
+++ b/src/wx/time_picker.cc
@@ -18,20 +18,22 @@
*/
+
+#include "static_text.h"
#include "time_picker.h"
#include "wx_util.h"
-#include "static_text.h"
#include <dcp/locale_convert.h>
#include <wx/spinctrl.h>
#include <boost/bind/bind.hpp>
#include <iomanip>
+
+using std::cout;
+using std::max;
+using std::min;
using std::setfill;
using std::setw;
-using std::min;
-using std::max;
using std::string;
-using std::cout;
using boost::bind;
using dcp::locale_convert;
diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc
index 359de9bf9..645cb3de3 100644
--- a/src/wx/timeline.cc
+++ b/src/wx/timeline.cc
@@ -18,40 +18,39 @@
*/
+#include "content_panel.h"
#include "film_editor.h"
+#include "film_viewer.h"
#include "timeline.h"
-#include "timeline_time_axis_view.h"
-#include "timeline_reels_view.h"
-#include "timeline_labels_view.h"
-#include "timeline_video_content_view.h"
+#include "timeline_atmos_content_view.h"
#include "timeline_audio_content_view.h"
+#include "timeline_labels_view.h"
+#include "timeline_reels_view.h"
#include "timeline_text_content_view.h"
-#include "timeline_atmos_content_view.h"
-#include "content_panel.h"
+#include "timeline_time_axis_view.h"
+#include "timeline_video_content_view.h"
#include "wx_util.h"
-#include "film_viewer.h"
+#include "lib/atmos_mxf_content.h"
+#include "lib/audio_content.h"
#include "lib/film.h"
-#include "lib/playlist.h"
#include "lib/image_content.h"
-#include "lib/timer.h"
-#include "lib/audio_content.h"
+#include "lib/playlist.h"
#include "lib/text_content.h"
+#include "lib/timer.h"
#include "lib/video_content.h"
-#include "lib/atmos_mxf_content.h"
#include <wx/graphics.h>
-#include <list>
#include <iterator>
-#include <iostream>
+#include <list>
+
+using std::abs;
+using std::dynamic_pointer_cast;
using std::list;
-using std::cout;
-using std::min;
+using std::make_shared;
using std::max;
-using std::abs;
+using std::min;
using std::shared_ptr;
using std::weak_ptr;
-using std::dynamic_pointer_cast;
-using std::make_shared;
using boost::bind;
using boost::optional;
using namespace dcpomatic;
@@ -59,10 +58,12 @@ using namespace dcpomatic;
using namespace boost::placeholders;
#endif
+
/* 3 hours in 640 pixels */
double const Timeline::_minimum_pixels_per_second = 640.0 / (60 * 60 * 3);
int const Timeline::_minimum_pixels_per_track = 16;
+
Timeline::Timeline (wxWindow* parent, ContentPanel* cp, shared_ptr<Film> film, weak_ptr<FilmViewer> viewer)
: wxPanel (parent, wxID_ANY)
, _labels_canvas (new wxScrolledCanvas (this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE))
@@ -126,18 +127,21 @@ Timeline::Timeline (wxWindow* parent, ContentPanel* cp, shared_ptr<Film> film, w
_labels_canvas->ShowScrollbars (wxSHOW_SB_NEVER, wxSHOW_SB_NEVER);
}
+
void
Timeline::update_playhead ()
{
Refresh ();
}
+
void
Timeline::set_pixels_per_second (double pps)
{
_pixels_per_second = max (_minimum_pixels_per_second, pps);
}
+
void
Timeline::paint_labels ()
{
@@ -157,6 +161,7 @@ Timeline::paint_labels ()
delete gc;
}
+
void
Timeline::paint_main ()
{
@@ -224,6 +229,7 @@ Timeline::paint_main ()
delete gc;
}
+
void
Timeline::film_change (ChangeType type, Film::Property p)
{
@@ -239,6 +245,7 @@ Timeline::film_change (ChangeType type, Film::Property p)
}
}
+
void
Timeline::recreate_views ()
{
@@ -274,6 +281,7 @@ Timeline::recreate_views ()
Refresh ();
}
+
void
Timeline::film_content_change (ChangeType type, int property, bool frequent)
{
@@ -293,6 +301,7 @@ Timeline::film_content_change (ChangeType type, int property, bool frequent)
}
}
+
template <class T>
int
place (shared_ptr<const Film> film, TimelineViewList& views, int& tracks)
@@ -345,6 +354,7 @@ place (shared_ptr<const Film> film, TimelineViewList& views, int& tracks)
return tracks - base;
}
+
/** Compare the mapped output channels of two TimelineViews, so we can into
* order of first mapped DCP channel.
*/
@@ -366,6 +376,7 @@ struct AudioMappingComparator {
}
};
+
void
Timeline::assign_tracks ()
{
@@ -429,12 +440,14 @@ Timeline::assign_tracks ()
_reels_view->set_y (8);
}
+
int
Timeline::tracks () const
{
return _tracks;
}
+
void
Timeline::setup_scrollbars ()
{
@@ -451,6 +464,7 @@ Timeline::setup_scrollbars ()
_main_canvas->SetScrollRate (_x_scroll_rate, _y_scroll_rate);
}
+
shared_ptr<TimelineView>
Timeline::event_to_view (wxMouseEvent& ev)
{
@@ -473,6 +487,7 @@ Timeline::event_to_view (wxMouseEvent& ev)
return *i;
}
+
void
Timeline::left_down (wxMouseEvent& ev)
{
@@ -492,6 +507,7 @@ Timeline::left_down (wxMouseEvent& ev)
}
}
+
void
Timeline::left_down_select (wxMouseEvent& ev)
{
@@ -548,6 +564,7 @@ Timeline::left_down_select (wxMouseEvent& ev)
}
}
+
void
Timeline::left_up (wxMouseEvent& ev)
{
@@ -567,6 +584,7 @@ Timeline::left_up (wxMouseEvent& ev)
}
}
+
void
Timeline::left_up_select (wxMouseEvent& ev)
{
@@ -591,6 +609,7 @@ Timeline::left_up_select (wxMouseEvent& ev)
_end_snaps.clear ();
}
+
void
Timeline::left_up_zoom (wxMouseEvent& ev)
{
@@ -626,12 +645,14 @@ Timeline::left_up_zoom (wxMouseEvent& ev)
Refresh ();
}
+
void
Timeline::set_pixels_per_track (int h)
{
_pixels_per_track = max(_minimum_pixels_per_track, h);
}
+
void
Timeline::mouse_moved (wxMouseEvent& ev)
{
@@ -649,6 +670,7 @@ Timeline::mouse_moved (wxMouseEvent& ev)
}
}
+
void
Timeline::mouse_moved_select (wxMouseEvent& ev)
{
@@ -659,6 +681,7 @@ Timeline::mouse_moved_select (wxMouseEvent& ev)
set_position_from_event (ev);
}
+
void
Timeline::mouse_moved_zoom (wxMouseEvent& ev)
{
@@ -670,6 +693,7 @@ Timeline::mouse_moved_zoom (wxMouseEvent& ev)
Refresh ();
}
+
void
Timeline::right_down (wxMouseEvent& ev)
{
@@ -691,6 +715,7 @@ Timeline::right_down (wxMouseEvent& ev)
}
}
+
void
Timeline::right_down_select (wxMouseEvent& ev)
{
@@ -708,6 +733,7 @@ Timeline::right_down_select (wxMouseEvent& ev)
_menu.popup (_film, selected_content (), selected_views (), ev.GetPosition ());
}
+
void
Timeline::maybe_snap (DCPTime a, DCPTime b, optional<DCPTime>& nearest_distance) const
{
@@ -717,6 +743,7 @@ Timeline::maybe_snap (DCPTime a, DCPTime b, optional<DCPTime>& nearest_distance)
}
}
+
void
Timeline::set_position_from_event (wxMouseEvent& ev, bool force_emit)
{
@@ -782,18 +809,21 @@ Timeline::set_position_from_event (wxMouseEvent& ev, bool force_emit)
film->set_sequence (false);
}
+
void
Timeline::force_redraw (dcpomatic::Rect<int> const & r)
{
_main_canvas->RefreshRect (wxRect (r.x, r.y, r.width, r.height), false);
}
+
shared_ptr<const Film>
Timeline::film () const
{
return _film.lock ();
}
+
void
Timeline::resized ()
{
@@ -804,6 +834,7 @@ Timeline::resized ()
setup_scrollbars ();
}
+
void
Timeline::clear_selection ()
{
@@ -815,6 +846,7 @@ Timeline::clear_selection ()
}
}
+
TimelineContentViewList
Timeline::selected_views () const
{
@@ -830,6 +862,7 @@ Timeline::selected_views () const
return sel;
}
+
ContentList
Timeline::selected_content () const
{
@@ -842,6 +875,7 @@ Timeline::selected_content () const
return sel;
}
+
void
Timeline::set_selection (ContentList selection)
{
@@ -853,18 +887,21 @@ Timeline::set_selection (ContentList selection)
}
}
+
int
Timeline::tracks_y_offset () const
{
return _reels_view->bbox().height + 4;
}
+
int
Timeline::width () const
{
return _main_canvas->GetVirtualSize().GetWidth();
}
+
void
Timeline::scrolled (wxScrollWinEvent& ev)
{
@@ -876,6 +913,7 @@ Timeline::scrolled (wxScrollWinEvent& ev)
ev.Skip ();
}
+
void
Timeline::tool_clicked (Tool t)
{
@@ -893,6 +931,7 @@ Timeline::tool_clicked (Tool t)
}
}
+
void
Timeline::zoom_all ()
{
diff --git a/src/wx/timeline.h b/src/wx/timeline.h
index b532e74e3..041970d16 100644
--- a/src/wx/timeline.h
+++ b/src/wx/timeline.h
@@ -20,19 +20,24 @@
#include "content_menu.h"
#include "timeline_content_view.h"
-#include "lib/util.h"
-#include "lib/rect.h"
#include "lib/film.h"
+#include "lib/rect.h"
+#include "lib/util.h"
+#include "lib/warnings.h"
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <boost/signals2.hpp>
-class Film;
+
class ContentPanel;
-class TimelineView;
-class TimelineTimeAxisView;
-class TimelineReelsView;
-class TimelineLabelsView;
+class Film;
class FilmViewer;
+class TimelineLabelsView;
+class TimelineReelsView;
+class TimelineTimeAxisView;
+class TimelineView;
+
class Timeline : public wxPanel
{
diff --git a/src/wx/timeline_content_view.cc b/src/wx/timeline_content_view.cc
index 481e8100d..926ca3258 100644
--- a/src/wx/timeline_content_view.cc
+++ b/src/wx/timeline_content_view.cc
@@ -18,12 +18,14 @@
*/
-#include "timeline_content_view.h"
+
#include "timeline.h"
+#include "timeline_content_view.h"
#include "wx_util.h"
#include "lib/content.h"
#include <wx/graphics.h>
+
using std::list;
using std::shared_ptr;
using namespace dcpomatic;
@@ -31,6 +33,7 @@ using namespace dcpomatic;
using namespace boost::placeholders;
#endif
+
TimelineContentView::TimelineContentView (Timeline& tl, shared_ptr<Content> c)
: TimelineView (tl)
, _content (c)
@@ -38,6 +41,7 @@ TimelineContentView::TimelineContentView (Timeline& tl, shared_ptr<Content> c)
_content_connection = c->Change.connect (bind (&TimelineContentView::content_change, this, _1, _3));
}
+
dcpomatic::Rect<int>
TimelineContentView::bbox () const
{
@@ -57,6 +61,7 @@ TimelineContentView::bbox () const
);
}
+
void
TimelineContentView::set_selected (bool s)
{
@@ -64,36 +69,42 @@ TimelineContentView::set_selected (bool s)
force_redraw ();
}
+
bool
TimelineContentView::selected () const
{
return _selected;
}
+
shared_ptr<Content>
TimelineContentView::content () const
{
return _content.lock ();
}
+
void
TimelineContentView::set_track (int t)
{
_track = t;
}
+
void
TimelineContentView::unset_track ()
{
_track = boost::optional<int>();
}
+
boost::optional<int>
TimelineContentView::track () const
{
return _track;
}
+
void
TimelineContentView::do_paint (wxGraphicsContext* gc, list<dcpomatic::Rect<int>> overlaps)
{
@@ -156,12 +167,14 @@ TimelineContentView::do_paint (wxGraphicsContext* gc, list<dcpomatic::Rect<int>>
gc->PopState ();
}
+
int
TimelineContentView::y_pos (int t) const
{
return t * _timeline.pixels_per_track() + _timeline.tracks_y_offset();
}
+
void
TimelineContentView::content_change (ChangeType type, int p)
{
@@ -176,6 +189,7 @@ TimelineContentView::content_change (ChangeType type, int p)
}
}
+
wxString
TimelineContentView::label () const
{
diff --git a/src/wx/timeline_dialog.cc b/src/wx/timeline_dialog.cc
index 975f7cd9d..8cdc6d63d 100644
--- a/src/wx/timeline_dialog.cc
+++ b/src/wx/timeline_dialog.cc
@@ -27,14 +27,12 @@
#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;
using std::shared_ptr;
+using std::string;
using std::weak_ptr;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
diff --git a/src/wx/timeline_labels_view.cc b/src/wx/timeline_labels_view.cc
index 4450fef05..cc0d76aa7 100644
--- a/src/wx/timeline_labels_view.cc
+++ b/src/wx/timeline_labels_view.cc
@@ -19,10 +19,10 @@
*/
-#include "timeline_labels_view.h"
#include "timeline.h"
-#include <wx/wx.h>
+#include "timeline_labels_view.h"
#include <wx/graphics.h>
+#include <wx/wx.h>
using std::list;
diff --git a/src/wx/timeline_reels_view.cc b/src/wx/timeline_reels_view.cc
index cf1abb34f..588ae7819 100644
--- a/src/wx/timeline_reels_view.cc
+++ b/src/wx/timeline_reels_view.cc
@@ -19,10 +19,10 @@
*/
-#include "timeline_reels_view.h"
#include "timeline.h"
-#include <wx/wx.h>
+#include "timeline_reels_view.h"
#include <wx/graphics.h>
+#include <wx/wx.h>
using std::min;
diff --git a/src/wx/timeline_time_axis_view.cc b/src/wx/timeline_time_axis_view.cc
index e9de1b542..3cdcfc2c8 100644
--- a/src/wx/timeline_time_axis_view.cc
+++ b/src/wx/timeline_time_axis_view.cc
@@ -18,16 +18,18 @@
*/
-#include "timeline_time_axis_view.h"
#include "timeline.h"
+#include "timeline_time_axis_view.h"
#include "wx_util.h"
-#include <wx/wx.h>
#include <wx/graphics.h>
+#include <wx/wx.h>
+
-using std::list;
using std::cout;
+using std::list;
using namespace dcpomatic;
+
TimelineTimeAxisView::TimelineTimeAxisView (Timeline& tl, int y)
: TimelineView (tl)
, _y (y)
@@ -35,12 +37,14 @@ TimelineTimeAxisView::TimelineTimeAxisView (Timeline& tl, int y)
}
+
dcpomatic::Rect<int>
TimelineTimeAxisView::bbox () const
{
return dcpomatic::Rect<int> (0, _y - 4, _timeline.width(), 24);
}
+
/** @param y y position in tracks (not pixels) */
void
TimelineTimeAxisView::set_y (int y)
@@ -49,6 +53,7 @@ TimelineTimeAxisView::set_y (int y)
force_redraw ();
}
+
void
TimelineTimeAxisView::do_paint (wxGraphicsContext* gc, list<dcpomatic::Rect<int> >)
{
diff --git a/src/wx/try_unmount_dialog.cc b/src/wx/try_unmount_dialog.cc
index 8a75a1376..dcec6bb0b 100644
--- a/src/wx/try_unmount_dialog.cc
+++ b/src/wx/try_unmount_dialog.cc
@@ -19,9 +19,9 @@
*/
+#include "static_text.h"
#include "try_unmount_dialog.h"
#include "wx_util.h"
-#include "static_text.h"
#include <wx/wx.h>
diff --git a/src/wx/verify_dcp_progress_dialog.cc b/src/wx/verify_dcp_progress_dialog.cc
index 030a9810d..c62d198a0 100644
--- a/src/wx/verify_dcp_progress_dialog.cc
+++ b/src/wx/verify_dcp_progress_dialog.cc
@@ -29,8 +29,8 @@
using std::string;
-using boost::optional;
using std::shared_ptr;
+using boost::optional;
static int const max_file_name_length = 80;
diff --git a/src/wx/video_view.h b/src/wx/video_view.h
index 5353f213f..28ca3a1e8 100644
--- a/src/wx/video_view.h
+++ b/src/wx/video_view.h
@@ -33,11 +33,11 @@
#include <boost/thread.hpp>
-class Image;
-class wxWindow;
class FilmViewer;
+class Image;
class Player;
class PlayerVideo;
+class wxWindow;
class VideoView : public ExceptionStore, public Signaller
diff --git a/src/wx/video_waveform_plot.cc b/src/wx/video_waveform_plot.cc
index 07b2955b3..766432ec6 100644
--- a/src/wx/video_waveform_plot.cc
+++ b/src/wx/video_waveform_plot.cc
@@ -28,8 +28,8 @@
#include "lib/player_video.h"
#include <dcp/locale_convert.h>
#include <dcp/openjpeg_image.h>
-#include <wx/rawbmp.h>
#include <wx/graphics.h>
+#include <wx/rawbmp.h>
#include <boost/bind/bind.hpp>
#include <iostream>
diff --git a/src/wx/wx_util.h b/src/wx/wx_util.h
index f85110eae..a41337720 100644
--- a/src/wx/wx_util.h
+++ b/src/wx/wx_util.h
@@ -34,8 +34,8 @@ DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
DCPOMATIC_ENABLE_WARNINGS
#include <wx/gbsizer.h>
-#include <boost/thread.hpp>
#include <boost/signals2.hpp>
+#include <boost/thread.hpp>
class FilePickerCtrl;