-/*\r
-* copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
-*\r
-* This file is part of CasparCG.\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
-*\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
-*/\r
-#pragma once\r
-\r
-#include "../frame_producer.h"\r
-\r
-#include <string>\r
-#include <memory>\r
-\r
-namespace caspar { namespace core {\r
-\r
-struct transition\r
-{\r
- enum type\r
- {\r
-\r
- cut = 1,\r
- mix,\r
- push,\r
- slide,\r
- wipe\r
- };\r
-};\r
-\r
-struct transition_direction\r
-{\r
- enum type\r
- {\r
- from_left = 1,\r
- from_right\r
- };\r
-};\r
-\r
-struct transition_info\r
-{\r
- transition_info() : type(transition::cut), duration(0), direction(transition_direction::from_left){}\r
- \r
- size_t duration;\r
- transition_direction::type direction;\r
- transition::type type;\r
-};\r
-\r
-class transition_producer : public frame_producer\r
-{\r
-public:\r
- explicit transition_producer(const safe_ptr<frame_producer>& destination, const transition_info& info);\r
- transition_producer(transition_producer&& other);\r
-\r
- virtual safe_ptr<draw_frame> receive();\r
-\r
- virtual safe_ptr<frame_producer> get_following_producer() const;\r
- virtual void set_leading_producer(const safe_ptr<frame_producer>& producer);\r
- virtual void initialize(const safe_ptr<frame_factory>& frame_factory);\r
- virtual void set_parent_printer(const printer& parent_printer);\r
- virtual std::wstring print() const;\r
-private:\r
- struct implementation;\r
- std::shared_ptr<implementation> impl_;\r
-};\r
-\r
-}}
\ No newline at end of file
+/*
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
+*
+* This file is part of CasparCG (www.casparcg.com).
+*
+* CasparCG 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 3 of the License, or
+* (at your option) any later version.
+*
+* CasparCG 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 CasparCG. If not, see <http://www.gnu.org/licenses/>.
+*
+* Author: Robert Nagy, ronag89@gmail.com
+*/
+
+#pragma once
+
+#include "../../video_format.h"
+#include "../../fwd.h"
+
+#include <common/memory.h>
+#include <common/tweener.h>
+
+#include <string>
+
+namespace caspar { namespace core {
+
+enum class transition_type
+{
+ cut,
+ mix,
+ push,
+ slide,
+ wipe,
+ count
+};
+
+enum class transition_direction
+{
+ from_left,
+ from_right,
+ count
+};
+
+struct transition_info
+{
+ int duration = 0;
+ transition_direction direction = transition_direction::from_left;
+ transition_type type = transition_type::cut;
+ caspar::tweener tweener { L"linear" };
+};
+
+spl::shared_ptr<frame_producer> create_transition_producer(const field_mode& mode, const spl::shared_ptr<frame_producer>& destination, const transition_info& info);
+
+}}