]> git.sesse.net Git - casparcg/blob - core/producer/layer.h
2.0.0.2: Disabled captured exceptions in order to allow exact rethrow.
[casparcg] / core / producer / layer.h
1 #pragma once\r
2 \r
3 #include <common/memory/safe_ptr.h>\r
4 \r
5 #include <boost/noncopyable.hpp>\r
6 \r
7 #include <tbb/atomic.h>\r
8 \r
9 namespace caspar { namespace core {\r
10 \r
11 class frame_producer;\r
12 class draw_frame;\r
13 \r
14 class layer : boost::noncopyable\r
15 {\r
16 public:\r
17         layer(); // nothrow\r
18         layer(layer&& other); // nothrow\r
19         ~layer(); // nothrow\r
20         layer& operator=(layer&& other); // nothrow\r
21 \r
22         //NOTE: swap is thread-safe on "other", NOT on "this".\r
23         void swap(layer& other); // nothrow \r
24                 \r
25         void load(const safe_ptr<frame_producer>& producer, bool play_on_load = false); // nothrow\r
26         void preview(const safe_ptr<frame_producer>& producer); // nothrow\r
27         void play(); // nothrow\r
28         void pause(); // nothrow\r
29         void stop(); // nothrow\r
30         void clear(); // nothrow\r
31 \r
32         safe_ptr<frame_producer> foreground() const; // nothrow\r
33         safe_ptr<frame_producer> background() const; // nothrow\r
34 \r
35         safe_ptr<draw_frame> receive(); // nothrow\r
36 private:\r
37         struct implementation;\r
38         tbb::atomic<implementation*> impl_;\r
39 };\r
40 \r
41 }}