]> git.sesse.net Git - casparcg/blobdiff - core/producer/stage.h
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches...
[casparcg] / core / producer / stage.h
index 54f680f2577be579799e18d18d3693655d1ce80a..bd8b67e5388ddbafc66b7659a9ad94ec442b3626 100644 (file)
@@ -1,67 +1,79 @@
 /*\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
 #pragma once\r
 \r
 #include "frame_producer.h"\r
 \r
+#include <common/forward.h>\r
 #include <common/memory/safe_ptr.h>\r
-#include <common/concurrency/target.h>\r
-#include <common/concurrency/governor.h>\r
-#include <common/diagnostics/graph.h>\r
+#include <common/tweener.h>\r
 \r
-#include <boost/noncopyable.hpp>\r
+#include <boost/property_tree/ptree_fwd.hpp>\r
 \r
-namespace caspar { namespace core {\r
+#include <functional>\r
+#include <tuple>\r
+#include <vector>\r
 \r
-struct video_format_desc;\r
-struct layer_status;\r
+FORWARD2(caspar, diagnostics, class graph);\r
+FORWARD1(boost, template<typename> class unique_future);\r
 \r
-class stage : boost::noncopyable\r
+namespace caspar { namespace core {\r
+       \r
+class stage sealed\r
 {\r
-public:\r
-       typedef target<std::pair<std::map<int, safe_ptr<basic_frame>>, ticket>> target_t;\r
+       stage(const stage&);\r
+       stage& operator=(const stage&);\r
+public:        \r
+       typedef std::function<struct frame_transform(struct frame_transform)> transform_func_t;\r
+       typedef std::tuple<int, transform_func_t, unsigned int, tweener> transform_tuple_t;\r
 \r
-       explicit stage(const safe_ptr<diagnostics::graph>& graph, const safe_ptr<target_t>& target, const video_format_desc& format_desc);\r
+       stage();\r
+               \r
+       std::map<int, safe_ptr<class draw_frame>> operator()(const struct video_format_desc& format_desc);\r
 \r
-       void swap(stage& other);\r
-                       \r
-       void load(int index, const safe_ptr<frame_producer>& producer, bool preview = false, int auto_play_delta = -1);\r
+       void apply_transforms(const std::vector<transform_tuple_t>& transforms);\r
+       void apply_transform(int index, const transform_func_t& transform, unsigned int mix_duration = 0, const tweener& tween = L"linear");\r
+       void clear_transforms(int index);\r
+       void clear_transforms();\r
+                               \r
+       void load(int index, const safe_ptr<struct frame_producer>& producer, int auto_play_delta = -1);\r
        void pause(int index);\r
        void play(int index);\r
        void stop(int index);\r
        void clear(int index);\r
        void clear();   \r
-       std::wstring call(int index, bool foreground, const std::wstring& param);\r
-       void swap_layer(int index, size_t other_index);\r
-       void swap_layer(int index, size_t other_index, stage& other);\r
-\r
-       layer_status get_status(int index);\r
-       safe_ptr<frame_producer> foreground(size_t index);\r
-       safe_ptr<frame_producer> background(size_t index);\r
+       void swap_layers(const safe_ptr<stage>& other);\r
+       void swap_layer(int index, int other_index);\r
+       void swap_layer(int index, int other_index, const safe_ptr<stage>& other);\r
        \r
-       void set_video_format_desc(const video_format_desc& format_desc);\r
+       boost::unique_future<safe_ptr<struct frame_producer>>   foreground(int index);\r
+       boost::unique_future<safe_ptr<struct frame_producer>>   background(int index);\r
 \r
+       boost::unique_future<boost::property_tree::wptree> info() const;\r
+       boost::unique_future<boost::property_tree::wptree> info(int index) const;\r
+       \r
 private:\r
-       struct implementation;\r
-       safe_ptr<implementation> impl_;\r
+       struct impl;\r
+       safe_ptr<impl> impl_;\r
 };\r
 \r
 }}
\ No newline at end of file