From c4403784febdbdd42e9c32e67fadb147f11fe566 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 8 May 2019 23:41:42 +0100 Subject: [PATCH] Put Time types in dcpomatic namespace. --- src/lib/active_text.cc | 1 + src/lib/active_text.h | 14 ++++---- src/lib/analyse_audio_job.cc | 1 + src/lib/analyse_audio_job.h | 4 +-- src/lib/atmos_mxf_content.cc | 1 + src/lib/atmos_mxf_content.h | 4 +-- src/lib/audio_analysis.cc | 1 + src/lib/audio_analysis.h | 4 +-- src/lib/audio_content.cc | 1 + src/lib/audio_content.h | 4 +-- src/lib/audio_decoder.cc | 1 + src/lib/audio_decoder.h | 6 ++-- src/lib/audio_merger.cc | 1 + src/lib/audio_merger.h | 16 ++++----- src/lib/audio_ring_buffers.cc | 1 + src/lib/audio_ring_buffers.h | 8 ++--- src/lib/butler.cc | 1 + src/lib/butler.h | 18 +++++----- src/lib/content.cc | 1 + src/lib/content.h | 32 ++++++++--------- src/lib/content_text.h | 10 +++--- src/lib/dcp_content.cc | 1 + src/lib/dcp_content.h | 8 ++--- src/lib/dcp_decoder.cc | 1 + src/lib/dcp_decoder.h | 8 ++--- src/lib/dcp_encoder.cc | 1 + src/lib/dcp_encoder.h | 6 ++-- src/lib/dcp_subtitle_content.cc | 1 + src/lib/dcp_subtitle_content.h | 6 ++-- src/lib/dcp_subtitle_decoder.cc | 1 + src/lib/dcp_subtitle_decoder.h | 4 +-- src/lib/dcpomatic_time.cc | 15 ++++---- src/lib/dcpomatic_time.h | 13 +++++-- src/lib/dcpomatic_time_coalesce.h | 4 +++ src/lib/decoder.cc | 1 + src/lib/decoder.h | 4 +-- src/lib/decoder_part.h | 2 +- src/lib/empty.cc | 1 + src/lib/empty.h | 10 +++--- src/lib/ffmpeg.cc | 1 + src/lib/ffmpeg.h | 4 +-- src/lib/ffmpeg_audio_stream.cc | 1 + src/lib/ffmpeg_audio_stream.h | 2 +- src/lib/ffmpeg_content.cc | 1 + src/lib/ffmpeg_content.h | 8 ++--- src/lib/ffmpeg_decoder.cc | 1 + src/lib/ffmpeg_decoder.h | 12 +++---- src/lib/ffmpeg_encoder.cc | 1 + src/lib/ffmpeg_encoder.h | 2 +- src/lib/ffmpeg_examiner.cc | 1 + src/lib/ffmpeg_examiner.h | 10 +++--- src/lib/ffmpeg_file_encoder.cc | 1 + src/lib/ffmpeg_file_encoder.h | 4 +-- src/lib/ffmpeg_subtitle_period.h | 8 ++--- src/lib/film.cc | 1 + src/lib/film.h | 20 +++++------ src/lib/hints.cc | 1 + src/lib/hints.h | 4 +-- src/lib/image_content.cc | 1 + src/lib/image_content.h | 4 +-- src/lib/image_decoder.cc | 1 + src/lib/image_decoder.h | 2 +- src/lib/j2k_encoder.cc | 1 + src/lib/j2k_encoder.h | 4 +-- src/lib/job.cc | 1 + src/lib/overlaps.cc | 1 + src/lib/overlaps.h | 2 +- src/lib/player.cc | 1 + src/lib/player.h | 50 +++++++++++++------------- src/lib/playlist.cc | 1 + src/lib/playlist.h | 12 +++---- src/lib/reel_writer.cc | 1 + src/lib/reel_writer.h | 8 ++--- src/lib/referenced_reel_asset.h | 4 +-- src/lib/render_text.cc | 1 + src/lib/render_text.h | 2 +- src/lib/string_text_file.cc | 1 + src/lib/string_text_file.h | 4 +-- src/lib/string_text_file_content.cc | 1 + src/lib/string_text_file_content.h | 6 ++-- src/lib/string_text_file_decoder.cc | 1 + src/lib/string_text_file_decoder.h | 4 +-- src/lib/text_content.cc | 1 + src/lib/text_content.h | 12 +++---- src/lib/text_decoder.cc | 1 + src/lib/text_decoder.h | 22 ++++++------ src/lib/text_ring_buffers.cc | 1 + src/lib/text_ring_buffers.h | 6 ++-- src/lib/util.cc | 1 + src/lib/util.h | 4 +-- src/lib/video_content.cc | 1 + src/lib/video_content.h | 4 +-- src/lib/video_decoder.cc | 1 + src/lib/video_decoder.h | 4 +-- src/lib/video_mxf_content.cc | 1 + src/lib/video_mxf_content.h | 4 +-- src/lib/video_mxf_decoder.cc | 1 + src/lib/video_mxf_decoder.h | 4 +-- src/lib/video_ring_buffers.cc | 1 + src/lib/video_ring_buffers.h | 6 ++-- src/lib/writer.cc | 1 + src/lib/writer.h | 4 +-- src/tools/dcpomatic_player.cc | 1 + src/wx/audio_dialog.cc | 1 + src/wx/audio_dialog.h | 2 +- src/wx/audio_plot.cc | 1 + src/wx/audio_plot.h | 6 ++-- src/wx/closed_captions_dialog.cc | 1 + src/wx/closed_captions_dialog.h | 4 +-- src/wx/content_panel.cc | 1 + src/wx/content_view.cc | 1 + src/wx/controls.cc | 1 + src/wx/controls.h | 2 +- src/wx/film_viewer.cc | 1 + src/wx/film_viewer.h | 22 ++++++------ src/wx/markers_dialog.cc | 3 +- src/wx/move_to_dialog.cc | 1 + src/wx/move_to_dialog.h | 4 +-- src/wx/playhead_to_frame_dialog.cc | 1 + src/wx/playhead_to_frame_dialog.h | 2 +- src/wx/playhead_to_timecode_dialog.cc | 2 ++ src/wx/playhead_to_timecode_dialog.h | 4 +-- src/wx/subtitle_appearance_dialog.cc | 1 + src/wx/subtitle_appearance_dialog.h | 4 +-- src/wx/swaroop_controls.cc | 1 + src/wx/text_view.cc | 1 + src/wx/text_view.h | 4 +-- src/wx/timeline.cc | 1 + src/wx/timeline.h | 8 ++--- src/wx/timeline_content_view.cc | 1 + src/wx/timeline_reels_view.cc | 1 + src/wx/timeline_time_axis_view.cc | 1 + src/wx/timeline_view.cc | 1 + src/wx/timeline_view.h | 2 +- src/wx/timing_panel.cc | 1 + src/wx/timing_panel.h | 10 +++--- src/wx/video_panel.cc | 1 + src/wx/video_panel.h | 4 +-- src/wx/wx_util.cc | 1 + src/wx/wx_util.h | 2 +- test/audio_analysis_test.cc | 1 + test/audio_merger_test.cc | 1 + test/audio_ring_buffers_test.cc | 1 + test/burnt_subtitle_test.cc | 1 + test/butler_test.cc | 1 + test/content_test.cc | 1 + test/dcp_playback_test.cc | 1 + test/dcp_subtitle_test.cc | 1 + test/dcpomatic_time_test.cc | 1 + test/empty_test.cc | 1 + test/ffmpeg_decoder_seek_test.cc | 1 + test/ffmpeg_decoder_sequential_test.cc | 1 + test/ffmpeg_encoder_test.cc | 1 + test/ffmpeg_examiner_test.cc | 1 + test/ffmpeg_pts_offset_test.cc | 1 + test/player_test.cc | 1 + test/reels_test.cc | 1 + test/silence_padding_test.cc | 2 +- test/srt_subtitle_test.cc | 1 + test/subtitle_trim_test.cc | 1 + test/time_calculation_test.cc | 1 + test/torture_test.cc | 1 + test/upmixer_a_test.cc | 1 + test/util_test.cc | 1 + test/vf_test.cc | 1 + 165 files changed, 367 insertions(+), 259 deletions(-) diff --git a/src/lib/active_text.cc b/src/lib/active_text.cc index 2988c04a3..3a7e1a27e 100644 --- a/src/lib/active_text.cc +++ b/src/lib/active_text.cc @@ -29,6 +29,7 @@ using std::make_pair; using boost::weak_ptr; using boost::shared_ptr; using boost::optional; +using namespace dcpomatic; /** Get the open captions that should be burnt into a given period. * @param period Period of interest. diff --git a/src/lib/active_text.h b/src/lib/active_text.h index ff4a1bd2f..90b6b533b 100644 --- a/src/lib/active_text.h +++ b/src/lib/active_text.h @@ -37,11 +37,11 @@ class TextContent; class ActiveText : public boost::noncopyable { public: - std::list get_burnt (DCPTimePeriod period, bool always_burn_captions) const; - void clear_before (DCPTime time); + std::list get_burnt (dcpomatic::DCPTimePeriod period, bool always_burn_captions) const; + void clear_before (dcpomatic::DCPTime time); void clear (); - void add_from (boost::weak_ptr content, PlayerText ps, DCPTime from); - std::pair add_to (boost::weak_ptr content, DCPTime to); + void add_from (boost::weak_ptr content, PlayerText ps, dcpomatic::DCPTime from); + std::pair add_to (boost::weak_ptr content, dcpomatic::DCPTime to); bool have (boost::weak_ptr content) const; private: @@ -50,14 +50,14 @@ private: public: Period () {} - Period (PlayerText s, DCPTime f) + Period (PlayerText s, dcpomatic::DCPTime f) : subs (s) , from (f) {} PlayerText subs; - DCPTime from; - boost::optional to; + dcpomatic::DCPTime from; + boost::optional to; }; typedef std::map, std::list > Map; diff --git a/src/lib/analyse_audio_job.cc b/src/lib/analyse_audio_job.cc index e4a100c4a..9d0882b3a 100644 --- a/src/lib/analyse_audio_job.cc +++ b/src/lib/analyse_audio_job.cc @@ -47,6 +47,7 @@ using std::min; using std::cout; using boost::shared_ptr; using boost::dynamic_pointer_cast; +using namespace dcpomatic; int const AnalyseAudioJob::_num_points = 1024; diff --git a/src/lib/analyse_audio_job.h b/src/lib/analyse_audio_job.h index b88d6c2bf..5d6c091bc 100644 --- a/src/lib/analyse_audio_job.h +++ b/src/lib/analyse_audio_job.h @@ -56,12 +56,12 @@ public: } private: - void analyse (boost::shared_ptr, DCPTime time); + void analyse (boost::shared_ptr, dcpomatic::DCPTime time); boost::shared_ptr _playlist; /** playlist's audio analysis path when the job was created */ boost::filesystem::path _path; - DCPTime _start; + dcpomatic::DCPTime _start; bool _from_zero; int64_t _done; diff --git a/src/lib/atmos_mxf_content.cc b/src/lib/atmos_mxf_content.cc index 5b97edcfd..fa27f600b 100644 --- a/src/lib/atmos_mxf_content.cc +++ b/src/lib/atmos_mxf_content.cc @@ -32,6 +32,7 @@ using std::list; using std::string; using boost::shared_ptr; +using namespace dcpomatic; AtmosMXFContent::AtmosMXFContent (boost::filesystem::path path) : Content (path) diff --git a/src/lib/atmos_mxf_content.h b/src/lib/atmos_mxf_content.h index 05f36c21c..06e9e747d 100644 --- a/src/lib/atmos_mxf_content.h +++ b/src/lib/atmos_mxf_content.h @@ -37,8 +37,8 @@ public: void examine (boost::shared_ptr film, boost::shared_ptr job); std::string summary () const; void as_xml (xmlpp::Node* node, bool with_path) const; - DCPTime full_length (boost::shared_ptr film) const; - DCPTime approximate_length () const; + dcpomatic::DCPTime full_length (boost::shared_ptr film) const; + dcpomatic::DCPTime approximate_length () const; static bool valid_mxf (boost::filesystem::path path); diff --git a/src/lib/audio_analysis.cc b/src/lib/audio_analysis.cc index 78e5741e5..13917cb5f 100644 --- a/src/lib/audio_analysis.cc +++ b/src/lib/audio_analysis.cc @@ -46,6 +46,7 @@ using boost::shared_ptr; using boost::optional; using boost::dynamic_pointer_cast; using dcp::raw_convert; +using namespace dcpomatic; int const AudioAnalysis::_current_state_version = 3; diff --git a/src/lib/audio_analysis.h b/src/lib/audio_analysis.h index e5ee24d49..3684db96a 100644 --- a/src/lib/audio_analysis.h +++ b/src/lib/audio_analysis.h @@ -43,13 +43,13 @@ public: void add_point (int c, AudioPoint const & p); struct PeakTime { - PeakTime (float p, DCPTime t) + PeakTime (float p, dcpomatic::DCPTime t) : peak (p) , time (t) {} float peak; - DCPTime time; + dcpomatic::DCPTime time; }; void set_sample_peak (std::vector peak) { diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc index 170b9299f..014221f2e 100644 --- a/src/lib/audio_content.cc +++ b/src/lib/audio_content.cc @@ -43,6 +43,7 @@ using boost::shared_ptr; using boost::dynamic_pointer_cast; using boost::optional; using dcp::raw_convert; +using namespace dcpomatic; /** Something stream-related has changed */ int const AudioContentProperty::STREAMS = 200; diff --git a/src/lib/audio_content.h b/src/lib/audio_content.h index 98e16a457..504c2aecf 100644 --- a/src/lib/audio_content.h +++ b/src/lib/audio_content.h @@ -82,8 +82,8 @@ public: void add_properties (boost::shared_ptr film, std::list &) const; - void modify_position (boost::shared_ptr film, DCPTime& pos) const; - void modify_trim_start (ContentTime& pos) const; + void modify_position (boost::shared_ptr film, dcpomatic::DCPTime& pos) const; + void modify_trim_start (dcpomatic::ContentTime& pos) const; static boost::shared_ptr from_xml (Content* parent, cxml::ConstNodePtr, int version); diff --git a/src/lib/audio_decoder.cc b/src/lib/audio_decoder.cc index 440510ce5..e0fb20b7e 100644 --- a/src/lib/audio_decoder.cc +++ b/src/lib/audio_decoder.cc @@ -35,6 +35,7 @@ using std::map; using std::pair; using boost::shared_ptr; using boost::optional; +using namespace dcpomatic; AudioDecoder::AudioDecoder (Decoder* parent, shared_ptr content, bool fast) : DecoderPart (parent) diff --git a/src/lib/audio_decoder.h b/src/lib/audio_decoder.h index 50e361e8f..32d71c067 100644 --- a/src/lib/audio_decoder.h +++ b/src/lib/audio_decoder.h @@ -47,12 +47,12 @@ class AudioDecoder : public boost::enable_shared_from_this, public public: AudioDecoder (Decoder* parent, boost::shared_ptr content, bool fast); - ContentTime position (boost::shared_ptr film) const; - void emit (boost::shared_ptr film, AudioStreamPtr stream, boost::shared_ptr, ContentTime); + dcpomatic::ContentTime position (boost::shared_ptr film) const; + void emit (boost::shared_ptr film, AudioStreamPtr stream, boost::shared_ptr, dcpomatic::ContentTime); void seek (); void flush (); - ContentTime stream_position (boost::shared_ptr film, AudioStreamPtr stream) const; + dcpomatic::ContentTime stream_position (boost::shared_ptr film, AudioStreamPtr stream) const; /** @return Number of frames of data that were accepted */ boost::signals2::signal Data; diff --git a/src/lib/audio_merger.cc b/src/lib/audio_merger.cc index a16c378c6..1cc5ff0a1 100644 --- a/src/lib/audio_merger.cc +++ b/src/lib/audio_merger.cc @@ -33,6 +33,7 @@ using std::cout; using std::make_pair; using boost::shared_ptr; using boost::optional; +using namespace dcpomatic; AudioMerger::AudioMerger (int frame_rate) : _frame_rate (frame_rate) diff --git a/src/lib/audio_merger.h b/src/lib/audio_merger.h index dbc0c8691..d5a6ec43a 100644 --- a/src/lib/audio_merger.h +++ b/src/lib/audio_merger.h @@ -33,12 +33,12 @@ class AudioMerger public: explicit AudioMerger (int frame_rate); - std::list, DCPTime> > pull (DCPTime time); - void push (boost::shared_ptr audio, DCPTime time); + std::list, dcpomatic::DCPTime> > pull (dcpomatic::DCPTime time); + void push (boost::shared_ptr audio, dcpomatic::DCPTime time); void clear (); private: - Frame frames (DCPTime t) const; + Frame frames (dcpomatic::DCPTime t) const; class Buffer { @@ -48,24 +48,24 @@ private: * @param t Time * @param r Frame rate. */ - Buffer (int c, int32_t f, DCPTime t, int r) + Buffer (int c, int32_t f, dcpomatic::DCPTime t, int r) : audio (new AudioBuffers (c, f)) , time (t) , frame_rate (r) {} - Buffer (boost::shared_ptr a, DCPTime t, int r) + Buffer (boost::shared_ptr a, dcpomatic::DCPTime t, int r) : audio (a) , time (t) , frame_rate (r) {} boost::shared_ptr audio; - DCPTime time; + dcpomatic::DCPTime time; int frame_rate; - DCPTimePeriod period () const { - return DCPTimePeriod (time, time + DCPTime::from_frames (audio->frames(), frame_rate)); + dcpomatic::DCPTimePeriod period () const { + return dcpomatic::DCPTimePeriod (time, time + dcpomatic::DCPTime::from_frames (audio->frames(), frame_rate)); } }; diff --git a/src/lib/audio_ring_buffers.cc b/src/lib/audio_ring_buffers.cc index d1375cb27..cd7f4f597 100644 --- a/src/lib/audio_ring_buffers.cc +++ b/src/lib/audio_ring_buffers.cc @@ -31,6 +31,7 @@ using std::pair; using std::list; using boost::shared_ptr; using boost::optional; +using namespace dcpomatic; AudioRingBuffers::AudioRingBuffers () : _used_in_head (0) diff --git a/src/lib/audio_ring_buffers.h b/src/lib/audio_ring_buffers.h index 8d830ecf7..bfaad5ec9 100644 --- a/src/lib/audio_ring_buffers.h +++ b/src/lib/audio_ring_buffers.h @@ -33,16 +33,16 @@ class AudioRingBuffers : public boost::noncopyable public: AudioRingBuffers (); - void put (boost::shared_ptr data, DCPTime time, int frame_rate); - boost::optional get (float* out, int channels, int frames); - boost::optional peek () const; + void put (boost::shared_ptr data, dcpomatic::DCPTime time, int frame_rate); + boost::optional get (float* out, int channels, int frames); + boost::optional peek () const; void clear (); Frame size () const; private: mutable boost::mutex _mutex; - std::list, DCPTime> > _buffers; + std::list, dcpomatic::DCPTime> > _buffers; int _used_in_head; }; diff --git a/src/lib/butler.cc b/src/lib/butler.cc index fe331fc79..0218c1fb3 100644 --- a/src/lib/butler.cc +++ b/src/lib/butler.cc @@ -38,6 +38,7 @@ using boost::shared_ptr; using boost::bind; using boost::optional; using boost::function; +using namespace dcpomatic; /** Minimum video readahead in frames */ #define MINIMUM_VIDEO_READAHEAD 10 diff --git a/src/lib/butler.h b/src/lib/butler.h index 8c4d30efe..f1922d348 100644 --- a/src/lib/butler.h +++ b/src/lib/butler.h @@ -47,15 +47,15 @@ public: ~Butler (); - void seek (DCPTime position, bool accurate); + void seek (dcpomatic::DCPTime position, bool accurate); enum Error { NONE, AGAIN }; - std::pair, DCPTime> get_video (Error* e = 0); - boost::optional get_audio (float* out, Frame frames); + std::pair, dcpomatic::DCPTime> get_video (Error* e = 0); + boost::optional get_audio (float* out, Frame frames); boost::optional get_closed_caption (); void disable_audio (); @@ -64,13 +64,13 @@ public: private: void thread (); - void video (boost::shared_ptr video, DCPTime time); - void audio (boost::shared_ptr audio, DCPTime time, int frame_rate); - void text (PlayerText pt, TextType type, boost::optional track, DCPTimePeriod period); + void video (boost::shared_ptr video, dcpomatic::DCPTime time); + void audio (boost::shared_ptr audio, dcpomatic::DCPTime time, int frame_rate); + void text (PlayerText pt, TextType type, boost::optional track, dcpomatic::DCPTimePeriod period); bool should_run () const; void prepare (boost::weak_ptr video); void player_change (ChangeType type, bool frequent); - void seek_unlocked (DCPTime position, bool accurate); + void seek_unlocked (dcpomatic::DCPTime position, bool accurate); boost::shared_ptr _player; boost::thread* _thread; @@ -93,7 +93,7 @@ private: boost::mutex _mutex; boost::condition _summon; boost::condition _arrived; - boost::optional _pending_seek_position; + boost::optional _pending_seek_position; bool _pending_seek_accurate; int _suspended; bool _finished; @@ -112,7 +112,7 @@ private: /** If we are waiting to be refilled following a seek, this is the time we were seeking to. */ - boost::optional _awaiting; + boost::optional _awaiting; boost::signals2::scoped_connection _player_video_connection; boost::signals2::scoped_connection _player_audio_connection; diff --git a/src/lib/content.cc b/src/lib/content.cc index 9280d2e61..a722cd15d 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -52,6 +52,7 @@ using boost::shared_ptr; using boost::optional; using dcp::raw_convert; using dcp::locale_convert; +using namespace dcpomatic; int const ContentProperty::PATH = 400; int const ContentProperty::POSITION = 401; diff --git a/src/lib/content.h b/src/lib/content.h index 4c1d55765..a2d78aa68 100644 --- a/src/lib/content.h +++ b/src/lib/content.h @@ -65,7 +65,7 @@ class Content : public boost::enable_shared_from_this, public Signaller { public: explicit Content (); - Content (DCPTime); + Content (dcpomatic::DCPTime); Content (boost::filesystem::path); Content (cxml::ConstNodePtr); Content (std::vector >); @@ -90,13 +90,13 @@ public: virtual std::string technical_summary () const; virtual void as_xml (xmlpp::Node *, bool with_paths) const; - virtual DCPTime full_length (boost::shared_ptr) const = 0; - virtual DCPTime approximate_length () const = 0; + virtual dcpomatic::DCPTime full_length (boost::shared_ptr) const = 0; + virtual dcpomatic::DCPTime approximate_length () const = 0; virtual std::string identifier () const; /** @return points at which to split this content when * REELTYPE_BY_VIDEO_CONTENT is in use. */ - virtual std::list reel_split_points (boost::shared_ptr) const; + virtual std::list reel_split_points (boost::shared_ptr) const; boost::shared_ptr clone () const; @@ -135,36 +135,36 @@ public: return _digest; } - void set_position (boost::shared_ptr film, DCPTime, bool force_emit = false); + void set_position (boost::shared_ptr film, dcpomatic::DCPTime, bool force_emit = false); - /** DCPTime that this content starts; i.e. the time that the first + /** dcpomatic::DCPTime that this content starts; i.e. the time that the first * bit of the content (trimmed or not) will happen. */ - DCPTime position () const { + dcpomatic::DCPTime position () const { boost::mutex::scoped_lock lm (_mutex); return _position; } - void set_trim_start (ContentTime); + void set_trim_start (dcpomatic::ContentTime); - ContentTime trim_start () const { + dcpomatic::ContentTime trim_start () const { boost::mutex::scoped_lock lm (_mutex); return _trim_start; } - void set_trim_end (ContentTime); + void set_trim_end (dcpomatic::ContentTime); - ContentTime trim_end () const { + dcpomatic::ContentTime trim_end () const { boost::mutex::scoped_lock lm (_mutex); return _trim_end; } /** @return Time immediately after the last thing in this content */ - DCPTime end (boost::shared_ptr film) const { + dcpomatic::DCPTime end (boost::shared_ptr film) const { return position() + length_after_trim(film); } - DCPTime length_after_trim (boost::shared_ptr film) const; + dcpomatic::DCPTime length_after_trim (boost::shared_ptr film) const; boost::optional video_frame_rate () const { boost::mutex::scoped_lock lm (_mutex); @@ -219,9 +219,9 @@ private: std::vector _last_write_times; std::string _digest; - DCPTime _position; - ContentTime _trim_start; - ContentTime _trim_end; + dcpomatic::DCPTime _position; + dcpomatic::ContentTime _trim_start; + dcpomatic::ContentTime _trim_end; /** The video frame rate that this content is or was prepared to be used with, * or empty if the effective rate of this content should be dictated by something * else (either some video happening at the same time, or the rate of the DCP). diff --git a/src/lib/content_text.h b/src/lib/content_text.h index 2d8910577..0c0df1ee6 100644 --- a/src/lib/content_text.h +++ b/src/lib/content_text.h @@ -33,22 +33,22 @@ class Image; class ContentText { public: - explicit ContentText (ContentTime f) + explicit ContentText (dcpomatic::ContentTime f) : _from (f) {} - ContentTime from () const { + dcpomatic::ContentTime from () const { return _from; } private: - ContentTime _from; + dcpomatic::ContentTime _from; }; class ContentBitmapText : public ContentText { public: - ContentBitmapText (ContentTime f, boost::shared_ptr im, dcpomatic::Rect r) + ContentBitmapText (dcpomatic::ContentTime f, boost::shared_ptr im, dcpomatic::Rect r) : ContentText (f) , sub (im, r) {} @@ -64,7 +64,7 @@ public: class ContentStringText : public ContentText { public: - ContentStringText (ContentTime f, std::list s) + ContentStringText (dcpomatic::ContentTime f, std::list s) : ContentText (f) , subs (s) {} diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index ef877a17f..dc1a463c5 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -55,6 +55,7 @@ using boost::optional; using boost::function; using boost::dynamic_pointer_cast; using dcp::raw_convert; +using namespace dcpomatic; int const DCPContentProperty::NEEDS_ASSETS = 600; int const DCPContentProperty::NEEDS_KDM = 601; diff --git a/src/lib/dcp_content.h b/src/lib/dcp_content.h index 763b3e903..65bed29bc 100644 --- a/src/lib/dcp_content.h +++ b/src/lib/dcp_content.h @@ -61,8 +61,8 @@ public: return boost::dynamic_pointer_cast (Content::shared_from_this ()); } - DCPTime full_length (boost::shared_ptr film) const; - DCPTime approximate_length () const; + dcpomatic::DCPTime full_length (boost::shared_ptr film) const; + dcpomatic::DCPTime approximate_length () const; void examine (boost::shared_ptr film, boost::shared_ptr); std::string summary () const; @@ -72,7 +72,7 @@ public: void take_settings_from (boost::shared_ptr c); void set_default_colour_conversion (); - std::list reel_split_points (boost::shared_ptr film) const; + std::list reel_split_points (boost::shared_ptr film) const; std::vector directories () const; @@ -153,7 +153,7 @@ private: void read_directory (boost::filesystem::path); void read_sub_directory (boost::filesystem::path); - std::list reels (boost::shared_ptr film) const; + std::list reels (boost::shared_ptr film) const; bool can_reference ( boost::shared_ptr film, boost::function )>, diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index 98238f653..5a72fb228 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -54,6 +54,7 @@ using std::cout; using boost::shared_ptr; using boost::dynamic_pointer_cast; using boost::optional; +using namespace dcpomatic; DCPDecoder::DCPDecoder (shared_ptr film, shared_ptr c, bool fast) : DCP (c) diff --git a/src/lib/dcp_decoder.h b/src/lib/dcp_decoder.h index 4068696ea..0fc598bd7 100644 --- a/src/lib/dcp_decoder.h +++ b/src/lib/dcp_decoder.h @@ -50,16 +50,16 @@ public: void set_forced_reduction (boost::optional reduction); bool pass (); - void seek (ContentTime t, bool accurate); + void seek (dcpomatic::ContentTime t, bool accurate); private: friend struct dcp_subtitle_within_dcp_test; void next_reel (); void get_readers (); - void pass_texts (ContentTime next, dcp::Size size); + void pass_texts (dcpomatic::ContentTime next, dcp::Size size); void pass_texts ( - ContentTime next, + dcpomatic::ContentTime next, boost::shared_ptr asset, bool reference, int64_t entry_point, @@ -68,7 +68,7 @@ private: ); /** Time of next thing to return from pass relative to the start of _reel */ - ContentTime _next; + dcpomatic::ContentTime _next; std::list > _reels; std::list >::iterator _reel; diff --git a/src/lib/dcp_encoder.cc b/src/lib/dcp_encoder.cc index 50a8fd927..99edb0050 100644 --- a/src/lib/dcp_encoder.cc +++ b/src/lib/dcp_encoder.cc @@ -50,6 +50,7 @@ using boost::shared_ptr; using boost::weak_ptr; using boost::dynamic_pointer_cast; using boost::optional; +using namespace dcpomatic; /** Construct a DCP encoder. * @param film Film that we are encoding. diff --git a/src/lib/dcp_encoder.h b/src/lib/dcp_encoder.h index 3ccd5695e..61cdcee68 100644 --- a/src/lib/dcp_encoder.h +++ b/src/lib/dcp_encoder.h @@ -51,9 +51,9 @@ public: private: - void video (boost::shared_ptr, DCPTime); - void audio (boost::shared_ptr, DCPTime); - void text (PlayerText, TextType, boost::optional, DCPTimePeriod); + void video (boost::shared_ptr, dcpomatic::DCPTime); + void audio (boost::shared_ptr, dcpomatic::DCPTime); + void text (PlayerText, TextType, boost::optional, dcpomatic::DCPTimePeriod); boost::shared_ptr _writer; boost::shared_ptr _j2k_encoder; diff --git a/src/lib/dcp_subtitle_content.cc b/src/lib/dcp_subtitle_content.cc index 54bd631cb..81e26cf7c 100644 --- a/src/lib/dcp_subtitle_content.cc +++ b/src/lib/dcp_subtitle_content.cc @@ -36,6 +36,7 @@ using std::list; using boost::shared_ptr; using boost::dynamic_pointer_cast; using dcp::raw_convert; +using namespace dcpomatic; DCPSubtitleContent::DCPSubtitleContent (boost::filesystem::path path) : Content (path) diff --git a/src/lib/dcp_subtitle_content.h b/src/lib/dcp_subtitle_content.h index f5f375eee..5ff409546 100644 --- a/src/lib/dcp_subtitle_content.h +++ b/src/lib/dcp_subtitle_content.h @@ -31,9 +31,9 @@ public: std::string summary () const; std::string technical_summary () const; void as_xml (xmlpp::Node *, bool with_paths) const; - DCPTime full_length (boost::shared_ptr film) const; - DCPTime approximate_length () const; + dcpomatic::DCPTime full_length (boost::shared_ptr film) const; + dcpomatic::DCPTime approximate_length () const; private: - ContentTime _length; + dcpomatic::ContentTime _length; }; diff --git a/src/lib/dcp_subtitle_decoder.cc b/src/lib/dcp_subtitle_decoder.cc index 3a182c0c7..096580a6c 100644 --- a/src/lib/dcp_subtitle_decoder.cc +++ b/src/lib/dcp_subtitle_decoder.cc @@ -28,6 +28,7 @@ using std::cout; using boost::shared_ptr; using boost::dynamic_pointer_cast; using boost::bind; +using namespace dcpomatic; DCPSubtitleDecoder::DCPSubtitleDecoder (shared_ptr film, shared_ptr content) : Decoder (film) diff --git a/src/lib/dcp_subtitle_decoder.h b/src/lib/dcp_subtitle_decoder.h index e5533927b..5bf6363ad 100644 --- a/src/lib/dcp_subtitle_decoder.h +++ b/src/lib/dcp_subtitle_decoder.h @@ -29,10 +29,10 @@ public: DCPSubtitleDecoder (boost::shared_ptr film, boost::shared_ptr); bool pass (); - void seek (ContentTime time, bool accurate); + void seek (dcpomatic::ContentTime time, bool accurate); private: - ContentTimePeriod content_time_period (boost::shared_ptr s) const; + dcpomatic::ContentTimePeriod content_time_period (boost::shared_ptr s) const; std::list > _subtitles; std::list >::const_iterator _next; diff --git a/src/lib/dcpomatic_time.cc b/src/lib/dcpomatic_time.cc index 4f6c9b664..8abd77555 100644 --- a/src/lib/dcpomatic_time.cc +++ b/src/lib/dcpomatic_time.cc @@ -22,6 +22,7 @@ #include using std::string; +using namespace dcpomatic; template <> Time::Time (DCPTime d, FrameRateChange f) @@ -38,7 +39,7 @@ Time::Time (ContentTime d, Fra } DCPTime -min (DCPTime a, DCPTime b) +dcpomatic::min (DCPTime a, DCPTime b) { if (a < b) { return a; @@ -48,7 +49,7 @@ min (DCPTime a, DCPTime b) } DCPTime -max (DCPTime a, DCPTime b) +dcpomatic::max (DCPTime a, DCPTime b) { if (a > b) { return a; @@ -58,7 +59,7 @@ max (DCPTime a, DCPTime b) } ContentTime -min (ContentTime a, ContentTime b) +dcpomatic::min (ContentTime a, ContentTime b) { if (a < b) { return a; @@ -68,7 +69,7 @@ min (ContentTime a, ContentTime b) } ContentTime -max (ContentTime a, ContentTime b) +dcpomatic::max (ContentTime a, ContentTime b) { if (a > b) { return a; @@ -78,7 +79,7 @@ max (ContentTime a, ContentTime b) } string -to_string (ContentTime t) +dcpomatic::to_string (ContentTime t) { char buffer[64]; #ifdef DCPOMATIC_WINDOWS @@ -90,7 +91,7 @@ to_string (ContentTime t) } string -to_string (DCPTime t) +dcpomatic::to_string (DCPTime t) { char buffer[64]; #ifdef DCPOMATIC_WINDOWS @@ -102,7 +103,7 @@ to_string (DCPTime t) } string -to_string (DCPTimePeriod p) +dcpomatic::to_string (DCPTimePeriod p) { char buffer[64]; #ifdef DCPOMATIC_WINDOWS diff --git a/src/lib/dcpomatic_time.h b/src/lib/dcpomatic_time.h index a09dd93e9..897b725bd 100644 --- a/src/lib/dcpomatic_time.h +++ b/src/lib/dcpomatic_time.h @@ -35,8 +35,13 @@ #include #include +struct dcpomatic_time_ceil_test; +struct dcpomatic_time_floor_test; + +namespace dcpomatic { + /** A time in seconds, expressed as a number scaled up by Time::HZ. We want two different - * versions of this class, ContentTime and DCPTime, and we want it to be impossible to + * versions of this class, dcpomatic::ContentTime and dcpomatic::DCPTime, and we want it to be impossible to * convert implicitly between the two. Hence there's this template hack. I'm not * sure if it's the best way to do it. * @@ -228,8 +233,8 @@ public: static const int HZ = 96000; private: - friend struct dcpomatic_time_ceil_test; - friend struct dcpomatic_time_floor_test; + friend struct ::dcpomatic_time_ceil_test; + friend struct ::dcpomatic_time_floor_test; Type _t; }; @@ -357,4 +362,6 @@ std::string to_string (ContentTime t); std::string to_string (DCPTime t); std::string to_string (DCPTimePeriod p); +} + #endif diff --git a/src/lib/dcpomatic_time_coalesce.h b/src/lib/dcpomatic_time_coalesce.h index e103e80e6..e6e16641e 100644 --- a/src/lib/dcpomatic_time_coalesce.h +++ b/src/lib/dcpomatic_time_coalesce.h @@ -21,6 +21,8 @@ #include "dcpomatic_time.h" #include +namespace dcpomatic { + /** @param periods Set of periods in ascending order of from time */ template std::list > coalesce (std::list > periods) @@ -46,3 +48,5 @@ std::list > coalesce (std::list > periods) return periods; } + +} diff --git a/src/lib/decoder.cc b/src/lib/decoder.cc index 52e8c04e6..f912c473c 100644 --- a/src/lib/decoder.cc +++ b/src/lib/decoder.cc @@ -29,6 +29,7 @@ using std::cout; using boost::optional; using boost::shared_ptr; using boost::weak_ptr; +using namespace dcpomatic; Decoder::Decoder (weak_ptr film) : _film (film) diff --git a/src/lib/decoder.h b/src/lib/decoder.h index d610f8727..92082ca18 100644 --- a/src/lib/decoder.h +++ b/src/lib/decoder.h @@ -55,9 +55,9 @@ public: * @return true if this decoder will emit no more data unless a seek() happens. */ virtual bool pass () = 0; - virtual void seek (ContentTime time, bool accurate); + virtual void seek (dcpomatic::ContentTime time, bool accurate); - ContentTime position () const; + dcpomatic::ContentTime position () const; protected: boost::shared_ptr film () const; diff --git a/src/lib/decoder_part.h b/src/lib/decoder_part.h index 7ba2cb2eb..53d1a1b08 100644 --- a/src/lib/decoder_part.h +++ b/src/lib/decoder_part.h @@ -34,7 +34,7 @@ public: DecoderPart (Decoder* parent); virtual ~DecoderPart () {} - virtual ContentTime position (boost::shared_ptr film) const = 0; + virtual dcpomatic::ContentTime position (boost::shared_ptr film) const = 0; virtual void seek () = 0; void set_ignore (bool i) { diff --git a/src/lib/empty.cc b/src/lib/empty.cc index 1df318b25..206acfdb0 100644 --- a/src/lib/empty.cc +++ b/src/lib/empty.cc @@ -34,6 +34,7 @@ using std::list; using boost::shared_ptr; using boost::dynamic_pointer_cast; using boost::function; +using namespace dcpomatic; Empty::Empty (shared_ptr film, list > pieces, function)> part) { diff --git a/src/lib/empty.h b/src/lib/empty.h index 50f21fc4d..bd295206e 100644 --- a/src/lib/empty.h +++ b/src/lib/empty.h @@ -37,23 +37,23 @@ public: Empty () {} Empty (boost::shared_ptr film, std::list > pieces, boost::function)> part); - DCPTime position () const { + dcpomatic::DCPTime position () const { return _position; } - DCPTimePeriod period_at_position () const; + dcpomatic::DCPTimePeriod period_at_position () const; bool done () const; - void set_position (DCPTime amount); + void set_position (dcpomatic::DCPTime amount); private: friend struct ::empty_test1; friend struct ::empty_test2; friend struct ::player_subframe_test; - std::list _periods; - DCPTime _position; + std::list _periods; + dcpomatic::DCPTime _position; }; #endif diff --git a/src/lib/ffmpeg.cc b/src/lib/ffmpeg.cc index 8a0dcb593..ab5148cfa 100644 --- a/src/lib/ffmpeg.cc +++ b/src/lib/ffmpeg.cc @@ -48,6 +48,7 @@ using std::vector; using boost::shared_ptr; using boost::optional; using dcp::raw_convert; +using namespace dcpomatic; boost::mutex FFmpeg::_mutex; diff --git a/src/lib/ffmpeg.h b/src/lib/ffmpeg.h index d2f797658..10517055c 100644 --- a/src/lib/ffmpeg.h +++ b/src/lib/ffmpeg.h @@ -53,8 +53,8 @@ public: protected: AVCodecContext* video_codec_context () const; AVCodecContext* subtitle_codec_context () const; - ContentTime pts_offset ( - std::vector > audio_streams, boost::optional first_video, double video_frame_rate + dcpomatic::ContentTime pts_offset ( + std::vector > audio_streams, boost::optional first_video, double video_frame_rate ) const; static FFmpegSubtitlePeriod subtitle_period (AVSubtitle const & sub); diff --git a/src/lib/ffmpeg_audio_stream.cc b/src/lib/ffmpeg_audio_stream.cc index 1b0d39db2..1fc008d51 100644 --- a/src/lib/ffmpeg_audio_stream.cc +++ b/src/lib/ffmpeg_audio_stream.cc @@ -26,6 +26,7 @@ using std::string; using boost::optional; using dcp::raw_convert; +using namespace dcpomatic; FFmpegAudioStream::FFmpegAudioStream (cxml::ConstNodePtr node, int version) : FFmpegStream (node) diff --git a/src/lib/ffmpeg_audio_stream.h b/src/lib/ffmpeg_audio_stream.h index a754ec574..65c4aba5e 100644 --- a/src/lib/ffmpeg_audio_stream.h +++ b/src/lib/ffmpeg_audio_stream.h @@ -49,7 +49,7 @@ public: /* XXX: should probably be locked */ - boost::optional first_audio; + boost::optional first_audio; boost::optional codec_name; private: diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index a3a1cfb0f..69d743215 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -56,6 +56,7 @@ using boost::shared_ptr; using boost::dynamic_pointer_cast; using boost::optional; using dcp::raw_convert; +using namespace dcpomatic; int const FFmpegContentProperty::SUBTITLE_STREAMS = 100; int const FFmpegContentProperty::SUBTITLE_STREAM = 101; diff --git a/src/lib/ffmpeg_content.h b/src/lib/ffmpeg_content.h index 4c612cd3e..8871301b1 100644 --- a/src/lib/ffmpeg_content.h +++ b/src/lib/ffmpeg_content.h @@ -63,8 +63,8 @@ public: std::string summary () const; std::string technical_summary () const; void as_xml (xmlpp::Node *, bool with_paths) const; - DCPTime full_length (boost::shared_ptr film) const; - DCPTime approximate_length () const; + dcpomatic::DCPTime full_length (boost::shared_ptr film) const; + dcpomatic::DCPTime approximate_length () const; std::string identifier () const; @@ -91,7 +91,7 @@ public: void set_subtitle_stream (boost::shared_ptr); - boost::optional first_video () const { + boost::optional first_video () const { boost::mutex::scoped_lock lm (_mutex); return _first_video; } @@ -116,7 +116,7 @@ private: std::vector > _subtitle_streams; boost::shared_ptr _subtitle_stream; - boost::optional _first_video; + boost::optional _first_video; /** Video filters that should be used when generating DCPs */ std::vector _filters; diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index edc0b08d1..0e65a6d6b 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -74,6 +74,7 @@ using boost::split; using boost::optional; using boost::dynamic_pointer_cast; using dcp::Size; +using namespace dcpomatic; FFmpegDecoder::FFmpegDecoder (shared_ptr film, shared_ptr c, bool fast) : FFmpeg (c) diff --git a/src/lib/ffmpeg_decoder.h b/src/lib/ffmpeg_decoder.h index 640229f23..65f36a004 100644 --- a/src/lib/ffmpeg_decoder.h +++ b/src/lib/ffmpeg_decoder.h @@ -48,7 +48,7 @@ public: FFmpegDecoder (boost::shared_ptr film, boost::shared_ptr, bool fast); bool pass (); - void seek (ContentTime time, bool); + void seek (dcpomatic::ContentTime time, bool); private: friend struct ::ffmpeg_pts_offset_test; @@ -62,8 +62,8 @@ private: void decode_audio_packet (); void decode_subtitle_packet (); - void decode_bitmap_subtitle (AVSubtitleRect const * rect, ContentTime from); - void decode_ass_subtitle (std::string ass, ContentTime from); + void decode_bitmap_subtitle (AVSubtitleRect const * rect, dcpomatic::ContentTime from); + void decode_ass_subtitle (std::string ass, dcpomatic::ContentTime from); void maybe_add_subtitle (); boost::shared_ptr deinterleave_audio (boost::shared_ptr stream) const; @@ -71,12 +71,12 @@ private: std::list > _filter_graphs; boost::mutex _filter_graphs_mutex; - ContentTime _pts_offset; - boost::optional _current_subtitle_to; + dcpomatic::ContentTime _pts_offset; + boost::optional _current_subtitle_to; /** true if we have a subtitle which has not had emit_stop called for it yet */ bool _have_current_subtitle; boost::shared_ptr _black_image; - std::vector > _next_time; + std::vector > _next_time; }; diff --git a/src/lib/ffmpeg_encoder.cc b/src/lib/ffmpeg_encoder.cc index 07b691956..1d112bdb4 100644 --- a/src/lib/ffmpeg_encoder.cc +++ b/src/lib/ffmpeg_encoder.cc @@ -41,6 +41,7 @@ using std::map; using boost::shared_ptr; using boost::bind; using boost::weak_ptr; +using namespace dcpomatic; FFmpegEncoder::FFmpegEncoder ( shared_ptr film, diff --git a/src/lib/ffmpeg_encoder.h b/src/lib/ffmpeg_encoder.h index 79539acce..687d2981e 100644 --- a/src/lib/ffmpeg_encoder.h +++ b/src/lib/ffmpeg_encoder.h @@ -78,7 +78,7 @@ private: int _output_audio_channels; mutable boost::mutex _mutex; - DCPTime _last_time; + dcpomatic::DCPTime _last_time; EventHistory _history; diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc index b31280cd5..382b71b83 100644 --- a/src/lib/ffmpeg_examiner.cc +++ b/src/lib/ffmpeg_examiner.cc @@ -42,6 +42,7 @@ using std::cout; using std::max; using boost::shared_ptr; using boost::optional; +using namespace dcpomatic; /** @param job job that the examiner is operating in, or 0 */ FFmpegExaminer::FFmpegExaminer (shared_ptr c, shared_ptr job) diff --git a/src/lib/ffmpeg_examiner.h b/src/lib/ffmpeg_examiner.h index 67fdcfae0..d2e6e1a0a 100644 --- a/src/lib/ffmpeg_examiner.h +++ b/src/lib/ffmpeg_examiner.h @@ -49,7 +49,7 @@ public: return _audio_streams; } - boost::optional first_video () const { + boost::optional first_video () const { return _first_video; } @@ -81,11 +81,11 @@ private: std::string stream_name (AVStream* s) const; std::string subtitle_stream_name (AVStream* s) const; - boost::optional frame_time (AVStream* s) const; + boost::optional frame_time (AVStream* s) const; std::vector > _subtitle_streams; std::vector > _audio_streams; - boost::optional _first_video; + boost::optional _first_video; /** Video length, either obtained from the header or derived by running * through the whole file. */ @@ -96,7 +96,7 @@ private: struct SubtitleStart { - SubtitleStart (std::string id_, bool image_, ContentTime time_) + SubtitleStart (std::string id_, bool image_, dcpomatic::ContentTime time_) : id (id_) , image (image_) , time (time_) @@ -105,7 +105,7 @@ private: std::string id; /** true if it's an image subtitle, false for text */ bool image; - ContentTime time; + dcpomatic::ContentTime time; }; typedef std::map, boost::optional > LastSubtitleMap; diff --git a/src/lib/ffmpeg_file_encoder.cc b/src/lib/ffmpeg_file_encoder.cc index 5eccb8f17..eb7036429 100644 --- a/src/lib/ffmpeg_file_encoder.cc +++ b/src/lib/ffmpeg_file_encoder.cc @@ -38,6 +38,7 @@ using std::pair; using boost::shared_ptr; using boost::bind; using boost::weak_ptr; +using namespace dcpomatic; int FFmpegFileEncoder::_video_stream_index = 0; int FFmpegFileEncoder::_audio_stream_index = 1; diff --git a/src/lib/ffmpeg_file_encoder.h b/src/lib/ffmpeg_file_encoder.h index 8b9d0b67c..5308947e6 100644 --- a/src/lib/ffmpeg_file_encoder.h +++ b/src/lib/ffmpeg_file_encoder.h @@ -43,9 +43,9 @@ public: boost::filesystem::path output ); - void video (boost::shared_ptr, DCPTime); + void video (boost::shared_ptr, dcpomatic::DCPTime); void audio (boost::shared_ptr); - void subtitle (PlayerText, DCPTimePeriod); + void subtitle (PlayerText, dcpomatic::DCPTimePeriod); void flush (); diff --git a/src/lib/ffmpeg_subtitle_period.h b/src/lib/ffmpeg_subtitle_period.h index 42c7bf763..0841207ad 100644 --- a/src/lib/ffmpeg_subtitle_period.h +++ b/src/lib/ffmpeg_subtitle_period.h @@ -24,15 +24,15 @@ class FFmpegSubtitlePeriod { public: - explicit FFmpegSubtitlePeriod (ContentTime f) + explicit FFmpegSubtitlePeriod (dcpomatic::ContentTime f) : from (f) {} - FFmpegSubtitlePeriod (ContentTime f, ContentTime t) + FFmpegSubtitlePeriod (dcpomatic::ContentTime f, dcpomatic::ContentTime t) : from (f) , to (t) {} - ContentTime from; - boost::optional to; + dcpomatic::ContentTime from; + boost::optional to; }; diff --git a/src/lib/film.cc b/src/lib/film.cc index dee3196c5..efc89e0eb 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -99,6 +99,7 @@ using boost::dynamic_pointer_cast; using boost::optional; using boost::is_any_of; using dcp::raw_convert; +using namespace dcpomatic; string const Film::metadata_file = "metadata.xml"; diff --git a/src/lib/film.h b/src/lib/film.h index e5d29145c..7d762f599 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -71,10 +71,10 @@ public: explicit Film (boost::optional dir); ~Film (); - boost::filesystem::path info_file (DCPTimePeriod p) const; + boost::filesystem::path info_file (dcpomatic::DCPTimePeriod p) const; boost::filesystem::path j2c_path (int, Frame, Eyes, bool) const; boost::filesystem::path internal_video_asset_dir () const; - boost::filesystem::path internal_video_asset_filename (DCPTimePeriod p) const; + boost::filesystem::path internal_video_asset_filename (dcpomatic::DCPTimePeriod p) const; boost::filesystem::path audio_analysis_path (boost::shared_ptr) const; @@ -123,9 +123,9 @@ public: /* Proxies for some Playlist methods */ ContentList content () const; - DCPTime length () const; + dcpomatic::DCPTime length () const; int best_video_frame_rate () const; - FrameRateChange active_frame_rate_change (DCPTime) const; + FrameRateChange active_frame_rate_change (dcpomatic::DCPTime) const; std::pair speed_up_range (int dcp_frame_rate) const; dcp::EncryptedKDM make_kdm ( @@ -163,10 +163,10 @@ public: return _playlist; } - std::list reels () const; + std::list reels () const; std::list mapped_audio_channels () const; - std::string content_summary (DCPTimePeriod period) const; + std::string content_summary (dcpomatic::DCPTimePeriod period) const; bool references_dcp_video () const; bool references_dcp_audio () const; @@ -298,8 +298,8 @@ public: return _reencode_j2k; } - boost::optional marker (dcp::Marker type) const; - std::map markers () const { + boost::optional marker (dcp::Marker type) const; + std::map markers () const { return _markers; } @@ -337,7 +337,7 @@ public: void set_reel_length (int64_t); void set_upload_after_make_dcp (bool); void set_reencode_j2k (bool); - void set_marker (dcp::Marker type, DCPTime time); + void set_marker (dcp::Marker type, dcpomatic::DCPTime time); void unset_marker (dcp::Marker type); void set_ratings (std::vector r); @@ -419,7 +419,7 @@ private: bool _reencode_j2k; /** true if the user has ever explicitly set the video frame rate of this film */ bool _user_explicit_video_frame_rate; - std::map _markers; + std::map _markers; std::vector _ratings; int _state_version; diff --git a/src/lib/hints.cc b/src/lib/hints.cc index df29a3336..cf14f0699 100644 --- a/src/lib/hints.cc +++ b/src/lib/hints.cc @@ -49,6 +49,7 @@ using boost::shared_ptr; using boost::weak_ptr; using boost::optional; using boost::bind; +using namespace dcpomatic; Hints::Hints (weak_ptr film) : _film (film) diff --git a/src/lib/hints.h b/src/lib/hints.h index 6f0e533d4..00c2486e7 100644 --- a/src/lib/hints.h +++ b/src/lib/hints.h @@ -46,7 +46,7 @@ public: private: void thread (); void hint (std::string h); - void text (PlayerText text, TextType type, DCPTimePeriod period); + void text (PlayerText text, TextType type, dcpomatic::DCPTimePeriod period); boost::weak_ptr _film; boost::thread* _thread; @@ -54,7 +54,7 @@ private: bool _long_ccap; bool _overlap_ccap; bool _too_many_ccap_lines; - boost::optional _last; + boost::optional _last; boost::mutex _mutex; bool _stop; diff --git a/src/lib/image_content.cc b/src/lib/image_content.cc index 1515c8b76..8cf44bda1 100644 --- a/src/lib/image_content.cc +++ b/src/lib/image_content.cc @@ -39,6 +39,7 @@ using std::cout; using std::list; using std::vector; using boost::shared_ptr; +using namespace dcpomatic; ImageContent::ImageContent (boost::filesystem::path p) { diff --git a/src/lib/image_content.h b/src/lib/image_content.h index 959923a51..970a68d66 100644 --- a/src/lib/image_content.h +++ b/src/lib/image_content.h @@ -41,8 +41,8 @@ public: std::string summary () const; std::string technical_summary () const; void as_xml (xmlpp::Node *, bool with_paths) const; - DCPTime full_length (boost::shared_ptr film) const; - DCPTime approximate_length () const; + dcpomatic::DCPTime full_length (boost::shared_ptr film) const; + dcpomatic::DCPTime approximate_length () const; std::string identifier () const; diff --git a/src/lib/image_decoder.cc b/src/lib/image_decoder.cc index ce45abdd9..8aa3f6a99 100644 --- a/src/lib/image_decoder.cc +++ b/src/lib/image_decoder.cc @@ -35,6 +35,7 @@ using std::cout; using boost::shared_ptr; using dcp::Size; +using namespace dcpomatic; ImageDecoder::ImageDecoder (shared_ptr film, shared_ptr c) : Decoder (film) diff --git a/src/lib/image_decoder.h b/src/lib/image_decoder.h index 9f1484e47..eeec779ba 100644 --- a/src/lib/image_decoder.h +++ b/src/lib/image_decoder.h @@ -34,7 +34,7 @@ public: } bool pass (); - void seek (ContentTime, bool); + void seek (dcpomatic::ContentTime, bool); private: diff --git a/src/lib/j2k_encoder.cc b/src/lib/j2k_encoder.cc index 94728d6a9..431a47e65 100644 --- a/src/lib/j2k_encoder.cc +++ b/src/lib/j2k_encoder.cc @@ -48,6 +48,7 @@ using boost::shared_ptr; using boost::weak_ptr; using boost::optional; using dcp::Data; +using namespace dcpomatic; /** @param film Film that we are encoding. * @param writer Writer that we are using. diff --git a/src/lib/j2k_encoder.h b/src/lib/j2k_encoder.h index 2180f3f6a..01cf0605e 100644 --- a/src/lib/j2k_encoder.h +++ b/src/lib/j2k_encoder.h @@ -63,7 +63,7 @@ public: void begin (); /** Called to pass a bit of video to be encoded as the next DCP frame */ - void encode (boost::shared_ptr pv, DCPTime time); + void encode (boost::shared_ptr pv, dcpomatic::DCPTime time); /** Called when a processing run has finished */ void end (); @@ -101,7 +101,7 @@ private: Waker _waker; boost::shared_ptr _last_player_video[EYES_COUNT]; - boost::optional _last_player_video_time; + boost::optional _last_player_video_time; boost::signals2::scoped_connection _server_found_connection; }; diff --git a/src/lib/job.cc b/src/lib/job.cc index 451776524..1416ddfc2 100644 --- a/src/lib/job.cc +++ b/src/lib/job.cc @@ -46,6 +46,7 @@ using std::cout; using boost::shared_ptr; using boost::optional; using boost::function; +using namespace dcpomatic; /** @param film Associated film, or 0 */ Job::Job (shared_ptr film) diff --git a/src/lib/overlaps.cc b/src/lib/overlaps.cc index 4c75ac0c3..5ed7a9832 100644 --- a/src/lib/overlaps.cc +++ b/src/lib/overlaps.cc @@ -25,6 +25,7 @@ using boost::shared_ptr; using boost::function; +using namespace dcpomatic; ContentList overlaps (shared_ptr film, ContentList cl, function)> part, DCPTime from, DCPTime to) { diff --git a/src/lib/overlaps.h b/src/lib/overlaps.h index be3edf9d4..9bd867030 100644 --- a/src/lib/overlaps.h +++ b/src/lib/overlaps.h @@ -29,5 +29,5 @@ class Film; * ContentList */ ContentList overlaps ( - boost::shared_ptr film, ContentList cl, boost::function)> part, DCPTime from, DCPTime to + boost::shared_ptr film, ContentList cl, boost::function)> part, dcpomatic::DCPTime from, dcpomatic::DCPTime to ); diff --git a/src/lib/player.cc b/src/lib/player.cc index 50bcef0ec..e44edd8dc 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -75,6 +75,7 @@ using boost::weak_ptr; using boost::dynamic_pointer_cast; using boost::optional; using boost::scoped_ptr; +using namespace dcpomatic; int const PlayerProperty::VIDEO_CONTAINER_SIZE = 700; int const PlayerProperty::PLAYLIST = 701; diff --git a/src/lib/player.h b/src/lib/player.h index 8a81146c9..381aa80b7 100644 --- a/src/lib/player.h +++ b/src/lib/player.h @@ -68,7 +68,7 @@ public: ~Player (); bool pass (); - void seek (DCPTime time, bool accurate); + void seek (dcpomatic::DCPTime time, bool accurate); std::list > get_subtitle_fonts (); std::list get_reel_assets (); @@ -86,17 +86,17 @@ public: void set_play_referenced (); void set_dcp_decode_reduction (boost::optional reduction); - boost::optional content_time_to_dcp (boost::shared_ptr content, ContentTime t); + boost::optional content_time_to_dcp (boost::shared_ptr content, dcpomatic::ContentTime t); boost::signals2::signal Change; /** Emitted when a video frame is ready. These emissions happen in the correct order. */ - boost::signals2::signal, DCPTime)> Video; - boost::signals2::signal, DCPTime, int)> Audio; + boost::signals2::signal, dcpomatic::DCPTime)> Video; + boost::signals2::signal, dcpomatic::DCPTime, int)> Audio; /** Emitted when a text is ready. This signal may be emitted considerably * after the corresponding Video. */ - boost::signals2::signal, DCPTimePeriod)> Text; + boost::signals2::signal, dcpomatic::DCPTimePeriod)> Text; private: friend class PlayerWrapper; @@ -114,27 +114,27 @@ private: void film_change (ChangeType, Film::Property); void playlist_change (ChangeType); void playlist_content_change (ChangeType, int, bool); - Frame dcp_to_content_video (boost::shared_ptr piece, DCPTime t) const; - DCPTime content_video_to_dcp (boost::shared_ptr piece, Frame f) const; - Frame dcp_to_resampled_audio (boost::shared_ptr piece, DCPTime t) const; - DCPTime resampled_audio_to_dcp (boost::shared_ptr piece, Frame f) const; - ContentTime dcp_to_content_time (boost::shared_ptr piece, DCPTime t) const; - DCPTime content_time_to_dcp (boost::shared_ptr piece, ContentTime t) const; + Frame dcp_to_content_video (boost::shared_ptr piece, dcpomatic::DCPTime t) const; + dcpomatic::DCPTime content_video_to_dcp (boost::shared_ptr piece, Frame f) const; + Frame dcp_to_resampled_audio (boost::shared_ptr piece, dcpomatic::DCPTime t) const; + dcpomatic::DCPTime resampled_audio_to_dcp (boost::shared_ptr piece, Frame f) const; + dcpomatic::ContentTime dcp_to_content_time (boost::shared_ptr piece, dcpomatic::DCPTime t) const; + dcpomatic::DCPTime content_time_to_dcp (boost::shared_ptr piece, dcpomatic::ContentTime t) const; boost::shared_ptr black_player_video_frame (Eyes eyes) const; void video (boost::weak_ptr, ContentVideo); void audio (boost::weak_ptr, AudioStreamPtr, ContentAudio); void bitmap_text_start (boost::weak_ptr, boost::weak_ptr, ContentBitmapText); void plain_text_start (boost::weak_ptr, boost::weak_ptr, ContentStringText); - void subtitle_stop (boost::weak_ptr, boost::weak_ptr, ContentTime); - DCPTime one_video_frame () const; - void fill_audio (DCPTimePeriod period); - std::pair, DCPTime> discard_audio ( - boost::shared_ptr audio, DCPTime time, DCPTime discard_to + void subtitle_stop (boost::weak_ptr, boost::weak_ptr, dcpomatic::ContentTime); + dcpomatic::DCPTime one_video_frame () const; + void fill_audio (dcpomatic::DCPTimePeriod period); + std::pair, dcpomatic::DCPTime> discard_audio ( + boost::shared_ptr audio, dcpomatic::DCPTime time, dcpomatic::DCPTime discard_to ) const; - boost::optional open_subtitles_for_frame (DCPTime time) const; - void emit_video (boost::shared_ptr pv, DCPTime time); - void do_emit_video (boost::shared_ptr pv, DCPTime time); - void emit_audio (boost::shared_ptr data, DCPTime time); + boost::optional open_subtitles_for_frame (dcpomatic::DCPTime time) const; + void emit_video (boost::shared_ptr pv, dcpomatic::DCPTime time); + void do_emit_video (boost::shared_ptr pv, dcpomatic::DCPTime time); + void emit_audio (boost::shared_ptr data, dcpomatic::DCPTime time); /** Mutex to protect the whole Player state. When it's used for the preview we have seek() and pass() called from the Butler thread and lots of other stuff called @@ -165,10 +165,10 @@ private: bool _play_referenced; /** Time just after the last video frame we emitted, or the time of the last accurate seek */ - boost::optional _last_video_time; + boost::optional _last_video_time; boost::optional _last_video_eyes; /** Time just after the last audio frame we emitted, or the time of the last accurate seek */ - boost::optional _last_audio_time; + boost::optional _last_audio_time; boost::optional _dcp_decode_reduction; @@ -177,20 +177,20 @@ private: AudioMerger _audio_merger; Shuffler* _shuffler; - std::list, DCPTime> > _delay; + std::list, dcpomatic::DCPTime> > _delay; class StreamState { public: StreamState () {} - StreamState (boost::shared_ptr p, DCPTime l) + StreamState (boost::shared_ptr p, dcpomatic::DCPTime l) : piece(p) , last_push_end(l) {} boost::shared_ptr piece; - DCPTime last_push_end; + dcpomatic::DCPTime last_push_end; }; std::map _stream_states; diff --git a/src/lib/playlist.cc b/src/lib/playlist.cc index 6d125afa6..9e96c693a 100644 --- a/src/lib/playlist.cc +++ b/src/lib/playlist.cc @@ -51,6 +51,7 @@ using boost::optional; using boost::shared_ptr; using boost::weak_ptr; using boost::dynamic_pointer_cast; +using namespace dcpomatic; Playlist::Playlist () : _sequence (true) diff --git a/src/lib/playlist.h b/src/lib/playlist.h index a5dce1498..d7db75d0f 100644 --- a/src/lib/playlist.h +++ b/src/lib/playlist.h @@ -59,15 +59,15 @@ public: std::string video_identifier () const; - DCPTime length (boost::shared_ptr film) const; - boost::optional start () const; + dcpomatic::DCPTime length (boost::shared_ptr film) const; + boost::optional start () const; int64_t required_disk_space (boost::shared_ptr film, int j2k_bandwidth, int audio_channels, int audio_frame_rate) const; int best_video_frame_rate () const; - DCPTime video_end (boost::shared_ptr film) const; - DCPTime text_end (boost::shared_ptr film) const; - FrameRateChange active_frame_rate_change (DCPTime, int dcp_frame_rate) const; - std::string content_summary (boost::shared_ptr film, DCPTimePeriod period) const; + dcpomatic::DCPTime video_end (boost::shared_ptr film) const; + dcpomatic::DCPTime text_end (boost::shared_ptr film) const; + FrameRateChange active_frame_rate_change (dcpomatic::DCPTime, int dcp_frame_rate) const; + std::string content_summary (boost::shared_ptr film, dcpomatic::DCPTimePeriod period) const; std::pair speed_up_range (int dcp_video_frame_rate) const; void set_sequence (bool); diff --git a/src/lib/reel_writer.cc b/src/lib/reel_writer.cc index f5fe87248..81057185a 100644 --- a/src/lib/reel_writer.cc +++ b/src/lib/reel_writer.cc @@ -60,6 +60,7 @@ using boost::optional; using boost::dynamic_pointer_cast; using dcp::Data; using dcp::raw_convert; +using namespace dcpomatic; int const ReelWriter::_info_size = 48; diff --git a/src/lib/reel_writer.h b/src/lib/reel_writer.h index ae64c3ac7..9ea576d7a 100644 --- a/src/lib/reel_writer.h +++ b/src/lib/reel_writer.h @@ -50,7 +50,7 @@ class ReelWriter public: ReelWriter ( boost::shared_ptr film, - DCPTimePeriod period, + dcpomatic::DCPTimePeriod period, boost::shared_ptr job, int reel_index, int reel_count, @@ -61,7 +61,7 @@ public: void fake_write (Frame frame, Eyes eyes, int size); void repeat_write (Frame frame, Eyes eyes); void write (boost::shared_ptr audio); - void write (PlayerText text, TextType type, boost::optional track, DCPTimePeriod period); + void write (PlayerText text, TextType type, boost::optional track, dcpomatic::DCPTimePeriod period); void finish (); boost::shared_ptr create_reel (std::list const & refs, std::list > const & fonts); @@ -69,7 +69,7 @@ public: Frame start () const; - DCPTimePeriod period () const { + dcpomatic::DCPTimePeriod period () const { return _period; } @@ -96,7 +96,7 @@ private: boost::shared_ptr _film; - DCPTimePeriod _period; + dcpomatic::DCPTimePeriod _period; /** the first picture frame index that does not already exist in our MXF */ int _first_nonexistant_frame; /** the data of the last written frame, if there is one */ diff --git a/src/lib/referenced_reel_asset.h b/src/lib/referenced_reel_asset.h index 739a8f490..0d66155b5 100644 --- a/src/lib/referenced_reel_asset.h +++ b/src/lib/referenced_reel_asset.h @@ -26,7 +26,7 @@ class ReferencedReelAsset { public: - ReferencedReelAsset (boost::shared_ptr asset_, DCPTimePeriod period_) + ReferencedReelAsset (boost::shared_ptr asset_, dcpomatic::DCPTimePeriod period_) : asset (asset_) , period (period_) {} @@ -34,7 +34,7 @@ public: /** The asset */ boost::shared_ptr asset; /** Period that this asset covers in the DCP */ - DCPTimePeriod period; + dcpomatic::DCPTimePeriod period; }; #endif diff --git a/src/lib/render_text.cc b/src/lib/render_text.cc index 8d5f8e6a9..8b9d93423 100644 --- a/src/lib/render_text.cc +++ b/src/lib/render_text.cc @@ -46,6 +46,7 @@ using std::make_pair; using boost::shared_ptr; using boost::optional; using boost::algorithm::replace_all; +using namespace dcpomatic; static FcConfig* fc_config = 0; static list > fc_config_fonts; diff --git a/src/lib/render_text.h b/src/lib/render_text.h index 99b4391db..f235fb459 100644 --- a/src/lib/render_text.h +++ b/src/lib/render_text.h @@ -27,5 +27,5 @@ class Font; std::string marked_up (std::list subtitles, int target_height, float fade_factor); std::list render_text ( - std::list, std::list > fonts, dcp::Size, DCPTime, int + std::list, std::list > fonts, dcp::Size, dcpomatic::DCPTime, int ); diff --git a/src/lib/string_text_file.cc b/src/lib/string_text_file.cc index c7eadbbb1..bf19e482c 100644 --- a/src/lib/string_text_file.cc +++ b/src/lib/string_text_file.cc @@ -38,6 +38,7 @@ using boost::shared_ptr; using boost::scoped_array; using boost::optional; using dcp::Data; +using namespace dcpomatic; StringTextFile::StringTextFile (shared_ptr content) { diff --git a/src/lib/string_text_file.h b/src/lib/string_text_file.h index 0091973a4..5ade4a9ec 100644 --- a/src/lib/string_text_file.h +++ b/src/lib/string_text_file.h @@ -43,8 +43,8 @@ class StringTextFile public: explicit StringTextFile (boost::shared_ptr); - boost::optional first () const; - ContentTime length () const; + boost::optional first () const; + dcpomatic::ContentTime length () const; protected: std::vector _subtitles; diff --git a/src/lib/string_text_file_content.cc b/src/lib/string_text_file_content.cc index b3f7f431e..9a25ef06f 100644 --- a/src/lib/string_text_file_content.cc +++ b/src/lib/string_text_file_content.cc @@ -35,6 +35,7 @@ using std::cout; using boost::shared_ptr; using boost::optional; using dcp::raw_convert; +using namespace dcpomatic; StringTextFileContent::StringTextFileContent (boost::filesystem::path path) : Content (path) diff --git a/src/lib/string_text_file_content.h b/src/lib/string_text_file_content.h index 83323172d..959190d32 100644 --- a/src/lib/string_text_file_content.h +++ b/src/lib/string_text_file_content.h @@ -43,10 +43,10 @@ public: std::string summary () const; std::string technical_summary () const; void as_xml (xmlpp::Node *, bool with_paths) const; - DCPTime full_length (boost::shared_ptr film) const; - DCPTime approximate_length () const; + dcpomatic::DCPTime full_length (boost::shared_ptr film) const; + dcpomatic::DCPTime approximate_length () const; std::string identifier () const; private: - ContentTime _length; + dcpomatic::ContentTime _length; }; diff --git a/src/lib/string_text_file_decoder.cc b/src/lib/string_text_file_decoder.cc index 8c9880b0c..4cf34a3a9 100644 --- a/src/lib/string_text_file_decoder.cc +++ b/src/lib/string_text_file_decoder.cc @@ -34,6 +34,7 @@ using std::max; using boost::shared_ptr; using boost::optional; using boost::dynamic_pointer_cast; +using namespace dcpomatic; StringTextFileDecoder::StringTextFileDecoder (shared_ptr film, shared_ptr content) : Decoder (film) diff --git a/src/lib/string_text_file_decoder.h b/src/lib/string_text_file_decoder.h index f30e1b762..0c1d31deb 100644 --- a/src/lib/string_text_file_decoder.h +++ b/src/lib/string_text_file_decoder.h @@ -31,11 +31,11 @@ class StringTextFileDecoder : public Decoder, public StringTextFile public: StringTextFileDecoder (boost::shared_ptr film, boost::shared_ptr); - void seek (ContentTime time, bool accurate); + void seek (dcpomatic::ContentTime time, bool accurate); bool pass (); private: - ContentTimePeriod content_time_period (sub::Subtitle s) const; + dcpomatic::ContentTimePeriod content_time_period (sub::Subtitle s) const; size_t _next; }; diff --git a/src/lib/text_content.cc b/src/lib/text_content.cc index 772ed31f5..901d38647 100644 --- a/src/lib/text_content.cc +++ b/src/lib/text_content.cc @@ -39,6 +39,7 @@ using boost::shared_ptr; using boost::dynamic_pointer_cast; using boost::optional; using dcp::raw_convert; +using namespace dcpomatic; int const TextContentProperty::X_OFFSET = 500; int const TextContentProperty::Y_OFFSET = 501; diff --git a/src/lib/text_content.h b/src/lib/text_content.h index 83860dff5..c7d1b590d 100644 --- a/src/lib/text_content.h +++ b/src/lib/text_content.h @@ -83,9 +83,9 @@ public: void set_effect_colour (dcp::Colour); void unset_effect_colour (); void set_line_spacing (double s); - void set_fade_in (ContentTime); + void set_fade_in (dcpomatic::ContentTime); void unset_fade_in (); - void set_fade_out (ContentTime); + void set_fade_out (dcpomatic::ContentTime); void set_outline_width (int); void unset_fade_out (); void set_type (TextType type); @@ -152,12 +152,12 @@ public: return _line_spacing; } - boost::optional fade_in () const { + boost::optional fade_in () const { boost::mutex::scoped_lock lm (_mutex); return _fade_in; } - boost::optional fade_out () const { + boost::optional fade_out () const { boost::mutex::scoped_lock lm (_mutex); return _fade_out; } @@ -217,8 +217,8 @@ private: boost::optional _effect_colour; /** scaling factor for line spacing; 1 is "standard", < 1 is closer together, > 1 is further apart */ double _line_spacing; - boost::optional _fade_in; - boost::optional _fade_out; + boost::optional _fade_in; + boost::optional _fade_out; int _outline_width; /** what these captions will be used for in the output DCP (not necessarily what * they were originally). diff --git a/src/lib/text_decoder.cc b/src/lib/text_decoder.cc index 74fea6ec3..4eaaf37af 100644 --- a/src/lib/text_decoder.cc +++ b/src/lib/text_decoder.cc @@ -36,6 +36,7 @@ using std::min; using boost::shared_ptr; using boost::optional; using boost::function; +using namespace dcpomatic; TextDecoder::TextDecoder ( Decoder* parent, diff --git a/src/lib/text_decoder.h b/src/lib/text_decoder.h index a82f43f51..02afeeb94 100644 --- a/src/lib/text_decoder.h +++ b/src/lib/text_decoder.h @@ -41,20 +41,20 @@ public: TextDecoder ( Decoder* parent, boost::shared_ptr, - ContentTime first + dcpomatic::ContentTime first ); - ContentTime position (boost::shared_ptr) const { + dcpomatic::ContentTime position (boost::shared_ptr) const { return _position; } - void emit_bitmap_start (ContentTime from, boost::shared_ptr image, dcpomatic::Rect rect); - void emit_bitmap (ContentTimePeriod period, boost::shared_ptr image, dcpomatic::Rect rect); - void emit_plain_start (ContentTime from, std::list s); - void emit_plain_start (ContentTime from, sub::Subtitle const & subtitle); - void emit_plain (ContentTimePeriod period, std::list s); - void emit_plain (ContentTimePeriod period, sub::Subtitle const & subtitle); - void emit_stop (ContentTime to); + void emit_bitmap_start (dcpomatic::ContentTime from, boost::shared_ptr image, dcpomatic::Rect rect); + void emit_bitmap (dcpomatic::ContentTimePeriod period, boost::shared_ptr image, dcpomatic::Rect rect); + void emit_plain_start (dcpomatic::ContentTime from, std::list s); + void emit_plain_start (dcpomatic::ContentTime from, sub::Subtitle const & subtitle); + void emit_plain (dcpomatic::ContentTimePeriod period, std::list s); + void emit_plain (dcpomatic::ContentTimePeriod period, sub::Subtitle const & subtitle); + void emit_stop (dcpomatic::ContentTime to); void seek (); @@ -64,11 +64,11 @@ public: boost::signals2::signal BitmapStart; boost::signals2::signal PlainStart; - boost::signals2::signal Stop; + boost::signals2::signal Stop; private: boost::shared_ptr _content; - ContentTime _position; + dcpomatic::ContentTime _position; }; #endif diff --git a/src/lib/text_ring_buffers.cc b/src/lib/text_ring_buffers.cc index cc5357804..ba727cc41 100644 --- a/src/lib/text_ring_buffers.cc +++ b/src/lib/text_ring_buffers.cc @@ -22,6 +22,7 @@ using std::pair; using boost::optional; +using namespace dcpomatic; void TextRingBuffers::put (PlayerText text, DCPTextTrack track, DCPTimePeriod period) diff --git a/src/lib/text_ring_buffers.h b/src/lib/text_ring_buffers.h index 289a38149..7d685d824 100644 --- a/src/lib/text_ring_buffers.h +++ b/src/lib/text_ring_buffers.h @@ -29,10 +29,10 @@ class TextRingBuffers { public: - void put (PlayerText text, DCPTextTrack track, DCPTimePeriod period); + void put (PlayerText text, DCPTextTrack track, dcpomatic::DCPTimePeriod period); struct Data { - Data (PlayerText text_, DCPTextTrack track_, DCPTimePeriod period_) + Data (PlayerText text_, DCPTextTrack track_, dcpomatic::DCPTimePeriod period_) : text (text_) , track (track_) , period (period_) @@ -40,7 +40,7 @@ public: PlayerText text; DCPTextTrack track; - DCPTimePeriod period; + dcpomatic::DCPTimePeriod period; }; boost::optional get (); diff --git a/src/lib/util.cc b/src/lib/util.cc index 340af1ea8..1f6fba963 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -106,6 +106,7 @@ using boost::scoped_array; using dcp::Size; using dcp::raw_convert; using dcp::locale_convert; +using namespace dcpomatic; /** Path to our executable, required by the stacktrace stuff and filled * in during App::onInit(). diff --git a/src/lib/util.h b/src/lib/util.h index 6cb818b39..b760f7f4b 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -72,7 +72,7 @@ class AudioBuffers; class TextDecoder; extern std::string seconds_to_hms (int); -extern std::string time_to_hmsf (DCPTime time, Frame rate); +extern std::string time_to_hmsf (dcpomatic::DCPTime time, Frame rate); extern std::string seconds_to_approximate_hms (int); extern double seconds (struct timeval); extern void dcpomatic_setup (); @@ -105,7 +105,7 @@ extern void checked_fread (void* ptr, size_t size, FILE* stream, boost::filesyst extern void checked_fwrite (void const * ptr, size_t size, FILE* stream, boost::filesystem::path path); extern size_t utf8_strlen (std::string s); extern std::string day_of_week_to_string (boost::gregorian::greg_weekday d); -extern void emit_subtitle_image (ContentTimePeriod period, dcp::SubtitleImage sub, dcp::Size size, boost::shared_ptr decoder); +extern void emit_subtitle_image (dcpomatic::ContentTimePeriod period, dcp::SubtitleImage sub, dcp::Size size, boost::shared_ptr decoder); #ifdef DCPOMATIC_VARIANT_SWAROOP extern boost::shared_ptr read_swaroop_chain (boost::filesystem::path path); extern void write_swaroop_chain (boost::shared_ptr chain, boost::filesystem::path output); diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index fe35b0df3..d8d8adbf8 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -61,6 +61,7 @@ using boost::shared_ptr; using boost::optional; using boost::dynamic_pointer_cast; using dcp::raw_convert; +using namespace dcpomatic; VideoContent::VideoContent (Content* parent) : ContentPart (parent) diff --git a/src/lib/video_content.h b/src/lib/video_content.h index 7ecc2813a..3d07a0947 100644 --- a/src/lib/video_content.h +++ b/src/lib/video_content.h @@ -168,8 +168,8 @@ public: void take_from_examiner (boost::shared_ptr); void add_properties (std::list &) const; - void modify_position (boost::shared_ptr film, DCPTime& pos) const; - void modify_trim_start (ContentTime& pos) const; + void modify_position (boost::shared_ptr film, dcpomatic::DCPTime& pos) const; + void modify_trim_start (dcpomatic::ContentTime& pos) const; static boost::shared_ptr from_xml (Content* parent, cxml::ConstNodePtr, int); diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc index 813320eb8..9f29a03bf 100644 --- a/src/lib/video_decoder.cc +++ b/src/lib/video_decoder.cc @@ -35,6 +35,7 @@ using std::max; using std::back_inserter; using boost::shared_ptr; using boost::optional; +using namespace dcpomatic; VideoDecoder::VideoDecoder (Decoder* parent, shared_ptr c) : DecoderPart (parent) diff --git a/src/lib/video_decoder.h b/src/lib/video_decoder.h index 0fc7ca5a4..c2ba8386e 100644 --- a/src/lib/video_decoder.h +++ b/src/lib/video_decoder.h @@ -51,7 +51,7 @@ public: friend struct ffmpeg_pts_offset_test; friend void ffmpeg_decoder_sequential_test_one (boost::filesystem::path file, float fps, int gaps, int video_length); - ContentTime position (boost::shared_ptr) const { + dcpomatic::ContentTime position (boost::shared_ptr) const { return _position; } @@ -65,7 +65,7 @@ private: /** Time of last thing to be emitted */ boost::shared_ptr _content; boost::optional _last_emitted; - ContentTime _position; + dcpomatic::ContentTime _position; }; #endif diff --git a/src/lib/video_mxf_content.cc b/src/lib/video_mxf_content.cc index 436046890..bf8bb9f46 100644 --- a/src/lib/video_mxf_content.cc +++ b/src/lib/video_mxf_content.cc @@ -35,6 +35,7 @@ using std::list; using std::string; using boost::shared_ptr; +using namespace dcpomatic; VideoMXFContent::VideoMXFContent (boost::filesystem::path path) : Content (path) diff --git a/src/lib/video_mxf_content.h b/src/lib/video_mxf_content.h index 27dce1fb7..dd470335c 100644 --- a/src/lib/video_mxf_content.h +++ b/src/lib/video_mxf_content.h @@ -39,8 +39,8 @@ public: std::string technical_summary () const; std::string identifier () const; void as_xml (xmlpp::Node* node, bool with_paths) const; - DCPTime full_length (boost::shared_ptr film) const; - DCPTime approximate_length () const; + dcpomatic::DCPTime full_length (boost::shared_ptr film) const; + dcpomatic::DCPTime approximate_length () const; void add_properties (boost::shared_ptr film, std::list& p) const; static bool valid_mxf (boost::filesystem::path path); diff --git a/src/lib/video_mxf_decoder.cc b/src/lib/video_mxf_decoder.cc index 3c4002ca2..1bf2b1bef 100644 --- a/src/lib/video_mxf_decoder.cc +++ b/src/lib/video_mxf_decoder.cc @@ -30,6 +30,7 @@ using boost::shared_ptr; using boost::optional; +using namespace dcpomatic; VideoMXFDecoder::VideoMXFDecoder (shared_ptr film, shared_ptr content) : Decoder (film) diff --git a/src/lib/video_mxf_decoder.h b/src/lib/video_mxf_decoder.h index 3e3760d97..78313df0f 100644 --- a/src/lib/video_mxf_decoder.h +++ b/src/lib/video_mxf_decoder.h @@ -31,13 +31,13 @@ public: VideoMXFDecoder (boost::shared_ptr film, boost::shared_ptr); bool pass (); - void seek (ContentTime t, bool accurate); + void seek (dcpomatic::ContentTime t, bool accurate); private: boost::shared_ptr _content; /** Time of next thing to return from pass */ - ContentTime _next; + dcpomatic::ContentTime _next; boost::shared_ptr _mono_reader; boost::shared_ptr _stereo_reader; diff --git a/src/lib/video_ring_buffers.cc b/src/lib/video_ring_buffers.cc index 0167f4aec..bfec507ea 100644 --- a/src/lib/video_ring_buffers.cc +++ b/src/lib/video_ring_buffers.cc @@ -32,6 +32,7 @@ using std::pair; using std::string; using boost::shared_ptr; using boost::optional; +using namespace dcpomatic; void VideoRingBuffers::put (shared_ptr frame, DCPTime time) diff --git a/src/lib/video_ring_buffers.h b/src/lib/video_ring_buffers.h index f3e521553..ba1b2162f 100644 --- a/src/lib/video_ring_buffers.h +++ b/src/lib/video_ring_buffers.h @@ -31,8 +31,8 @@ class PlayerVideo; class VideoRingBuffers : public boost::noncopyable { public: - void put (boost::shared_ptr frame, DCPTime time); - std::pair, DCPTime> get (); + void put (boost::shared_ptr frame, dcpomatic::DCPTime time); + std::pair, dcpomatic::DCPTime> get (); void clear (); Frame size () const; @@ -42,5 +42,5 @@ public: private: mutable boost::mutex _mutex; - std::list, DCPTime> > _data; + std::list, dcpomatic::DCPTime> > _data; }; diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 79e5c8c36..3fc01571e 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -63,6 +63,7 @@ using boost::weak_ptr; using boost::dynamic_pointer_cast; using boost::optional; using dcp::Data; +using namespace dcpomatic; Writer::Writer (shared_ptr film, weak_ptr j) : _film (film) diff --git a/src/lib/writer.h b/src/lib/writer.h index e08e9f28d..ce1d04ced 100644 --- a/src/lib/writer.h +++ b/src/lib/writer.h @@ -104,8 +104,8 @@ public: void fake_write (Frame, Eyes); bool can_repeat (Frame) const; void repeat (Frame, Eyes); - void write (boost::shared_ptr, DCPTime time); - void write (PlayerText text, TextType type, boost::optional, DCPTimePeriod period); + void write (boost::shared_ptr, dcpomatic::DCPTime time); + void write (PlayerText text, TextType type, boost::optional, dcpomatic::DCPTimePeriod period); void write (std::list > fonts); void write (ReferencedReelAsset asset); void finish (); diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc index 8422df28e..3ba63379b 100644 --- a/src/tools/dcpomatic_player.cc +++ b/src/tools/dcpomatic_player.cc @@ -89,6 +89,7 @@ using boost::optional; using boost::dynamic_pointer_cast; using boost::thread; using boost::bind; +using namespace dcpomatic; enum { ID_file_open = 1, diff --git a/src/wx/audio_dialog.cc b/src/wx/audio_dialog.cc index f4de9cd1a..9b3a93769 100644 --- a/src/wx/audio_dialog.cc +++ b/src/wx/audio_dialog.cc @@ -42,6 +42,7 @@ using boost::bind; using boost::optional; using boost::const_pointer_cast; using boost::dynamic_pointer_cast; +using namespace dcpomatic; /** @param parent Parent window. * @param film Film we are using. diff --git a/src/wx/audio_dialog.h b/src/wx/audio_dialog.h index 38f474afd..e866aca3f 100644 --- a/src/wx/audio_dialog.h +++ b/src/wx/audio_dialog.h @@ -35,7 +35,7 @@ public: bool Show (bool show = true); - void set_cursor (boost::optional time, boost::optional db); + void set_cursor (boost::optional time, boost::optional db); private: void film_change (ChangeType, int); diff --git a/src/wx/audio_plot.cc b/src/wx/audio_plot.cc index 079f69cdc..3da7a50ff 100644 --- a/src/wx/audio_plot.cc +++ b/src/wx/audio_plot.cc @@ -37,6 +37,7 @@ using std::map; using boost::bind; using boost::optional; using boost::shared_ptr; +using namespace dcpomatic; int const AudioPlot::_minimum = -70; int const AudioPlot::_cursor_size = 8; diff --git a/src/wx/audio_plot.h b/src/wx/audio_plot.h index 85306a58d..edb444a2a 100644 --- a/src/wx/audio_plot.h +++ b/src/wx/audio_plot.h @@ -41,7 +41,7 @@ public: wxColour colour (int n) const; - boost::signals2::signal, boost::optional)> Cursor; + boost::signals2::signal, boost::optional)> Cursor; static const int max_smoothing; @@ -52,14 +52,14 @@ private: : db(0) {} - Point (wxPoint draw_, DCPTime time_, float db_) + Point (wxPoint draw_, dcpomatic::DCPTime time_, float db_) : draw(draw_) , time(time_) , db(db_) {} wxPoint draw; - DCPTime time; + dcpomatic::DCPTime time; float db; }; diff --git a/src/wx/closed_captions_dialog.cc b/src/wx/closed_captions_dialog.cc index 44e6b8da1..061262cdd 100644 --- a/src/wx/closed_captions_dialog.cc +++ b/src/wx/closed_captions_dialog.cc @@ -35,6 +35,7 @@ using std::make_pair; using boost::shared_ptr; using boost::weak_ptr; using boost::optional; +using namespace dcpomatic; ClosedCaptionsDialog::ClosedCaptionsDialog (wxWindow* parent, FilmViewer* viewer) : wxDialog (parent, wxID_ANY, _("Closed captions"), wxDefaultPosition, wxDefaultSize, diff --git a/src/wx/closed_captions_dialog.h b/src/wx/closed_captions_dialog.h index 4b407fa5a..fb4e9d59b 100644 --- a/src/wx/closed_captions_dialog.h +++ b/src/wx/closed_captions_dialog.h @@ -31,7 +31,7 @@ class ClosedCaptionsDialog : public wxDialog public: explicit ClosedCaptionsDialog (wxWindow* parent, FilmViewer* viewer); - void update (DCPTime); + void update (dcpomatic::DCPTime); void clear (); void set_film_and_butler (boost::shared_ptr, boost::weak_ptr); @@ -47,5 +47,5 @@ private: std::vector _lines; std::vector _tracks; boost::weak_ptr _butler; - DCPTime _last_update; + dcpomatic::DCPTime _last_update; }; diff --git a/src/wx/content_panel.cc b/src/wx/content_panel.cc index 82caaf1ff..72ef0e9eb 100644 --- a/src/wx/content_panel.cc +++ b/src/wx/content_panel.cc @@ -61,6 +61,7 @@ using boost::shared_ptr; using boost::weak_ptr; using boost::dynamic_pointer_cast; using boost::optional; +using namespace dcpomatic; class LimitedSplitter : public wxSplitterWindow { diff --git a/src/wx/content_view.cc b/src/wx/content_view.cc index 4db00fb54..d4ef39cb9 100644 --- a/src/wx/content_view.cc +++ b/src/wx/content_view.cc @@ -39,6 +39,7 @@ using boost::shared_ptr; using boost::weak_ptr; using boost::optional; using boost::dynamic_pointer_cast; +using namespace dcpomatic; ContentView::ContentView (wxWindow* parent) : wxListCtrl (parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_NO_HEADER) diff --git a/src/wx/controls.cc b/src/wx/controls.cc index 473ad8cb3..7cd31634d 100644 --- a/src/wx/controls.cc +++ b/src/wx/controls.cc @@ -52,6 +52,7 @@ using boost::optional; using boost::shared_ptr; using boost::weak_ptr; using boost::dynamic_pointer_cast; +using namespace dcpomatic; Controls::Controls (wxWindow* parent, shared_ptr viewer, bool editor_controls) : wxPanel (parent) diff --git a/src/wx/controls.h b/src/wx/controls.h index 7ffe0c4ea..88d21defb 100644 --- a/src/wx/controls.h +++ b/src/wx/controls.h @@ -83,7 +83,7 @@ private: void jump_to_selected_clicked (); void timecode_clicked (); void active_jobs_changed (boost::optional); - DCPTime nudge_amount (wxKeyboardState& ev); + dcpomatic::DCPTime nudge_amount (wxKeyboardState& ev); void image_changed (boost::weak_ptr); void outline_content_changed (); void eye_changed (); diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index a803eeda1..48fbf9fdc 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -67,6 +67,7 @@ using boost::dynamic_pointer_cast; using boost::weak_ptr; using boost::optional; using dcp::Size; +using namespace dcpomatic; static int diff --git a/src/wx/film_viewer.h b/src/wx/film_viewer.h index 97da5f591..0222d31c9 100644 --- a/src/wx/film_viewer.h +++ b/src/wx/film_viewer.h @@ -59,14 +59,14 @@ public: return _film; } - void seek (DCPTime t, bool accurate); - void seek (boost::shared_ptr content, ContentTime p, bool accurate); - void seek_by (DCPTime by, bool accurate); + void seek (dcpomatic::DCPTime t, bool accurate); + void seek (boost::shared_ptr content, dcpomatic::ContentTime p, bool accurate); + void seek_by (dcpomatic::DCPTime by, bool accurate); /** @return our `playhead' position; this may not lie exactly on a frame boundary */ - DCPTime position () const { + dcpomatic::DCPTime position () const { return _video_position; } - DCPTime one_video_frame () const; + dcpomatic::DCPTime one_video_frame () const; void start (); bool stop (); @@ -106,8 +106,8 @@ public: boost::signals2::signal)> ImageChanged; boost::signals2::signal PositionChanged; - boost::signals2::signal Started; - boost::signals2::signal Stopped; + boost::signals2::signal Started; + boost::signals2::signal Stopped; /** While playing back we reached the end of the film (emitted from GUI thread) */ boost::signals2::signal Finished; @@ -126,8 +126,8 @@ private: void config_changed (Config::Property); bool maybe_draw_background_image (wxPaintDC& dc); - DCPTime time () const; - DCPTime uncorrected_time () const; + dcpomatic::DCPTime time () const; + dcpomatic::DCPTime uncorrected_time () const; Frame average_latency () const; void refresh_panel (); @@ -142,9 +142,9 @@ private: bool _coalesce_player_changes; std::list _pending_player_changes; - std::pair, DCPTime> _player_video; + std::pair, dcpomatic::DCPTime> _player_video; boost::shared_ptr _frame; - DCPTime _video_position; + dcpomatic::DCPTime _video_position; Position _inter_position; dcp::Size _inter_size; diff --git a/src/wx/markers_dialog.cc b/src/wx/markers_dialog.cc index 46e8e6d09..dba4c0c0e 100644 --- a/src/wx/markers_dialog.cc +++ b/src/wx/markers_dialog.cc @@ -36,6 +36,7 @@ using boost::bind; using boost::shared_ptr; using boost::weak_ptr; using boost::optional; +using dcpomatic::DCPTime; class Marker { @@ -100,7 +101,7 @@ private: weak_ptr viewer; dcp::Marker type; CheckBox* checkbox; - Timecode* timecode; + Timecode* timecode; Button* set_button; }; diff --git a/src/wx/move_to_dialog.cc b/src/wx/move_to_dialog.cc index cb3db90cc..266f44264 100644 --- a/src/wx/move_to_dialog.cc +++ b/src/wx/move_to_dialog.cc @@ -26,6 +26,7 @@ using std::list; using boost::shared_ptr; using boost::optional; +using namespace dcpomatic; MoveToDialog::MoveToDialog (wxWindow* parent, optional position, shared_ptr film) : TableDialog (parent, _("Move content"), 2, 0, true) diff --git a/src/wx/move_to_dialog.h b/src/wx/move_to_dialog.h index 4d8d991f5..3c6f3d064 100644 --- a/src/wx/move_to_dialog.h +++ b/src/wx/move_to_dialog.h @@ -29,9 +29,9 @@ class wxSpinCtrl; class MoveToDialog : public TableDialog { public: - MoveToDialog (wxWindow* parent, boost::optional position, boost::shared_ptr film); + MoveToDialog (wxWindow* parent, boost::optional position, boost::shared_ptr film); - DCPTime position () const; + dcpomatic::DCPTime position () const; private: boost::weak_ptr _film; diff --git a/src/wx/playhead_to_frame_dialog.cc b/src/wx/playhead_to_frame_dialog.cc index 1ae049d26..4c8bc1cc6 100644 --- a/src/wx/playhead_to_frame_dialog.cc +++ b/src/wx/playhead_to_frame_dialog.cc @@ -22,6 +22,7 @@ #include using dcp::locale_convert; +using namespace dcpomatic; PlayheadToFrameDialog::PlayheadToFrameDialog (wxWindow* parent, int fps) : TableDialog (parent, _("Go to frame"), 2, 1, true) diff --git a/src/wx/playhead_to_frame_dialog.h b/src/wx/playhead_to_frame_dialog.h index b6a902a55..ab3898dea 100644 --- a/src/wx/playhead_to_frame_dialog.h +++ b/src/wx/playhead_to_frame_dialog.h @@ -26,7 +26,7 @@ class PlayheadToFrameDialog : public TableDialog public: PlayheadToFrameDialog (wxWindow* parent, int fps); - DCPTime get () const; + dcpomatic::DCPTime get () const; private: wxTextCtrl* _frame; diff --git a/src/wx/playhead_to_timecode_dialog.cc b/src/wx/playhead_to_timecode_dialog.cc index a691aa64e..c622111db 100644 --- a/src/wx/playhead_to_timecode_dialog.cc +++ b/src/wx/playhead_to_timecode_dialog.cc @@ -20,6 +20,8 @@ #include "playhead_to_timecode_dialog.h" +using namespace dcpomatic; + PlayheadToTimecodeDialog::PlayheadToTimecodeDialog (wxWindow* parent, int fps) : TableDialog (parent, _("Go to timecode"), 2, 1, true) , _fps (fps) diff --git a/src/wx/playhead_to_timecode_dialog.h b/src/wx/playhead_to_timecode_dialog.h index adce87434..226978582 100644 --- a/src/wx/playhead_to_timecode_dialog.h +++ b/src/wx/playhead_to_timecode_dialog.h @@ -26,9 +26,9 @@ class PlayheadToTimecodeDialog : public TableDialog public: PlayheadToTimecodeDialog (wxWindow* parent, int fps); - DCPTime get () const; + dcpomatic::DCPTime get () const; private: - Timecode* _timecode; + Timecode* _timecode; int _fps; }; diff --git a/src/wx/subtitle_appearance_dialog.cc b/src/wx/subtitle_appearance_dialog.cc index ad4c03850..76e8d8b16 100644 --- a/src/wx/subtitle_appearance_dialog.cc +++ b/src/wx/subtitle_appearance_dialog.cc @@ -40,6 +40,7 @@ using boost::shared_ptr; using boost::bind; using boost::dynamic_pointer_cast; using boost::optional; +using namespace dcpomatic; int const SubtitleAppearanceDialog::NONE = 0; int const SubtitleAppearanceDialog::OUTLINE = 1; diff --git a/src/wx/subtitle_appearance_dialog.h b/src/wx/subtitle_appearance_dialog.h index 0b3c66132..6c7e46817 100644 --- a/src/wx/subtitle_appearance_dialog.h +++ b/src/wx/subtitle_appearance_dialog.h @@ -58,9 +58,9 @@ private: wxCheckBox* _force_effect_colour; wxColourPickerCtrl* _effect_colour; wxCheckBox* _force_fade_in; - Timecode* _fade_in; + Timecode* _fade_in; wxCheckBox* _force_fade_out; - Timecode* _fade_out; + Timecode* _fade_out; wxSpinCtrl* _outline_width; wxGridBagSizer* _table; std::map _pickers; diff --git a/src/wx/swaroop_controls.cc b/src/wx/swaroop_controls.cc index 33db37bab..d557d09e9 100644 --- a/src/wx/swaroop_controls.cc +++ b/src/wx/swaroop_controls.cc @@ -41,6 +41,7 @@ using std::sort; using boost::shared_ptr; using boost::dynamic_pointer_cast; using boost::optional; +using namespace dcpomatic; SwaroopControls::SwaroopControls (wxWindow* parent, shared_ptr viewer) : Controls (parent, viewer, false) diff --git a/src/wx/text_view.cc b/src/wx/text_view.cc index 9b591b191..271e02d41 100644 --- a/src/wx/text_view.cc +++ b/src/wx/text_view.cc @@ -35,6 +35,7 @@ using boost::shared_ptr; using boost::weak_ptr; using boost::bind; using boost::dynamic_pointer_cast; +using namespace dcpomatic; TextView::TextView ( wxWindow* parent, shared_ptr film, shared_ptr content, shared_ptr text, shared_ptr decoder, weak_ptr viewer diff --git a/src/wx/text_view.h b/src/wx/text_view.h index 1fe07a999..6ce22dc79 100644 --- a/src/wx/text_view.h +++ b/src/wx/text_view.h @@ -42,14 +42,14 @@ public: private: void data_start (ContentStringText cts); - void data_stop (ContentTime time); + void data_stop (dcpomatic::ContentTime time); void subtitle_selected (wxListEvent &); wxListCtrl* _list; int _subs; boost::optional _frc; boost::optional _last_count; - std::vector _start_times; + std::vector _start_times; boost::weak_ptr _content; boost::weak_ptr _film_viewer; }; diff --git a/src/wx/timeline.cc b/src/wx/timeline.cc index de5f05ae7..2c510efb5 100644 --- a/src/wx/timeline.cc +++ b/src/wx/timeline.cc @@ -54,6 +54,7 @@ using boost::weak_ptr; using boost::dynamic_pointer_cast; using boost::bind; using boost::optional; +using namespace dcpomatic; /* 3 hours in 640 pixels */ double const Timeline::_minimum_pixels_per_second = 640.0 / (60 * 60 * 3); diff --git a/src/wx/timeline.h b/src/wx/timeline.h index a7f345863..84cb870f2 100644 --- a/src/wx/timeline.h +++ b/src/wx/timeline.h @@ -107,7 +107,7 @@ private: boost::shared_ptr event_to_view (wxMouseEvent &); TimelineContentViewList selected_views () const; ContentList selected_content () const; - void maybe_snap (DCPTime a, DCPTime b, boost::optional& nearest_distance) const; + void maybe_snap (dcpomatic::DCPTime a, dcpomatic::DCPTime b, boost::optional& nearest_distance) const; wxScrolledCanvas* _labels_canvas; wxScrolledCanvas* _main_canvas; @@ -123,12 +123,12 @@ private: wxPoint _down_point; boost::optional _zoom_point; boost::shared_ptr _down_view; - DCPTime _down_view_position; + dcpomatic::DCPTime _down_view_position; bool _first_move; ContentMenu _menu; bool _snap; - std::list _start_snaps; - std::list _end_snaps; + std::list _start_snaps; + std::list _end_snaps; Tool _tool; int _x_scroll_rate; int _y_scroll_rate; diff --git a/src/wx/timeline_content_view.cc b/src/wx/timeline_content_view.cc index a55526c88..6902a11d6 100644 --- a/src/wx/timeline_content_view.cc +++ b/src/wx/timeline_content_view.cc @@ -27,6 +27,7 @@ using std::list; using boost::shared_ptr; +using namespace dcpomatic; TimelineContentView::TimelineContentView (Timeline& tl, shared_ptr c) : TimelineView (tl) diff --git a/src/wx/timeline_reels_view.cc b/src/wx/timeline_reels_view.cc index f09a52a53..fa89c60a7 100644 --- a/src/wx/timeline_reels_view.cc +++ b/src/wx/timeline_reels_view.cc @@ -26,6 +26,7 @@ using std::min; using std::list; +using namespace dcpomatic; TimelineReelsView::TimelineReelsView (Timeline& tl, int y) : TimelineView (tl) diff --git a/src/wx/timeline_time_axis_view.cc b/src/wx/timeline_time_axis_view.cc index a31ed5ced..e9de1b542 100644 --- a/src/wx/timeline_time_axis_view.cc +++ b/src/wx/timeline_time_axis_view.cc @@ -26,6 +26,7 @@ using std::list; using std::cout; +using namespace dcpomatic; TimelineTimeAxisView::TimelineTimeAxisView (Timeline& tl, int y) : TimelineView (tl) diff --git a/src/wx/timeline_view.cc b/src/wx/timeline_view.cc index bb6ab6034..fb23fa7b1 100644 --- a/src/wx/timeline_view.cc +++ b/src/wx/timeline_view.cc @@ -22,6 +22,7 @@ #include "timeline.h" using std::list; +using namespace dcpomatic; /** @class TimelineView * @brief Parent class for components of the timeline (e.g. a piece of content or an axis). diff --git a/src/wx/timeline_view.h b/src/wx/timeline_view.h index f0ded7bce..d94e10124 100644 --- a/src/wx/timeline_view.h +++ b/src/wx/timeline_view.h @@ -45,7 +45,7 @@ public: protected: virtual void do_paint (wxGraphicsContext *, std::list > overlaps) = 0; - int time_x (DCPTime t) const; + int time_x (dcpomatic::DCPTime t) const; Timeline& _timeline; diff --git a/src/wx/timing_panel.cc b/src/wx/timing_panel.cc index f10815ca4..06d655b6b 100644 --- a/src/wx/timing_panel.cc +++ b/src/wx/timing_panel.cc @@ -48,6 +48,7 @@ using boost::weak_ptr; using boost::dynamic_pointer_cast; using boost::optional; using dcp::locale_convert; +using namespace dcpomatic; TimingPanel::TimingPanel (ContentPanel* p, weak_ptr viewer) /* horrid hack for apparent lack of context support with wxWidgets i18n code */ diff --git a/src/wx/timing_panel.h b/src/wx/timing_panel.h index 65d8aabc9..962a7fedc 100644 --- a/src/wx/timing_panel.h +++ b/src/wx/timing_panel.h @@ -57,18 +57,18 @@ private: wxStaticText* _colon[3]; wxStaticText* _tip; wxStaticText* _position_label; - Timecode* _position; + Timecode* _position; wxButton* _move_to_start_of_reel; wxStaticText* _full_length_label; - Timecode* _full_length; + Timecode* _full_length; wxStaticText* _trim_start_label; - Timecode* _trim_start; + Timecode* _trim_start; wxButton* _trim_start_to_playhead; wxButton* _trim_end_to_playhead; wxStaticText* _trim_end_label; - Timecode* _trim_end; + Timecode* _trim_end; wxStaticText* _play_length_label; - Timecode* _play_length; + Timecode* _play_length; wxStaticText* _video_frame_rate_label; wxTextCtrl* _video_frame_rate; wxButton* _set_video_frame_rate; diff --git a/src/wx/video_panel.cc b/src/wx/video_panel.cc index 6615215d5..9c044e188 100644 --- a/src/wx/video_panel.cc +++ b/src/wx/video_panel.cc @@ -51,6 +51,7 @@ using boost::shared_ptr; using boost::dynamic_pointer_cast; using boost::bind; using boost::optional; +using namespace dcpomatic; static VideoContentScale index_to_scale (int n) diff --git a/src/wx/video_panel.h b/src/wx/video_panel.h index 795a52a78..8e9a77cab 100644 --- a/src/wx/video_panel.h +++ b/src/wx/video_panel.h @@ -70,9 +70,9 @@ private: wxStaticText* _bottom_crop_label; ContentSpinCtrl* _bottom_crop; wxStaticText* _fade_in_label; - Timecode* _fade_in; + Timecode* _fade_in; wxStaticText* _fade_out_label; - Timecode* _fade_out; + Timecode* _fade_out; wxStaticText* _scale_to_label; ContentChoice* _scale; wxStaticText* _description; diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index 1a537c087..d2f463b73 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -44,6 +44,7 @@ using std::pair; using boost::shared_ptr; using boost::optional; using dcp::locale_convert; +using namespace dcpomatic; wxStaticText * #ifdef __WXOSX__ diff --git a/src/wx/wx_util.h b/src/wx/wx_util.h index 1b3c4a2ae..400493f18 100644 --- a/src/wx/wx_util.h +++ b/src/wx/wx_util.h @@ -84,7 +84,7 @@ extern wxString std_to_wx (std::string); extern void dcpomatic_setup_i18n (); extern wxString context_translation (wxString); extern std::string string_client_data (wxClientData* o); -extern wxString time_to_timecode (DCPTime t, double fps); +extern wxString time_to_timecode (dcpomatic::DCPTime t, double fps); extern void setup_audio_channels_choice (wxChoice* choice, int minimum); extern wxSplashScreen* maybe_show_splash (); extern double calculate_mark_interval (double start); diff --git a/test/audio_analysis_test.cc b/test/audio_analysis_test.cc index a2da8d690..5d65ab693 100644 --- a/test/audio_analysis_test.cc +++ b/test/audio_analysis_test.cc @@ -42,6 +42,7 @@ using std::vector; using boost::shared_ptr; +using namespace dcpomatic; static float random_float () diff --git a/test/audio_merger_test.cc b/test/audio_merger_test.cc index 1484213e7..4a1f689dd 100644 --- a/test/audio_merger_test.cc +++ b/test/audio_merger_test.cc @@ -36,6 +36,7 @@ using std::list; using std::cout; using boost::shared_ptr; using boost::bind; +using namespace dcpomatic; static shared_ptr last_audio; diff --git a/test/audio_ring_buffers_test.cc b/test/audio_ring_buffers_test.cc index 9ebd64ded..782451a7d 100644 --- a/test/audio_ring_buffers_test.cc +++ b/test/audio_ring_buffers_test.cc @@ -24,6 +24,7 @@ using std::cout; using boost::shared_ptr; +using namespace dcpomatic; #define CANARY 9999 diff --git a/test/burnt_subtitle_test.cc b/test/burnt_subtitle_test.cc index 91edcad9f..8bd2c46b8 100644 --- a/test/burnt_subtitle_test.cc +++ b/test/burnt_subtitle_test.cc @@ -51,6 +51,7 @@ using std::cout; using std::map; using boost::shared_ptr; using boost::dynamic_pointer_cast; +using namespace dcpomatic; /** Build a small DCP with no picture and a single subtitle overlaid onto it from a SubRip file */ BOOST_AUTO_TEST_CASE (burnt_subtitle_test_subrip) diff --git a/test/butler_test.cc b/test/butler_test.cc index 93e141c42..cc2841268 100644 --- a/test/butler_test.cc +++ b/test/butler_test.cc @@ -29,6 +29,7 @@ #include using boost::shared_ptr; +using namespace dcpomatic; BOOST_AUTO_TEST_CASE (butler_test1) { diff --git a/test/content_test.cc b/test/content_test.cc index 55e34ac5f..2f8963f5b 100644 --- a/test/content_test.cc +++ b/test/content_test.cc @@ -32,6 +32,7 @@ #include using boost::shared_ptr; +using namespace dcpomatic; /** There has been garbled audio with this piece of content */ BOOST_AUTO_TEST_CASE (content_test1) diff --git a/test/dcp_playback_test.cc b/test/dcp_playback_test.cc index 04a0eabe3..9fef1801b 100644 --- a/test/dcp_playback_test.cc +++ b/test/dcp_playback_test.cc @@ -28,6 +28,7 @@ using std::pair; using boost::shared_ptr; using boost::optional; +using namespace dcpomatic; /** Simulate the work that the player does, for profiling */ BOOST_AUTO_TEST_CASE (dcp_playback_test) diff --git a/test/dcp_subtitle_test.cc b/test/dcp_subtitle_test.cc index 89eb11a60..150cd8539 100644 --- a/test/dcp_subtitle_test.cc +++ b/test/dcp_subtitle_test.cc @@ -42,6 +42,7 @@ using std::cout; using std::list; using boost::shared_ptr; using boost::optional; +using namespace dcpomatic; optional stored; diff --git a/test/dcpomatic_time_test.cc b/test/dcpomatic_time_test.cc index 1637738ad..5b58c369b 100644 --- a/test/dcpomatic_time_test.cc +++ b/test/dcpomatic_time_test.cc @@ -31,6 +31,7 @@ using std::list; using std::cout; +using namespace dcpomatic; BOOST_AUTO_TEST_CASE (dcpomatic_time_test) { diff --git a/test/empty_test.cc b/test/empty_test.cc index 86ce2075c..428d0f9bb 100644 --- a/test/empty_test.cc +++ b/test/empty_test.cc @@ -30,6 +30,7 @@ #include using boost::shared_ptr; +using namespace dcpomatic; bool has_video (shared_ptr piece) diff --git a/test/ffmpeg_decoder_seek_test.cc b/test/ffmpeg_decoder_seek_test.cc index c69c74c68..3e825e443 100644 --- a/test/ffmpeg_decoder_seek_test.cc +++ b/test/ffmpeg_decoder_seek_test.cc @@ -44,6 +44,7 @@ using std::list; using std::cout; using boost::shared_ptr; using boost::optional; +using namespace dcpomatic; static optional stored; static bool diff --git a/test/ffmpeg_decoder_sequential_test.cc b/test/ffmpeg_decoder_sequential_test.cc index 892bc9e4c..f99229c65 100644 --- a/test/ffmpeg_decoder_sequential_test.cc +++ b/test/ffmpeg_decoder_sequential_test.cc @@ -43,6 +43,7 @@ using std::list; using boost::shared_ptr; using boost::optional; using boost::bind; +using namespace dcpomatic; static DCPTime next; static DCPTime frame; diff --git a/test/ffmpeg_encoder_test.cc b/test/ffmpeg_encoder_test.cc index 1e001f0c8..dd10bd4a1 100644 --- a/test/ffmpeg_encoder_test.cc +++ b/test/ffmpeg_encoder_test.cc @@ -36,6 +36,7 @@ using std::string; using boost::shared_ptr; +using namespace dcpomatic; static void ffmpeg_content_test (int number, boost::filesystem::path content, ExportFormat format) diff --git a/test/ffmpeg_examiner_test.cc b/test/ffmpeg_examiner_test.cc index d4614e226..b6b2bbf06 100644 --- a/test/ffmpeg_examiner_test.cc +++ b/test/ffmpeg_examiner_test.cc @@ -31,6 +31,7 @@ #include "test.h" using boost::shared_ptr; +using namespace dcpomatic; BOOST_AUTO_TEST_CASE (ffmpeg_examiner_test) { diff --git a/test/ffmpeg_pts_offset_test.cc b/test/ffmpeg_pts_offset_test.cc index 18f89713e..f4bf6df35 100644 --- a/test/ffmpeg_pts_offset_test.cc +++ b/test/ffmpeg_pts_offset_test.cc @@ -32,6 +32,7 @@ #include "test.h" using boost::shared_ptr; +using namespace dcpomatic; BOOST_AUTO_TEST_CASE (ffmpeg_pts_offset_test) { diff --git a/test/player_test.cc b/test/player_test.cc index 1736bfc7e..7b65783c6 100644 --- a/test/player_test.cc +++ b/test/player_test.cc @@ -48,6 +48,7 @@ using std::pair; using boost::shared_ptr; using boost::bind; using boost::optional; +using namespace dcpomatic; static shared_ptr accumulated; diff --git a/test/reels_test.cc b/test/reels_test.cc index eea9ebfbe..15e386d59 100644 --- a/test/reels_test.cc +++ b/test/reels_test.cc @@ -39,6 +39,7 @@ using std::list; using std::cout; using boost::shared_ptr; +using namespace dcpomatic; /** Test Film::reels() */ BOOST_AUTO_TEST_CASE (reels_test1) diff --git a/test/silence_padding_test.cc b/test/silence_padding_test.cc index 070cb235d..b15f4691b 100644 --- a/test/silence_padding_test.cc +++ b/test/silence_padding_test.cc @@ -141,7 +141,7 @@ BOOST_AUTO_TEST_CASE (silence_padding_test2) BOOST_REQUIRE (!wait_for_jobs()); film->set_video_frame_rate (24); - content->set_trim_start (ContentTime(4003)); + content->set_trim_start (dcpomatic::ContentTime(4003)); film->make_dcp (); BOOST_REQUIRE (!wait_for_jobs()); diff --git a/test/srt_subtitle_test.cc b/test/srt_subtitle_test.cc index 0c1f07161..eefdb4122 100644 --- a/test/srt_subtitle_test.cc +++ b/test/srt_subtitle_test.cc @@ -37,6 +37,7 @@ using std::string; using std::list; using boost::shared_ptr; +using namespace dcpomatic; /** Make a very short DCP with a single subtitle from .srt with no specified fonts */ BOOST_AUTO_TEST_CASE (srt_subtitle_test) diff --git a/test/subtitle_trim_test.cc b/test/subtitle_trim_test.cc index 2380449d8..966fc66b6 100644 --- a/test/subtitle_trim_test.cc +++ b/test/subtitle_trim_test.cc @@ -24,6 +24,7 @@ #include using boost::shared_ptr; +using namespace dcpomatic; /** Check for no crash when trimming DCP subtitles (#1275) */ BOOST_AUTO_TEST_CASE (subtitle_trim_test1) diff --git a/test/time_calculation_test.cc b/test/time_calculation_test.cc index e995a4ed0..968138f96 100644 --- a/test/time_calculation_test.cc +++ b/test/time_calculation_test.cc @@ -34,6 +34,7 @@ using std::string; using std::list; using boost::shared_ptr; +using namespace dcpomatic; static string const xml = "" "FFmpeg" diff --git a/test/torture_test.cc b/test/torture_test.cc index 5525eb081..10d343268 100644 --- a/test/torture_test.cc +++ b/test/torture_test.cc @@ -45,6 +45,7 @@ using std::list; using std::cout; using boost::shared_ptr; using boost::dynamic_pointer_cast; +using namespace dcpomatic; /** Test start/end trim and positioning of some audio content */ BOOST_AUTO_TEST_CASE (torture_test1) diff --git a/test/upmixer_a_test.cc b/test/upmixer_a_test.cc index 5643310c6..545f081ba 100644 --- a/test/upmixer_a_test.cc +++ b/test/upmixer_a_test.cc @@ -35,6 +35,7 @@ #include "test.h" using boost::shared_ptr; +using namespace dcpomatic; static SNDFILE* L; static SNDFILE* R; diff --git a/test/util_test.cc b/test/util_test.cc index 1e13efa82..709bb0827 100644 --- a/test/util_test.cc +++ b/test/util_test.cc @@ -32,6 +32,7 @@ using std::string; using std::vector; using boost::shared_ptr; +using namespace dcpomatic; BOOST_AUTO_TEST_CASE (digest_head_tail_test) { diff --git a/test/vf_test.cc b/test/vf_test.cc index 6862a1204..307d26ea6 100644 --- a/test/vf_test.cc +++ b/test/vf_test.cc @@ -45,6 +45,7 @@ using std::string; using std::cout; using boost::shared_ptr; using boost::dynamic_pointer_cast; +using namespace dcpomatic; /** Test the logic which decides whether a DCP can be referenced or not */ BOOST_AUTO_TEST_CASE (vf_test1) -- 2.30.2