diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-05-11 20:43:58 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-05-11 21:03:32 +0200 |
| commit | a98f6e4f84d02b87ba05cecfcc3005858f274afa (patch) | |
| tree | 5b244f709c400cf2fff25f7af7b4f9c158bc8f2c | |
| parent | 6157596fabb32c0f915525e4d05130652c1cd751 (diff) | |
Cleanup: use constexpr for content and player properties.
Also fix a clash between the ATMOS and player properties.
| -rw-r--r-- | src/lib/atmos_content.cc | 3 | ||||
| -rw-r--r-- | src/lib/atmos_content.h | 2 | ||||
| -rw-r--r-- | src/lib/audio_content.cc | 9 | ||||
| -rw-r--r-- | src/lib/audio_content.h | 13 | ||||
| -rw-r--r-- | src/lib/content.cc | 8 | ||||
| -rw-r--r-- | src/lib/content.h | 12 | ||||
| -rw-r--r-- | src/lib/dcp_content.cc | 10 | ||||
| -rw-r--r-- | src/lib/dcp_content.h | 16 | ||||
| -rw-r--r-- | src/lib/ffmpeg_content.cc | 6 | ||||
| -rw-r--r-- | src/lib/ffmpeg_content.h | 8 | ||||
| -rw-r--r-- | src/lib/player.cc | 13 | ||||
| -rw-r--r-- | src/lib/player.h | 22 | ||||
| -rw-r--r-- | src/lib/text_content.cc | 20 | ||||
| -rw-r--r-- | src/lib/text_content.h | 36 | ||||
| -rw-r--r-- | src/lib/video_content.cc | 13 | ||||
| -rw-r--r-- | src/lib/video_content.h | 22 |
16 files changed, 66 insertions, 147 deletions
diff --git a/src/lib/atmos_content.cc b/src/lib/atmos_content.cc index c83b259cc..b4b18010f 100644 --- a/src/lib/atmos_content.cc +++ b/src/lib/atmos_content.cc @@ -32,9 +32,6 @@ using std::string; using std::shared_ptr; -int const AtmosContentProperty::EDIT_RATE = 700; - - AtmosContent::AtmosContent (Content* parent) : ContentPart (parent) , _length (0) diff --git a/src/lib/atmos_content.h b/src/lib/atmos_content.h index ffa181497..21d52bfe8 100644 --- a/src/lib/atmos_content.h +++ b/src/lib/atmos_content.h @@ -30,7 +30,7 @@ class Content; class AtmosContentProperty { public: - static int const EDIT_RATE; + static int constexpr EDIT_RATE = 700; }; diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc index 65f781a1e..ce9e5c945 100644 --- a/src/lib/audio_content.cc +++ b/src/lib/audio_content.cc @@ -50,15 +50,6 @@ using boost::optional; using namespace dcpomatic; -/** Something stream-related has changed */ -int const AudioContentProperty::STREAMS = 200; -int const AudioContentProperty::GAIN = 201; -int const AudioContentProperty::DELAY = 202; -int const AudioContentProperty::FADE_IN = 203; -int const AudioContentProperty::FADE_OUT = 204; -int const AudioContentProperty::USE_SAME_FADES_AS_VIDEO = 205; - - AudioContent::AudioContent (Content* parent) : ContentPart (parent) , _delay (Config::instance()->default_audio_delay()) diff --git a/src/lib/audio_content.h b/src/lib/audio_content.h index b21b2ab21..2bcf194de 100644 --- a/src/lib/audio_content.h +++ b/src/lib/audio_content.h @@ -40,12 +40,13 @@ class AudioContentProperty { public: - static int const STREAMS; - static int const GAIN; - static int const DELAY; - static int const FADE_IN; - static int const FADE_OUT; - static int const USE_SAME_FADES_AS_VIDEO; + /** Something stream-related has changed */ + static int constexpr STREAMS = 200; + static int constexpr GAIN = 201; + static int constexpr DELAY = 202; + static int constexpr FADE_IN = 203; + static int constexpr FADE_OUT = 204; + static int constexpr USE_SAME_FADES_AS_VIDEO = 205; }; diff --git a/src/lib/content.cc b/src/lib/content.cc index 5e3d01847..2a69adefd 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -57,14 +57,6 @@ using dcp::locale_convert; using namespace dcpomatic; -int const ContentProperty::PATH = 400; -int const ContentProperty::POSITION = 401; -int const ContentProperty::LENGTH = 402; -int const ContentProperty::TRIM_START = 403; -int const ContentProperty::TRIM_END = 404; -int const ContentProperty::VIDEO_FRAME_RATE = 405; - - Content::Content(DCPTime p) : _position(p) { diff --git a/src/lib/content.h b/src/lib/content.h index 8ddb7d7e7..7d7700999 100644 --- a/src/lib/content.h +++ b/src/lib/content.h @@ -58,12 +58,12 @@ class VideoContent; class ContentProperty { public: - static int const PATH; - static int const POSITION; - static int const LENGTH; - static int const TRIM_START; - static int const TRIM_END; - static int const VIDEO_FRAME_RATE; + static int constexpr PATH = 400; + static int constexpr POSITION = 401; + static int constexpr LENGTH = 402; + static int constexpr TRIM_START = 403; + static int constexpr TRIM_END = 404; + static int constexpr VIDEO_FRAME_RATE = 405; }; diff --git a/src/lib/dcp_content.cc b/src/lib/dcp_content.cc index 4df0c4618..aa92567ac 100644 --- a/src/lib/dcp_content.cc +++ b/src/lib/dcp_content.cc @@ -66,16 +66,6 @@ using dcp::raw_convert; using namespace dcpomatic; -int const DCPContentProperty::NEEDS_ASSETS = 600; -int const DCPContentProperty::NEEDS_KDM = 601; -int const DCPContentProperty::REFERENCE_VIDEO = 602; -int const DCPContentProperty::REFERENCE_AUDIO = 603; -int const DCPContentProperty::REFERENCE_TEXT = 604; -int const DCPContentProperty::NAME = 605; -int const DCPContentProperty::TEXTS = 606; -int const DCPContentProperty::CPL = 607; - - DCPContent::DCPContent (boost::filesystem::path p) : _encrypted (false) , _needs_assets (false) diff --git a/src/lib/dcp_content.h b/src/lib/dcp_content.h index d4527febd..3b843f22e 100644 --- a/src/lib/dcp_content.h +++ b/src/lib/dcp_content.h @@ -43,14 +43,14 @@ class DCPContentProperty { public: - static int const NEEDS_KDM; - static int const NEEDS_ASSETS; - static int const REFERENCE_VIDEO; - static int const REFERENCE_AUDIO; - static int const REFERENCE_TEXT; - static int const NAME; - static int const TEXTS; - static int const CPL; + static int constexpr NEEDS_KDM = 600; + static int constexpr NEEDS_ASSETS = 601; + static int constexpr REFERENCE_VIDEO = 602; + static int constexpr REFERENCE_AUDIO = 603; + static int constexpr REFERENCE_TEXT = 604; + static int constexpr NAME = 605; + static int constexpr TEXTS = 606; + static int constexpr CPL = 607; }; diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 8434197c5..95aa63ba4 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -62,12 +62,6 @@ using boost::optional; using namespace dcpomatic; -int const FFmpegContentProperty::SUBTITLE_STREAMS = 100; -int const FFmpegContentProperty::SUBTITLE_STREAM = 101; -int const FFmpegContentProperty::FILTERS = 102; -int const FFmpegContentProperty::KDM = 103; - - FFmpegContent::FFmpegContent (boost::filesystem::path p) : Content (p) { diff --git a/src/lib/ffmpeg_content.h b/src/lib/ffmpeg_content.h index ca2f56619..f08a23001 100644 --- a/src/lib/ffmpeg_content.h +++ b/src/lib/ffmpeg_content.h @@ -43,11 +43,11 @@ struct audio_sampling_rate_test; class FFmpegContentProperty { public: - static int const SUBTITLE_STREAMS; + static int constexpr SUBTITLE_STREAMS = 100; /** The chosen subtitle stream, or something about it */ - static int const SUBTITLE_STREAM; - static int const FILTERS; - static int const KDM; + static int constexpr SUBTITLE_STREAM = 101; + static int constexpr FILTERS = 102; + static int constexpr KDM = 103; }; diff --git a/src/lib/player.cc b/src/lib/player.cc index 869067906..516a66ee2 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -84,19 +84,6 @@ using namespace boost::placeholders; using namespace dcpomatic; -int const PlayerProperty::VIDEO_CONTAINER_SIZE = 700; -int const PlayerProperty::PLAYLIST = 701; -int const PlayerProperty::FILM_CONTAINER = 702; -int const PlayerProperty::FILM_VIDEO_FRAME_RATE = 703; -int const PlayerProperty::DCP_DECODE_REDUCTION = 704; -int const PlayerProperty::PLAYBACK_LENGTH = 705; -int const PlayerProperty::IGNORE_VIDEO = 706; -int const PlayerProperty::IGNORE_AUDIO = 707; -int const PlayerProperty::IGNORE_TEXT = 708; -int const PlayerProperty::ALWAYS_BURN_OPEN_SUBTITLES = 709; -int const PlayerProperty::PLAY_REFERENCED = 710; - - Player::Player(shared_ptr<const Film> film, Image::Alignment subtitle_alignment, bool tolerant) : _film(film) , _suspended(0) diff --git a/src/lib/player.h b/src/lib/player.h index 8922741bd..9076ac242 100644 --- a/src/lib/player.h +++ b/src/lib/player.h @@ -59,17 +59,17 @@ class ReferencedReelAsset; class PlayerProperty { public: - static int const VIDEO_CONTAINER_SIZE; - static int const PLAYLIST; - static int const FILM_CONTAINER; - static int const FILM_VIDEO_FRAME_RATE; - static int const DCP_DECODE_REDUCTION; - static int const PLAYBACK_LENGTH; - static int const IGNORE_VIDEO; - static int const IGNORE_AUDIO; - static int const IGNORE_TEXT; - static int const ALWAYS_BURN_OPEN_SUBTITLES; - static int const PLAY_REFERENCED; + static int constexpr VIDEO_CONTAINER_SIZE = 800; + static int constexpr PLAYLIST = 801; + static int constexpr FILM_CONTAINER = 802; + static int constexpr FILM_VIDEO_FRAME_RATE = 803; + static int constexpr DCP_DECODE_REDUCTION = 804; + static int constexpr PLAYBACK_LENGTH = 805; + static int constexpr IGNORE_VIDEO = 806; + static int constexpr IGNORE_AUDIO = 808; + static int constexpr IGNORE_TEXT = 808; + static int constexpr ALWAYS_BURN_OPEN_SUBTITLES = 809; + static int constexpr PLAY_REFERENCED = 810; }; diff --git a/src/lib/text_content.cc b/src/lib/text_content.cc index 66ede4281..f1691e0e0 100644 --- a/src/lib/text_content.cc +++ b/src/lib/text_content.cc @@ -44,26 +44,6 @@ using boost::optional; using namespace dcpomatic; -int const TextContentProperty::X_OFFSET = 500; -int const TextContentProperty::Y_OFFSET = 501; -int const TextContentProperty::X_SCALE = 502; -int const TextContentProperty::Y_SCALE = 503; -int const TextContentProperty::USE = 504; -int const TextContentProperty::BURN = 505; -int const TextContentProperty::FONTS = 506; -int const TextContentProperty::COLOUR = 507; -int const TextContentProperty::EFFECT = 508; -int const TextContentProperty::EFFECT_COLOUR = 509; -int const TextContentProperty::LINE_SPACING = 510; -int const TextContentProperty::FADE_IN = 511; -int const TextContentProperty::FADE_OUT = 512; -int const TextContentProperty::OUTLINE_WIDTH = 513; -int const TextContentProperty::TYPE = 514; -int const TextContentProperty::DCP_TRACK = 515; -int const TextContentProperty::LANGUAGE = 516; -int const TextContentProperty::LANGUAGE_IS_ADDITIONAL = 517; - - TextContent::TextContent(Content* parent, TextType type, TextType original_type) : ContentPart(parent) , _use(false) diff --git a/src/lib/text_content.h b/src/lib/text_content.h index 306653d4b..69a0581fc 100644 --- a/src/lib/text_content.h +++ b/src/lib/text_content.h @@ -38,24 +38,24 @@ namespace dcpomatic { class TextContentProperty { public: - static int const X_OFFSET; - static int const Y_OFFSET; - static int const X_SCALE; - static int const Y_SCALE; - static int const USE; - static int const BURN; - static int const FONTS; - static int const COLOUR; - static int const EFFECT; - static int const EFFECT_COLOUR; - static int const LINE_SPACING; - static int const FADE_IN; - static int const FADE_OUT; - static int const OUTLINE_WIDTH; - static int const TYPE; - static int const DCP_TRACK; - static int const LANGUAGE; - static int const LANGUAGE_IS_ADDITIONAL; + static int constexpr X_OFFSET = 500; + static int constexpr Y_OFFSET = 501; + static int constexpr X_SCALE = 502; + static int constexpr Y_SCALE = 503; + static int constexpr USE = 504; + static int constexpr BURN = 505; + static int constexpr FONTS = 506; + static int constexpr COLOUR = 507; + static int constexpr EFFECT = 508; + static int constexpr EFFECT_COLOUR = 509; + static int constexpr LINE_SPACING = 510; + static int constexpr FADE_IN = 511; + static int constexpr FADE_OUT = 512; + static int constexpr OUTLINE_WIDTH = 513; + static int constexpr TYPE = 514; + static int constexpr DCP_TRACK = 515; + static int constexpr LANGUAGE = 516; + static int constexpr LANGUAGE_IS_ADDITIONAL = 517; }; diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index a5f65de24..dcce499cb 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -41,19 +41,6 @@ #include "i18n.h" -int const VideoContentProperty::USE = 0; -int const VideoContentProperty::SIZE = 1; -int const VideoContentProperty::FRAME_TYPE = 2; -int const VideoContentProperty::CROP = 3; -int const VideoContentProperty::COLOUR_CONVERSION = 4; -int const VideoContentProperty::FADE_IN = 5; -int const VideoContentProperty::FADE_OUT = 6; -int const VideoContentProperty::RANGE = 7; -int const VideoContentProperty::CUSTOM_RATIO = 8; -int const VideoContentProperty::CUSTOM_SIZE = 9; -int const VideoContentProperty::BURNT_SUBTITLE_LANGUAGE = 10; - - using std::cout; using std::dynamic_pointer_cast; using std::list; diff --git a/src/lib/video_content.h b/src/lib/video_content.h index db46f06eb..23936b768 100644 --- a/src/lib/video_content.h +++ b/src/lib/video_content.h @@ -45,17 +45,17 @@ class Content; class VideoContentProperty { public: - static int const USE; - static int const SIZE; - static int const FRAME_TYPE; - static int const CROP; - static int const COLOUR_CONVERSION; - static int const FADE_IN; - static int const FADE_OUT; - static int const RANGE; - static int const CUSTOM_RATIO; - static int const CUSTOM_SIZE; - static int const BURNT_SUBTITLE_LANGUAGE; + static int constexpr USE = 0; + static int constexpr SIZE = 1; + static int constexpr FRAME_TYPE = 2; + static int constexpr CROP = 3; + static int constexpr COLOUR_CONVERSION = 4; + static int constexpr FADE_IN = 5; + static int constexpr FADE_OUT = 6; + static int constexpr RANGE = 7; + static int constexpr CUSTOM_RATIO = 8; + static int constexpr CUSTOM_SIZE = 9; + static int constexpr BURNT_SUBTITLE_LANGUAGE = 10; }; |
