Extract resolution.h
authorCarl Hetherington <cth@carlh.net>
Sat, 10 Dec 2022 22:32:51 +0000 (23:32 +0100)
committerCarl Hetherington <cth@carlh.net>
Sat, 10 Dec 2022 23:19:21 +0000 (00:19 +0100)
src/lib/dcp_content.h
src/lib/dcp_video.h
src/lib/film.h
src/lib/resolution.cc [new file with mode: 0644]
src/lib/resolution.h [new file with mode: 0644]
src/lib/types.cc
src/lib/types.h
src/lib/wscript

index 17a9a9386006f70fefa024f95c564af37792eeb0..96ae09521fd53f4e1d46ae8bdd19ea5a69ef89ad 100644 (file)
@@ -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>
index 3bd516ccd4ea676567e80ac70880d39b382568c6..5b397a391608c2b0d02357783ad50da45406a822 100644 (file)
 
 */
 
-#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.
  *
index b1451c212092b2ec5435ef8cb00c6b46a3093008..55412c2e88b03936ef35e297b7f77699adebb55e 100644 (file)
 #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 (file)
index 0000000..d87db7a
--- /dev/null
@@ -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 (file)
index 0000000..eab6b06
--- /dev/null
@@ -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
index 6bac0cf3efe0298f0e734b10d6a1e60567f0a379..d9108a94219dcb82aef96d66aa03e4a8f6a16fdb 100644 (file)
@@ -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)
 {
index ab3f15841b3b367e2e07efb3cb52c4d89a934fb5..e4a333bc2f0d63a15cad17e0ab65f3b1d86aefe3 100644 (file)
@@ -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
index 3a3c8fd51ea2960dc9ca6f87d7d5f0c2d1253fe7..447c0f4783d832de4b80e7bd9fbd677d1012ea62 100644 (file)
@@ -159,6 +159,7 @@ sources = """
           release_notes.cc
           render_text.cc
           resampler.cc
+          resolution.cc
           rgba.cc
           rng.cc
           scoped_temporary.cc