X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=core%2Fproducer%2Flayer.cpp;h=a76b9b50e103b61f3f5743be7e95b93354b8ece3;hb=c5bf7659f087e5c0fa7fcc6e46cf182a822faa21;hp=f85f407f39b03785ed541beb99015986abd6f28e;hpb=41f7ebd4750a00c7a8b2a16ed2ea4430d969535f;p=casparcg diff --git a/core/producer/layer.cpp b/core/producer/layer.cpp index f85f407f3..a76b9b50e 100644 --- a/core/producer/layer.cpp +++ b/core/producer/layer.cpp @@ -1,3 +1,23 @@ +/* +* copyright (c) 2010 Sveriges Television AB +* +* This file is part of CasparCG. +* +* CasparCG is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* CasparCG is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. + +* You should have received a copy of the GNU General Public License +* along with CasparCG. If not, see . +* +*/ + #include "../stdafx.h" #include "layer.h" @@ -8,7 +28,7 @@ namespace caspar { namespace core { -struct layer::implementation : boost::noncopyable +struct layer::implementation { safe_ptr foreground_; safe_ptr background_; @@ -21,22 +41,16 @@ public: , last_frame_(basic_frame::empty()) , is_paused_(false){} - void pause() - { - is_paused_ = true; - } - - void resume() - { - is_paused_ = false; - } + void pause(){is_paused_ = true;} + void resume(){is_paused_ = false;} void load(const safe_ptr& producer, bool preview) { background_ = producer; - if(preview) + if(preview) { + // Play the first frame and pause. play(); receive(); pause(); @@ -79,6 +93,13 @@ layer& layer::operator=(layer&& other) impl_ = std::move(other.impl_); return *this; } +layer::layer(const layer& other) : impl_(new implementation(*other.impl_)){} +layer& layer::operator=(const layer& other) +{ + layer temp(other); + temp.swap(*this); + return *this; +} void layer::swap(layer& other) { impl_.swap(other.impl_);