\r
#include "frame_producer.h"\r
\r
+#include "../monitor/monitor.h"\r
+\r
#include <common/forward.h>\r
#include <common/spl/memory.h>\r
#include <common/tweener.h>\r
\r
+#include <boost/optional.hpp>\r
#include <boost/property_tree/ptree_fwd.hpp>\r
\r
#include <functional>\r
\r
namespace caspar { namespace core {\r
\r
-class stage sealed\r
+class stage sealed : public monitor::observable\r
{\r
stage(const stage&);\r
stage& operator=(const stage&);\r
public: \r
+\r
+ // Static Members\r
+ \r
typedef std::function<struct frame_transform(struct frame_transform)> transform_func_t;\r
typedef std::tuple<int, transform_func_t, unsigned int, tweener> transform_tuple_t;\r
\r
- stage();\r
- \r
- std::map<int, spl::shared_ptr<class draw_frame>> operator()(const struct video_format_desc& format_desc);\r
+ // Constructors\r
+\r
+ explicit stage(spl::shared_ptr<diagnostics::graph> graph);\r
+ \r
+ // Methods\r
+\r
+ std::map<int, class draw_frame> operator()(const struct video_format_desc& format_desc);\r
\r
void apply_transforms(const std::vector<transform_tuple_t>& transforms);\r
void apply_transform(int index, const transform_func_t& transform, unsigned int mix_duration = 0, const tweener& tween = L"linear");\r
void clear_transforms(int index);\r
void clear_transforms();\r
\r
- void load(int index, const spl::shared_ptr<struct frame_producer>& producer, const boost::optional<int32_t>& auto_play_delta = nullptr);\r
+ void load(int index, const spl::shared_ptr<class frame_producer>& producer, const boost::optional<int32_t>& auto_play_delta = nullptr);\r
void pause(int index);\r
void play(int index);\r
void stop(int index);\r
void clear(int index);\r
void clear(); \r
- void swap_layers(const spl::shared_ptr<stage>& other);\r
+ void swap_layers(stage& other);\r
void swap_layer(int index, int other_index);\r
- void swap_layer(int index, int other_index, const spl::shared_ptr<stage>& other);\r
+ void swap_layer(int index, int other_index, stage& other);\r
\r
- boost::unique_future<spl::shared_ptr<struct frame_producer>> foreground(int index);\r
- boost::unique_future<spl::shared_ptr<struct frame_producer>> background(int index);\r
+ // monitor::observable\r
+\r
+ virtual void subscribe(const monitor::observable::observer_ptr& o) override;\r
+ virtual void unsubscribe(const monitor::observable::observer_ptr& o) override;\r
+\r
+ // Properties\r
+\r
+ boost::unique_future<spl::shared_ptr<class frame_producer>> foreground(int index);\r
+ boost::unique_future<spl::shared_ptr<class frame_producer>> background(int index);\r
+\r
+ boost::unique_future<boost::property_tree::wptree> info() const;\r
+ boost::unique_future<boost::property_tree::wptree> info(int index) const;\r
\r
- boost::unique_future<boost::property_tree::wptree> info() const;\r
- boost::unique_future<boost::property_tree::wptree> info(int index) const;\r
- \r
private:\r
struct impl;\r
spl::shared_ptr<impl> impl_;\r