diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-05-08 23:41:42 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2019-05-10 23:43:55 +0100 |
| commit | c4403784febdbdd42e9c32e67fadb147f11fe566 (patch) | |
| tree | a3c76832e341eedcaed2152c2ebf4dd76325b6b2 /src/lib | |
| parent | 248fe9bd28d93a9e269093b4dfbec5d0ceb49ce1 (diff) | |
Put Time types in dcpomatic namespace.
Diffstat (limited to 'src/lib')
102 files changed, 277 insertions, 217 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<PlayerText> get_burnt (DCPTimePeriod period, bool always_burn_captions) const; - void clear_before (DCPTime time); + std::list<PlayerText> get_burnt (dcpomatic::DCPTimePeriod period, bool always_burn_captions) const; + void clear_before (dcpomatic::DCPTime time); void clear (); - void add_from (boost::weak_ptr<const TextContent> content, PlayerText ps, DCPTime from); - std::pair<PlayerText, DCPTime> add_to (boost::weak_ptr<const TextContent> content, DCPTime to); + void add_from (boost::weak_ptr<const TextContent> content, PlayerText ps, dcpomatic::DCPTime from); + std::pair<PlayerText, dcpomatic::DCPTime> add_to (boost::weak_ptr<const TextContent> content, dcpomatic::DCPTime to); bool have (boost::weak_ptr<const TextContent> 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<DCPTime> to; + dcpomatic::DCPTime from; + boost::optional<dcpomatic::DCPTime> to; }; typedef std::map<boost::weak_ptr<const TextContent>, std::list<Period> > 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<const AudioBuffers>, DCPTime time); + void analyse (boost::shared_ptr<const AudioBuffers>, dcpomatic::DCPTime time); boost::shared_ptr<const Playlist> _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<const Film> film, boost::shared_ptr<Job> job); std::string summary () const; void as_xml (xmlpp::Node* node, bool with_path) const; - DCPTime full_length (boost::shared_ptr<const Film> film) const; - DCPTime approximate_length () const; + dcpomatic::DCPTime full_length (boost::shared_ptr<const Film> 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<PeakTime> 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<const Film> film, std::list<UserProperty> &) const; - void modify_position (boost::shared_ptr<const Film> film, DCPTime& pos) const; - void modify_trim_start (ContentTime& pos) const; + void modify_position (boost::shared_ptr<const Film> film, dcpomatic::DCPTime& pos) const; + void modify_trim_start (dcpomatic::ContentTime& pos) const; static boost::shared_ptr<AudioContent> 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<const AudioContent> 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<AudioDecoder>, public public: AudioDecoder (Decoder* parent, boost::shared_ptr<const AudioContent> content, bool fast); - ContentTime position (boost::shared_ptr<const Film> film) const; - void emit (boost::shared_ptr<const Film> film, AudioStreamPtr stream, boost::shared_ptr<const AudioBuffers>, ContentTime); + dcpomatic::ContentTime position (boost::shared_ptr<const Film> film) const; + void emit (boost::shared_ptr<const Film> film, AudioStreamPtr stream, boost::shared_ptr<const AudioBuffers>, dcpomatic::ContentTime); void seek (); void flush (); - ContentTime stream_position (boost::shared_ptr<const Film> film, AudioStreamPtr stream) const; + dcpomatic::ContentTime stream_position (boost::shared_ptr<const Film> film, AudioStreamPtr stream) const; /** @return Number of frames of data that were accepted */ boost::signals2::signal<void (AudioStreamPtr, ContentAudio)> 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<std::pair<boost::shared_ptr<AudioBuffers>, DCPTime> > pull (DCPTime time); - void push (boost::shared_ptr<const AudioBuffers> audio, DCPTime time); + std::list<std::pair<boost::shared_ptr<AudioBuffers>, dcpomatic::DCPTime> > pull (dcpomatic::DCPTime time); + void push (boost::shared_ptr<const AudioBuffers> 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<AudioBuffers> a, DCPTime t, int r) + Buffer (boost::shared_ptr<AudioBuffers> a, dcpomatic::DCPTime t, int r) : audio (a) , time (t) , frame_rate (r) {} boost::shared_ptr<AudioBuffers> 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<const AudioBuffers> data, DCPTime time, int frame_rate); - boost::optional<DCPTime> get (float* out, int channels, int frames); - boost::optional<DCPTime> peek () const; + void put (boost::shared_ptr<const AudioBuffers> data, dcpomatic::DCPTime time, int frame_rate); + boost::optional<dcpomatic::DCPTime> get (float* out, int channels, int frames); + boost::optional<dcpomatic::DCPTime> peek () const; void clear (); Frame size () const; private: mutable boost::mutex _mutex; - std::list<std::pair<boost::shared_ptr<const AudioBuffers>, DCPTime> > _buffers; + std::list<std::pair<boost::shared_ptr<const AudioBuffers>, 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<boost::shared_ptr<PlayerVideo>, DCPTime> get_video (Error* e = 0); - boost::optional<DCPTime> get_audio (float* out, Frame frames); + std::pair<boost::shared_ptr<PlayerVideo>, dcpomatic::DCPTime> get_video (Error* e = 0); + boost::optional<dcpomatic::DCPTime> get_audio (float* out, Frame frames); boost::optional<TextRingBuffers::Data> get_closed_caption (); void disable_audio (); @@ -64,13 +64,13 @@ public: private: void thread (); - void video (boost::shared_ptr<PlayerVideo> video, DCPTime time); - void audio (boost::shared_ptr<AudioBuffers> audio, DCPTime time, int frame_rate); - void text (PlayerText pt, TextType type, boost::optional<DCPTextTrack> track, DCPTimePeriod period); + void video (boost::shared_ptr<PlayerVideo> video, dcpomatic::DCPTime time); + void audio (boost::shared_ptr<AudioBuffers> audio, dcpomatic::DCPTime time, int frame_rate); + void text (PlayerText pt, TextType type, boost::optional<DCPTextTrack> track, dcpomatic::DCPTimePeriod period); bool should_run () const; void prepare (boost::weak_ptr<PlayerVideo> 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> _player; boost::thread* _thread; @@ -93,7 +93,7 @@ private: boost::mutex _mutex; boost::condition _summon; boost::condition _arrived; - boost::optional<DCPTime> _pending_seek_position; + boost::optional<dcpomatic::DCPTime> _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<DCPTime> _awaiting; + boost::optional<dcpomatic::DCPTime> _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<Content>, public Signaller { public: explicit Content (); - Content (DCPTime); + Content (dcpomatic::DCPTime); Content (boost::filesystem::path); Content (cxml::ConstNodePtr); Content (std::vector<boost::shared_ptr<Content> >); @@ -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 Film>) const = 0; - virtual DCPTime approximate_length () const = 0; + virtual dcpomatic::DCPTime full_length (boost::shared_ptr<const Film>) 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<DCPTime> reel_split_points (boost::shared_ptr<const Film>) const; + virtual std::list<dcpomatic::DCPTime> reel_split_points (boost::shared_ptr<const Film>) const; boost::shared_ptr<Content> clone () const; @@ -135,36 +135,36 @@ public: return _digest; } - void set_position (boost::shared_ptr<const Film> film, DCPTime, bool force_emit = false); + void set_position (boost::shared_ptr<const Film> 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<const Film> film) const { + dcpomatic::DCPTime end (boost::shared_ptr<const Film> film) const { return position() + length_after_trim(film); } - DCPTime length_after_trim (boost::shared_ptr<const Film> film) const; + dcpomatic::DCPTime length_after_trim (boost::shared_ptr<const Film> film) const; boost::optional<double> video_frame_rate () const { boost::mutex::scoped_lock lm (_mutex); @@ -219,9 +219,9 @@ private: std::vector<std::time_t> _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<Image> im, dcpomatic::Rect<double> r) + ContentBitmapText (dcpomatic::ContentTime f, boost::shared_ptr<Image> im, dcpomatic::Rect<double> r) : ContentText (f) , sub (im, r) {} @@ -64,7 +64,7 @@ public: class ContentStringText : public ContentText { public: - ContentStringText (ContentTime f, std::list<dcp::SubtitleString> s) + ContentStringText (dcpomatic::ContentTime f, std::list<dcp::SubtitleString> 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<const DCPContent> (Content::shared_from_this ()); } - DCPTime full_length (boost::shared_ptr<const Film> film) const; - DCPTime approximate_length () const; + dcpomatic::DCPTime full_length (boost::shared_ptr<const Film> film) const; + dcpomatic::DCPTime approximate_length () const; void examine (boost::shared_ptr<const Film> film, boost::shared_ptr<Job>); std::string summary () const; @@ -72,7 +72,7 @@ public: void take_settings_from (boost::shared_ptr<const Content> c); void set_default_colour_conversion (); - std::list<DCPTime> reel_split_points (boost::shared_ptr<const Film> film) const; + std::list<dcpomatic::DCPTime> reel_split_points (boost::shared_ptr<const Film> film) const; std::vector<boost::filesystem::path> directories () const; @@ -153,7 +153,7 @@ private: void read_directory (boost::filesystem::path); void read_sub_directory (boost::filesystem::path); - std::list<DCPTimePeriod> reels (boost::shared_ptr<const Film> film) const; + std::list<dcpomatic::DCPTimePeriod> reels (boost::shared_ptr<const Film> film) const; bool can_reference ( boost::shared_ptr<const Film> film, boost::function <bool (boost::shared_ptr<const Content>)>, 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<const Film> film, shared_ptr<const DCPContent> 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<int> 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<dcp::SubtitleAsset> 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<boost::shared_ptr<dcp::Reel> > _reels; std::list<boost::shared_ptr<dcp::Reel> >::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<PlayerVideo>, DCPTime); - void audio (boost::shared_ptr<AudioBuffers>, DCPTime); - void text (PlayerText, TextType, boost::optional<DCPTextTrack>, DCPTimePeriod); + void video (boost::shared_ptr<PlayerVideo>, dcpomatic::DCPTime); + void audio (boost::shared_ptr<AudioBuffers>, dcpomatic::DCPTime); + void text (PlayerText, TextType, boost::optional<DCPTextTrack>, dcpomatic::DCPTimePeriod); boost::shared_ptr<Writer> _writer; boost::shared_ptr<J2KEncoder> _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<const Film> film) const; - DCPTime approximate_length () const; + dcpomatic::DCPTime full_length (boost::shared_ptr<const Film> 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<const Film> film, shared_ptr<const DCPSubtitleContent> 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<const Film> film, boost::shared_ptr<const DCPSubtitleContent>); bool pass (); - void seek (ContentTime time, bool accurate); + void seek (dcpomatic::ContentTime time, bool accurate); private: - ContentTimePeriod content_time_period (boost::shared_ptr<dcp::Subtitle> s) const; + dcpomatic::ContentTimePeriod content_time_period (boost::shared_ptr<dcp::Subtitle> s) const; std::list<boost::shared_ptr<dcp::Subtitle> > _subtitles; std::list<boost::shared_ptr<dcp::Subtitle> >::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 <inttypes.h> using std::string; +using namespace dcpomatic; template <> Time<ContentTimeDifferentiator, DCPTimeDifferentiator>::Time (DCPTime d, FrameRateChange f) @@ -38,7 +39,7 @@ Time<DCPTimeDifferentiator, ContentTimeDifferentiator>::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 <iomanip> #include <cstdio> +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 <iostream> +namespace dcpomatic { + /** @param periods Set of periods in ascending order of from time */ template <class T> std::list<TimePeriod<T> > coalesce (std::list<TimePeriod<T> > periods) @@ -46,3 +48,5 @@ std::list<TimePeriod<T> > coalesce (std::list<TimePeriod<T> > 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<const Film> 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<const Film> 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<const Film> film) const = 0; + virtual dcpomatic::ContentTime position (boost::shared_ptr<const Film> 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<const Film> film, list<shared_ptr<Piece> > pieces, function<bool (shared_ptr<Piece>)> 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<const Film> film, std::list<boost::shared_ptr<Piece> > pieces, boost::function<bool (boost::shared_ptr<Piece>)> 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<DCPTimePeriod> _periods; - DCPTime _position; + std::list<dcpomatic::DCPTimePeriod> _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<boost::shared_ptr<FFmpegAudioStream> > audio_streams, boost::optional<ContentTime> first_video, double video_frame_rate + dcpomatic::ContentTime pts_offset ( + std::vector<boost::shared_ptr<FFmpegAudioStream> > audio_streams, boost::optional<dcpomatic::ContentTime> 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<ContentTime> first_audio; + boost::optional<dcpomatic::ContentTime> first_audio; boost::optional<std::string> 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<const Film> film) const; - DCPTime approximate_length () const; + dcpomatic::DCPTime full_length (boost::shared_ptr<const Film> film) const; + dcpomatic::DCPTime approximate_length () const; std::string identifier () const; @@ -91,7 +91,7 @@ public: void set_subtitle_stream (boost::shared_ptr<FFmpegSubtitleStream>); - boost::optional<ContentTime> first_video () const { + boost::optional<dcpomatic::ContentTime> first_video () const { boost::mutex::scoped_lock lm (_mutex); return _first_video; } @@ -116,7 +116,7 @@ private: std::vector<boost::shared_ptr<FFmpegSubtitleStream> > _subtitle_streams; boost::shared_ptr<FFmpegSubtitleStream> _subtitle_stream; - boost::optional<ContentTime> _first_video; + boost::optional<dcpomatic::ContentTime> _first_video; /** Video filters that should be used when generating DCPs */ std::vector<Filter const *> _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<const Film> film, shared_ptr<const FFmpegContent> 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<const Film> film, boost::shared_ptr<const FFmpegContent>, 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<AudioBuffers> deinterleave_audio (boost::shared_ptr<FFmpegAudioStream> stream) const; @@ -71,12 +71,12 @@ private: std::list<boost::shared_ptr<VideoFilterGraph> > _filter_graphs; boost::mutex _filter_graphs_mutex; - ContentTime _pts_offset; - boost::optional<ContentTime> _current_subtitle_to; + dcpomatic::ContentTime _pts_offset; + boost::optional<dcpomatic::ContentTime> _current_subtitle_to; /** true if we have a subtitle which has not had emit_stop called for it yet */ bool _have_current_subtitle; boost::shared_ptr<Image> _black_image; - std::vector<boost::optional<ContentTime> > _next_time; + std::vector<boost::optional<dcpomatic::ContentTime> > _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<const Film> 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<const FFmpegContent> c, shared_ptr<Job> 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<ContentTime> first_video () const { + boost::optional<dcpomatic::ContentTime> 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<ContentTime> frame_time (AVStream* s) const; + boost::optional<dcpomatic::ContentTime> frame_time (AVStream* s) const; std::vector<boost::shared_ptr<FFmpegSubtitleStream> > _subtitle_streams; std::vector<boost::shared_ptr<FFmpegAudioStream> > _audio_streams; - boost::optional<ContentTime> _first_video; + boost::optional<dcpomatic::ContentTime> _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::shared_ptr<FFmpegSubtitleStream>, boost::optional<SubtitleStart> > 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<PlayerVideo>, DCPTime); + void video (boost::shared_ptr<PlayerVideo>, dcpomatic::DCPTime); void audio (boost::shared_ptr<AudioBuffers>); - 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<ContentTime> to; + dcpomatic::ContentTime from; + boost::optional<dcpomatic::ContentTime> 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<boost::filesystem::path> 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 Playlist>) 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<double, double> speed_up_range (int dcp_frame_rate) const; dcp::EncryptedKDM make_kdm ( @@ -163,10 +163,10 @@ public: return _playlist; } - std::list<DCPTimePeriod> reels () const; + std::list<dcpomatic::DCPTimePeriod> reels () const; std::list<int> 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<DCPTime> marker (dcp::Marker type) const; - std::map<dcp::Marker, DCPTime> markers () const { + boost::optional<dcpomatic::DCPTime> marker (dcp::Marker type) const; + std::map<dcp::Marker, dcpomatic::DCPTime> 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<dcp::Rating> 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<dcp::Marker, DCPTime> _markers; + std::map<dcp::Marker, dcpomatic::DCPTime> _markers; std::vector<dcp::Rating> _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<const Film> 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<const Film> _film; boost::thread* _thread; @@ -54,7 +54,7 @@ private: bool _long_ccap; bool _overlap_ccap; bool _too_many_ccap_lines; - boost::optional<DCPTimePeriod> _last; + boost::optional<dcpomatic::DCPTimePeriod> _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<const Film> film) const; - DCPTime approximate_length () const; + dcpomatic::DCPTime full_length (boost::shared_ptr<const Film> 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<const Film> film, shared_ptr<const ImageContent> 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<PlayerVideo> pv, DCPTime time); + void encode (boost::shared_ptr<PlayerVideo> pv, dcpomatic::DCPTime time); /** Called when a processing run has finished */ void end (); @@ -101,7 +101,7 @@ private: Waker _waker; boost::shared_ptr<PlayerVideo> _last_player_video[EYES_COUNT]; - boost::optional<DCPTime> _last_player_video_time; + boost::optional<dcpomatic::DCPTime> _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<const Film> 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<const Film> film, ContentList cl, function<bool (shared_ptr<const Content>)> 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<const Film> film, ContentList cl, boost::function<bool (boost::shared_ptr<const Content>)> part, DCPTime from, DCPTime to + boost::shared_ptr<const Film> film, ContentList cl, boost::function<bool (boost::shared_ptr<const Content>)> 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<boost::shared_ptr<Font> > get_subtitle_fonts (); std::list<ReferencedReelAsset> get_reel_assets (); @@ -86,17 +86,17 @@ public: void set_play_referenced (); void set_dcp_decode_reduction (boost::optional<int> reduction); - boost::optional<DCPTime> content_time_to_dcp (boost::shared_ptr<Content> content, ContentTime t); + boost::optional<dcpomatic::DCPTime> content_time_to_dcp (boost::shared_ptr<Content> content, dcpomatic::ContentTime t); boost::signals2::signal<void (ChangeType, int, bool)> Change; /** Emitted when a video frame is ready. These emissions happen in the correct order. */ - boost::signals2::signal<void (boost::shared_ptr<PlayerVideo>, DCPTime)> Video; - boost::signals2::signal<void (boost::shared_ptr<AudioBuffers>, DCPTime, int)> Audio; + boost::signals2::signal<void (boost::shared_ptr<PlayerVideo>, dcpomatic::DCPTime)> Video; + boost::signals2::signal<void (boost::shared_ptr<AudioBuffers>, dcpomatic::DCPTime, int)> Audio; /** Emitted when a text is ready. This signal may be emitted considerably * after the corresponding Video. */ - boost::signals2::signal<void (PlayerText, TextType, boost::optional<DCPTextTrack>, DCPTimePeriod)> Text; + boost::signals2::signal<void (PlayerText, TextType, boost::optional<DCPTextTrack>, 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<const Piece> piece, DCPTime t) const; - DCPTime content_video_to_dcp (boost::shared_ptr<const Piece> piece, Frame f) const; - Frame dcp_to_resampled_audio (boost::shared_ptr<const Piece> piece, DCPTime t) const; - DCPTime resampled_audio_to_dcp (boost::shared_ptr<const Piece> piece, Frame f) const; - ContentTime dcp_to_content_time (boost::shared_ptr<const Piece> piece, DCPTime t) const; - DCPTime content_time_to_dcp (boost::shared_ptr<const Piece> piece, ContentTime t) const; + Frame dcp_to_content_video (boost::shared_ptr<const Piece> piece, dcpomatic::DCPTime t) const; + dcpomatic::DCPTime content_video_to_dcp (boost::shared_ptr<const Piece> piece, Frame f) const; + Frame dcp_to_resampled_audio (boost::shared_ptr<const Piece> piece, dcpomatic::DCPTime t) const; + dcpomatic::DCPTime resampled_audio_to_dcp (boost::shared_ptr<const Piece> piece, Frame f) const; + dcpomatic::ContentTime dcp_to_content_time (boost::shared_ptr<const Piece> piece, dcpomatic::DCPTime t) const; + dcpomatic::DCPTime content_time_to_dcp (boost::shared_ptr<const Piece> piece, dcpomatic::ContentTime t) const; boost::shared_ptr<PlayerVideo> black_player_video_frame (Eyes eyes) const; void video (boost::weak_ptr<Piece>, ContentVideo); void audio (boost::weak_ptr<Piece>, AudioStreamPtr, ContentAudio); void bitmap_text_start (boost::weak_ptr<Piece>, boost::weak_ptr<const TextContent>, ContentBitmapText); void plain_text_start (boost::weak_ptr<Piece>, boost::weak_ptr<const TextContent>, ContentStringText); - void subtitle_stop (boost::weak_ptr<Piece>, boost::weak_ptr<const TextContent>, ContentTime); - DCPTime one_video_frame () const; - void fill_audio (DCPTimePeriod period); - std::pair<boost::shared_ptr<AudioBuffers>, DCPTime> discard_audio ( - boost::shared_ptr<const AudioBuffers> audio, DCPTime time, DCPTime discard_to + void subtitle_stop (boost::weak_ptr<Piece>, boost::weak_ptr<const TextContent>, dcpomatic::ContentTime); + dcpomatic::DCPTime one_video_frame () const; + void fill_audio (dcpomatic::DCPTimePeriod period); + std::pair<boost::shared_ptr<AudioBuffers>, dcpomatic::DCPTime> discard_audio ( + boost::shared_ptr<const AudioBuffers> audio, dcpomatic::DCPTime time, dcpomatic::DCPTime discard_to ) const; - boost::optional<PositionImage> open_subtitles_for_frame (DCPTime time) const; - void emit_video (boost::shared_ptr<PlayerVideo> pv, DCPTime time); - void do_emit_video (boost::shared_ptr<PlayerVideo> pv, DCPTime time); - void emit_audio (boost::shared_ptr<AudioBuffers> data, DCPTime time); + boost::optional<PositionImage> open_subtitles_for_frame (dcpomatic::DCPTime time) const; + void emit_video (boost::shared_ptr<PlayerVideo> pv, dcpomatic::DCPTime time); + void do_emit_video (boost::shared_ptr<PlayerVideo> pv, dcpomatic::DCPTime time); + void emit_audio (boost::shared_ptr<AudioBuffers> 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<DCPTime> _last_video_time; + boost::optional<dcpomatic::DCPTime> _last_video_time; boost::optional<Eyes> _last_video_eyes; /** Time just after the last audio frame we emitted, or the time of the last accurate seek */ - boost::optional<DCPTime> _last_audio_time; + boost::optional<dcpomatic::DCPTime> _last_audio_time; boost::optional<int> _dcp_decode_reduction; @@ -177,20 +177,20 @@ private: AudioMerger _audio_merger; Shuffler* _shuffler; - std::list<std::pair<boost::shared_ptr<PlayerVideo>, DCPTime> > _delay; + std::list<std::pair<boost::shared_ptr<PlayerVideo>, dcpomatic::DCPTime> > _delay; class StreamState { public: StreamState () {} - StreamState (boost::shared_ptr<Piece> p, DCPTime l) + StreamState (boost::shared_ptr<Piece> p, dcpomatic::DCPTime l) : piece(p) , last_push_end(l) {} boost::shared_ptr<Piece> piece; - DCPTime last_push_end; + dcpomatic::DCPTime last_push_end; }; std::map<AudioStreamPtr, StreamState> _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<const Film> film) const; - boost::optional<DCPTime> start () const; + dcpomatic::DCPTime length (boost::shared_ptr<const Film> film) const; + boost::optional<dcpomatic::DCPTime> start () const; int64_t required_disk_space (boost::shared_ptr<const Film> film, int j2k_bandwidth, int audio_channels, int audio_frame_rate) const; int best_video_frame_rate () const; - DCPTime video_end (boost::shared_ptr<const Film> film) const; - DCPTime text_end (boost::shared_ptr<const Film> film) const; - FrameRateChange active_frame_rate_change (DCPTime, int dcp_frame_rate) const; - std::string content_summary (boost::shared_ptr<const Film> film, DCPTimePeriod period) const; + dcpomatic::DCPTime video_end (boost::shared_ptr<const Film> film) const; + dcpomatic::DCPTime text_end (boost::shared_ptr<const Film> film) const; + FrameRateChange active_frame_rate_change (dcpomatic::DCPTime, int dcp_frame_rate) const; + std::string content_summary (boost::shared_ptr<const Film> film, dcpomatic::DCPTimePeriod period) const; std::pair<double, double> 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<const Film> film, - DCPTimePeriod period, + dcpomatic::DCPTimePeriod period, boost::shared_ptr<Job> 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<const AudioBuffers> audio); - void write (PlayerText text, TextType type, boost::optional<DCPTextTrack> track, DCPTimePeriod period); + void write (PlayerText text, TextType type, boost::optional<DCPTextTrack> track, dcpomatic::DCPTimePeriod period); void finish (); boost::shared_ptr<dcp::Reel> create_reel (std::list<ReferencedReelAsset> const & refs, std::list<boost::shared_ptr<Font> > 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<const Film> _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<dcp::ReelAsset> asset_, DCPTimePeriod period_) + ReferencedReelAsset (boost::shared_ptr<dcp::ReelAsset> asset_, dcpomatic::DCPTimePeriod period_) : asset (asset_) , period (period_) {} @@ -34,7 +34,7 @@ public: /** The asset */ boost::shared_ptr<dcp::ReelAsset> 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<pair<boost::filesystem::path, string> > 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<StringText> subtitles, int target_height, float fade_factor); std::list<PositionImage> render_text ( - std::list<StringText>, std::list<boost::shared_ptr<Font> > fonts, dcp::Size, DCPTime, int + std::list<StringText>, std::list<boost::shared_ptr<Font> > 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<const StringTextFileContent> 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<const StringTextFileContent>); - boost::optional<ContentTime> first () const; - ContentTime length () const; + boost::optional<dcpomatic::ContentTime> first () const; + dcpomatic::ContentTime length () const; protected: std::vector<sub::Subtitle> _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<const Film> film) const; - DCPTime approximate_length () const; + dcpomatic::DCPTime full_length (boost::shared_ptr<const Film> 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<const Film> film, shared_ptr<const StringTextFileContent> 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<const Film> film, boost::shared_ptr<const StringTextFileContent>); - 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<ContentTime> fade_in () const { + boost::optional<dcpomatic::ContentTime> fade_in () const { boost::mutex::scoped_lock lm (_mutex); return _fade_in; } - boost::optional<ContentTime> fade_out () const { + boost::optional<dcpomatic::ContentTime> fade_out () const { boost::mutex::scoped_lock lm (_mutex); return _fade_out; } @@ -217,8 +217,8 @@ private: boost::optional<dcp::Colour> _effect_colour; /** scaling factor for line spacing; 1 is "standard", < 1 is closer together, > 1 is further apart */ double _line_spacing; - boost::optional<ContentTime> _fade_in; - boost::optional<ContentTime> _fade_out; + boost::optional<dcpomatic::ContentTime> _fade_in; + boost::optional<dcpomatic::ContentTime> _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<const TextContent>, - ContentTime first + dcpomatic::ContentTime first ); - ContentTime position (boost::shared_ptr<const Film>) const { + dcpomatic::ContentTime position (boost::shared_ptr<const Film>) const { return _position; } - void emit_bitmap_start (ContentTime from, boost::shared_ptr<Image> image, dcpomatic::Rect<double> rect); - void emit_bitmap (ContentTimePeriod period, boost::shared_ptr<Image> image, dcpomatic::Rect<double> rect); - void emit_plain_start (ContentTime from, std::list<dcp::SubtitleString> s); - void emit_plain_start (ContentTime from, sub::Subtitle const & subtitle); - void emit_plain (ContentTimePeriod period, std::list<dcp::SubtitleString> 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> image, dcpomatic::Rect<double> rect); + void emit_bitmap (dcpomatic::ContentTimePeriod period, boost::shared_ptr<Image> image, dcpomatic::Rect<double> rect); + void emit_plain_start (dcpomatic::ContentTime from, std::list<dcp::SubtitleString> s); + void emit_plain_start (dcpomatic::ContentTime from, sub::Subtitle const & subtitle); + void emit_plain (dcpomatic::ContentTimePeriod period, std::list<dcp::SubtitleString> 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<void (ContentBitmapText)> BitmapStart; boost::signals2::signal<void (ContentStringText)> PlainStart; - boost::signals2::signal<void (ContentTime)> Stop; + boost::signals2::signal<void (dcpomatic::ContentTime)> Stop; private: boost::shared_ptr<const TextContent> _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<Data> 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<TextDecoder> decoder); +extern void emit_subtitle_image (dcpomatic::ContentTimePeriod period, dcp::SubtitleImage sub, dcp::Size size, boost::shared_ptr<TextDecoder> decoder); #ifdef DCPOMATIC_VARIANT_SWAROOP extern boost::shared_ptr<dcp::CertificateChain> read_swaroop_chain (boost::filesystem::path path); extern void write_swaroop_chain (boost::shared_ptr<const dcp::CertificateChain> 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<VideoExaminer>); void add_properties (std::list<UserProperty> &) const; - void modify_position (boost::shared_ptr<const Film> film, DCPTime& pos) const; - void modify_trim_start (ContentTime& pos) const; + void modify_position (boost::shared_ptr<const Film> film, dcpomatic::DCPTime& pos) const; + void modify_trim_start (dcpomatic::ContentTime& pos) const; static boost::shared_ptr<VideoContent> 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<const Content> 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 Film>) const { + dcpomatic::ContentTime position (boost::shared_ptr<const Film>) const { return _position; } @@ -65,7 +65,7 @@ private: /** Time of last thing to be emitted */ boost::shared_ptr<const Content> _content; boost::optional<Frame> _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<const Film> film) const; - DCPTime approximate_length () const; + dcpomatic::DCPTime full_length (boost::shared_ptr<const Film> film) const; + dcpomatic::DCPTime approximate_length () const; void add_properties (boost::shared_ptr<const Film> film, std::list<UserProperty>& 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<const Film> film, shared_ptr<const VideoMXFContent> 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<const Film> film, boost::shared_ptr<const VideoMXFContent>); bool pass (); - void seek (ContentTime t, bool accurate); + void seek (dcpomatic::ContentTime t, bool accurate); private: boost::shared_ptr<const VideoMXFContent> _content; /** Time of next thing to return from pass */ - ContentTime _next; + dcpomatic::ContentTime _next; boost::shared_ptr<dcp::MonoPictureAssetReader> _mono_reader; boost::shared_ptr<dcp::StereoPictureAssetReader> _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<PlayerVideo> 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<PlayerVideo> frame, DCPTime time); - std::pair<boost::shared_ptr<PlayerVideo>, DCPTime> get (); + void put (boost::shared_ptr<PlayerVideo> frame, dcpomatic::DCPTime time); + std::pair<boost::shared_ptr<PlayerVideo>, dcpomatic::DCPTime> get (); void clear (); Frame size () const; @@ -42,5 +42,5 @@ public: private: mutable boost::mutex _mutex; - std::list<std::pair<boost::shared_ptr<PlayerVideo>, DCPTime> > _data; + std::list<std::pair<boost::shared_ptr<PlayerVideo>, 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<const Film> film, weak_ptr<Job> 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<const AudioBuffers>, DCPTime time); - void write (PlayerText text, TextType type, boost::optional<DCPTextTrack>, DCPTimePeriod period); + void write (boost::shared_ptr<const AudioBuffers>, dcpomatic::DCPTime time); + void write (PlayerText text, TextType type, boost::optional<DCPTextTrack>, dcpomatic::DCPTimePeriod period); void write (std::list<boost::shared_ptr<Font> > fonts); void write (ReferencedReelAsset asset); void finish (); |
