]> git.sesse.net Git - casparcg/blob - core/producer/frame_producer_device.h
854ee6bc2b78aa7b0450a35efce8b28c09d6f5a7
[casparcg] / core / producer / frame_producer_device.h
1 #pragma once\r
2 \r
3 #include "frame_producer.h"\r
4 \r
5 #include <common/memory/safe_ptr.h>\r
6 #include <common/utility/printable.h>\r
7 \r
8 #include <boost/noncopyable.hpp>\r
9 #include <boost/thread/future.hpp>\r
10 \r
11 #include <functional>\r
12 \r
13 namespace caspar { namespace core {\r
14 \r
15 ////////////////////////////////////////////////////////////////////////////////////////////////////\r
16 /// \class      frame_producer_device\r
17 ///\r
18 /// \brief\r
19 ///             \r
20 ///                |**********| <-   empty frame   <- |***********| <-   frame format  <- |**********|\r
21 ///   PROTOCOL ->  | PRODUCER |                       |   MIXER   |                       | CONSUMER |  -> DISPLAY DEVICE\r
22 ///                |**********| -> rendered frames -> |***********| -> formatted frame -> |**********|\r
23 ///   \r
24 ////////////////////////////////////////////////////////////////////////////////////////////////////\r
25 \r
26 class frame_producer_device : boost::noncopyable\r
27 {\r
28 public:\r
29         typedef std::function<void(const std::vector<safe_ptr<draw_frame>>&)> output_func;\r
30 \r
31         explicit frame_producer_device(const printer& parent_printer, const safe_ptr<frame_factory>& factory, const output_func& output);\r
32         frame_producer_device(frame_producer_device&& other);\r
33         void swap(frame_producer_device& other);\r
34                 \r
35         void load(int index, const safe_ptr<frame_producer>& producer, bool play_on_load = false);\r
36         void preview(int index, const safe_ptr<frame_producer>& producer);\r
37         void pause(int index);\r
38         void play(int index);\r
39         void stop(int index);\r
40         void clear(int index);\r
41         void clear();   \r
42         void swap_layer(int index, size_t other_index);\r
43         void swap_layer(int index, size_t other_index, frame_producer_device& other);\r
44         boost::unique_future<safe_ptr<frame_producer>> foreground(size_t index) const;\r
45 \r
46 private:\r
47         struct implementation;\r
48         safe_ptr<implementation> impl_;\r
49 };\r
50 \r
51 }}