]> git.sesse.net Git - casparcg/blob - core/producer/layer.h
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches...
[casparcg] / core / producer / layer.h
1 #pragma once\r
2 \r
3 #include <common/memory/safe_ptr.h>\r
4 #include <common/utility/printable.h>\r
5 \r
6 #include <boost/noncopyable.hpp>\r
7 \r
8 #include <tbb/atomic.h>\r
9 \r
10 #include <memory>\r
11 \r
12 namespace caspar { namespace core {\r
13 \r
14 class frame_producer;\r
15 class draw_frame;\r
16 \r
17 class layer : boost::noncopyable\r
18 {\r
19 public:\r
20         layer(int index, const printer& parent_printer = nullptr); // nothrow\r
21         ~layer();\r
22         layer(layer&& other); // nothrow\r
23         layer& operator=(layer&& other); // nothrow\r
24 \r
25         // Swap is thread-safe on "other".\r
26         void swap(layer& other); // nothrow \r
27                 \r
28         void load(const safe_ptr<frame_producer>& producer, bool play_on_load = false); // nothrow\r
29         void preview(const safe_ptr<frame_producer>& producer); // nothrow\r
30         void play(); // nothrow\r
31         void pause(); // nothrow\r
32         void stop(); // nothrow\r
33         void clear(); // nothrow\r
34 \r
35         safe_ptr<frame_producer> foreground() const; // nothrow\r
36         safe_ptr<frame_producer> background() const; // nothrow\r
37 \r
38         safe_ptr<draw_frame> receive(); // nothrow\r
39 \r
40         std::wstring print() const;\r
41 private:\r
42         struct implementation;\r
43         tbb::atomic<implementation*> impl_;\r
44 };\r
45 \r
46 }}