2 * Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
4 * This file is part of CasparCG (www.casparcg.com).
6 * CasparCG is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * CasparCG is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
19 * Author: Robert Nagy, ronag89@gmail.com
24 #include "frame_producer.h"
26 #include "../monitor/monitor.h"
27 #include "../interaction/interaction_sink.h"
29 #include <common/forward.h>
30 #include <common/future_fwd.h>
31 #include <common/memory.h>
33 #include <boost/property_tree/ptree_fwd.hpp>
37 FORWARD1(boost, template<typename T> class optional);
39 namespace caspar { namespace core {
41 class layer /*final*/ : public interaction_sink
44 layer& operator=(const layer&);
50 explicit layer(int index = -1);
55 layer& operator=(layer&& other);
57 void swap(layer& other);
59 void load(spl::shared_ptr<class frame_producer> producer, bool preview, const boost::optional<int32_t>& auto_play_delta = nullptr);
64 class draw_frame receive(const struct video_format_desc& format_desc);
66 // monitor::observable
68 monitor::source& monitor_output();
72 void on_interaction(const interaction_event::ptr& event) override;
73 bool collides(double x, double y) const override;
77 spl::shared_ptr<class frame_producer> foreground() const;
78 spl::shared_ptr<class frame_producer> background() const;
80 boost::property_tree::wptree info() const;
84 spl::shared_ptr<impl> impl_;