From: Carl Hetherington Date: Tue, 13 Dec 2022 10:18:31 +0000 (+0100) Subject: More header trimming. X-Git-Tag: v2.16.36~14 X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=0185ba27b0e9c52a173147c1380ec5f345109afc More header trimming. --- diff --git a/cscript b/cscript index 7568338dd..b025e8690 100644 --- a/cscript +++ b/cscript @@ -453,7 +453,7 @@ def dependencies(target, options): # Use distro-provided FFmpeg on Arch deps = [] - deps.append(('libdcp', 'v1.8.37')) + deps.append(('libdcp', 'v1.8.38')) deps.append(('libsub', 'v1.6.42')) deps.append(('leqm-nrt', '93ae9e6')) deps.append(('rtaudio', 'f619b76')) diff --git a/src/lib/analyse_subtitles_job.h b/src/lib/analyse_subtitles_job.h index daaaf267a..ef720ef09 100644 --- a/src/lib/analyse_subtitles_job.h +++ b/src/lib/analyse_subtitles_job.h @@ -20,8 +20,8 @@ #include "job.h" -#include "types.h" #include "player_text.h" +#include "text_type.h" class Film; diff --git a/src/lib/atmos_content.h b/src/lib/atmos_content.h index 8edab8c31..cfacb9729 100644 --- a/src/lib/atmos_content.h +++ b/src/lib/atmos_content.h @@ -20,6 +20,7 @@ #include "content_part.h" +#include "types.h" class Content; diff --git a/src/lib/audio_examiner.h b/src/lib/audio_examiner.h index a1d952c35..f18387041 100644 --- a/src/lib/audio_examiner.h +++ b/src/lib/audio_examiner.h @@ -25,8 +25,6 @@ * @brief AudioExaminer class. */ -#include "types.h" - /** @class AudioExaminer * @brief Parent for classes which examine AudioContent for their pertinent details. */ diff --git a/src/lib/audio_ring_buffers.h b/src/lib/audio_ring_buffers.h index 6fb84e0d7..376ff92ee 100644 --- a/src/lib/audio_ring_buffers.h +++ b/src/lib/audio_ring_buffers.h @@ -24,8 +24,8 @@ #include "audio_buffers.h" -#include "types.h" #include "dcpomatic_time.h" +#include "types.h" #include #include diff --git a/src/lib/butler.h b/src/lib/butler.h index 1dba6e129..6bb0467af 100644 --- a/src/lib/butler.h +++ b/src/lib/butler.h @@ -28,6 +28,7 @@ #include "change_signaller.h" #include "exception_store.h" #include "text_ring_buffers.h" +#include "text_type.h" #include "video_ring_buffers.h" #include #include diff --git a/src/lib/config.cc b/src/lib/config.cc index 81d4ab160..e3be484e2 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -33,7 +33,6 @@ #include "filter.h" #include "log.h" #include "ratio.h" -#include "types.h" #include "zipper.h" #include #include diff --git a/src/lib/config.h b/src/lib/config.h index 62a36f084..2535bd82a 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -31,7 +31,6 @@ #include "export_config.h" #include "rough_duration.h" #include "state.h" -#include "types.h" #include #include #include diff --git a/src/lib/content.h b/src/lib/content.h index ce6eaa83b..eddce2858 100644 --- a/src/lib/content.h +++ b/src/lib/content.h @@ -31,8 +31,8 @@ #include "change_signaller.h" #include "dcpomatic_time.h" #include "signaller.h" -#include "types.h" #include "user_property.h" +#include "text_type.h" #include #include #include diff --git a/src/lib/content_atmos.h b/src/lib/content_atmos.h index 891ca3b83..bffa94dcc 100644 --- a/src/lib/content_atmos.h +++ b/src/lib/content_atmos.h @@ -18,13 +18,16 @@ */ + #ifndef DCPOMATIC_CONTENT_ATMOS_H #define DCPOMATIC_CONTENT_ATMOS_H + #include "atmos_metadata.h" #include "types.h" #include + /** @class ContentAtmos * @brief Some Atmos data that has come out of a decoder. */ diff --git a/src/lib/content_audio.h b/src/lib/content_audio.h index 89a908b68..074d6b428 100644 --- a/src/lib/content_audio.h +++ b/src/lib/content_audio.h @@ -18,16 +18,20 @@ */ + #ifndef DCPOMATIC_CONTENT_AUDIO_H #define DCPOMATIC_CONTENT_AUDIO_H + /** @file src/lib/content_audio.h * @brief ContentAudio class. */ + #include "audio_buffers.h" #include "types.h" + /** @class ContentAudio * @brief A block of audio from a piece of content, with a timestamp as a frame within that content. */ @@ -43,4 +47,5 @@ public: Frame frame; }; + #endif diff --git a/src/lib/content_text.h b/src/lib/content_text.h index 06fb39cfc..51d4e8009 100644 --- a/src/lib/content_text.h +++ b/src/lib/content_text.h @@ -27,7 +27,6 @@ #include "dcpomatic_time.h" #include "rect.h" #include "string_text.h" -#include "types.h" #include #include diff --git a/src/lib/content_video.h b/src/lib/content_video.h index 8ca18576e..4fdab717a 100644 --- a/src/lib/content_video.h +++ b/src/lib/content_video.h @@ -18,13 +18,17 @@ */ + #ifndef DCPOMATIC_CONTENT_VIDEO_H #define DCPOMATIC_CONTENT_VIDEO_H + #include "types.h" + class ImageProxy; + /** @class ContentVideo * @brief A frame of video straight out of some content. */ diff --git a/src/lib/copy_dcp_details_to_film.cc b/src/lib/copy_dcp_details_to_film.cc index 5c3c79638..a269fae97 100644 --- a/src/lib/copy_dcp_details_to_film.cc +++ b/src/lib/copy_dcp_details_to_film.cc @@ -18,21 +18,21 @@ */ + +#include "audio_content.h" #include "copy_dcp_details_to_film.h" #include "dcp_content.h" +#include "dcp_content_type.h" #include "film.h" -#include "types.h" -#include "video_content.h" -#include "audio_content.h" #include "ratio.h" -#include "dcp_content_type.h" +#include "video_content.h" #include using std::map; +using std::shared_ptr; using std::string; using std::vector; -using std::shared_ptr; void diff --git a/src/lib/dcp_encoder.h b/src/lib/dcp_encoder.h index a78ea1a90..ad77f6951 100644 --- a/src/lib/dcp_encoder.h +++ b/src/lib/dcp_encoder.h @@ -25,7 +25,6 @@ #include "encoder.h" #include "player_text.h" #include "j2k_encoder.h" -#include "types.h" #include "writer.h" #include diff --git a/src/lib/dcp_video.h b/src/lib/dcp_video.h index 5b397a391..33df0942c 100644 --- a/src/lib/dcp_video.h +++ b/src/lib/dcp_video.h @@ -23,6 +23,7 @@ #include "resolution.h" #include #include +#include /** @file src/dcp_video_frame.h diff --git a/src/lib/encode_server_description.h b/src/lib/encode_server_description.h index f60051b85..f79b890f7 100644 --- a/src/lib/encode_server_description.h +++ b/src/lib/encode_server_description.h @@ -18,12 +18,15 @@ */ + #ifndef DCPOMATIC_ENCODE_SERVER_DESCRIPTION_H #define DCPOMATIC_ENCODE_SERVER_DESCRIPTION_H + #include "types.h" #include + /** @class EncodeServerDescription * @brief Class to describe a server to which we can send encoding work. */ diff --git a/src/lib/encoder.h b/src/lib/encoder.h index 24217b124..9b67720d3 100644 --- a/src/lib/encoder.h +++ b/src/lib/encoder.h @@ -25,7 +25,6 @@ #include "player.h" #include "player_text.h" -#include "types.h" #include diff --git a/src/lib/ffmpeg_image_proxy.h b/src/lib/ffmpeg_image_proxy.h index b2b0260b5..df8301f15 100644 --- a/src/lib/ffmpeg_image_proxy.h +++ b/src/lib/ffmpeg_image_proxy.h @@ -19,7 +19,6 @@ */ #include "image_proxy.h" -#include "types.h" #include #include #include diff --git a/src/lib/film.h b/src/lib/film.h index f3e05f083..41b04c997 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -37,6 +37,7 @@ #include "resolution.h" #include "signaller.h" #include "transcode_job.h" +#include "types.h" #include "util.h" #include #include diff --git a/src/lib/frame_rate_change.cc b/src/lib/frame_rate_change.cc index 99424a9c1..8372493ef 100644 --- a/src/lib/frame_rate_change.cc +++ b/src/lib/frame_rate_change.cc @@ -23,7 +23,6 @@ #include "content.h" #include "film.h" #include "frame_rate_change.h" -#include "types.h" #include #include "i18n.h" diff --git a/src/lib/hints.h b/src/lib/hints.h index 985fa1910..b29b1c0fc 100644 --- a/src/lib/hints.h +++ b/src/lib/hints.h @@ -22,7 +22,6 @@ #include "audio_analyser.h" #include "signaller.h" #include "player_text.h" -#include "types.h" #include "dcp_text_track.h" #include "dcpomatic_time.h" #include "weak_film.h" diff --git a/src/lib/overlaps.h b/src/lib/overlaps.h index bce163a57..bb8277eaa 100644 --- a/src/lib/overlaps.h +++ b/src/lib/overlaps.h @@ -19,8 +19,8 @@ */ -#include "types.h" #include "dcpomatic_time.h" +#include "types.h" class ContentPart; diff --git a/src/lib/resampler.h b/src/lib/resampler.h index 0dbd0b491..95b71c222 100644 --- a/src/lib/resampler.h +++ b/src/lib/resampler.h @@ -19,8 +19,8 @@ */ -#include "types.h" #include +#include class AudioBuffers; diff --git a/src/lib/shuffler.h b/src/lib/shuffler.h index 476f571b4..4d1404560 100644 --- a/src/lib/shuffler.h +++ b/src/lib/shuffler.h @@ -24,7 +24,6 @@ #include "content_video.h" -#include "types.h" #include diff --git a/src/lib/subtitle_encoder.h b/src/lib/subtitle_encoder.h index a10e4ba47..17d658e62 100644 --- a/src/lib/subtitle_encoder.h +++ b/src/lib/subtitle_encoder.h @@ -19,11 +19,10 @@ */ -#include "types.h" -#include "player_text.h" #include "dcp_text_track.h" -#include "encoder.h" #include "dcpomatic_time.h" +#include "encoder.h" +#include "player_text.h" namespace dcp { diff --git a/src/lib/text_type.cc b/src/lib/text_type.cc new file mode 100644 index 000000000..b1dcfc99c --- /dev/null +++ b/src/lib/text_type.cc @@ -0,0 +1,78 @@ +/* + Copyright (C) 2013-2021 Carl Hetherington + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see . + +*/ + + +#include "compose.hpp" +#include "dcpomatic_assert.h" +#include "exceptions.h" +#include "text_type.h" +#include "types.h" + +#include "i18n.h" + + +using std::string; + + +TextType +string_to_text_type(string s) +{ + if (s == "unknown") { + return TextType::UNKNOWN; + } else if (s == "open-subtitle") { + return TextType::OPEN_SUBTITLE; + } else if (s == "closed-caption") { + return TextType::CLOSED_CAPTION; + } else { + throw MetadataError(String::compose("Unknown text type %1", s)); + } +} + +string +text_type_to_string(TextType t) +{ + switch (t) { + case TextType::UNKNOWN: + return "unknown"; + case TextType::OPEN_SUBTITLE: + return "open-subtitle"; + case TextType::CLOSED_CAPTION: + return "closed-caption"; + default: + DCPOMATIC_ASSERT(false); + } +} + +string +text_type_to_name(TextType t) +{ + switch (t) { + case TextType::UNKNOWN: + return _("Timed text"); + case TextType::OPEN_SUBTITLE: + return _("Open subtitles"); + case TextType::CLOSED_CAPTION: + return _("Closed captions"); + default: + DCPOMATIC_ASSERT(false); + } +} + + diff --git a/src/lib/text_type.h b/src/lib/text_type.h new file mode 100644 index 000000000..d21e03a60 --- /dev/null +++ b/src/lib/text_type.h @@ -0,0 +1,56 @@ +/* + Copyright (C) 2013-2021 Carl Hetherington + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see . + +*/ + + +#ifndef DCPOMATIC_TEXT_TYPE_H +#define DCPOMATIC_TEXT_TYPE_H + + +#include + + +/** Type of captions. + * + * The generally accepted definitions seem to be: + * - subtitles: text for an audience who doesn't speak the film's language + * - captions: text for a hearing-impaired audience + * - open: on-screen + * - closed: only visible by some audience members + * + * At the moment DoM supports open subtitles and closed captions. + * + * There is some use of the word `subtitle' in the code which may mean + * caption in some contexts. + */ +enum class TextType +{ + UNKNOWN, + OPEN_SUBTITLE, + CLOSED_CAPTION, + COUNT +}; + +extern std::string text_type_to_string(TextType t); +extern std::string text_type_to_name(TextType t); +extern TextType string_to_text_type(std::string s); + + +#endif + diff --git a/src/lib/types.cc b/src/lib/types.cc index fd4b8906c..3ac3690c0 100644 --- a/src/lib/types.cc +++ b/src/lib/types.cc @@ -43,50 +43,6 @@ using std::vector; using dcp::raw_convert; -TextType -string_to_text_type (string s) -{ - if (s == "unknown") { - return TextType::UNKNOWN; - } else if (s == "open-subtitle") { - return TextType::OPEN_SUBTITLE; - } else if (s == "closed-caption") { - return TextType::CLOSED_CAPTION; - } else { - throw MetadataError (String::compose ("Unknown text type %1", s)); - } -} - -string -text_type_to_string (TextType t) -{ - switch (t) { - case TextType::UNKNOWN: - return "unknown"; - case TextType::OPEN_SUBTITLE: - return "open-subtitle"; - case TextType::CLOSED_CAPTION: - return "closed-caption"; - default: - DCPOMATIC_ASSERT (false); - } -} - -string -text_type_to_name (TextType t) -{ - switch (t) { - case TextType::UNKNOWN: - return _("Timed text"); - case TextType::OPEN_SUBTITLE: - return _("Open subtitles"); - case TextType::CLOSED_CAPTION: - return _("Closed captions"); - default: - DCPOMATIC_ASSERT (false); - } -} - CPLSummary::CPLSummary (boost::filesystem::path p) : dcp_directory (p.leaf().string()) { diff --git a/src/lib/types.h b/src/lib/types.h index 9801ef557..36059401e 100644 --- a/src/lib/types.h +++ b/src/lib/types.h @@ -111,32 +111,6 @@ enum class ReelType }; -/** Type of captions. - * - * The generally accepted definitions seem to be: - * - subtitles: text for an audience who doesn't speak the film's language - * - captions: text for a hearing-impaired audience - * - open: on-screen - * - closed: only visible by some audience members - * - * At the moment DoM supports open subtitles and closed captions. - * - * There is some use of the word `subtitle' in the code which may mean - * caption in some contexts. - */ -enum class TextType -{ - UNKNOWN, - OPEN_SUBTITLE, - CLOSED_CAPTION, - COUNT -}; - -extern std::string text_type_to_string (TextType t); -extern std::string text_type_to_name (TextType t); -extern TextType string_to_text_type (std::string s); - - struct CPLSummary { CPLSummary (boost::filesystem::path p); diff --git a/src/lib/video_content.h b/src/lib/video_content.h index 3ef8b2775..9f6cc105e 100644 --- a/src/lib/video_content.h +++ b/src/lib/video_content.h @@ -31,6 +31,7 @@ #include "user_property.h" #include "video_frame_type.h" #include "video_range.h" +#include "types.h" #include #include diff --git a/src/lib/video_examiner.h b/src/lib/video_examiner.h index 86dd9345a..44a1186bb 100644 --- a/src/lib/video_examiner.h +++ b/src/lib/video_examiner.h @@ -25,7 +25,6 @@ #include "pixel_quanta.h" -#include "types.h" #include "video_content.h" #include diff --git a/src/lib/video_ring_buffers.h b/src/lib/video_ring_buffers.h index 842336a26..1514e9bbd 100644 --- a/src/lib/video_ring_buffers.h +++ b/src/lib/video_ring_buffers.h @@ -25,7 +25,6 @@ #include "dcpomatic_time.h" #include "player_video.h" -#include "types.h" #include #include diff --git a/src/lib/writer.h b/src/lib/writer.h index b4cc3ecaa..1fbf7bbd5 100644 --- a/src/lib/writer.h +++ b/src/lib/writer.h @@ -34,7 +34,6 @@ #include "exception_store.h" #include "font_id_map.h" #include "player_text.h" -#include "types.h" #include "weak_film.h" #include #include diff --git a/src/lib/wscript b/src/lib/wscript index cdf864cfc..43ccead77 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -181,6 +181,7 @@ sources = """ subtitle_analysis.cc subtitle_encoder.cc text_ring_buffers.cc + text_type.cc timer.cc transcode_job.cc trusted_device.cc diff --git a/src/wx/audio_mapping_view.h b/src/wx/audio_mapping_view.h index 3bdc8f1a9..70a226392 100644 --- a/src/wx/audio_mapping_view.h +++ b/src/wx/audio_mapping_view.h @@ -26,7 +26,6 @@ #include "lib/audio_mapping.h" #include "lib/named_channel.h" -#include "lib/types.h" #include LIBDCP_DISABLE_WARNINGS #include diff --git a/src/wx/content_panel.h b/src/wx/content_panel.h index a493ea80d..de1123cce 100644 --- a/src/wx/content_panel.h +++ b/src/wx/content_panel.h @@ -22,6 +22,7 @@ #include "content_menu.h" #include "lib/enum_indexed_vector.h" #include "lib/film.h" +#include "lib/text_type.h" #include LIBDCP_DISABLE_WARNINGS #include diff --git a/src/wx/timecode.h b/src/wx/timecode.h index 65b30be12..6c5d8ae23 100644 --- a/src/wx/timecode.h +++ b/src/wx/timecode.h @@ -25,7 +25,6 @@ #include "wx_util.h" #include "lib/dcpomatic_time.h" -#include "lib/types.h" #include #include LIBDCP_DISABLE_WARNINGS diff --git a/wscript b/wscript index 14d1d53a7..3a5d71a63 100644 --- a/wscript +++ b/wscript @@ -35,7 +35,7 @@ except ImportError: from waflib import Logs, Context APPNAME = 'dcpomatic' -libdcp_version = '1.8.13' +libdcp_version = '1.8.38' libsub_version = '1.6.13' this_version = subprocess.Popen(shlex.split('git tag -l --points-at HEAD'), stdout=subprocess.PIPE).communicate()[0]