summaryrefslogtreecommitdiff
path: root/src/lib/types.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-01-09 16:29:21 +0100
committerCarl Hetherington <cth@carlh.net>2022-01-09 16:29:21 +0100
commit92b7d1cffbd0d457f8b4b23cc72937bcf8e5ed5e (patch)
treeb175db682422765468991702e8563bcd89713b70 /src/lib/types.cc
parent7392cb8383c9b857edad5f99eaf917ed70da237d (diff)
Tidying.
Diffstat (limited to 'src/lib/types.cc')
-rw-r--r--src/lib/types.cc19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/lib/types.cc b/src/lib/types.cc
index 228ebf28f..f08dd63b1 100644
--- a/src/lib/types.cc
+++ b/src/lib/types.cc
@@ -18,15 +18,16 @@
*/
-#include "types.h"
+
#include "compose.hpp"
#include "dcpomatic_assert.h"
+#include "types.h"
#include "warnings.h"
-#include <dcp/raw_convert.h>
#include <dcp/cpl.h>
#include <dcp/dcp.h>
-#include <dcp/reel_file_asset.h>
+#include <dcp/raw_convert.h>
#include <dcp/reel_asset.h>
+#include <dcp/reel_file_asset.h>
DCPOMATIC_DISABLE_WARNINGS
#include <libxml++/libxml++.h>
DCPOMATIC_ENABLE_WARNINGS
@@ -34,6 +35,7 @@ DCPOMATIC_ENABLE_WARNINGS
#include "i18n.h"
+
using std::max;
using std::min;
using std::string;
@@ -42,16 +44,19 @@ using std::shared_ptr;
using std::vector;
using dcp::raw_convert;
+
bool operator== (Crop const & a, Crop const & b)
{
return (a.left == b.left && a.right == b.right && a.top == b.top && a.bottom == b.bottom);
}
+
bool operator!= (Crop const & a, Crop const & b)
{
return !(a == b);
}
+
/** @param r Resolution.
* @return Untranslated string representation.
*/
@@ -85,6 +90,7 @@ string_to_resolution (string s)
return Resolution::TWO_K;
}
+
Crop::Crop (shared_ptr<cxml::Node> node)
{
left = node->number_child<int> ("LeftCrop");
@@ -93,6 +99,7 @@ Crop::Crop (shared_ptr<cxml::Node> node)
bottom = node->number_child<int> ("BottomCrop");
}
+
void
Crop::as_xml (xmlpp::Node* node) const
{
@@ -102,6 +109,7 @@ Crop::as_xml (xmlpp::Node* node) const
node->add_child("BottomCrop")->add_child_text (raw_convert<string> (bottom));
}
+
TextType
string_to_text_type (string s)
{
@@ -116,6 +124,7 @@ string_to_text_type (string s)
}
}
+
string
text_type_to_string (TextType t)
{
@@ -131,6 +140,7 @@ text_type_to_string (TextType t)
}
}
+
string
text_type_to_name (TextType t)
{
@@ -146,6 +156,7 @@ text_type_to_name (TextType t)
}
}
+
string
video_frame_type_to_string (VideoFrameType t)
{
@@ -171,6 +182,7 @@ video_frame_type_to_string (VideoFrameType t)
DCPOMATIC_ASSERT (false);
}
+
VideoFrameType
string_to_video_frame_type (string s)
{
@@ -193,6 +205,7 @@ string_to_video_frame_type (string s)
DCPOMATIC_ASSERT (false);
}
+
CPLSummary::CPLSummary (boost::filesystem::path p)
: dcp_directory (p.leaf().string())
{