]> git.sesse.net Git - casparcg/blob - modules/flash/producer/cg_producer.h
2.0.2: INFO further improved. STATUS 1-1 removed in favor of INFO 1-1.
[casparcg] / modules / flash / producer / cg_producer.h
1 /*\r
2 * copyright (c) 2010 Sveriges Television AB <info@casparcg.com>\r
3 *\r
4 *  This file is part of CasparCG.\r
5 *\r
6 *    CasparCG is free software: you can redistribute it and/or modify\r
7 *    it under the terms of the GNU General Public License as published by\r
8 *    the Free Software Foundation, either version 3 of the License, or\r
9 *    (at your option) any later version.\r
10 *\r
11 *    CasparCG is distributed in the hope that it will be useful,\r
12 *    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14 *    GNU General Public License for more details.\r
15 \r
16 *    You should have received a copy of the GNU General Public License\r
17 *    along with CasparCG.  If not, see <http://www.gnu.org/licenses/>.\r
18 *\r
19 */\r
20 #pragma once\r
21 \r
22 #include <core/producer/frame_producer.h>\r
23 #include <core/producer/stage.h>\r
24 #include <core/video_format.h>\r
25 #include <core/video_channel.h>\r
26 \r
27 #include <boost/thread/future.hpp>\r
28 \r
29 #include <string>\r
30 \r
31 namespace caspar { namespace flash {\r
32                 \r
33 class cg_producer : public core::frame_producer\r
34 {\r
35 public:\r
36         static const unsigned int DEFAULT_LAYER = 9999;\r
37 \r
38         explicit cg_producer(const safe_ptr<core::frame_producer>& producer);\r
39         cg_producer(cg_producer&& other);\r
40         \r
41         // frame_producer\r
42 \r
43         virtual safe_ptr<core::basic_frame> receive(int) override;\r
44         virtual safe_ptr<core::basic_frame> last_frame() const override;\r
45         virtual std::wstring print() const override;\r
46         virtual boost::unique_future<std::wstring> call(const std::wstring&) override;\r
47         virtual boost::property_tree::wptree info() const override;\r
48 \r
49         //cg_producer\r
50 \r
51         void add(int layer, const std::wstring& template_name,  bool play_on_load, const std::wstring& start_from_label = TEXT(""), const std::wstring& data = TEXT(""));\r
52         void remove(int layer);\r
53         void play(int layer);\r
54         void stop(int layer, unsigned int mix_out_duration);\r
55         void next(int layer);\r
56         void update(int layer, const std::wstring& data);\r
57         std::wstring invoke(int layer, const std::wstring& label);\r
58         std::wstring description(int layer);\r
59         std::wstring template_host_info();\r
60 \r
61 private:\r
62         struct implementation;\r
63         std::shared_ptr<implementation> impl_;\r
64 };\r
65 safe_ptr<cg_producer> get_default_cg_producer(const safe_ptr<core::video_channel>& video_channel, int layer_index = cg_producer::DEFAULT_LAYER);\r
66 \r
67 safe_ptr<core::frame_producer> create_ct_producer(const safe_ptr<core::frame_factory> frame_factory, const std::vector<std::wstring>& params);\r
68 safe_ptr<core::frame_producer> create_cg_producer(const safe_ptr<core::frame_factory> frame_factory, const std::vector<std::wstring>& params);\r
69 \r
70 }}