X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=core%2Fproducer%2Fstage.h;h=900d841c990b208691ffc73742c7893c2147c5f8;hb=435cf4b385c5099270bee44f89c3e2615af30521;hp=681372a2dc62643f091355af964b95bfaee37c10;hpb=a9b91fc4213df638f5a83fa772fd7cab5908d508;p=casparcg diff --git a/core/producer/stage.h b/core/producer/stage.h index 681372a2d..900d841c9 100644 --- a/core/producer/stage.h +++ b/core/producer/stage.h @@ -23,10 +23,13 @@ #include "frame_producer.h" +#include "../monitor/monitor.h" + #include #include #include +#include #include #include @@ -38,39 +41,53 @@ FORWARD1(boost, template class unique_future); namespace caspar { namespace core { -class stage sealed +class stage sealed : public monitor::observable { stage(const stage&); stage& operator=(const stage&); public: + + // Static Members + typedef std::function transform_func_t; typedef std::tuple transform_tuple_t; - stage(); - - std::map> operator()(const struct video_format_desc& format_desc); + // 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 tweener& tween = L"linear"); void clear_transforms(int index); void clear_transforms(); - void load(int index, const spl::shared_ptr& producer, const boost::optional& auto_play_delta = nullptr); + 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 spl::shared_ptr& other); + void swap_layers(stage& other); void swap_layer(int index, int other_index); - void swap_layer(int index, int other_index, const spl::shared_ptr& other); + void swap_layer(int index, int other_index, stage& other); - boost::unique_future> foreground(int index); - boost::unique_future> background(int index); + // monitor::observable + + 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; - boost::unique_future info() const; - boost::unique_future info(int index) const; - private: struct impl; spl::shared_ptr impl_;