summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-12-10 23:32:51 +0100
committerCarl Hetherington <cth@carlh.net>2022-12-11 00:19:21 +0100
commit4becf7d0cb19fbbdad4f31b0881b77e689d2c1d6 (patch)
tree593a00f78db056ee23408198fbfb3ca5b1cb9d58
parent2d6dc3ab7212316bc297b7fceea27d12187a6c06 (diff)
Extract resolution.h
-rw-r--r--src/lib/dcp_content.h1
-rw-r--r--src/lib/dcp_video.h6
-rw-r--r--src/lib/film.h3
-rw-r--r--src/lib/resolution.cc62
-rw-r--r--src/lib/resolution.h38
-rw-r--r--src/lib/types.cc34
-rw-r--r--src/lib/types.h8
-rw-r--r--src/lib/wscript1
8 files changed, 109 insertions, 44 deletions
diff --git a/src/lib/dcp_content.h b/src/lib/dcp_content.h
index 17a9a9386..96ae09521 100644
--- a/src/lib/dcp_content.h
+++ b/src/lib/dcp_content.h
@@ -31,6 +31,7 @@
#include "content.h"
#include "enum_indexed_vector.h"
#include "font.h"
+#include "resolution.h"
#include <libcxml/cxml.h>
#include <dcp/content_kind.h>
#include <dcp/encrypted_kdm.h>
diff --git a/src/lib/dcp_video.h b/src/lib/dcp_video.h
index 3bd516ccd..5b397a391 100644
--- a/src/lib/dcp_video.h
+++ b/src/lib/dcp_video.h
@@ -18,18 +18,22 @@
*/
-#include "types.h"
+
#include "encode_server_description.h"
+#include "resolution.h"
#include <libcxml/cxml.h>
#include <dcp/array_data.h>
+
/** @file src/dcp_video_frame.h
* @brief A single frame of video destined for a DCP.
*/
+
class Log;
class PlayerVideo;
+
/** @class DCPVideo
* @brief A single frame of video destined for a DCP.
*
diff --git a/src/lib/film.h b/src/lib/film.h
index b1451c212..55412c2e8 100644
--- a/src/lib/film.h
+++ b/src/lib/film.h
@@ -33,9 +33,10 @@
#include "dcp_text_track.h"
#include "dcpomatic_time.h"
#include "frame_rate_change.h"
+#include "resolution.h"
#include "signaller.h"
#include "transcode_job.h"
-#include "types.h"
+#include "util.h"
#include <dcp/encrypted_kdm.h>
#include <dcp/file.h>
#include <dcp/key.h>
diff --git a/src/lib/resolution.cc b/src/lib/resolution.cc
new file mode 100644
index 000000000..d87db7a57
--- /dev/null
+++ b/src/lib/resolution.cc
@@ -0,0 +1,62 @@
+/*
+ Copyright (C) 2013-2019 Carl Hetherington <cth@carlh.net>
+
+ 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 <http://www.gnu.org/licenses/>.
+
+*/
+
+
+#include "dcpomatic_assert.h"
+#include "resolution.h"
+
+
+using std::string;
+
+
+/** @param r Resolution.
+ * @return Untranslated string representation.
+ */
+string
+resolution_to_string (Resolution r)
+{
+ switch (r) {
+ case Resolution::TWO_K:
+ return "2K";
+ case Resolution::FOUR_K:
+ return "4K";
+ }
+
+ DCPOMATIC_ASSERT (false);
+ return "";
+}
+
+
+Resolution
+string_to_resolution (string s)
+{
+ if (s == "2K") {
+ return Resolution::TWO_K;
+ }
+
+ if (s == "4K") {
+ return Resolution::FOUR_K;
+ }
+
+ DCPOMATIC_ASSERT (false);
+ return Resolution::TWO_K;
+}
+
+
diff --git a/src/lib/resolution.h b/src/lib/resolution.h
new file mode 100644
index 000000000..eab6b0610
--- /dev/null
+++ b/src/lib/resolution.h
@@ -0,0 +1,38 @@
+/*
+ Copyright (C) 2013-2021 Carl Hetherington <cth@carlh.net>
+
+ 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 <http://www.gnu.org/licenses/>.
+
+*/
+
+
+#ifndef DCPOMATIC_RESOLUTION_H
+#define DCPOMATIC_RESOLUTION_H
+
+
+#include <string>
+
+
+enum class Resolution {
+ TWO_K,
+ FOUR_K
+};
+
+std::string resolution_to_string(Resolution);
+Resolution string_to_resolution(std::string);
+
+
+#endif
diff --git a/src/lib/types.cc b/src/lib/types.cc
index 6bac0cf3e..d9108a942 100644
--- a/src/lib/types.cc
+++ b/src/lib/types.cc
@@ -43,40 +43,6 @@ using std::vector;
using dcp::raw_convert;
-/** @param r Resolution.
- * @return Untranslated string representation.
- */
-string
-resolution_to_string (Resolution r)
-{
- switch (r) {
- case Resolution::TWO_K:
- return "2K";
- case Resolution::FOUR_K:
- return "4K";
- }
-
- DCPOMATIC_ASSERT (false);
- return "";
-}
-
-
-Resolution
-string_to_resolution (string s)
-{
- if (s == "2K") {
- return Resolution::TWO_K;
- }
-
- if (s == "4K") {
- return Resolution::FOUR_K;
- }
-
- DCPOMATIC_ASSERT (false);
- return Resolution::TWO_K;
-}
-
-
TextType
string_to_text_type (string s)
{
diff --git a/src/lib/types.h b/src/lib/types.h
index ab3f15841..e4a333bc2 100644
--- a/src/lib/types.h
+++ b/src/lib/types.h
@@ -190,14 +190,6 @@ struct CPLSummary
time_t last_write_time;
};
-enum class Resolution {
- TWO_K,
- FOUR_K
-};
-
-std::string resolution_to_string (Resolution);
-Resolution string_to_resolution (std::string);
-
enum class FileTransferProtocol {
SCP,
FTP
diff --git a/src/lib/wscript b/src/lib/wscript
index 3a3c8fd51..447c0f478 100644
--- a/src/lib/wscript
+++ b/src/lib/wscript
@@ -159,6 +159,7 @@ sources = """
release_notes.cc
render_text.cc
resampler.cc
+ resolution.cc
rgba.cc
rng.cc
scoped_temporary.cc