-/*\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
-\r
-#include <boost/noncopyable.hpp>\r
-#include <boost/thread/future.hpp>\r
-#include <boost/property_tree/ptree_fwd.hpp>\r
-\r
-#include <string>\r
-\r
-namespace caspar { namespace core {\r
-\r
-struct frame_producer;\r
-class basic_frame;\r
-\r
-class layer : boost::noncopyable\r
-{\r
-public:\r
- layer(); // nothrow\r
- layer(layer&& other); // nothrow\r
- layer& operator=(layer&& other); // nothrow\r
- layer(const layer&);\r
- layer& operator=(const layer&);\r
-\r
- void swap(layer& other); // nothrow \r
- \r
- void load(const safe_ptr<frame_producer>& producer, bool preview, int auto_play_delta); // nothrow\r
- void play(); // nothrow\r
- void pause(); // nothrow\r
- void stop(); // nothrow\r
- boost::unique_future<std::wstring> call(bool foreground, const std::wstring& param);\r
-\r
- bool is_paused() const;\r
- int64_t frame_number() const;\r
- \r
- bool empty() const;\r
-\r
- safe_ptr<frame_producer> foreground() const; // nothrow\r
- safe_ptr<frame_producer> background() const; // nothrow\r
-\r
- safe_ptr<basic_frame> receive(int hints); // nothrow\r
-\r
- boost::property_tree::wptree info() const;\r
-private:\r
- struct implementation;\r
- safe_ptr<implementation> impl_;\r
-};\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 "../interaction/interaction_sink.h"
+#include "../fwd.h"
+
+#include <common/forward.h>
+#include <common/future_fwd.h>
+#include <common/memory.h>
+
+#include <boost/property_tree/ptree_fwd.hpp>
+#include <boost/optional.hpp>
+
+#include <string>
+
+namespace caspar { namespace core {
+
+class layer final : public interaction_sink
+{
+ 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<frame_producer> producer, bool preview, const boost::optional<int32_t>& auto_play_delta = boost::optional<int32_t>());
+ void play();
+ void pause();
+ void resume();
+ void stop();
+
+ draw_frame receive(const video_format_desc& format_desc);
+
+ // monitor::observable
+
+ monitor::subject& monitor_output();
+
+ // interaction_sink
+
+ void on_interaction(const interaction_event::ptr& event) override;
+ bool collides(double x, double y) const override;
+
+ // Properties
+
+ spl::shared_ptr<frame_producer> foreground() const;
+ spl::shared_ptr<frame_producer> background() const;
+
+ boost::property_tree::wptree info() const;
+ boost::property_tree::wptree delay_info() const;
+
+private:
+ struct impl;
+ spl::shared_ptr<impl> impl_;
+};
+
}}
\ No newline at end of file