]> git.sesse.net Git - casparcg/blobdiff - core/producer/layer.h
set svn:eol-style native on .h and .cpp files
[casparcg] / core / producer / layer.h
index e67b9949bed479a08a3732bd291d409a3112a26d..aa7cf5d4ff7eb6f858f4504ec4198ac95ba436a3 100644 (file)
@@ -1,43 +1,82 @@
-#pragma once\r
-\r
-#include "../producer/frame_producer.h"\r
-\r
-namespace caspar { namespace core {\r
-\r
-struct load_option\r
-{\r
-       enum type\r
-       {\r
-               none,\r
-               preview,\r
-               auto_play\r
-       };\r
-};\r
-\r
-class layer\r
-{\r
-       layer(const layer& other);\r
-       layer& operator=(const layer& other);\r
-public:\r
-       layer();\r
-       layer(layer&& other);\r
-       layer& operator=(layer&& other);\r
-\r
-       void load(const frame_producer_ptr& producer, load_option::type option = load_option::none);    \r
-       void play();\r
-       void pause();\r
-       void stop();\r
-       void clear();\r
-               \r
-       frame_producer_ptr active() const;\r
-       frame_producer_ptr background() const;\r
-\r
-       frame_ptr render_frame();\r
-private:\r
-       struct implementation;\r
-       std::shared_ptr<implementation> impl_;\r
-};\r
-typedef std::shared_ptr<layer> layer_ptr;\r
-typedef std::unique_ptr<layer> layer_uptr;\r
-\r
+/*
+* Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
+*
+* This file is part of CasparCG (www.casparcg.com).
+*
+* 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 <http://www.gnu.org/licenses/>.
+*
+* Author: Robert Nagy, ronag89@gmail.com
+*/
+
+#pragma once
+
+#include "frame_producer.h"
+
+#include "../monitor/monitor.h"
+
+#include <common/forward.h>
+#include <common/future_fwd.h>
+#include <common/memory.h>
+
+#include <boost/property_tree/ptree_fwd.hpp>
+
+#include <string>
+
+FORWARD1(boost, template<typename T> class optional);
+
+namespace caspar { namespace core {
+       
+class layer sealed : public monitor::observable
+{
+       layer(const layer&);
+       layer& operator=(const layer&);
+public:
+       // Static Members
+
+       // Constructors
+
+       explicit layer(int index = -1); 
+       layer(layer&& other); 
+
+       // Methods
+
+       layer& operator=(layer&& other); 
+
+       void swap(layer& other);  
+               
+       void load(spl::shared_ptr<class frame_producer> producer, bool preview, const boost::optional<int32_t>& auto_play_delta = nullptr); 
+       void play(); 
+       void pause(); 
+       void stop(); 
+       
+       class draw_frame receive(const struct video_format_desc& format_desc); 
+       
+       // monitor::observable
+
+       void subscribe(const monitor::observable::observer_ptr& o) override;
+       void unsubscribe(const monitor::observable::observer_ptr& o) override;
+
+       // Properties
+               
+       spl::shared_ptr<class frame_producer>   foreground() const; 
+       spl::shared_ptr<class frame_producer>   background() const; 
+
+       boost::property_tree::wptree                    info() const;
+
+private:
+       struct impl;
+       spl::shared_ptr<impl> impl_;
+};
+
 }}
\ No newline at end of file