]> git.sesse.net Git - casparcg/blob - core/channel.h
2.0.0.2: Renamed "processor" to "mixer".
[casparcg] / core / channel.h
1 #pragma once\r
2 \r
3 #include "consumer/frame_consumer.h"\r
4 #include "producer/frame_producer.h"\r
5 \r
6 #include <common/memory/safe_ptr.h>\r
7 \r
8 #include <boost/noncopyable.hpp>\r
9 #include <boost/thread/future.hpp>\r
10 \r
11 namespace caspar { namespace core {\r
12 \r
13 ////////////////////////////////////////////////////////////////////////////////////////////////////\r
14 /// \class      channel\r
15 ///\r
16 /// \brief\r
17 ///             \r
18 ///                |**********| <-   empty frame   <- |***********| <-   frame format  <- |**********|\r
19 ///   PROTOCOL ->  | PRODUCER |                       |   MIXER   |                       | CONSUMER |  -> DISPLAY DEVICE\r
20 ///                |**********| -> rendered frames -> |***********| -> formatted frame -> |**********|\r
21 ///   \r
22 ////////////////////////////////////////////////////////////////////////////////////////////////////\r
23 class channel : boost::noncopyable\r
24 {\r
25 public:\r
26         explicit channel(const video_format_desc& format_desc);\r
27         channel(channel&& other);\r
28 \r
29         // Consumers\r
30         void add(int index, const safe_ptr<frame_consumer>& consumer);\r
31         void remove(int index);\r
32         \r
33         // Layers and Producers\r
34         void set_video_gain(int index, double value);\r
35         void set_video_opacity(int index, double value);\r
36 \r
37         void set_audio_gain(int index, double value);\r
38 \r
39         void load(int index, const safe_ptr<frame_producer>& producer, bool play_on_load = false);\r
40         void preview(int index, const safe_ptr<frame_producer>& producer);\r
41         void pause(int index);\r
42         void play(int index);\r
43         void stop(int index);\r
44         void clear(int index);\r
45         void clear();   \r
46         boost::unique_future<safe_ptr<frame_producer>> foreground(int index) const;\r
47         boost::unique_future<safe_ptr<frame_producer>> background(int index) const;\r
48         const video_format_desc& get_video_format_desc() const;\r
49 \r
50 private:\r
51         struct implementation;\r
52         safe_ptr<implementation> impl_;\r
53 };\r
54 \r
55 }}