\r
frame_producer_remover g_remover;\r
\r
-struct layer::implementation : boost::noncopyable\r
+struct layer::implementation : public object, boost::noncopyable\r
{ \r
mutable tbb::spin_mutex printer_mutex_;\r
printer parent_printer_;\r
safe_ptr<basic_frame> last_frame_;\r
bool is_paused_;\r
public:\r
- implementation(int index, const printer& parent_printer) \r
- : parent_printer_(parent_printer)\r
+ implementation(const object* parent, int index) \r
+ : object(parent)\r
, index_(index)\r
, foreground_(frame_producer::empty())\r
, background_(frame_producer::empty())\r
\r
void load(const safe_ptr<frame_producer>& frame_producer, bool play_on_load, bool preview)\r
{ \r
+ frame_producer->set_parent(this);\r
background_ = frame_producer;\r
is_paused_ = false;\r
\r
\r
auto following = foreground_->get_following_producer();\r
following->set_leading_producer(foreground_);\r
- following->set_parent_printer([=]{return print();});\r
+ following->set_parent(this);\r
g_remover.remove(std::move(foreground_));\r
foreground_ = following;\r
CASPAR_LOG(info) << foreground_->print() << L" Added.";\r
std::wstring print() const\r
{\r
tbb::spin_mutex::scoped_lock lock(printer_mutex_); // Child-producers may call print asynchronously to the producer thread.\r
- return (parent_printer_ ? parent_printer_() + L"/" : L"") + L"layer[" + boost::lexical_cast<std::wstring>(index_) + L"]";\r
+ return object::print() + L"layer[" + boost::lexical_cast<std::wstring>(index_) + L"]";\r
}\r
};\r
\r
-layer::layer(int index, const printer& parent_printer) : impl_(new implementation(index, parent_printer)){}\r
+layer::layer(const object* parent, int index) : impl_(new implementation(parent, index)){}\r
layer::layer(layer&& other) : impl_(std::move(other.impl_)){}\r
layer& layer::operator=(layer&& other)\r
{\r