]> git.sesse.net Git - casparcg/blob - core/producer/layer.h
[image_producer] refuse too large images nicely instead of letting OpenGL tell us...
[casparcg] / core / producer / layer.h
1 /*
2 * Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
3 *
4 * This file is part of CasparCG (www.casparcg.com).
5 *
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.
10 *
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.
15 *
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/>.
18 *
19 * Author: Robert Nagy, ronag89@gmail.com
20 */
21
22 #pragma once
23
24 #include "frame_producer.h"
25
26 #include "../monitor/monitor.h"
27 #include "../interaction/interaction_sink.h"
28 #include "../fwd.h"
29
30 #include <common/forward.h>
31 #include <common/future_fwd.h>
32 #include <common/memory.h>
33
34 #include <boost/property_tree/ptree_fwd.hpp>
35 #include <boost/optional.hpp>
36
37 #include <string>
38
39 namespace caspar { namespace core {
40         
41 class layer final : public interaction_sink
42 {
43         layer(const layer&);
44         layer& operator=(const layer&);
45 public:
46         // Static Members
47
48         // Constructors
49
50         explicit layer(int index = -1); 
51         layer(layer&& other); 
52
53         // Methods
54
55         layer& operator=(layer&& other); 
56
57         void swap(layer& other);  
58                 
59         void load(spl::shared_ptr<frame_producer> producer, bool preview, const boost::optional<int32_t>& auto_play_delta = boost::optional<int32_t>());
60         void play();
61         void pause();
62         void resume();
63         void stop();
64         
65         draw_frame receive(const video_format_desc& format_desc);
66         
67         // monitor::observable
68
69         monitor::subject& monitor_output();
70
71         // interaction_sink
72
73         void on_interaction(const interaction_event::ptr& event) override;
74         bool collides(double x, double y) const override;
75
76         // Properties
77                 
78         spl::shared_ptr<frame_producer> foreground() const; 
79         spl::shared_ptr<frame_producer> background() const; 
80
81         boost::property_tree::wptree    info() const;
82         boost::property_tree::wptree    delay_info() const;
83
84 private:
85         struct impl;
86         spl::shared_ptr<impl> impl_;
87 };
88
89 }}