diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-07-22 12:25:35 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-07-22 12:25:35 +0100 |
| commit | 75712cfaf2a8ec8904d7d9552c542a2245bbbc17 (patch) | |
| tree | 5a7994b213e7baab5675351b13807719a44d7862 /src/lib | |
| parent | 3d9f434ef9db3e78eed808d6ecb2d26fd03c2902 (diff) | |
Basic UI.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/types.h | 6 | ||||
| -rw-r--r-- | src/lib/video_content.cc | 20 | ||||
| -rw-r--r-- | src/lib/video_content.h | 9 |
3 files changed, 33 insertions, 2 deletions
diff --git a/src/lib/types.h b/src/lib/types.h index 458a2ecf3..b1b359810 100644 --- a/src/lib/types.h +++ b/src/lib/types.h @@ -34,6 +34,12 @@ typedef int64_t OutputAudioFrame; typedef int OutputVideoFrame; typedef std::vector<boost::shared_ptr<Content> > ContentList; +enum VideoFrameType +{ + VIDEO_FRAME_TYPE_2D, + VIDEO_FRAME_TYPE_3D_LEFT_RIGHT +}; + /** @struct Crop * @brief A description of the crop of an image or video. */ diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index a157b0599..7eca53c3d 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -28,8 +28,9 @@ int const VideoContentProperty::VIDEO_SIZE = 0; int const VideoContentProperty::VIDEO_FRAME_RATE = 1; -int const VideoContentProperty::VIDEO_CROP = 2; -int const VideoContentProperty::VIDEO_RATIO = 3; +int const VideoContentProperty::VIDEO_FRAME_TYPE = 2; +int const VideoContentProperty::VIDEO_CROP = 3; +int const VideoContentProperty::VIDEO_RATIO = 4; using std::string; using std::stringstream; @@ -42,6 +43,7 @@ VideoContent::VideoContent (shared_ptr<const Film> f, Time s, VideoContent::Fram : Content (f, s) , _video_length (len) , _video_frame_rate (0) + , _video_frame_type (VIDEO_FRAME_TYPE_2D) , _ratio (Ratio::from_id ("185")) { @@ -51,6 +53,7 @@ VideoContent::VideoContent (shared_ptr<const Film> f, boost::filesystem::path p) : Content (f, p) , _video_length (0) , _video_frame_rate (0) + , _video_frame_type (VIDEO_FRAME_TYPE_2D) , _ratio (Ratio::from_id ("185")) { @@ -63,6 +66,7 @@ VideoContent::VideoContent (shared_ptr<const Film> f, shared_ptr<const cxml::Nod _video_size.width = node->number_child<int> ("VideoWidth"); _video_size.height = node->number_child<int> ("VideoHeight"); _video_frame_rate = node->number_child<float> ("VideoFrameRate"); + _video_frame_type = static_cast<VideoFrameType> (node->number_child<int> ("VideoFrameType")); _crop.left = node->number_child<int> ("LeftCrop"); _crop.right = node->number_child<int> ("RightCrop"); _crop.top = node->number_child<int> ("TopCrop"); @@ -81,6 +85,7 @@ VideoContent::as_xml (xmlpp::Node* node) const node->add_child("VideoWidth")->add_child_text (lexical_cast<string> (_video_size.width)); node->add_child("VideoHeight")->add_child_text (lexical_cast<string> (_video_size.height)); node->add_child("VideoFrameRate")->add_child_text (lexical_cast<string> (_video_frame_rate)); + node->add_child("VideoFrameType")->add_child_text (lexical_cast<string> (static_cast<int> (_video_frame_type))); node->add_child("LeftCrop")->add_child_text (boost::lexical_cast<string> (_crop.left)); node->add_child("RightCrop")->add_child_text (boost::lexical_cast<string> (_crop.right)); node->add_child("TopCrop")->add_child_text (boost::lexical_cast<string> (_crop.top)); @@ -220,3 +225,14 @@ VideoContent::identifier () const return s.str (); } + +void +VideoContent::set_video_frame_type (VideoFrameType t) +{ + { + boost::mutex::scoped_lock lm (_mutex); + _video_frame_rate = t; + } + + signal_changed (VideoContentProperty::VIDEO_FRAME_TYPE); +} diff --git a/src/lib/video_content.h b/src/lib/video_content.h index 1c85ca090..348e2ce8b 100644 --- a/src/lib/video_content.h +++ b/src/lib/video_content.h @@ -30,6 +30,7 @@ class VideoContentProperty public: static int const VIDEO_SIZE; static int const VIDEO_FRAME_RATE; + static int const VIDEO_FRAME_TYPE; static int const VIDEO_CROP; static int const VIDEO_RATIO; }; @@ -62,11 +63,18 @@ public: return _video_frame_rate; } + void set_video_frame_type (VideoFrameType); + void set_left_crop (int); void set_right_crop (int); void set_top_crop (int); void set_bottom_crop (int); + VideoFrameType video_frame_type () const { + boost::mutex::scoped_lock lm (_mutex); + return _video_frame_type; + } + Crop crop () const { boost::mutex::scoped_lock lm (_mutex); return _crop; @@ -92,6 +100,7 @@ private: libdcp::Size _video_size; float _video_frame_rate; + VideoFrameType _video_frame_type; Crop _crop; Ratio const * _ratio; }; |
