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