X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ftypes.h;h=36059401ec8eb96d73a6921d4715443ab028d9fc;hb=7cb1677e10b9692698ede5741c50d8c4b4144ddf;hp=9b322bdaeea5da81ebec291135b1a12b10db9962;hpb=f7b6c0595fe13be3f4a10bcce88dd895b1111b57;p=dcpomatic.git diff --git a/src/lib/types.h b/src/lib/types.h index 9b322bdae..36059401e 100644 --- a/src/lib/types.h +++ b/src/lib/types.h @@ -18,28 +18,24 @@ */ + #ifndef DCPOMATIC_TYPES_H #define DCPOMATIC_TYPES_H + #include "position.h" #include "rect.h" #include #include #include + class Content; class VideoContent; class AudioContent; class TextContent; class FFmpegContent; -namespace cxml { - class Node; -} - -namespace xmlpp { - class Node; -} /** The version number of the protocol used to communicate * with servers. Intended to be bumped when incompatibilities @@ -90,23 +86,6 @@ typedef std::vector> FFmpegContentList; typedef int64_t Frame; -enum class VideoFrameType -{ - TWO_D, - /** `True' 3D content, e.g. 3D DCPs */ - THREE_D, - THREE_D_LEFT_RIGHT, - THREE_D_TOP_BOTTOM, - THREE_D_ALTERNATE, - /** This content is all the left frames of some 3D */ - THREE_D_LEFT, - /** This content is all the right frames of some 3D */ - THREE_D_RIGHT -}; - -std::string video_frame_type_to_string (VideoFrameType); -VideoFrameType string_to_video_frame_type (std::string); - enum class Eyes { BOTH, @@ -132,87 +111,6 @@ enum class ReelType }; -enum class VideoRange -{ - FULL, ///< full, or "JPEG" (0-255 for 8-bit) - VIDEO ///< video, or "MPEG" (16-235 for 8-bit) -}; - -extern std::string video_range_to_string (VideoRange r); -extern VideoRange string_to_video_range (std::string s); - - -/** 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); - -enum class ExportFormat -{ - PRORES, - H264_AAC, - SUBTITLES_DCP -}; - -/** @struct Crop - * @brief A description of the crop of an image or video. - */ -struct Crop -{ - Crop () : left (0), right (0), top (0), bottom (0) {} - Crop (int l, int r, int t, int b) : left (l), right (r), top (t), bottom (b) {} - explicit Crop (std::shared_ptr); - - /** Number of pixels to remove from the left-hand side */ - int left; - /** Number of pixels to remove from the right-hand side */ - int right; - /** Number of pixels to remove from the top */ - int top; - /** Number of pixels to remove from the bottom */ - int bottom; - - dcp::Size apply (dcp::Size s, int minimum = 4) const { - s.width -= left + right; - s.height -= top + bottom; - - if (s.width < minimum) { - s.width = minimum; - } - - if (s.height < minimum) { - s.height = minimum; - } - - return s; - } - - void as_xml (xmlpp::Node *) const; -}; - -extern bool operator== (Crop const & a, Crop const & b); -extern bool operator!= (Crop const & a, Crop const & b); - struct CPLSummary { CPLSummary (boost::filesystem::path p); @@ -235,14 +133,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 @@ -256,19 +146,4 @@ enum class EmailProtocol { }; -class NamedChannel -{ -public: - NamedChannel (std::string name_, int index_) - : name(name_) - , index(index_) - {} - - std::string name; - int index; -}; - - -bool operator== (NamedChannel const& a, NamedChannel const& b); - #endif