X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ffilm.h;h=6828df21aa366cad9e7506cedad0b5925a9d2dff;hb=9b946fc5250eff5a5dd4a661896916fcd5d9bd4b;hp=4854d2ae72ef466d123bd813ff71d429c7055084;hpb=d330522cb1a0504e5f85c2346344e04916c68a4f;p=dcpomatic.git diff --git a/src/lib/film.h b/src/lib/film.h index 4854d2ae7..6828df21a 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -68,6 +67,7 @@ struct atmos_encrypted_passthrough_test; class InfoFileHandle { public: + InfoFileHandle (boost::mutex& mutex, boost::filesystem::path file, bool read); ~InfoFileHandle (); FILE* get () const { @@ -81,8 +81,6 @@ public: private: friend class Film; - InfoFileHandle (boost::mutex& mutex, boost::filesystem::path file, bool read); - boost::mutex::scoped_lock _lock; FILE* _handle; boost::filesystem::path _file; @@ -95,19 +93,19 @@ private: * * The content of a Film is held in a Playlist (created and managed by the Film). */ -class Film : public boost::enable_shared_from_this, public Signaller, public boost::noncopyable +class Film : public std::enable_shared_from_this, public Signaller, public boost::noncopyable { public: explicit Film (boost::optional dir); ~Film (); - boost::shared_ptr info_file_handle (dcpomatic::DCPTimePeriod period, bool read) const; + std::shared_ptr info_file_handle (dcpomatic::DCPTimePeriod period, bool read) 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 (dcpomatic::DCPTimePeriod p) const; - boost::filesystem::path audio_analysis_path (boost::shared_ptr) const; - boost::filesystem::path subtitle_analysis_path (boost::shared_ptr) const; + boost::filesystem::path audio_analysis_path (std::shared_ptr) const; + boost::filesystem::path subtitle_analysis_path (std::shared_ptr) const; void send_dcp_to_tms (); void make_dcp (bool gui = false, bool check = true); @@ -115,7 +113,7 @@ public: /** @return Logger. * It is safe to call this from any thread. */ - boost::shared_ptr log () const { + std::shared_ptr log () const { return _log; } @@ -127,9 +125,9 @@ public: void write_metadata () const; void write_metadata (boost::filesystem::path path) const; void write_template (boost::filesystem::path path) const; - boost::shared_ptr metadata (bool with_content_paths = true) const; + std::shared_ptr metadata (bool with_content_paths = true) const; - void copy_from (boost::shared_ptr film); + void copy_from (std::shared_ptr film); std::string isdcf_name (bool if_created_now) const; std::string dcp_name (bool if_created_now = false) const; @@ -175,13 +173,11 @@ public: return _state_version; } - std::string subtitle_language () const; - std::vector audio_output_names () const; void repeat_content (ContentList, int); - boost::shared_ptr playlist () const { + std::shared_ptr playlist () const { return _playlist; } @@ -240,7 +236,8 @@ public: CHAIN, DISTRIBUTOR, FACILITY, - LUMINANCE + LUMINANCE, + SUBTITLE_LANGUAGES }; @@ -378,17 +375,21 @@ public: return _luminance; } + std::vector subtitle_languages () const { + return _subtitle_languages; + } + /* SET */ void set_directory (boost::filesystem::path); void set_name (std::string); void set_use_isdcf_name (bool); - void examine_and_add_content (boost::shared_ptr content, bool disable_audio_analysis = false); - void add_content (boost::shared_ptr); - void remove_content (boost::shared_ptr); + void examine_and_add_content (std::shared_ptr content, bool disable_audio_analysis = false); + void add_content (std::shared_ptr); + void remove_content (std::shared_ptr); void remove_content (ContentList); - void move_content_earlier (boost::shared_ptr); - void move_content_later (boost::shared_ptr); + void move_content_earlier (std::shared_ptr); + void move_content_later (std::shared_ptr); void set_dcp_content_type (DCPContentType const *); void set_container (Ratio const *, bool user_explicit = true); void set_resolution (Resolution, bool user_explicit = true); @@ -419,6 +420,9 @@ public: void set_facility (std::string f); void set_distributor (std::string d); void set_luminance (dcp::Luminance l); + void set_subtitle_language (dcp::LanguageTag language); + void unset_subtitle_language (); + void set_subtitle_languages (std::vector languages); void add_ffoc_lfoc (Markers& markers) const; @@ -426,7 +430,7 @@ public: mutable boost::signals2::signal Change; /** Emitted when some property of our content has changed */ - mutable boost::signals2::signal, int, bool)> ContentChange; + mutable boost::signals2::signal, int, bool)> ContentChange; /** Emitted when the film's length might have changed; this is not like a normal property as its value is derived from the playlist, so it has its own signal. @@ -453,9 +457,9 @@ private: std::string video_identifier () const; void playlist_change (ChangeType); void playlist_order_changed (); - void playlist_content_change (ChangeType type, boost::weak_ptr, int, bool frequent); + void playlist_content_change (ChangeType type, std::weak_ptr, int, bool frequent); void playlist_length_change (); - void maybe_add_content (boost::weak_ptr, boost::weak_ptr, bool disable_audio_analysis); + void maybe_add_content (std::weak_ptr, std::weak_ptr, bool disable_audio_analysis); void audio_analysis_finished (); void check_settings_consistency (); void maybe_set_container_and_resolution (); @@ -463,8 +467,8 @@ private: static std::string const metadata_file; /** Log to write to */ - boost::shared_ptr _log; - boost::shared_ptr _playlist; + std::shared_ptr _log; + std::shared_ptr _playlist; /** Complete path to directory containing the film metadata; * must not be relative. @@ -524,13 +528,14 @@ private: std::string _distributor; std::string _facility; dcp::Luminance _luminance; + std::vector _subtitle_languages; int _state_version; /** true if our state has changed since we last saved it */ mutable bool _dirty; /** film being used as a template, or 0 */ - boost::shared_ptr _template_film; + std::shared_ptr _template_film; /** Be tolerant of errors in content (currently applies to DCP only). Not saved as state.