]> git.sesse.net Git - casparcg/blobdiff - core/producer/layer.h
git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches...
[casparcg] / core / producer / layer.h
index cf66e1ea38d83d040f142be136130410ad3ecfce..d8adad7f93bb8c9f2659042f41caff5b8202116c 100644 (file)
@@ -1,42 +1,82 @@
+/*\r
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>\r
+*\r
+* This file is part of CasparCG (www.casparcg.com).\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
+* Author: Robert Nagy, ronag89@gmail.com\r
+*/\r
+\r
 #pragma once\r
 \r
-#include <common/memory/safe_ptr.h>\r
-#include <common/utility/printer.h>\r
+#include "frame_producer.h"\r
 \r
-#include <boost/noncopyable.hpp>\r
+#include "../monitor/monitor.h"\r
 \r
-#include <tbb/atomic.h>\r
+#include <common/forward.h>\r
+#include <common/future_fwd.h>\r
+#include <common/memory.h>\r
 \r
-#include <memory>\r
+#include <boost/property_tree/ptree_fwd.hpp>\r
 \r
-namespace caspar { namespace core {\r
+#include <string>\r
 \r
-class frame_producer;\r
-class draw_frame;\r
+FORWARD1(boost, template<typename T> class optional);\r
 \r
-class layer : boost::noncopyable\r
+namespace caspar { namespace core {\r
+       \r
+class layer sealed : public monitor::observable\r
 {\r
+       layer(const layer&);\r
+       layer& operator=(const layer&);\r
 public:\r
-       layer(int index = std::numeric_limits<int>::min(), const printer& parent_printer = nullptr); // nothrow\r
-       layer(layer&& other); // nothrow\r
-       layer& operator=(layer&& other); // nothrow\r
+       // Static Members\r
+\r
+       // Constructors\r
+\r
+       explicit layer(int index = -1); \r
+       layer(layer&& other); \r
 \r
-       void swap(layer& other); // nothrow \r
+       // Methods\r
+\r
+       layer& operator=(layer&& other); \r
+\r
+       void swap(layer& other);  \r
                \r
-       void load(const safe_ptr<frame_producer>& producer, bool play_on_load, bool preview); // nothrow\r
-       void play(); // nothrow\r
-       void pause(); // nothrow\r
-       void stop(); // nothrow\r
+       void load(spl::shared_ptr<class frame_producer> producer, bool preview, const boost::optional<int32_t>& auto_play_delta = nullptr); \r
+       void play(); \r
+       void pause(); \r
+       void stop(); \r
+       \r
+       class draw_frame receive(const struct video_format_desc& format_desc); \r
+       \r
+       // monitor::observable\r
 \r
-       safe_ptr<frame_producer> foreground() const; // nothrow\r
-       safe_ptr<frame_producer> background() const; // nothrow\r
+       void subscribe(const monitor::observable::observer_ptr& o) override;\r
+       void unsubscribe(const monitor::observable::observer_ptr& o) override;\r
+\r
+       // Properties\r
+               \r
+       spl::shared_ptr<class frame_producer>   foreground() const; \r
+       spl::shared_ptr<class frame_producer>   background() const; \r
 \r
-       safe_ptr<draw_frame> receive(); // nothrow\r
+       boost::property_tree::wptree                    info() const;\r
 \r
-       std::wstring print() const;\r
 private:\r
-       struct implementation;\r
-       std::shared_ptr<implementation> impl_;\r
+       struct impl;\r
+       spl::shared_ptr<impl> impl_;\r
 };\r
 \r
 }}
\ No newline at end of file