\r
#include <boost/noncopyable.hpp>\r
\r
+#include <tbb/atomic.h>\r
+\r
namespace caspar { namespace core {\r
\r
class frame_producer;\r
class layer : boost::noncopyable\r
{\r
public:\r
- layer(int index = -1); // nothrow\r
+ layer(); // nothrow\r
layer(layer&& other); // nothrow\r
+ ~layer();\r
layer& operator=(layer&& other); // nothrow\r
- \r
+\r
+ //NOTE: swap is thread-safe on "other", NOT on "this".\r
+ void swap(layer& other); // nothrow \r
+ \r
void load(const safe_ptr<frame_producer>& producer, bool play_on_load = false); // nothrow\r
void preview(const safe_ptr<frame_producer>& producer); // nothrow\r
void play(); // nothrow\r
void stop(); // nothrow\r
void clear(); // nothrow\r
\r
- bool empty() const; // nothrow\r
- \r
safe_ptr<frame_producer> foreground() const; // nothrow\r
safe_ptr<frame_producer> background() const; // nothrow\r
\r
safe_ptr<draw_frame> receive(); // nothrow\r
private:\r
struct implementation;\r
- std::shared_ptr<implementation> impl_;\r
+ tbb::atomic<implementation*> impl_;\r
};\r
\r
}}
\ No newline at end of file