/*\r
-* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>\r
*\r
-* This file is part of CasparCG.\r
+* This file is part of CasparCG (www.casparcg.com).\r
*\r
-* CasparCG is free software: you can redistribute it and/or modify\r
-* it under the terms of the GNU General Public License as published by\r
-* the Free Software Foundation, either version 3 of the License, or\r
-* (at your option) any later version.\r
+* CasparCG is free software: you can redistribute it and/or modify\r
+* it under the terms of the GNU General Public License as published by\r
+* the Free Software Foundation, either version 3 of the License, or\r
+* (at your option) any later version.\r
*\r
-* CasparCG is distributed in the hope that it will be useful,\r
-* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-* GNU General Public License for more details.\r
-\r
-* You should have received a copy of the GNU General Public License\r
-* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.\r
+* CasparCG is distributed in the hope that it will be useful,\r
+* but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+* GNU General Public License for more details.\r
+*\r
+* You should have received a copy of the GNU General Public License\r
+* along with CasparCG. If not, see <http://www.gnu.org/licenses/>.\r
*\r
+* Author: Robert Nagy, ronag89@gmail.com\r
*/\r
+\r
#include "../../stdafx.h"\r
\r
#include "basic_frame.h"\r
\r
-#include "image_transform.h"\r
-#include "audio_transform.h"\r
+#include "frame_transform.h"\r
#include "../../video_format.h"\r
\r
#include <boost/foreach.hpp>\r
{ \r
std::vector<safe_ptr<basic_frame>> frames_;\r
\r
- image_transform image_transform_; \r
- audio_transform audio_transform_;\r
+ frame_transform frame_transform_; \r
\r
public:\r
implementation(const std::vector<safe_ptr<basic_frame>>& frames) : frames_(frames) \r
frame->accept(visitor);\r
visitor.end();\r
} \r
-\r
- std::wstring print() const\r
- {\r
- std::wstring str = L"\tbasic_frame[\n";\r
- BOOST_FOREACH(auto& frame, frames_)\r
- str += frame->print() + L"\n";\r
- str += L"\n]";\r
- return str;\r
- }\r
};\r
\r
basic_frame::basic_frame() : impl_(new implementation(std::vector<safe_ptr<basic_frame>>())){}\r
}\r
void basic_frame::swap(basic_frame& other){impl_.swap(other.impl_);}\r
\r
-const image_transform& basic_frame::get_image_transform() const { return impl_->image_transform_;}\r
-image_transform& basic_frame::get_image_transform() { return impl_->image_transform_;}\r
-const audio_transform& basic_frame::get_audio_transform() const { return impl_->audio_transform_;}\r
-audio_transform& basic_frame::get_audio_transform() { return impl_->audio_transform_;}\r
-\r
-std::wstring basic_frame::print() const{return impl_->print();}\r
+const frame_transform& basic_frame::get_frame_transform() const { return impl_->frame_transform_;}\r
+frame_transform& basic_frame::get_frame_transform() { return impl_->frame_transform_;}\r
void basic_frame::accept(frame_visitor& visitor){impl_->accept(*this, visitor);}\r
\r
safe_ptr<basic_frame> basic_frame::interlace(const safe_ptr<basic_frame>& frame1, const safe_ptr<basic_frame>& frame2, field_mode::type mode)\r
auto my_frame2 = make_safe<basic_frame>(frame2);\r
if(mode == field_mode::upper)\r
{\r
- my_frame1->get_image_transform().set_field_mode(field_mode::upper); \r
- my_frame2->get_image_transform().set_field_mode(field_mode::lower); \r
- } \r
- else \r
- { \r
- my_frame1->get_image_transform().set_field_mode(field_mode::lower); \r
- my_frame2->get_image_transform().set_field_mode(field_mode::upper); \r
+ my_frame1->get_frame_transform().field_mode = field_mode::upper; \r
+ my_frame2->get_frame_transform().field_mode = field_mode::lower; \r
+ } \r
+ else \r
+ { \r
+ my_frame1->get_frame_transform().field_mode = field_mode::lower; \r
+ my_frame2->get_frame_transform().field_mode = field_mode::upper; \r
}\r
\r
std::vector<safe_ptr<basic_frame>> frames;\r
frames.push_back(my_frame1);\r
frames.push_back(my_frame2);\r
- return basic_frame(std::move(frames));\r
+ return make_safe<basic_frame>(std::move(frames));\r
}\r
\r
safe_ptr<basic_frame> basic_frame::combine(const safe_ptr<basic_frame>& frame1, const safe_ptr<basic_frame>& frame2)\r
std::vector<safe_ptr<basic_frame>> frames;\r
frames.push_back(frame1);\r
frames.push_back(frame2);\r
- return basic_frame(std::move(frames));\r
+ return make_safe<basic_frame>(std::move(frames));\r
}\r
\r
safe_ptr<basic_frame> basic_frame::fill_and_key(const safe_ptr<basic_frame>& fill, const safe_ptr<basic_frame>& key)\r
return basic_frame::empty();\r
\r
std::vector<safe_ptr<basic_frame>> frames;\r
- key->get_image_transform().set_is_key(true);\r
+ key->get_frame_transform().is_key = true;\r
frames.push_back(key);\r
frames.push_back(fill);\r
- return basic_frame(std::move(frames));\r
+ return make_safe<basic_frame>(std::move(frames));\r
}\r
\r
safe_ptr<basic_frame> disable_audio(const safe_ptr<basic_frame>& frame)\r
{\r
basic_frame frame2 = frame;\r
- frame2.get_audio_transform().set_has_audio(false);\r
- return std::move(frame2);\r
+ frame2.get_frame_transform().volume = 0.0;\r
+ return make_safe<basic_frame>(std::move(frame2));\r
}\r
\r
}}
\ No newline at end of file