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