From 313319ba2d8544bc25524e02e634804a503b54f1 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 21 Apr 2022 21:34:50 +0200 Subject: [PATCH] Tidying. --- src/lib/reel_writer.cc | 41 +++++++++------ src/tools/dcpomatic_playlist.cc | 12 ++--- src/wx/audio_plot.cc | 2 - src/wx/batch_job_view.cc | 2 +- src/wx/colour_conversion_editor.cc | 6 +-- src/wx/colour_conversion_editor.h | 2 +- src/wx/content_menu.cc | 38 +++++++------- src/wx/content_menu.h | 6 ++- src/wx/content_panel.cc | 8 ++- src/wx/content_panel.h | 22 ++++---- src/wx/content_sub_panel.cc | 5 +- src/wx/content_view.cc | 6 +-- src/wx/content_widget.h | 5 +- src/wx/controls.cc | 16 +++--- src/wx/dcp_panel.cc | 30 ++++++----- src/wx/dcpomatic_spin_ctrl.cc | 1 + src/wx/dkdm_dialog.cc | 26 +++++----- src/wx/dkdm_dialog.h | 8 +-- src/wx/dkdm_output_panel.h | 13 +++-- src/wx/editable_list.h | 7 ++- src/wx/film_editor.cc | 16 +++--- src/wx/film_name_location_dialog.cc | 3 +- src/wx/film_viewer.cc | 28 +++++------ src/wx/fonts_dialog.cc | 10 ++-- src/wx/full_language_tag_dialog.cc | 7 ++- src/wx/interop_metadata_dialog.cc | 2 +- src/wx/job_view.cc | 14 +++--- src/wx/kdm_advanced_dialog.cc | 5 +- src/wx/kdm_dialog.cc | 32 ++++++------ src/wx/kdm_dialog.h | 9 ++-- src/wx/markers_dialog.cc | 16 +++--- src/wx/player_config_dialog.cc | 46 +++++++++-------- src/wx/player_stress_tester.cc | 10 ++-- src/wx/playlist_controls.cc | 25 ++++++---- src/wx/recipient_dialog.h | 3 ++ src/wx/send_i18n_dialog.h | 2 + src/wx/smpte_metadata_dialog.cc | 6 +-- src/wx/smpte_metadata_dialog.h | 6 +-- src/wx/static_text.h | 2 + src/wx/templates_dialog.cc | 4 +- src/wx/text_panel.cc | 11 ++-- src/wx/text_view.cc | 26 ++++++---- src/wx/time_picker.cc | 10 ++-- src/wx/timeline.cc | 75 +++++++++++++++++++++------- src/wx/timeline.h | 19 ++++--- src/wx/timeline_content_view.cc | 16 +++++- src/wx/timeline_dialog.cc | 4 +- src/wx/timeline_labels_view.cc | 4 +- src/wx/timeline_reels_view.cc | 4 +- src/wx/timeline_time_axis_view.cc | 11 ++-- src/wx/try_unmount_dialog.cc | 2 +- src/wx/verify_dcp_progress_dialog.cc | 2 +- src/wx/video_view.h | 4 +- src/wx/video_waveform_plot.cc | 2 +- src/wx/wx_util.h | 2 +- 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 #include #include @@ -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 info, Frame frame, Eyes eyes) const { @@ -224,6 +230,7 @@ ReelWriter::read_frame_info (shared_ptr 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 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 track, } } + bool ReelWriter::existing_picture_frame_ok (FILE* asset_file, shared_ptr 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 -#include #include -#include +#include #include +#include +#include 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 #include #include -#include -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 #include +#include 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 #include #include -#include +#include #include +#include #include #include #include -#include -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 +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 -#include #include +#include #include -#include #include -#include +#include -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 #include + +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 -#include -#include #include +#include +#include +#include #include -#include -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 +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 + 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 #include #include 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 #include #include +#include #include + /** @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 #include +#include #include #include -#include -#include #include #include +#include +#include -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 -#include -#include #include +#include #include +#include #include -#include -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 #include + #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 #include -#include #include +#include #include -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 -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 #include #include -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 +#include "wx_util.h" #include +#include #include + 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 +#include "lib/film.h" +#include "lib/job_manager.h" #include -#include +#include -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 #include 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 } #include #include -#include #include 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 -#include #include 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 #include #include @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -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 +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 #include -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 + using boost::optional; + KDMAdvancedDialog::KDMAdvancedDialog (wxWindow* parent, bool forensic_mark_video, bool forensic_mark_audio, optional 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 #include -#include #include -#include +#include -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 #include #include #include + 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 #include #include -#include -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 -#include #include -#include +#include +#include +#include #include #include -#include +#include #include #include -#include -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 #include #include #include #include +#include #include #include -#include + +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 #include #include #include -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 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 #include + 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 + 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 #include #include +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 -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 + 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 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 -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, shared_ptr content, shared_ptr text, shared_ptr decoder, weak_ptr 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 lc = _content.lock (); + auto lc = _content.lock (); DCPOMATIC_ASSERT (lc); - shared_ptr 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 #include #include #include + +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 -#include #include -#include +#include + +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, weak_ptr 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, 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 int place (shared_ptr film, TimelineViewList& views, int& tracks) @@ -345,6 +354,7 @@ place (shared_ptr 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 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& nearest_distance) const { @@ -717,6 +743,7 @@ Timeline::maybe_snap (DCPTime a, DCPTime b, optional& 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 const & r) { _main_canvas->RefreshRect (wxRect (r.x, r.y, r.width, r.height), false); } + shared_ptr 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 +DCPOMATIC_ENABLE_WARNINGS #include -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 + 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 c) : TimelineView (tl) , _content (c) @@ -38,6 +41,7 @@ TimelineContentView::TimelineContentView (Timeline& tl, shared_ptr c) _content_connection = c->Change.connect (bind (&TimelineContentView::content_change, this, _1, _3)); } + dcpomatic::Rect 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 TimelineContentView::content () const { return _content.lock (); } + void TimelineContentView::set_track (int t) { _track = t; } + void TimelineContentView::unset_track () { _track = boost::optional(); } + boost::optional TimelineContentView::track () const { return _track; } + void TimelineContentView::do_paint (wxGraphicsContext* gc, list> overlaps) { @@ -156,12 +167,14 @@ TimelineContentView::do_paint (wxGraphicsContext* gc, list> 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 -#include #include 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 +#include "timeline_labels_view.h" #include +#include 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 +#include "timeline_reels_view.h" #include +#include 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 #include +#include + -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 TimelineTimeAxisView::bbox () const { return dcpomatic::Rect (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 >) { 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 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 -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 #include -#include #include +#include #include #include 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 DCPOMATIC_ENABLE_WARNINGS #include -#include #include +#include class FilePickerCtrl; -- 2.30.2