X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=core%2Fproducer%2Flayer.h;h=2fb114f0381beb78b70fbeaf3feb97ac59df055f;hb=3c7a4be67bcd574bc1b4dd3c80cd986d5ca82861;hp=86c741ded4868d35f98f6806a35b9e129ad66d2f;hpb=16b26eececbd6932e3381e826eb4e123cb8e2c97;p=casparcg diff --git a/core/producer/layer.h b/core/producer/layer.h index 86c741ded..2fb114f03 100644 --- a/core/producer/layer.h +++ b/core/producer/layer.h @@ -1,58 +1,89 @@ -/* -* copyright (c) 2010 Sveriges Television AB -* -* This file is part of CasparCG. -* -* 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 . -* -*/ - -#pragma once - -#include - -#include - -namespace caspar { namespace core { - -struct frame_producer; -class basic_frame; - -class layer : boost::noncopyable -{ -public: - layer(); // nothrow - layer(layer&& other); // nothrow - layer& operator=(layer&& other); // nothrow - layer(const layer&); - layer& operator=(const layer&); - - void swap(layer& other); // nothrow - - void load(const safe_ptr& producer, bool preview, int auto_play_delta); // nothrow - void play(); // nothrow - void pause(); // nothrow - void stop(); // nothrow - void param(const std::wstring& param); - - safe_ptr foreground() const; // nothrow - safe_ptr background() const; // nothrow - - safe_ptr receive(); // nothrow -private: - struct implementation; - safe_ptr impl_; -}; - +/* +* Copyright (c) 2011 Sveriges Television AB +* +* 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 . +* +* 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 +#include +#include + +#include +#include + +#include + +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 producer, bool preview, const boost::optional& auto_play_delta = boost::optional()); + 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 foreground() const; + spl::shared_ptr background() const; + + boost::property_tree::wptree info() const; + boost::property_tree::wptree delay_info() const; + +private: + struct impl; + spl::shared_ptr impl_; +}; + }} \ No newline at end of file