X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=core%2Fproducer%2Fstage.h;h=900d841c990b208691ffc73742c7893c2147c5f8;hb=435cf4b385c5099270bee44f89c3e2615af30521;hp=a435279f05229b64788a516ec9acc145cceaeb60;hpb=521f0c5769e4cc41fa0270c827089106e53dad2d;p=casparcg diff --git a/core/producer/stage.h b/core/producer/stage.h index a435279f0..900d841c9 100644 --- a/core/producer/stage.h +++ b/core/producer/stage.h @@ -23,11 +23,13 @@ #include "frame_producer.h" -#include +#include "../monitor/monitor.h" + #include -#include -#include +#include +#include +#include #include #include @@ -39,47 +41,56 @@ FORWARD1(boost, template class unique_future); namespace caspar { namespace core { -class stage sealed +class stage sealed : public monitor::observable { - CASPAR_NO_COPY(stage); + stage(const stage&); + stage& operator=(const stage&); public: - typedef std::function transform_func_t; - typedef std::tuple transform_tuple_t; - typedef target>, std::shared_ptr>> target_t; - stage(const safe_ptr& target, const safe_ptr& graph, const struct video_format_desc& format_desc); + // Static Members - // stage + typedef std::function transform_func_t; + typedef std::tuple transform_tuple_t; + + // Constructors + + explicit stage(spl::shared_ptr graph); + // Methods + + std::map operator()(const struct video_format_desc& format_desc); + void apply_transforms(const std::vector& transforms); - void apply_transform(int index, const transform_func_t& transform, unsigned int mix_duration = 0, const std::wstring& tween = L"linear"); + void apply_transform(int index, const transform_func_t& transform, unsigned int mix_duration = 0, const tweener& tween = L"linear"); void clear_transforms(int index); void clear_transforms(); - - void spawn_token(); - - void load(int index, const safe_ptr& producer, bool preview = false, int auto_play_delta = -1); + + void load(int index, const spl::shared_ptr& producer, const boost::optional& auto_play_delta = nullptr); void pause(int index); void play(int index); void stop(int index); void clear(int index); void clear(); - void swap_layers(const safe_ptr& other); + void swap_layers(stage& other); void swap_layer(int index, int other_index); - void swap_layer(int index, int other_index, const safe_ptr& other); + void swap_layer(int index, int other_index, stage& other); - boost::unique_future call(int index, bool foreground, const std::wstring& param); - boost::unique_future> foreground(int index); - boost::unique_future> background(int index); + // monitor::observable - boost::unique_future info() const; - boost::unique_future info(int layer) const; - - void set_video_format_desc(const struct video_format_desc& format_desc); + virtual void subscribe(const monitor::observable::observer_ptr& o) override; + virtual void unsubscribe(const monitor::observable::observer_ptr& o) override; + + // Properties + + boost::unique_future> foreground(int index); + boost::unique_future> background(int index); + + boost::unique_future info() const; + boost::unique_future info(int index) const; private: struct impl; - safe_ptr impl_; + spl::shared_ptr impl_; }; }} \ No newline at end of file